From 1094cfff5c2acb550eb131fd0a206f2eec9fcba5 Mon Sep 17 00:00:00 2001 From: Jin Hai Date: Mon, 30 Dec 2024 09:43:25 +0800 Subject: [PATCH 1/9] Feature: snapshot part1 (#2413) ### What problem does this PR solve? 1. Snapshot storage directory config 2. SQL commands of snapshot ### Type of change - [x] New Feature (non-breaking change which adds functionality) --------- Signed-off-by: Jin Hai --- conf/infinity_conf.toml | 2 + src/admin/admin_executor.cpp | 43 + src/common/default_values.cppm | 5 +- src/executor/explain_physical_plan.cpp | 36 + src/executor/operator/physical_command.cpp | 53 + src/executor/operator/physical_show.cpp | 118 + src/executor/operator/physical_show.cppm | 4 + src/executor/operator/snapshot/snapshot.cppm | 33 + .../operator/snapshot/snapshot_brief.cppm | 32 + .../operator/snapshot/table_snapshot.cpp | 38 + src/main/config.cpp | 28 + src/main/config.cppm | 1 + src/main/options.cpp | 1 + src/main/options.cppm | 1 + src/parser/expression_lexer.cpp | 2657 +-- src/parser/expression_lexer.h | 215 +- src/parser/expression_parser.cpp | 4895 ++--- src/parser/expression_parser.h | 437 +- src/parser/lexer.cpp | 5373 +++--- src/parser/lexer.h | 217 +- src/parser/lexer.l | 2 + src/parser/parser.cpp | 15985 ++++++++-------- src/parser/parser.h | 659 +- src/parser/parser.y | 58 +- src/parser/search_lexer.cpp | 2294 +-- src/parser/search_parser.cpp | 1995 +- src/parser/search_parser.h | 1667 +- src/parser/statement/admin_statement.h | 7 +- src/parser/statement/command_statement.cpp | 1 + src/parser/statement/command_statement.cppm | 4 + src/parser/statement/command_statement.h | 24 +- src/parser/statement/show_statement.cpp | 8 + src/parser/statement/show_statement.h | 5 +- src/planner/explain_ast.cpp | 8 + src/planner/explain_logical_plan.cpp | 28 + src/planner/logical_planner.cpp | 42 + src/planner/node/logical_command.cpp | 47 + src/planner/node/logical_show.cpp | 4 + src/storage/common/snapshot_info.cppm | 74 + src/storage/meta/catalog.cpp | 11 + src/storage/meta/catalog.cppm | 3 + src/storage/meta/entry/block_column_entry.cpp | 2 + .../meta/entry/block_column_entry.cppm | 2 + src/storage/meta/entry/table_entry.cpp | 2 + src/storage/meta/entry/table_entry.cppm | 3 + src/storage/txn/txn.cpp | 7 + src/storage/txn/txn.cppm | 3 + src/unit_test/main/config.cpp | 1 + 48 files changed, 19515 insertions(+), 17620 deletions(-) create mode 100644 src/executor/operator/snapshot/snapshot.cppm create mode 100644 src/executor/operator/snapshot/snapshot_brief.cppm create mode 100644 src/executor/operator/snapshot/table_snapshot.cpp create mode 100644 src/storage/common/snapshot_info.cppm diff --git a/conf/infinity_conf.toml b/conf/infinity_conf.toml index 409bd1a8c5..fe51f79dc9 100644 --- a/conf/infinity_conf.toml +++ b/conf/infinity_conf.toml @@ -43,6 +43,8 @@ mem_index_capacity = 65536 # secret_key = "minioadmin" # enable_https = false +snapshot_dir = "/var/infinity/snapshots" + [buffer] buffer_manager_size = "4GB" lru_num = 7 diff --git a/src/admin/admin_executor.cpp b/src/admin/admin_executor.cpp index 1b4c9eb7ac..e037935e27 100644 --- a/src/admin/admin_executor.cpp +++ b/src/admin/admin_executor.cpp @@ -3399,6 +3399,28 @@ QueryResult AdminExecutor::ListConfigs(QueryContext *query_context, const AdminS } } + { + { + // option name + Value value = Value::MakeVarchar(SNAPSHOT_DIR_OPTION_NAME); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[0]); + } + { + // option name type + Value value = Value::MakeVarchar(std::to_string(global_config->CleanupInterval())); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[1]); + } + { + // option name type + Value value = Value::MakeVarchar("Snapshots store directory"); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[2]); + } + } + + { { // option name @@ -3483,6 +3505,27 @@ QueryResult AdminExecutor::ListConfigs(QueryContext *query_context, const AdminS } } + { + { + // option name + Value value = Value::MakeVarchar(SNAPSHOT_DIR_OPTION_NAME); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[0]); + } + { + // option name type + Value value = Value::MakeVarchar(global_config->SnapshotDir()); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[1]); + } + { + // option name type + Value value = Value::MakeVarchar("Snapshot storage directory"); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[2]); + } + } + { { // option name diff --git a/src/common/default_values.cppm b/src/common/default_values.cppm index e47a1dedbb..5cb99000c6 100644 --- a/src/common/default_values.cppm +++ b/src/common/default_values.cppm @@ -200,8 +200,10 @@ export { constexpr std::string_view DEFAULT_RESULT_CACHE = "off"; constexpr SizeT DEFAULT_CACHE_RESULT_CAPACITY = 10000; + constexpr std::string_view DEFAULT_SNAPSHOT_DIR = "/var/infinity/snapshot"; + // default persistence parameter - constexpr std::string_view DEFAULT_PERSISTENCE_DIR = "/var/infinity/persistence"; // Empty means disabled + constexpr std::string_view DEFAULT_PERSISTENCE_DIR = "/var/infinity/persistence"; constexpr std::string_view DEFAULT_PERSISTENCE_OBJECT_SIZE_LIMIT_STR = "128MB"; // 128MB constexpr SizeT DEFAULT_PERSISTENCE_OBJECT_SIZE_LIMIT = 128 * 1024lu * 1024lu; // 128MB @@ -293,6 +295,7 @@ export { constexpr std::string_view RECORD_RUNNING_QUERY_OPTION_NAME = "record_running_query"; + constexpr std::string_view SNAPSHOT_DIR_OPTION_NAME = "snapshot_dir"; // Variable name constexpr std::string_view QUERY_COUNT_VAR_NAME = "query_count"; // global and session constexpr std::string_view SESSION_COUNT_VAR_NAME = "session_count"; // global diff --git a/src/executor/explain_physical_plan.cpp b/src/executor/explain_physical_plan.cpp index 1c8cc00e4a..e1662df0e8 100644 --- a/src/executor/explain_physical_plan.cpp +++ b/src/executor/explain_physical_plan.cpp @@ -1824,6 +1824,42 @@ void ExplainPhysicalPlan::Explain(const PhysicalShow *show_node, SharedPtremplace_back(MakeShared(output_columns_str)); break; } + case ShowStmtType::kListSnapshots: { + String show_str; + if (intent_size != 0) { + show_str = String(intent_size - 2, ' '); + show_str += "-> SHOW SNAPSHOTS "; + } else { + show_str = "SHOW SNAPSHOTS "; + } + show_str += "("; + show_str += std::to_string(show_node->node_id()); + show_str += ")"; + result->emplace_back(MakeShared(show_str)); + + String output_columns_str = String(intent_size, ' '); + output_columns_str += " - output columns: [name, count, total_size]"; + result->emplace_back(MakeShared(output_columns_str)); + break; + } + case ShowStmtType::kShowSnapshot: { + String show_str; + if (intent_size != 0) { + show_str = String(intent_size - 2, ' '); + show_str += "-> SHOW MEMORY ALLOCATION "; + } else { + show_str = "SHOW MEMORY ALLOCATION "; + } + show_str += "("; + show_str += std::to_string(show_node->node_id()); + show_str += ")"; + result->emplace_back(MakeShared(show_str)); + + String output_columns_str = String(intent_size, ' '); + output_columns_str += " - output columns: [name, count, total_size]"; + result->emplace_back(MakeShared(output_columns_str)); + break; + } case ShowStmtType::kFunction: { String show_str; if (intent_size != 0) { diff --git a/src/executor/operator/physical_command.cpp b/src/executor/operator/physical_command.cpp index a7ce707a6d..b7bf4b6115 100644 --- a/src/executor/operator/physical_command.cpp +++ b/src/executor/operator/physical_command.cpp @@ -446,6 +446,59 @@ bool PhysicalCommand::Execute(QueryContext *query_context, OperatorState *operat auto *compact_processor = query_context->storage()->compaction_processor(); compact_processor->AddTestCommand(BGTaskType::kTestCommand, "stuck for 3 seconds"); } else if (test_command->command_content() == "delta checkpoint") { + LOG_INFO(fmt::format("test command: delta checkpoint")); + } else { + LOG_INFO(fmt::format("test command: other")); + } + break; + } + case CommandType::kSnapshot: { + SnapshotCmd *snapshot_cmd = static_cast(command_info_.get()); + LOG_INFO(fmt::format("Execute snapshot command")); + SnapshotOp snapshot_operation = snapshot_cmd->operation(); + switch(snapshot_operation) { + case SnapshotOp::kCreate: { + LOG_INFO(fmt::format("Execute snapshot create")); + break; + } + case SnapshotOp::kDrop: { + LOG_INFO(fmt::format("Execute snapshot drop")); + break; + } + case SnapshotOp::kRestore: { + LOG_INFO(fmt::format("Execute snapshot restore")); + break; + } + default: { + String error_message = "Invalid snapshot operation type"; + UnrecoverableError(error_message); + break; + } + } + + SnapshotScope snapshot_scope = snapshot_cmd->scope(); + switch(snapshot_scope) { + case SnapshotScope::kSystem: { + LOG_INFO(fmt::format("Execute snapshot system")); + break; + } + case SnapshotScope::kDatabase: { + LOG_INFO(fmt::format("Execute snapshot database")); + break; + } + case SnapshotScope::kTable: { + LOG_INFO(fmt::format("Execute snapshot table")); + break; + } + case SnapshotScope::kIgnore: { + LOG_INFO(fmt::format("Execute snapshot ignore")); + break; + } + default: { + String error_message = "Invalid snapshot scope"; + UnrecoverableError(error_message); + break; + } } break; } diff --git a/src/executor/operator/physical_show.cpp b/src/executor/operator/physical_show.cpp index 31273120fb..f27b3894b5 100644 --- a/src/executor/operator/physical_show.cpp +++ b/src/executor/operator/physical_show.cpp @@ -552,6 +552,30 @@ void PhysicalShow::Init() { output_types_->emplace_back(varchar_type); break; } + case ShowStmtType::kListSnapshots: { + output_names_->reserve(5); + output_types_->reserve(5); + output_names_->emplace_back("name"); + output_names_->emplace_back("scope"); + output_names_->emplace_back("time"); + output_names_->emplace_back("commit"); + output_names_->emplace_back("size"); + output_types_->emplace_back(varchar_type); + output_types_->emplace_back(varchar_type); + output_types_->emplace_back(varchar_type); + output_types_->emplace_back(bigint_type); + output_types_->emplace_back(bigint_type); + break; + } + case ShowStmtType::kShowSnapshot: { + output_names_->reserve(2); + output_types_->reserve(2); + output_names_->emplace_back("name"); + output_names_->emplace_back("value"); + output_types_->emplace_back(varchar_type); + output_types_->emplace_back(varchar_type); + break; + } default: { Status status = Status::NotSupport("Not implemented show type"); RecoverableError(status); @@ -716,6 +740,14 @@ bool PhysicalShow::Execute(QueryContext *query_context, OperatorState *operator_ ExecuteShowFunction(query_context, show_operator_state); break; } + case ShowStmtType::kListSnapshots: { + ExecuteListSnapshots(query_context, show_operator_state); + break; + } + case ShowStmtType::kShowSnapshot: { + ExecuteShowSnapshot(query_context, show_operator_state); + break; + } default: { String error_message = "Invalid chunk scan type"; UnrecoverableError(error_message); @@ -3184,6 +3216,27 @@ void PhysicalShow::ExecuteShowConfigs(QueryContext *query_context, ShowOperatorS } } + { + { + // option name + Value value = Value::MakeVarchar(SNAPSHOT_DIR_OPTION_NAME); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[0]); + } + { + // option name type + Value value = Value::MakeVarchar(global_config->SnapshotDir()); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[1]); + } + { + // option name type + Value value = Value::MakeVarchar("Snapshot storage directory"); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[2]); + } + } + { { // option name @@ -6407,4 +6460,69 @@ void PhysicalShow::ExecuteShowFunction(QueryContext *query_context, ShowOperator return; } +void PhysicalShow::ExecuteListSnapshots(QueryContext *query_context, ShowOperatorState *operator_state) { + auto varchar_type = MakeShared(LogicalType::kVarchar); + auto bigint_type = MakeShared(LogicalType::kBigInt); + UniquePtr output_block_ptr = DataBlock::MakeUniquePtr(); + Vector> column_types{ + varchar_type, + varchar_type, + varchar_type, + bigint_type, + bigint_type + }; + + output_block_ptr->Init(column_types); + output_block_ptr->Finalize(); + operator_state->output_.emplace_back(std::move(output_block_ptr)); + return; +} + +void PhysicalShow::ExecuteShowSnapshot(QueryContext *query_context, ShowOperatorState *operator_state) { + auto varchar_type = MakeShared(LogicalType::kVarchar); + UniquePtr output_block_ptr = DataBlock::MakeUniquePtr(); + Vector> column_types{ + varchar_type, + varchar_type, + }; + + output_block_ptr->Init(column_types); + +// { +// SizeT column_id = 0; +// { +// Value value = Value::MakeVarchar("memory_objects"); +// ValueExpression value_expr(value); +// value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); +// } +// +// ++column_id; +// { +// Value value = Value::MakeVarchar(GlobalResourceUsage::GetObjectCountInfo()); +// ValueExpression value_expr(value); +// value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); +// } +// } +// +// { +// SizeT column_id = 0; +// { +// Value value = Value::MakeVarchar("memory_allocation"); +// ValueExpression value_expr(value); +// value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); +// } +// +// ++column_id; +// { +// Value value = Value::MakeVarchar(GlobalResourceUsage::GetRawMemoryInfo()); +// ValueExpression value_expr(value); +// value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); +// } +// } + + output_block_ptr->Finalize(); + operator_state->output_.emplace_back(std::move(output_block_ptr)); + return; +} + } // namespace infinity diff --git a/src/executor/operator/physical_show.cppm b/src/executor/operator/physical_show.cppm index 780d4aa4bc..c30ad4db68 100644 --- a/src/executor/operator/physical_show.cppm +++ b/src/executor/operator/physical_show.cppm @@ -159,6 +159,10 @@ private: void ExecuteShowFunction(QueryContext *query_context, ShowOperatorState *operator_state); + void ExecuteListSnapshots(QueryContext *query_context, ShowOperatorState *operator_state); + + void ExecuteShowSnapshot(QueryContext *query_context, ShowOperatorState *operator_state); + private: ShowStmtType show_type_{ShowStmtType::kInvalid}; String db_name_{}; diff --git a/src/executor/operator/snapshot/snapshot.cppm b/src/executor/operator/snapshot/snapshot.cppm new file mode 100644 index 0000000000..f2f63f725e --- /dev/null +++ b/src/executor/operator/snapshot/snapshot.cppm @@ -0,0 +1,33 @@ +// Copyright(C) 2024 InfiniFlow, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module; + +export module snapshot; + +import stl; +import status; +import snapshot_info; +import query_context; + +namespace infinity { + +class Snapshot { +public: + static Status CreateTableSnapshot(QueryContext *query_context, const String &snapshot_name, const String& table_name); + static Status RestoreTableSnapshot(); + static Status DropSnapshot(QueryContext *query_context, const String &snapshot_name); +}; + +} // namespace infinity diff --git a/src/executor/operator/snapshot/snapshot_brief.cppm b/src/executor/operator/snapshot/snapshot_brief.cppm new file mode 100644 index 0000000000..df3fc4571b --- /dev/null +++ b/src/executor/operator/snapshot/snapshot_brief.cppm @@ -0,0 +1,32 @@ +// Copyright(C) 2024 InfiniFlow, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module; + +export module snapshot_brief; + +import stl; +import command_statement; + +namespace infinity { + +export struct SnapshotBrief { + String snapshot_name_; // snapshot_name_ + SnapshotScope scope_; // system / db / table snapshot + u64 create_time_; // when create the snapshot + u64 commit_ts_; // txn ts the snapshot created. + u64 size_; // total snapshot size +}; + +} // namespace infinity diff --git a/src/executor/operator/snapshot/table_snapshot.cpp b/src/executor/operator/snapshot/table_snapshot.cpp new file mode 100644 index 0000000000..62d159b36f --- /dev/null +++ b/src/executor/operator/snapshot/table_snapshot.cpp @@ -0,0 +1,38 @@ +// Copyright(C) 2024 InfiniFlow, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module; + +module snapshot; + +import stl; +import txn; +import query_context; +import table_entry; +import status; + +namespace infinity { + +Status Snapshot::CreateTableSnapshot(QueryContext *query_context, const String &snapshot_name, const String &table_name) { +// Txn *txn_ptr = query_context->GetTxn(); +// const String &db_name = query_context->schema_name(); +// auto [table_entry, table_status] = txn_ptr->GetTableByName(db_name, table_name); + + return Status::OK(); +} + +Status Snapshot::RestoreTableSnapshot() { return Status::OK(); } +Status Snapshot::DropSnapshot(QueryContext *query_context, const String &snapshot_name) { return Status::OK(); } + +} // namespace infinity \ No newline at end of file diff --git a/src/main/config.cpp b/src/main/config.cpp index dd389bcfdb..5a7e6b9c2b 100644 --- a/src/main/config.cpp +++ b/src/main/config.cpp @@ -454,6 +454,11 @@ Status Config::Init(const SharedPtr &config_path, DefaultConfig *default UnrecoverableError(status.message()); } + // Snapshots Dir + String snapshot_dir = DEFAULT_SNAPSHOT_DIR.data(); + UniquePtr snapshot_dir_option = MakeUnique(SNAPSHOT_DIR_OPTION_NAME, snapshot_dir); + global_options_.AddOption(std::move(snapshot_dir_option)); + // Buffer Manager Size i64 buffer_manager_size = DEFAULT_BUFFER_MANAGER_SIZE; UniquePtr buffer_manager_size_option = @@ -1653,6 +1658,17 @@ Status Config::Init(const SharedPtr &config_path, DefaultConfig *default } break; } + case GlobalOptionIndex::kSnapshotDir: { + String snapshot_dir; + if (elem.second.is_string()) { + snapshot_dir = elem.second.value_or(DEFAULT_SNAPSHOT_DIR.data()); + } else { + return Status::InvalidConfig("'snapshot_dir' field isn't string, such as \"snapshot\""); + } + UniquePtr snapshot_dir_option = MakeUnique(SNAPSHOT_DIR_OPTION_NAME, snapshot_dir); + global_options_.AddOption(std::move(snapshot_dir_option)); + break; + } case GlobalOptionIndex::kStorageType: { // File System Type String storage_type_str = String(DEFAULT_STORAGE_TYPE); @@ -1917,6 +1933,12 @@ Status Config::Init(const SharedPtr &config_path, DefaultConfig *default } } + if (global_options_.GetOptionByIndex(GlobalOptionIndex::kSnapshotDir) == nullptr) { + String snapshot_dir = DEFAULT_SNAPSHOT_DIR.data(); + UniquePtr snapshot_dir_option = MakeUnique(SNAPSHOT_DIR_OPTION_NAME, snapshot_dir); + global_options_.AddOption(std::move(snapshot_dir_option)); + } + if (BaseOption *base_option = global_options_.GetOptionByIndex(GlobalOptionIndex::kStorageType); base_option == nullptr) { String storage_type_str = String(DEFAULT_STORAGE_TYPE); UniquePtr storage_type_option = MakeUnique(STORAGE_TYPE_OPTION_NAME, storage_type_str); @@ -2680,6 +2702,11 @@ void Config::SetOptimizeInterval(i64 interval) { return; } +String Config::SnapshotDir() { + std::lock_guard guard(mutex_); + return global_options_.GetStringValue(GlobalOptionIndex::kSnapshotDir); +} + i64 Config::MemIndexCapacity() { std::lock_guard guard(mutex_); return global_options_.GetIntegerValue(GlobalOptionIndex::kMemIndexCapacity); @@ -2918,6 +2945,7 @@ void Config::PrintAll() { break; } } + fmt::print(" - snapshot_dir: {}\n", SnapshotDir()); // Buffer manager fmt::print(" - buffer_manager_size: {}\n", Utility::FormatByteSize(BufferManagerSize())); diff --git a/src/main/config.cppm b/src/main/config.cppm index 4836235a69..3654f48bb5 100644 --- a/src/main/config.cppm +++ b/src/main/config.cppm @@ -101,6 +101,7 @@ public: i64 OptimizeIndexInterval(); void SetOptimizeInterval(i64); + String SnapshotDir(); i64 MemIndexCapacity(); i64 DenseIndexBuildingWorker(); i64 SparseIndexBuildingWorker(); diff --git a/src/main/options.cpp b/src/main/options.cpp index 52fb84045e..63d96e1a52 100644 --- a/src/main/options.cpp +++ b/src/main/options.cpp @@ -93,6 +93,7 @@ GlobalOptions::GlobalOptions() { name2index_[String(DELTA_CHECKPOINT_THRESHOLD_OPTION_NAME)] = GlobalOptionIndex::kDeltaCheckpointThreshold; name2index_[String(WAL_FLUSH_OPTION_NAME)] = GlobalOptionIndex::kFlushMethodAtCommit; name2index_[String(RESOURCE_DIR_OPTION_NAME)] = GlobalOptionIndex::kResourcePath; + name2index_[String(SNAPSHOT_DIR_OPTION_NAME)] = GlobalOptionIndex::kSnapshotDir; name2index_[String(RECORD_RUNNING_QUERY_OPTION_NAME)] = GlobalOptionIndex::kRecordRunningQuery; } diff --git a/src/main/options.cppm b/src/main/options.cppm index a6ea57d484..f0d9f1b414 100644 --- a/src/main/options.cppm +++ b/src/main/options.cppm @@ -171,6 +171,7 @@ export enum class GlobalOptionIndex : i8 { kDenseIndexBuildingWorker = 53, kSparseIndexBuildingWorker = 54, kFulltextIndexBuildingWorker = 55, + kSnapshotDir = 56, kInvalid = 57, }; diff --git a/src/parser/expression_lexer.cpp b/src/parser/expression_lexer.cpp index 1f24586517..62f363e292 100644 --- a/src/parser/expression_lexer.cpp +++ b/src/parser/expression_lexer.cpp @@ -2,7 +2,7 @@ #line 4 "expression_lexer.cpp" -#define YY_INT_ALIGNED short int +#define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ @@ -269,10 +269,10 @@ /* begin standard C headers. */ /* %if-c-only */ -#include #include -#include #include +#include +#include /* %endif */ /* %if-tables-serialization */ @@ -287,10 +287,10 @@ /* C99 systems have . Non-C99 systems may or may not. */ -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -307,41 +307,41 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN -#define INT8_MIN (-128) +#define INT8_MIN (-128) #endif #ifndef INT16_MIN -#define INT16_MIN (-32767 - 1) +#define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN -#define INT32_MIN (-2147483647 - 1) +#define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX -#define INT8_MAX (127) +#define INT8_MAX (127) #endif #ifndef INT16_MAX -#define INT16_MAX (32767) +#define INT16_MAX (32767) #endif #ifndef INT32_MAX -#define INT32_MAX (2147483647) +#define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX -#define UINT8_MAX (255U) +#define UINT8_MAX (255U) #endif #ifndef UINT16_MAX -#define UINT16_MAX (65535U) +#define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) +#define UINT32_MAX (4294967295U) #endif #ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) +#define SIZE_MAX (~(size_t)0) #endif #endif /* ! C99 */ @@ -372,7 +372,7 @@ typedef unsigned int flex_uint32_t; /* Promotes a possibly negative, possibly signed char to an * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((YY_CHAR)(c)) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* %ok-for-header */ /* %if-reentrant */ @@ -380,7 +380,7 @@ typedef unsigned int flex_uint32_t; /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T #define YY_TYPEDEF_YY_SCANNER_T -typedef void *yyscan_t; +typedef void* yyscan_t; #endif /* For convenience, these vars (plus the bison vars far below) @@ -413,7 +413,7 @@ typedef void *yyscan_t; /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin, yyscanner) +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -431,7 +431,7 @@ typedef void *yyscan_t; /* The state buf must be large enough to hold one state per character in the main buffer. */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE @@ -454,89 +454,93 @@ typedef size_t yy_size_t; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - -#define YY_LESS_LINENO(n) -#define YY_LINENO_REWIND_TO(ptr) - + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + /* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg); \ - *yy_cp = yyg->yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } while (0) -#define unput(c) yyunput(c, yyg->yytext_ptr, yyscanner) +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state { - /* %if-c-only */ - FILE *yy_input_file; - /* %endif */ +struct yy_buffer_state + { +/* %if-c-only */ + FILE *yy_input_file; +/* %endif */ - /* %if-c++-only */ - /* %endif */ +/* %if-c++-only */ +/* %endif */ - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; - int yy_buffer_status; + int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ #define YY_BUFFER_EOF_PENDING 2 -}; + + }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* %if-c-only Standard (non-C++) definition */ @@ -553,7 +557,9 @@ struct yy_buffer_state { * * Returns the top of the stack, or NULL. */ -#define YY_CURRENT_BUFFER (yyg->yy_buffer_stack ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] : NULL) +#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ @@ -567,52 +573,54 @@ struct yy_buffer_state { /* %endif */ -void yyrestart(FILE *input_file, yyscan_t yyscanner); -void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner); -YY_BUFFER_STATE yy_create_buffer(FILE *file, int size, yyscan_t yyscanner); -void yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner); -void yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner); -void yypush_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner); -void yypop_buffer_state(yyscan_t yyscanner); +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); -static void yyensure_buffer_stack(yyscan_t yyscanner); -static void yy_load_buffer_state(yyscan_t yyscanner); -static void yy_init_buffer(YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner); -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER, yyscanner) +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) -YY_BUFFER_STATE yy_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner); -YY_BUFFER_STATE yy_scan_string(const char *yy_str, yyscan_t yyscanner); -YY_BUFFER_STATE yy_scan_bytes(const char *bytes, int len, yyscan_t yyscanner); +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); /* %endif */ -void *yyalloc(yy_size_t, yyscan_t yyscanner); -void *yyrealloc(void *, yy_size_t, yyscan_t yyscanner); -void yyfree(void *, yyscan_t yyscanner); +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); #define yy_new_buffer yy_create_buffer -#define yy_set_interactive(is_interactive) \ - { \ - if (!YY_CURRENT_BUFFER) { \ - yyensure_buffer_stack(yyscanner); \ - YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } -#define yy_set_bol(at_bol) \ - { \ - if (!YY_CURRENT_BUFFER) { \ - yyensure_buffer_stack(yyscanner); \ - YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */ /* Begin user sect3 */ -#define expressionwrap(yyscanner) (/*CONSTCOND*/ 1) +#define expressionwrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP #define FLEX_DEBUG @@ -626,81 +634,165 @@ typedef int yy_state_type; /* %if-c-only Standard (non-C++) definition */ -static yy_state_type yy_get_previous_state(yyscan_t yyscanner); -static yy_state_type yy_try_NUL_trans(yy_state_type current_state, yyscan_t yyscanner); -static int yy_get_next_buffer(yyscan_t yyscanner); -static void yynoreturn yy_fatal_error(const char *msg, yyscan_t yyscanner); +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); /* %endif */ /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ -#define YY_DO_BEFORE_ACTION \ - yyg->yytext_ptr = yy_bp; \ - /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */ \ - yyleng = (int)(yy_cp - yy_bp); \ - yyg->yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */ \ - yyg->yy_c_buf_p = yy_cp; +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ +/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\ + yyleng = (int) (yy_cp - yy_bp); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ +/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\ + yyg->yy_c_buf_p = yy_cp; /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */ #define YY_NUM_RULES 29 #define YY_END_OF_BUFFER 30 /* This struct is not used in this scanner, but its presence is necessary. */ -struct yy_trans_info { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; -}; -static const flex_int16_t yy_accept[73] = {0, 0, 0, 26, 26, 30, 28, 1, 1, 28, 28, 18, 24, 18, 18, 21, 18, 18, 18, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 26, 27, 1, 14, 0, 21, 20, 19, 16, 15, 13, 17, 23, 23, 3, 23, 23, 6, 7, 23, 23, 23, - 11, 23, 26, 25, 22, 19, 2, 23, 23, 23, 9, 23, 23, 23, 23, 8, 10, 12, 23, 5, 23, 4, 0}; - -static const YY_CHAR yy_ec[256] = { - 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, - 5, 1, 1, 6, 1, 7, 6, 6, 6, 6, 6, 8, 9, 6, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 6, 6, 11, 12, 13, 6, 1, 14, 15, 16, - 17, 18, 19, 16, 16, 20, 16, 21, 22, 16, 23, 24, 16, 16, 25, 26, 27, 28, 16, 29, 16, 16, 16, 6, 1, 6, 6, 30, 1, 31, 32, 16, 33, - - 34, 35, 16, 16, 36, 16, 37, 38, 16, 39, 40, 16, 16, 41, 42, 43, 44, 16, 45, 16, 16, 16, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - -static const YY_CHAR yy_meta[46] = {0, 1, 1, 2, 1, 2, 1, 3, 1, 1, 4, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}; - -static const flex_int16_t yy_base[77] = {0, 0, 0, 128, 127, 133, 136, 44, 46, 120, 0, 136, 136, 121, 120, 41, 40, 117, 116, 31, - 37, 0, 44, 37, 36, 37, 37, 39, 0, 120, 64, 136, 121, 59, 114, 109, 136, 136, 136, 136, - 0, 57, 0, 55, 61, 0, 0, 63, 58, 64, 0, 59, 0, 136, 136, 96, 0, 59, 63, 73, - 0, 70, 75, 76, 77, 0, 0, 0, 78, 0, 74, 0, 136, 113, 117, 55, 121}; - -static const flex_int16_t yy_def[77] = {0, 72, 1, 73, 73, 72, 72, 72, 72, 72, 74, 72, 72, 72, 72, 72, 72, 72, 72, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 76, 72, 72, 72, 74, 72, 72, 72, 72, 72, 72, 72, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 76, 72, 72, 72, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 0, 72, 72, 72, 72}; - -static const flex_int16_t yy_nxt[182] = {0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, 21, 22, 23, 21, 24, 25, 26, 21, 21, - 27, 21, 21, 6, 19, 20, 21, 21, 22, 23, 21, 24, 25, 26, 21, 21, 27, 21, 21, 30, 30, 30, 30, 35, 33, 36, 37, - 41, 43, 47, 42, 44, 40, 45, 48, 50, 46, 51, 49, 30, 30, 35, 33, 41, 43, 47, 42, 56, 44, 45, 48, 50, 46, 51, - 49, 57, 58, 59, 60, 61, 62, 63, 64, 56, 65, 66, 67, 68, 69, 70, 71, 57, 58, 59, - - 60, 61, 62, 63, 64, 55, 65, 66, 67, 68, 69, 70, 71, 28, 28, 28, 28, 32, 55, 32, 32, 52, 52, 34, 52, 54, 53, - 39, 38, 34, 33, 31, 72, 29, 29, 5, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72}; - -static const flex_int16_t yy_chk[182] = {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 7, 8, 8, 15, 15, 16, 16, - 19, 20, 24, 19, 22, 75, 23, 25, 26, 23, 27, 25, 30, 30, 33, 33, 19, 20, 24, 19, 41, 22, 23, 25, 26, 23, 27, - 25, 43, 44, 47, 48, 49, 51, 57, 58, 41, 59, 61, 62, 63, 64, 68, 70, 43, 44, 47, - - 48, 49, 51, 57, 58, 55, 59, 61, 62, 63, 64, 68, 70, 73, 73, 73, 73, 74, 35, 74, 74, 76, 76, 34, 76, 32, 29, - 18, 17, 14, 13, 9, 5, 4, 3, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72}; - -static const flex_int16_t yy_rule_linenum[29] = {0, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, - 45, 46, 47, 49, 51, 52, 57, 67, 76, 81, 82, 83, 84, 87}; +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[73] = + { 0, + 0, 0, 26, 26, 30, 28, 1, 1, 28, 28, + 18, 24, 18, 18, 21, 18, 18, 18, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 26, 27, 1, + 14, 0, 21, 20, 19, 16, 15, 13, 17, 23, + 23, 3, 23, 23, 6, 7, 23, 23, 23, 11, + 23, 26, 25, 22, 19, 2, 23, 23, 23, 9, + 23, 23, 23, 23, 8, 10, 12, 23, 5, 23, + 4, 0 + } ; + +static const YY_CHAR yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 5, 1, 1, 6, 1, 7, 6, + 6, 6, 6, 6, 8, 9, 6, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 6, 6, 11, + 12, 13, 6, 1, 14, 15, 16, 17, 18, 19, + 16, 16, 20, 16, 21, 22, 16, 23, 24, 16, + 16, 25, 26, 27, 28, 16, 29, 16, 16, 16, + 6, 1, 6, 6, 30, 1, 31, 32, 16, 33, + + 34, 35, 16, 16, 36, 16, 37, 38, 16, 39, + 40, 16, 16, 41, 42, 43, 44, 16, 45, 16, + 16, 16, 6, 6, 6, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static const YY_CHAR yy_meta[46] = + { 0, + 1, 1, 2, 1, 2, 1, 3, 1, 1, 4, + 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4 + } ; + +static const flex_int16_t yy_base[77] = + { 0, + 0, 0, 128, 127, 133, 136, 44, 46, 120, 0, + 136, 136, 121, 120, 41, 40, 117, 116, 31, 37, + 0, 44, 37, 36, 37, 37, 39, 0, 120, 64, + 136, 121, 59, 114, 109, 136, 136, 136, 136, 0, + 57, 0, 55, 61, 0, 0, 63, 58, 64, 0, + 59, 0, 136, 136, 96, 0, 59, 63, 73, 0, + 70, 75, 76, 77, 0, 0, 0, 78, 0, 74, + 0, 136, 113, 117, 55, 121 + } ; + +static const flex_int16_t yy_def[77] = + { 0, + 72, 1, 73, 73, 72, 72, 72, 72, 72, 74, + 72, 72, 72, 72, 72, 72, 72, 72, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 76, 72, 72, + 72, 74, 72, 72, 72, 72, 72, 72, 72, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 76, 72, 72, 72, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 0, 72, 72, 72, 72 + } ; + +static const flex_int16_t yy_nxt[182] = + { 0, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 21, 21, 22, 23, + 21, 24, 25, 26, 21, 21, 27, 21, 21, 6, + 19, 20, 21, 21, 22, 23, 21, 24, 25, 26, + 21, 21, 27, 21, 21, 30, 30, 30, 30, 35, + 33, 36, 37, 41, 43, 47, 42, 44, 40, 45, + 48, 50, 46, 51, 49, 30, 30, 35, 33, 41, + 43, 47, 42, 56, 44, 45, 48, 50, 46, 51, + 49, 57, 58, 59, 60, 61, 62, 63, 64, 56, + 65, 66, 67, 68, 69, 70, 71, 57, 58, 59, + + 60, 61, 62, 63, 64, 55, 65, 66, 67, 68, + 69, 70, 71, 28, 28, 28, 28, 32, 55, 32, + 32, 52, 52, 34, 52, 54, 53, 39, 38, 34, + 33, 31, 72, 29, 29, 5, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72 + } ; + +static const flex_int16_t yy_chk[182] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 7, 7, 8, 8, 15, + 15, 16, 16, 19, 20, 24, 19, 22, 75, 23, + 25, 26, 23, 27, 25, 30, 30, 33, 33, 19, + 20, 24, 19, 41, 22, 23, 25, 26, 23, 27, + 25, 43, 44, 47, 48, 49, 51, 57, 58, 41, + 59, 61, 62, 63, 64, 68, 70, 43, 44, 47, + + 48, 49, 51, 57, 58, 55, 59, 61, 62, 63, + 64, 68, 70, 73, 73, 73, 73, 74, 35, 74, + 74, 76, 76, 34, 76, 32, 29, 18, 17, 14, + 13, 9, 5, 4, 3, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72 + } ; + +static const flex_int16_t yy_rule_linenum[29] = + { 0, + 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 43, 44, 45, 46, 47, 49, 51, 52, + 57, 67, 76, 81, 82, 83, 84, 87 + } ; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. @@ -746,16 +838,17 @@ static thread_local std::stringstream string_buffer; /* %if-reentrant */ /* Holds the entire state of the reentrant scanner. */ -struct yyguts_t { +struct yyguts_t + { /* User-defined. Not touched by flex. */ YY_EXTRA_TYPE yyextra_r; /* The rest are the same as the globals declared in the non-reentrant scanner. */ FILE *yyin_r, *yyout_r; - size_t yy_buffer_stack_top; /**< index of top of stack. */ - size_t yy_buffer_stack_max; /**< capacity of stack. */ - YY_BUFFER_STATE *yy_buffer_stack; /**< Stack as an array. */ + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; int yy_n_chars; int yyleng_r; @@ -767,7 +860,7 @@ struct yyguts_t { int yy_start_stack_depth; int *yy_start_stack; yy_state_type yy_last_accepting_state; - char *yy_last_accepting_cpos; + char* yy_last_accepting_cpos; int yylineno_r; int yy_flex_debug_r; @@ -776,29 +869,29 @@ struct yyguts_t { int yy_more_flag; int yy_more_len; - YYSTYPE *yylval_r; + YYSTYPE * yylval_r; - YYLTYPE *yylloc_r; + YYLTYPE * yylloc_r; -}; /* end struct yyguts_t */ + }; /* end struct yyguts_t */ /* %if-c-only */ -static int yy_init_globals(yyscan_t yyscanner); +static int yy_init_globals ( yyscan_t yyscanner ); /* %endif */ /* %if-reentrant */ -/* This must go here because YYSTYPE and YYLTYPE are included - * from bison output in section 1.*/ -#define yylval yyg->yylval_r - -#define yylloc yyg->yylloc_r + /* This must go here because YYSTYPE and YYLTYPE are included + * from bison output in section 1.*/ + # define yylval yyg->yylval_r + + # define yylloc yyg->yylloc_r + +int yylex_init (yyscan_t* scanner); -int yylex_init(yyscan_t *scanner); - -int yylex_init_extra(YY_EXTRA_TYPE user_defined, yyscan_t *scanner); +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); /* %endif */ @@ -807,46 +900,46 @@ int yylex_init_extra(YY_EXTRA_TYPE user_defined, yyscan_t *scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int yylex_destroy(yyscan_t yyscanner); +int yylex_destroy ( yyscan_t yyscanner ); -int yyget_debug(yyscan_t yyscanner); +int yyget_debug ( yyscan_t yyscanner ); -void yyset_debug(int debug_flag, yyscan_t yyscanner); +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); -YY_EXTRA_TYPE yyget_extra(yyscan_t yyscanner); +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); -void yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner); +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); -FILE *yyget_in(yyscan_t yyscanner); +FILE *yyget_in ( yyscan_t yyscanner ); -void yyset_in(FILE *_in_str, yyscan_t yyscanner); +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); -FILE *yyget_out(yyscan_t yyscanner); +FILE *yyget_out ( yyscan_t yyscanner ); -void yyset_out(FILE *_out_str, yyscan_t yyscanner); +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); -int yyget_leng(yyscan_t yyscanner); + int yyget_leng ( yyscan_t yyscanner ); -char *yyget_text(yyscan_t yyscanner); +char *yyget_text ( yyscan_t yyscanner ); -int yyget_lineno(yyscan_t yyscanner); +int yyget_lineno ( yyscan_t yyscanner ); -void yyset_lineno(int _line_number, yyscan_t yyscanner); +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); -int yyget_column(yyscan_t yyscanner); +int yyget_column ( yyscan_t yyscanner ); -void yyset_column(int _column_no, yyscan_t yyscanner); +void yyset_column ( int _column_no , yyscan_t yyscanner ); /* %if-bison-bridge */ -YYSTYPE *yyget_lval(yyscan_t yyscanner); - -void yyset_lval(YYSTYPE *yylval_param, yyscan_t yyscanner); - -YYLTYPE *yyget_lloc(yyscan_t yyscanner); +YYSTYPE * yyget_lval ( yyscan_t yyscanner ); -void yyset_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner); +void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); + YYLTYPE *yyget_lloc ( yyscan_t yyscanner ); + + void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner ); + /* %endif */ /* Macros after this point can all be overridden by user definitions in @@ -855,35 +948,35 @@ void yyset_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap(yyscan_t yyscanner); +extern "C" int yywrap ( yyscan_t yyscanner ); #else -extern int yywrap(yyscan_t yyscanner); +extern int yywrap ( yyscan_t yyscanner ); #endif #endif /* %not-for-header */ #ifndef YY_NO_UNPUT - + #endif /* %ok-for-header */ /* %endif */ #ifndef yytext_ptr -static void yy_flex_strncpy(char *, const char *, int, yyscan_t yyscanner); +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen(const char *, yyscan_t yyscanner); +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT /* %if-c-only Standard (non-C++) definition */ /* %not-for-header */ #ifdef __cplusplus -static int yyinput(yyscan_t yyscanner); +static int yyinput ( yyscan_t yyscanner ); #else -static int input(yyscan_t yyscanner); +static int input ( yyscan_t yyscanner ); #endif /* %ok-for-header */ @@ -910,11 +1003,7 @@ static int input(yyscan_t yyscanner); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO \ - do { \ - if (fwrite(yytext, (size_t)yyleng, 1, yyout)) { \ - } \ - } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) /* %endif */ /* %if-c++-only C++ definition */ /* %endif */ @@ -924,32 +1013,38 @@ static int input(yyscan_t yyscanner); * is returned in "result". */ #ifndef YY_INPUT -#define YY_INPUT(buf, result, max_size) \ - /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */ \ - if (YY_CURRENT_BUFFER_LVALUE->yy_is_interactive) { \ - int c = '*'; \ - int n; \ - for (n = 0; n < max_size && (c = getc(yyin)) != EOF && c != '\n'; ++n) \ - buf[n] = (char)c; \ - if (c == '\n') \ - buf[n++] = (char)c; \ - if (c == EOF && ferror(yyin)) \ - YY_FATAL_ERROR("input in flex scanner failed"); \ - result = n; \ - } else { \ - errno = 0; \ - while ((result = (int)fread(buf, 1, (yy_size_t)max_size, yyin)) == 0 && ferror(yyin)) { \ - if (errno != EINTR) { \ - YY_FATAL_ERROR("input in flex scanner failed"); \ - break; \ - } \ - errno = 0; \ - clearerr(yyin); \ - } \ - } \ - \ - /* %if-c++-only C++ definition \ */ \ - /* %endif */ +#define YY_INPUT(buf,result,max_size) \ +/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + int n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ +/* %if-c++-only C++ definition \ */\ +/* %endif */ #endif @@ -969,7 +1064,7 @@ static int input(yyscan_t yyscanner); /* Report a fatal error. */ #ifndef YY_FATAL_ERROR /* %if-c-only */ -#define YY_FATAL_ERROR(msg) yy_fatal_error(msg, yyscanner) +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ @@ -993,9 +1088,11 @@ static int input(yyscan_t yyscanner); #define YY_DECL_IS_OURS 1 /* %if-c-only Standard (non-C++) definition */ -extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner); +extern int yylex \ + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner); -#define YY_DECL int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner) +#define YY_DECL int yylex \ + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) /* %endif */ /* %if-c++-only C++ definition */ /* %endif */ @@ -1010,477 +1107,449 @@ extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanne /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK /*LINTED*/ break; +#define YY_BREAK /*LINTED*/break; #endif /* %% [6.0] YY_RULE_SETUP definition goes here */ -#define YY_RULE_SETUP YY_USER_ACTION +#define YY_RULE_SETUP \ + YY_USER_ACTION /* %not-for-header */ /** The main scanner function which does all the work. */ -YY_DECL { - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylval = yylval_param; yylloc = yylloc_param; - if (!yyg->yy_init) { - yyg->yy_init = 1; + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; #ifdef YY_USER_INIT - YY_USER_INIT; + YY_USER_INIT; #endif - if (!yyg->yy_start) - yyg->yy_start = 1; /* first start state */ + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ - if (!yyin) - /* %if-c-only */ - yyin = stdin; - /* %endif */ - /* %if-c++-only */ - /* %endif */ + if ( ! yyin ) +/* %if-c-only */ + yyin = stdin; +/* %endif */ +/* %if-c++-only */ +/* %endif */ - if (!yyout) - /* %if-c-only */ - yyout = stdout; - /* %endif */ - /* %if-c++-only */ - /* %endif */ + if ( ! yyout ) +/* %if-c-only */ + yyout = stdout; +/* %endif */ +/* %if-c++-only */ +/* %endif */ - if (!YY_CURRENT_BUFFER) { - yyensure_buffer_stack(yyscanner); - YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner); - } + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } - yy_load_buffer_state(yyscanner); - } + yy_load_buffer_state( yyscanner ); + } - { + { /* %% [7.0] user's declarations go here */ #line 27 "expression_lexer.l" + #line 1171 "expression_lexer.cpp" - while (/*CONSTCOND*/ 1) /* loops until end-of-file is reached */ - { - /* %% [8.0] yymore()-related code goes here */ - yy_cp = yyg->yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yyg->yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - /* %% [9.0] code to set up and find next match goes here */ - yy_current_state = yyg->yy_start; - yy_match: - do { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if (yy_accept[yy_current_state]) { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { - yy_current_state = (int)yy_def[yy_current_state]; - if (yy_current_state >= 73) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - ++yy_cp; - } while (yy_current_state != 72); - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - - yy_find_action: - /* %% [10.0] code to find the action number goes here */ - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - - /* %% [11.0] code for yylineno update goes here */ - - do_action: /* This label is used only to access EOF actions. */ - - /* %% [12.0] debug code goes here */ - if (yy_flex_debug) { - if (yy_act == 0) - fprintf(stderr, "--scanner backing up\n"); - else if (yy_act < 29) - fprintf(stderr, "--accepting rule at line %ld (\"%s\")\n", (long)yy_rule_linenum[yy_act], yytext); - else if (yy_act == 29) - fprintf(stderr, "--accepting default rule (\"%s\")\n", yytext); - else if (yy_act == 30) - fprintf(stderr, "--(end of buffer or a NUL)\n"); - else - fprintf(stderr, "--EOF (start condition %d)\n", YY_START); - } - - switch (yy_act) { /* beginning of action switch */ - /* %% [13.0] actions go here */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yyg->yy_hold_char; - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - goto yy_find_action; - - case 1: - /* rule 1 can match eol */ - YY_RULE_SETUP + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { +/* %% [8.0] yymore()-related code goes here */ + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + +/* %% [9.0] code to set up and find next match goes here */ + yy_current_state = yyg->yy_start; +yy_match: + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 73 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + ++yy_cp; + } + while ( yy_current_state != 72 ); + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + +yy_find_action: +/* %% [10.0] code to find the action number goes here */ + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +/* %% [11.0] code for yylineno update goes here */ + +do_action: /* This label is used only to access EOF actions. */ + +/* %% [12.0] debug code goes here */ + if ( yy_flex_debug ) + { + if ( yy_act == 0 ) + fprintf( stderr, "--scanner backing up\n" ); + else if ( yy_act < 29 ) + fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n", + (long)yy_rule_linenum[yy_act], yytext ); + else if ( yy_act == 29 ) + fprintf( stderr, "--accepting default rule (\"%s\")\n", + yytext ); + else if ( yy_act == 30 ) + fprintf( stderr, "--(end of buffer or a NUL)\n" ); + else + fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); + } + + switch ( yy_act ) + { /* beginning of action switch */ +/* %% [13.0] actions go here */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + +case 1: +/* rule 1 can match eol */ +YY_RULE_SETUP #line 29 "expression_lexer.l" - /* ignore \t\n and space */; - YY_BREAK - case 2: - YY_RULE_SETUP +/* ignore \t\n and space */; + YY_BREAK +case 2: +YY_RULE_SETUP #line 31 "expression_lexer.l" - { - return AND; - } - YY_BREAK - case 3: - YY_RULE_SETUP +{ return AND; } + YY_BREAK +case 3: +YY_RULE_SETUP #line 32 "expression_lexer.l" - { - return AS; - } - YY_BREAK - case 4: - YY_RULE_SETUP +{ return AS; } + YY_BREAK +case 4: +YY_RULE_SETUP #line 33 "expression_lexer.l" - { - return BETWEEN; - } - YY_BREAK - case 5: - YY_RULE_SETUP +{ return BETWEEN; } + YY_BREAK +case 5: +YY_RULE_SETUP #line 34 "expression_lexer.l" - { - return FALSE; - } - YY_BREAK - case 6: - YY_RULE_SETUP +{ return FALSE; } + YY_BREAK +case 6: +YY_RULE_SETUP #line 35 "expression_lexer.l" - { - return IN; - } - YY_BREAK - case 7: - YY_RULE_SETUP +{ return IN; } + YY_BREAK +case 7: +YY_RULE_SETUP #line 36 "expression_lexer.l" - { - return IS; - } - YY_BREAK - case 8: - YY_RULE_SETUP +{ return IS; } + YY_BREAK +case 8: +YY_RULE_SETUP #line 37 "expression_lexer.l" - { - return LIKE; - } - YY_BREAK - case 9: - YY_RULE_SETUP +{ return LIKE; } + YY_BREAK +case 9: +YY_RULE_SETUP #line 38 "expression_lexer.l" - { - return NOT; - } - YY_BREAK - case 10: - YY_RULE_SETUP +{ return NOT; } + YY_BREAK +case 10: +YY_RULE_SETUP #line 39 "expression_lexer.l" - { - return NULLABLE; - } - YY_BREAK - case 11: - YY_RULE_SETUP +{ return NULLABLE; } + YY_BREAK +case 11: +YY_RULE_SETUP #line 40 "expression_lexer.l" - { - return OR; - } - YY_BREAK - case 12: - YY_RULE_SETUP +{ return OR; } + YY_BREAK +case 12: +YY_RULE_SETUP #line 41 "expression_lexer.l" - { - return TRUE; - } - YY_BREAK - case 13: - YY_RULE_SETUP +{ return TRUE; } + YY_BREAK +case 13: +YY_RULE_SETUP #line 43 "expression_lexer.l" - { - return EQUAL; - } - YY_BREAK - case 14: - YY_RULE_SETUP +{ return EQUAL; } + YY_BREAK +case 14: +YY_RULE_SETUP #line 44 "expression_lexer.l" - { - return NOT_EQ; - } - YY_BREAK - case 15: - YY_RULE_SETUP +{ return NOT_EQ; } + YY_BREAK +case 15: +YY_RULE_SETUP #line 45 "expression_lexer.l" - { - return NOT_EQ; - } - YY_BREAK - case 16: - YY_RULE_SETUP +{ return NOT_EQ; } + YY_BREAK +case 16: +YY_RULE_SETUP #line 46 "expression_lexer.l" - { - return LESS_EQ; - } - YY_BREAK - case 17: - YY_RULE_SETUP +{ return LESS_EQ; } + YY_BREAK +case 17: +YY_RULE_SETUP #line 47 "expression_lexer.l" - { - return GREATER_EQ; - } - YY_BREAK - case 18: - YY_RULE_SETUP +{ return GREATER_EQ; } + YY_BREAK +case 18: +YY_RULE_SETUP #line 49 "expression_lexer.l" - { - return yytext[0]; - } - YY_BREAK - case 19: +{ return yytext[0]; } + YY_BREAK +case 19: #line 52 "expression_lexer.l" - case 20: - YY_RULE_SETUP +case 20: +YY_RULE_SETUP #line 52 "expression_lexer.l" - { - yylval->double_value = atof(yytext); - return DOUBLE_VALUE; - } - YY_BREAK - case 21: - YY_RULE_SETUP +{ + yylval->double_value = atof(yytext); + return DOUBLE_VALUE; +} + YY_BREAK +case 21: +YY_RULE_SETUP #line 57 "expression_lexer.l" - { - errno = 0; - yylval->long_value = strtoll(yytext, nullptr, 0); - if (errno) { - return fprintf(stderr, "[EXPRESSION-Lexer-Error] Integer cannot be parsed - is it out of range?"); - return 0; - } - return LONG_VALUE; - } - YY_BREAK - case 22: - YY_RULE_SETUP +{ + errno = 0; + yylval->long_value = strtoll(yytext, nullptr, 0); + if (errno) { + return fprintf(stderr, "[EXPRESSION-Lexer-Error] Integer cannot be parsed - is it out of range?"); + return 0; + } + return LONG_VALUE; +} + YY_BREAK +case 22: +YY_RULE_SETUP #line 67 "expression_lexer.l" - { - // total length - 2 of quota + 1 null char - long str_len = strlen(yytext) - 1; - yylval->str_value = (char *)malloc(str_len); - memset(yylval->str_value, 0, str_len); - memcpy(yylval->str_value, (char *)(yytext + 1), str_len - 1); - return IDENTIFIER; - } - YY_BREAK - case 23: - YY_RULE_SETUP +{ + // total length - 2 of quota + 1 null char + long str_len = strlen(yytext) - 1; + yylval->str_value = (char*)malloc(str_len); + memset(yylval->str_value, 0, str_len); + memcpy(yylval->str_value, (char*)(yytext + 1), str_len - 1); + return IDENTIFIER; +} + YY_BREAK +case 23: +YY_RULE_SETUP #line 76 "expression_lexer.l" - { - yylval->str_value = strdup(yytext); - return IDENTIFIER; - } - YY_BREAK - case 24: - YY_RULE_SETUP +{ + yylval->str_value = strdup(yytext); + return IDENTIFIER; +} + YY_BREAK +case 24: +YY_RULE_SETUP #line 81 "expression_lexer.l" - { - BEGIN SINGLE_QUOTED_STRING; - string_buffer.clear(); - string_buffer.str(""); - } // Clear strbuf manually, see #170 - YY_BREAK - case 25: - YY_RULE_SETUP +{ BEGIN SINGLE_QUOTED_STRING; string_buffer.clear(); string_buffer.str(""); } // Clear strbuf manually, see #170 + YY_BREAK +case 25: +YY_RULE_SETUP #line 82 "expression_lexer.l" - { - string_buffer << '\''; - } - YY_BREAK - case 26: - /* rule 26 can match eol */ - YY_RULE_SETUP +{ string_buffer << '\''; } + YY_BREAK +case 26: +/* rule 26 can match eol */ +YY_RULE_SETUP #line 83 "expression_lexer.l" - { - string_buffer << yytext; - } - YY_BREAK - case 27: - YY_RULE_SETUP +{ string_buffer << yytext; } + YY_BREAK +case 27: +YY_RULE_SETUP #line 84 "expression_lexer.l" - { - BEGIN INITIAL; - yylval->str_value = strdup(string_buffer.str().c_str()); - return STRING; - } - YY_BREAK - case YY_STATE_EOF(SINGLE_QUOTED_STRING): +{ BEGIN INITIAL; yylval->str_value = strdup(string_buffer.str().c_str()); return STRING; } + YY_BREAK +case YY_STATE_EOF(SINGLE_QUOTED_STRING): #line 85 "expression_lexer.l" - { - fprintf(stderr, "[EXPRESSION-Lexer-Error] Unterminated string\n"); - return 0; - } - YY_BREAK - case 28: - YY_RULE_SETUP +{ fprintf(stderr, "[EXPRESSION-Lexer-Error] Unterminated string\n"); return 0; } + YY_BREAK +case 28: +YY_RULE_SETUP #line 87 "expression_lexer.l" - { - fprintf(stderr, "[EXPRESSION-Lexer-Error] Unknown Character: %c\n", yytext[0]); - return 0; - } - YY_BREAK - case 29: - YY_RULE_SETUP +{ fprintf(stderr, "[EXPRESSION-Lexer-Error] Unknown Character: %c\n", yytext[0]); return 0; } + YY_BREAK +case 29: +YY_RULE_SETUP #line 89 "expression_lexer.l" - ECHO; - YY_BREAK +ECHO; + YY_BREAK #line 1416 "expression_lexer.cpp" - case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int)(yy_cp - yyg->yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yyg->yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW) { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - /* %if-c-only */ - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - /* %endif */ - /* %if-c++-only */ - /* %endif */ - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if (yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]) { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(yyscanner); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans(yy_current_state, yyscanner); - - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - - if (yy_next_state) { - /* Consume the NUL. */ - yy_cp = ++yyg->yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else { - /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - goto yy_find_action; - } - } - - else - switch (yy_get_next_buffer(yyscanner)) { - case EOB_ACT_END_OF_FILE: { - yyg->yy_did_buffer_switch_on_eof = 0; - - if (yywrap(yyscanner)) { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else { - if (!yyg->yy_did_buffer_switch_on_eof) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(yyscanner); - - yy_cp = yyg->yy_c_buf_p; - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yyg->yy_c_buf_p = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; - - yy_current_state = yy_get_previous_state(yyscanner); - - yy_cp = yyg->yy_c_buf_p; - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR("fatal flex scanner internal error--no action found"); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; +/* %if-c-only */ + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; +/* %endif */ +/* %if-c++-only */ +/* %endif */ + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { +/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( yywrap( yyscanner ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* %ok-for-header */ @@ -1498,158 +1567,181 @@ YY_DECL { * EOB_ACT_END_OF_FILE - end of file */ /* %if-c-only */ -static int yy_get_next_buffer(yyscan_t yyscanner) +static int yy_get_next_buffer (yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = yyg->yytext_ptr; - int number_to_move, i; - int ret_val; - - if (yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1]) - YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed"); - - if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0) { /* Don't try to fill the buffer, so this is an EOF. */ - if (yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1) { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int)(yyg->yy_c_buf_p - yyg->yytext_ptr - 1); - - for (i = 0; i < number_to_move; ++i) - *(dest++) = *(source++); - - if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; - - else { - int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while (num_to_read <= 0) { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = (int)(yyg->yy_c_buf_p - b->yy_ch_buf); - - if (b->yy_is_our_buffer) { - int new_size = b->yy_buf_size * 2; - - if (new_size <= 0) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc((void *)b->yy_ch_buf, (yy_size_t)(b->yy_buf_size + 2), yyscanner); - } else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; - - if (!b->yy_ch_buf) - YY_FATAL_ERROR("fatal error - scanner input buffer overflow"); - - yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - } - - if (num_to_read > YY_READ_BUF_SIZE) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), yyg->yy_n_chars, num_to_read); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - if (yyg->yy_n_chars == 0) { - if (number_to_move == YY_MORE_ADJ) { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin, yyscanner); - } - - else { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *)yyrealloc((void *)YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t)new_size, yyscanner); - if (!YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) - YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()"); - /* "- 2" to take care of EOB's */ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int)(new_size - 2); - } - - yyg->yy_n_chars += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + yyg->yy_n_chars, num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin , yyscanner); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ /* %if-c-only */ /* %not-for-header */ -static yy_state_type yy_get_previous_state(yyscan_t yyscanner) + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - yy_state_type yy_current_state; - char *yy_cp; - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - - /* %% [15.0] code to get the start state into yy_current_state goes here */ - yy_current_state = yyg->yy_start; - - for (yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp) { - /* %% [16.0] code to find the next state goes here */ - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if (yy_accept[yy_current_state]) { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { - yy_current_state = (int)yy_def[yy_current_state]; - if (yy_current_state >= 73) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - } - - return yy_current_state; + yy_state_type yy_current_state; + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + +/* %% [15.0] code to get the start state into yy_current_state goes here */ + yy_current_state = yyg->yy_start; + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { +/* %% [16.0] code to find the next state goes here */ + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 73 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + } + + return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character @@ -1658,31 +1750,33 @@ static yy_state_type yy_get_previous_state(yyscan_t yyscanner) * next_state = yy_try_NUL_trans( current_state ); */ /* %if-c-only */ -static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state, yyscan_t yyscanner) + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - int yy_is_jam; - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; /* This var may be unused depending upon options. */ - /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ - char *yy_cp = yyg->yy_c_buf_p; - - YY_CHAR yy_c = 1; - if (yy_accept[yy_current_state]) { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { - yy_current_state = (int)yy_def[yy_current_state]; - if (yy_current_state >= 73) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 72); - - (void)yyg; - return yy_is_jam ? 0 : yy_current_state; + int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ +/* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ + char *yy_cp = yyg->yy_c_buf_p; + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 73 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 72); + + (void)yyg; + return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT @@ -1694,81 +1788,85 @@ static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state, yyscan_t y /* %if-c-only */ #ifndef YY_NO_INPUT #ifdef __cplusplus -static int yyinput(yyscan_t yyscanner) + static int yyinput (yyscan_t yyscanner) #else -static int input(yyscan_t yyscanner) + static int input (yyscan_t yyscanner) #endif /* %endif */ /* %if-c++-only */ /* %endif */ { - int c; - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - - *yyg->yy_c_buf_p = yyg->yy_hold_char; - - if (*yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR) { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if (yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]) - /* This was really a NUL. */ - *yyg->yy_c_buf_p = '\0'; - - else { /* need more input */ - int offset = (int)(yyg->yy_c_buf_p - yyg->yytext_ptr); - ++yyg->yy_c_buf_p; - - switch (yy_get_next_buffer(yyscanner)) { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart(yyin, yyscanner); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: { - if (yywrap(yyscanner)) - return 0; - - if (!yyg->yy_did_buffer_switch_on_eof) - YY_NEW_FILE; + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin , yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( yyscanner ) ) + return 0; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; #ifdef __cplusplus - return yyinput(yyscanner); + return yyinput(yyscanner); #else - return input(yyscanner); + return input(yyscanner); #endif - } + } - case EOB_ACT_CONTINUE_SCAN: - yyg->yy_c_buf_p = yyg->yytext_ptr + offset; - break; - } - } - } + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } - c = *(unsigned char *)yyg->yy_c_buf_p; /* cast for 8-bit char's */ - *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ - yyg->yy_hold_char = *++yyg->yy_c_buf_p; + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; - /* %% [19.0] update BOL and yylineno */ +/* %% [19.0] update BOL and yylineno */ - return c; + return c; } /* %if-c-only */ -#endif /* ifndef YY_NO_INPUT */ - /* %endif */ +#endif /* ifndef YY_NO_INPUT */ +/* %endif */ /** Immediately switch to a different input stream. * @param input_file A readable stream. @@ -1776,20 +1874,21 @@ static int input(yyscan_t yyscanner) * @note This function does not reset the start condition to @c INITIAL . */ /* %if-c-only */ -void yyrestart(FILE *input_file, yyscan_t yyscanner) + void yyrestart (FILE * input_file , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (!YY_CURRENT_BUFFER) { - yyensure_buffer_stack(yyscanner); - YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner); - } + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } - yy_init_buffer(YY_CURRENT_BUFFER, input_file, yyscanner); - yy_load_buffer_state(yyscanner); + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); } /* %if-c++-only */ @@ -1800,55 +1899,56 @@ void yyrestart(FILE *input_file, yyscan_t yyscanner) * @param yyscanner The scanner object. */ /* %if-c-only */ -void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner) + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack(yyscanner); - if (YY_CURRENT_BUFFER == new_buffer) - return; - - if (YY_CURRENT_BUFFER) { - /* Flush out information for old buffer. */ - *yyg->yy_c_buf_p = yyg->yy_hold_char; - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state(yyscanner); + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); */ - yyg->yy_did_buffer_switch_on_eof = 1; + yyensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( yyscanner ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yyg->yy_did_buffer_switch_on_eof = 1; } /* %if-c-only */ -static void yy_load_buffer_state(yyscan_t yyscanner) +static void yy_load_buffer_state (yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - /* %if-c-only */ - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - /* %endif */ - /* %if-c++-only */ - /* %endif */ - yyg->yy_hold_char = *yyg->yy_c_buf_p; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; +/* %if-c-only */ + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; +/* %endif */ +/* %if-c++-only */ +/* %endif */ + yyg->yy_hold_char = *yyg->yy_c_buf_p; } /** Allocate and initialize an input buffer state. @@ -1858,31 +1958,31 @@ static void yy_load_buffer_state(yyscan_t yyscanner) * @return the allocated buffer state. */ /* %if-c-only */ -YY_BUFFER_STATE yy_create_buffer(FILE *file, int size, yyscan_t yyscanner) + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE)yyalloc(sizeof(struct yy_buffer_state), yyscanner); - if (!b) - YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = size; - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *)yyalloc((yy_size_t)(b->yy_buf_size + 2), yyscanner); - if (!b->yy_ch_buf) - YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_is_our_buffer = 1; + b->yy_is_our_buffer = 1; - yy_init_buffer(b, file, yyscanner); + yy_init_buffer( b, file , yyscanner); - return b; + return b; } /* %if-c++-only */ @@ -1893,23 +1993,23 @@ YY_BUFFER_STATE yy_create_buffer(FILE *file, int size, yyscan_t yyscanner) * @param yyscanner The scanner object. */ /* %if-c-only */ -void yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner) + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (!b) - return; + if ( ! b ) + return; - if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE)0; + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - if (b->yy_is_our_buffer) - yyfree((void *)b->yy_ch_buf, yyscanner); + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf , yyscanner ); - yyfree((void *)b, yyscanner); + yyfree( (void *) b , yyscanner ); } /* Initializes or reinitializes a buffer. @@ -1917,41 +2017,41 @@ void yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner) * such as during a yyrestart() or at EOF. */ /* %if-c-only */ -static void yy_init_buffer(YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner) + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - int oerrno = errno; - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flush_buffer(b, yyscanner); + yy_flush_buffer( b , yyscanner); - /* %if-c-only */ - b->yy_input_file = file; - /* %endif */ - /* %if-c++-only */ - /* %endif */ - b->yy_fill_buffer = 1; +/* %if-c-only */ + b->yy_input_file = file; +/* %endif */ +/* %if-c++-only */ +/* %endif */ + b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ - if (b != YY_CURRENT_BUFFER) { + if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } - /* %if-c-only */ - - b->yy_is_interactive = 0; +/* %if-c-only */ - /* %endif */ - /* %if-c++-only */ - /* %endif */ - errno = oerrno; + b->yy_is_interactive = 0; + +/* %endif */ +/* %if-c++-only */ +/* %endif */ + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. @@ -1959,31 +2059,31 @@ static void yy_init_buffer(YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner) * @param yyscanner The scanner object. */ /* %if-c-only */ -void yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner) + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - if (!b) - return; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if ( ! b ) + return; - b->yy_n_chars = 0; + b->yy_n_chars = 0; - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - b->yy_buf_pos = &b->yy_ch_buf[0]; + b->yy_buf_pos = &b->yy_ch_buf[0]; - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; - if (b == YY_CURRENT_BUFFER) - yy_load_buffer_state(yyscanner); + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( yyscanner ); } /* %if-c-or-c++ */ @@ -1994,33 +2094,34 @@ void yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner) * @param yyscanner The scanner object. */ /* %if-c-only */ -void yypush_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner) +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(yyscanner); - - /* This block is copied from yy_switch_to_buffer. */ - if (YY_CURRENT_BUFFER) { - /* Flush out information for old buffer. */ - *yyg->yy_c_buf_p = yyg->yy_hold_char; - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - yyg->yy_buffer_stack_top++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state(yyscanner); - yyg->yy_did_buffer_switch_on_eof = 1; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(yyscanner); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; } /* %endif */ @@ -2030,24 +2131,24 @@ void yypush_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner) * @param yyscanner The scanner object. */ /* %if-c-only */ -void yypop_buffer_state(yyscan_t yyscanner) +void yypop_buffer_state (yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner); - YY_CURRENT_BUFFER_LVALUE = NULL; - if (yyg->yy_buffer_stack_top > 0) - --yyg->yy_buffer_stack_top; - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state(yyscanner); - yyg->yy_did_buffer_switch_on_eof = 1; - } + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; + } } /* %endif */ @@ -2056,46 +2157,51 @@ void yypop_buffer_state(yyscan_t yyscanner) * Guarantees space for at least one push. */ /* %if-c-only */ -static void yyensure_buffer_stack(yyscan_t yyscanner) +static void yyensure_buffer_stack (yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - yy_size_t num_to_alloc; - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (!yyg->yy_buffer_stack) { + if (!yyg->yy_buffer_stack) { - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ - yyg->yy_buffer_stack = (struct yy_buffer_state **)yyalloc(num_to_alloc * sizeof(struct yy_buffer_state *), yyscanner); - if (!yyg->yy_buffer_stack) - YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); - - memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state *)); - - yyg->yy_buffer_stack_max = num_to_alloc; - yyg->yy_buffer_stack_top = 0; - return; - } - - if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1) { - - /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = yyg->yy_buffer_stack_max + grow_size; - yyg->yy_buffer_stack = (struct yy_buffer_state **)yyrealloc(yyg->yy_buffer_stack, num_to_alloc * sizeof(struct yy_buffer_state *), yyscanner); - if (!yyg->yy_buffer_stack) - YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); - - /* zero only the new slots.*/ - memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state *)); - yyg->yy_buffer_stack_max = num_to_alloc; - } + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->yy_buffer_stack_max = num_to_alloc; + } } /* %endif */ @@ -2106,30 +2212,33 @@ static void yyensure_buffer_stack(yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner) { - YY_BUFFER_STATE b; - - if (size < 2 || base[size - 2] != YY_END_OF_BUFFER_CHAR || base[size - 1] != YY_END_OF_BUFFER_CHAR) - /* They forgot to leave room for the EOB's. */ - return NULL; - - b = (YY_BUFFER_STATE)yyalloc(sizeof(struct yy_buffer_state), yyscanner); - if (!b) - YY_FATAL_ERROR("out of dynamic memory in yy_scan_buffer()"); - - b->yy_buf_size = (int)(size - 2); /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = NULL; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer(b, yyscanner); - - return b; +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b , yyscanner ); + + return b; } /* %endif */ @@ -2142,7 +2251,11 @@ YY_BUFFER_STATE yy_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner) { * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ -YY_BUFFER_STATE yy_scan_string(const char *yystr, yyscan_t yyscanner) { return yy_scan_bytes(yystr, (int)strlen(yystr), yyscanner); } +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); +} /* %endif */ /* %if-c-only */ @@ -2153,33 +2266,34 @@ YY_BUFFER_STATE yy_scan_string(const char *yystr, yyscan_t yyscanner) { return y * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes(const char *yybytes, int _yybytes_len, yyscan_t yyscanner) { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = (yy_size_t)(_yybytes_len + 2); - buf = (char *)yyalloc(n, yyscanner); - if (!buf) - YY_FATAL_ERROR("out of dynamic memory in yy_scan_bytes()"); - - for (i = 0; i < _yybytes_len; ++i) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len + 1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer(buf, n, yyscanner); - if (!b) - YY_FATAL_ERROR("bad buffer in yy_scan_bytes()"); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n , yyscanner); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; } /* %endif */ @@ -2188,11 +2302,12 @@ YY_BUFFER_STATE yy_scan_bytes(const char *yybytes, int _yybytes_len, yyscan_t yy #endif /* %if-c-only */ -static void yynoreturn yy_fatal_error(const char *msg, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - (void)yyg; - fprintf(stderr, "%s\n", msg); - exit(YY_EXIT_FAILURE); +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); } /* %endif */ /* %if-c++-only */ @@ -2201,17 +2316,19 @@ static void yynoreturn yy_fatal_error(const char *msg, yyscan_t yyscanner) { /* Redefine yyless() so it works in section 3 code. */ #undef yyless -#define yyless(n) \ - do { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg); \ - yytext[yyleng] = yyg->yy_hold_char; \ - yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ - yyg->yy_hold_char = *yyg->yy_c_buf_p; \ - *yyg->yy_c_buf_p = '\0'; \ - yyleng = yyless_macro_arg; \ - } while (0) +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ @@ -2221,8 +2338,9 @@ static void yynoreturn yy_fatal_error(const char *msg, yyscan_t yyscanner) { /** Get the user-defined data for this scanner. * @param yyscanner The scanner object. */ -YY_EXTRA_TYPE yyget_extra(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyextra; } @@ -2231,48 +2349,53 @@ YY_EXTRA_TYPE yyget_extra(yyscan_t yyscanner) { /** Get the current line number. * @param yyscanner The scanner object. */ -int yyget_lineno(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - - if (!YY_CURRENT_BUFFER) - return 0; +int yyget_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (! YY_CURRENT_BUFFER) + return 0; + return yylineno; } /** Get the current column number. * @param yyscanner The scanner object. */ -int yyget_column(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - - if (!YY_CURRENT_BUFFER) - return 0; +int yyget_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (! YY_CURRENT_BUFFER) + return 0; + return yycolumn; } /** Get the input stream. * @param yyscanner The scanner object. */ -FILE *yyget_in(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +FILE *yyget_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyin; } /** Get the output stream. * @param yyscanner The scanner object. */ -FILE *yyget_out(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +FILE *yyget_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyout; } /** Get the length of the current token. * @param yyscanner The scanner object. */ -int yyget_leng(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +int yyget_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; } @@ -2280,8 +2403,9 @@ int yyget_leng(yyscan_t yyscanner) { * @param yyscanner The scanner object. */ -char *yyget_text(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +char *yyget_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yytext; } @@ -2291,9 +2415,10 @@ char *yyget_text(yyscan_t yyscanner) { * @param user_defined The data to be associated with this scanner. * @param yyscanner The scanner object. */ -void yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - yyextra = user_defined; +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; } /* %endif */ @@ -2302,13 +2427,14 @@ void yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner) { * @param _line_number line number * @param yyscanner The scanner object. */ -void yyset_lineno(int _line_number, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - - /* lineno is only valid if an input buffer exists. */ - if (!YY_CURRENT_BUFFER) - YY_FATAL_ERROR("yyset_lineno called with no buffer"); +void yyset_lineno (int _line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + yylineno = _line_number; } @@ -2316,13 +2442,14 @@ void yyset_lineno(int _line_number, yyscan_t yyscanner) { * @param _column_no column number * @param yyscanner The scanner object. */ -void yyset_column(int _column_no, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - - /* column is only valid if an input buffer exists. */ - if (!YY_CURRENT_BUFFER) - YY_FATAL_ERROR("yyset_column called with no buffer"); +void yyset_column (int _column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + yycolumn = _column_no; } @@ -2332,24 +2459,28 @@ void yyset_column(int _column_no, yyscan_t yyscanner) { * @param yyscanner The scanner object. * @see yy_switch_to_buffer */ -void yyset_in(FILE *_in_str, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - yyin = _in_str; +void yyset_in (FILE * _in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; } -void yyset_out(FILE *_out_str, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - yyout = _out_str; +void yyset_out (FILE * _out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; } -int yyget_debug(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +int yyget_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yy_flex_debug; } -void yyset_debug(int _bdebug, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - yy_flex_debug = _bdebug; +void yyset_debug (int _bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; } /* %endif */ @@ -2359,26 +2490,30 @@ void yyset_debug(int _bdebug, yyscan_t yyscanner) { /* %if-bison-bridge */ -YYSTYPE *yyget_lval(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +YYSTYPE * yyget_lval (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylval; } -void yyset_lval(YYSTYPE *yylval_param, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylval = yylval_param; } -YYLTYPE *yyget_lloc(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +YYLTYPE *yyget_lloc (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylloc; } - -void yyset_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; + +void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylloc = yylloc_param; } - + /* %endif */ /* User-visible API */ @@ -2387,23 +2522,24 @@ void yyset_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner) { * the ONLY reentrant function that doesn't take the scanner as the last argument. * That's why we explicitly handle the declaration, instead of using our macros. */ -int yylex_init(yyscan_t *ptr_yy_globals) { - if (ptr_yy_globals == NULL) { +int yylex_init(yyscan_t* ptr_yy_globals) +{ + if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } - *ptr_yy_globals = (yyscan_t)yyalloc(sizeof(struct yyguts_t), NULL); + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); - if (*ptr_yy_globals == NULL) { + if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals, 0x00, sizeof(struct yyguts_t)); + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - return yy_init_globals(*ptr_yy_globals); + return yy_init_globals ( *ptr_yy_globals ); } /* yylex_init_extra has the same functionality as yylex_init, but follows the @@ -2413,37 +2549,39 @@ int yylex_init(yyscan_t *ptr_yy_globals) { * The user defined value in the first argument will be available to yyalloc in * the yyextra field. */ -int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined, yyscan_t *ptr_yy_globals) { +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) +{ struct yyguts_t dummy_yyguts; - yyset_extra(yy_user_defined, &dummy_yyguts); + yyset_extra (yy_user_defined, &dummy_yyguts); - if (ptr_yy_globals == NULL) { + if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } - *ptr_yy_globals = (yyscan_t)yyalloc(sizeof(struct yyguts_t), &dummy_yyguts); + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - if (*ptr_yy_globals == NULL) { + if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals, 0x00, sizeof(struct yyguts_t)); + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - yyset_extra(yy_user_defined, *ptr_yy_globals); + yyset_extra (yy_user_defined, *ptr_yy_globals); - return yy_init_globals(*ptr_yy_globals); + return yy_init_globals ( *ptr_yy_globals ); } /* %endif if-c-only */ /* %if-c-only */ -static int yy_init_globals(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ @@ -2457,7 +2595,7 @@ static int yy_init_globals(yyscan_t yyscanner) { yyg->yy_start_stack_ptr = 0; yyg->yy_start_stack_depth = 0; - yyg->yy_start_stack = NULL; + yyg->yy_start_stack = NULL; /* Defined in main.c */ #ifdef YY_STDINIT @@ -2477,33 +2615,34 @@ static int yy_init_globals(yyscan_t yyscanner) { /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */ /* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +int yylex_destroy (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* Pop the buffer stack, destroying each element. */ - while (YY_CURRENT_BUFFER) { - yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(yyscanner); - } + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(yyscanner); + } - /* Destroy the stack itself. */ - yyfree(yyg->yy_buffer_stack, yyscanner); - yyg->yy_buffer_stack = NULL; + /* Destroy the stack itself. */ + yyfree(yyg->yy_buffer_stack , yyscanner); + yyg->yy_buffer_stack = NULL; /* Destroy the start condition stack. */ - yyfree(yyg->yy_start_stack, yyscanner); - yyg->yy_start_stack = NULL; + yyfree( yyg->yy_start_stack , yyscanner ); + yyg->yy_start_stack = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ - yy_init_globals(yyscanner); + yy_init_globals( yyscanner); - /* %if-reentrant */ +/* %if-reentrant */ /* Destroy the main struct (reentrant only). */ - yyfree(yyscanner, yyscanner); + yyfree ( yyscanner , yyscanner ); yyscanner = NULL; - /* %endif */ +/* %endif */ return 0; } /* %endif */ @@ -2513,50 +2652,55 @@ int yylex_destroy(yyscan_t yyscanner) { */ #ifndef yytext_ptr -static void yy_flex_strncpy(char *s1, const char *s2, int n, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - (void)yyg; +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; - int i; - for (i = 0; i < n; ++i) - s1[i] = s2[i]; + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen(const char *s, yyscan_t yyscanner) { - int n; - for (n = 0; s[n]; ++n) - ; +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; - return n; + return n; } #endif -void *yyalloc(yy_size_t size, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - (void)yyg; - return malloc(size); +void *yyalloc (yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); } -void *yyrealloc(void *ptr, yy_size_t size, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - (void)yyg; - - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return realloc(ptr, size); +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); } -void yyfree(void *ptr, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - (void)yyg; - free((char *)ptr); /* see yyrealloc() for (char *) cast */ +void yyfree (void * ptr , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } /* %if-tables-serialization definitions */ @@ -2568,7 +2712,8 @@ void yyfree(void *ptr, yyscan_t yyscanner) { #line 89 "expression_lexer.l" + int expressionerror(const char *msg) { - fprintf(stderr, "[Why here?] %s\n", msg); - return 0; + fprintf(stderr, "[Why here?] %s\n",msg); return 0; } + diff --git a/src/parser/expression_lexer.h b/src/parser/expression_lexer.h index 134fe55629..533db5085f 100644 --- a/src/parser/expression_lexer.h +++ b/src/parser/expression_lexer.h @@ -6,7 +6,7 @@ #line 8 "expression_lexer.h" -#define YY_INT_ALIGNED short int +#define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ @@ -268,10 +268,10 @@ /* begin standard C headers. */ /* %if-c-only */ -#include #include -#include #include +#include +#include /* %endif */ /* %if-tables-serialization */ @@ -286,10 +286,10 @@ /* C99 systems have . Non-C99 systems may or may not. */ -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -306,41 +306,41 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN -#define INT8_MIN (-128) +#define INT8_MIN (-128) #endif #ifndef INT16_MIN -#define INT16_MIN (-32767 - 1) +#define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN -#define INT32_MIN (-2147483647 - 1) +#define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX -#define INT8_MAX (127) +#define INT8_MAX (127) #endif #ifndef INT16_MAX -#define INT16_MAX (32767) +#define INT16_MAX (32767) #endif #ifndef INT32_MAX -#define INT32_MAX (2147483647) +#define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX -#define UINT8_MAX (255U) +#define UINT8_MAX (255U) #endif #ifndef UINT16_MAX -#define UINT16_MAX (65535U) +#define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) +#define UINT32_MAX (4294967295U) #endif #ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) +#define SIZE_MAX (~(size_t)0) #endif #endif /* ! C99 */ @@ -371,7 +371,7 @@ typedef unsigned int flex_uint32_t; /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T #define YY_TYPEDEF_YY_SCANNER_T -typedef void *yyscan_t; +typedef void* yyscan_t; #endif /* For convenience, these vars (plus the bison vars far below) @@ -423,56 +423,58 @@ typedef size_t yy_size_t; #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state { - /* %if-c-only */ - FILE *yy_input_file; - /* %endif */ - - /* %if-c++-only */ - /* %endif */ - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; +struct yy_buffer_state + { +/* %if-c-only */ + FILE *yy_input_file; +/* %endif */ + +/* %if-c++-only */ +/* %endif */ + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; - int yy_buffer_status; -}; + }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* %if-c-only Standard (non-C++) definition */ @@ -487,28 +489,28 @@ struct yy_buffer_state { /* %endif */ -void yyrestart(FILE *input_file, yyscan_t yyscanner); -void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner); -YY_BUFFER_STATE yy_create_buffer(FILE *file, int size, yyscan_t yyscanner); -void yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner); -void yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner); -void yypush_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner); -void yypop_buffer_state(yyscan_t yyscanner); +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner); -YY_BUFFER_STATE yy_scan_string(const char *yy_str, yyscan_t yyscanner); -YY_BUFFER_STATE yy_scan_bytes(const char *bytes, int len, yyscan_t yyscanner); +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); /* %endif */ -void *yyalloc(yy_size_t, yyscan_t yyscanner); -void *yyrealloc(void *, yy_size_t, yyscan_t yyscanner); -void yyfree(void *, yyscan_t yyscanner); +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */ /* Begin user sect3 */ -#define expressionwrap(yyscanner) (/*CONSTCOND*/ 1) +#define expressionwrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP #define FLEX_DEBUG @@ -550,9 +552,9 @@ void yyfree(void *, yyscan_t yyscanner); /* %if-reentrant */ -int yylex_init(yyscan_t *scanner); +int yylex_init (yyscan_t* scanner); -int yylex_init_extra(YY_EXTRA_TYPE user_defined, yyscan_t *scanner); +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); /* %endif */ @@ -561,46 +563,46 @@ int yylex_init_extra(YY_EXTRA_TYPE user_defined, yyscan_t *scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int yylex_destroy(yyscan_t yyscanner); +int yylex_destroy ( yyscan_t yyscanner ); -int yyget_debug(yyscan_t yyscanner); +int yyget_debug ( yyscan_t yyscanner ); -void yyset_debug(int debug_flag, yyscan_t yyscanner); +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); -YY_EXTRA_TYPE yyget_extra(yyscan_t yyscanner); +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); -void yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner); +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); -FILE *yyget_in(yyscan_t yyscanner); +FILE *yyget_in ( yyscan_t yyscanner ); -void yyset_in(FILE *_in_str, yyscan_t yyscanner); +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); -FILE *yyget_out(yyscan_t yyscanner); +FILE *yyget_out ( yyscan_t yyscanner ); -void yyset_out(FILE *_out_str, yyscan_t yyscanner); +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); -int yyget_leng(yyscan_t yyscanner); + int yyget_leng ( yyscan_t yyscanner ); -char *yyget_text(yyscan_t yyscanner); +char *yyget_text ( yyscan_t yyscanner ); -int yyget_lineno(yyscan_t yyscanner); +int yyget_lineno ( yyscan_t yyscanner ); -void yyset_lineno(int _line_number, yyscan_t yyscanner); +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); -int yyget_column(yyscan_t yyscanner); +int yyget_column ( yyscan_t yyscanner ); -void yyset_column(int _column_no, yyscan_t yyscanner); +void yyset_column ( int _column_no , yyscan_t yyscanner ); /* %if-bison-bridge */ -YYSTYPE *yyget_lval(yyscan_t yyscanner); +YYSTYPE * yyget_lval ( yyscan_t yyscanner ); -void yyset_lval(YYSTYPE *yylval_param, yyscan_t yyscanner); - -YYLTYPE *yyget_lloc(yyscan_t yyscanner); - -void yyset_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner); +void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); + YYLTYPE *yyget_lloc ( yyscan_t yyscanner ); + + void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner ); + /* %endif */ /* Macros after this point can all be overridden by user definitions in @@ -609,9 +611,9 @@ void yyset_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap(yyscan_t yyscanner); +extern "C" int yywrap ( yyscan_t yyscanner ); #else -extern int yywrap(yyscan_t yyscanner); +extern int yywrap ( yyscan_t yyscanner ); #endif #endif @@ -620,11 +622,11 @@ extern int yywrap(yyscan_t yyscanner); /* %endif */ #ifndef yytext_ptr -static void yy_flex_strncpy(char *, const char *, int, yyscan_t yyscanner); +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen(const char *, yyscan_t yyscanner); +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT @@ -665,9 +667,11 @@ static int yy_flex_strlen(const char *, yyscan_t yyscanner); #define YY_DECL_IS_OURS 1 /* %if-c-only Standard (non-C++) definition */ -extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner); +extern int yylex \ + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner); -#define YY_DECL int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner) +#define YY_DECL int yylex \ + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) /* %endif */ /* %if-c++-only C++ definition */ /* %endif */ @@ -844,6 +848,7 @@ extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanne #line 89 "expression_lexer.l" + #line 853 "expression_lexer.h" #undef expressionIN_HEADER #endif /* expressionHEADER_H */ diff --git a/src/parser/expression_parser.cpp b/src/parser/expression_parser.cpp index bc6699f66b..7fc9b84b74 100644 --- a/src/parser/expression_parser.cpp +++ b/src/parser/expression_parser.cpp @@ -64,258 +64,261 @@ #define YYPULL 1 /* Substitute the type names. */ -#define YYSTYPE EXPRESSIONSTYPE -#define YYLTYPE EXPRESSIONLTYPE +#define YYSTYPE EXPRESSIONSTYPE +#define YYLTYPE EXPRESSIONLTYPE /* Substitute the variable and function names. */ -#define yyparse expressionparse -#define yylex expressionlex -#define yyerror expressionerror -#define yydebug expressiondebug -#define yynerrs expressionnerrs +#define yyparse expressionparse +#define yylex expressionlex +#define yyerror expressionerror +#define yydebug expressiondebug +#define yynerrs expressionnerrs /* First part of user prologue. */ #line 2 "expression_parser.y" +#include +#include #include "expression_parser.h" #include "expression_lexer.h" #include "parser_helper.h" -#include -#include -void expressionerror(YYLTYPE *llocp, void *lexer, infinity::ExpressionParserResult *result, const char *msg); +void expressionerror(YYLTYPE * llocp, void* lexer, infinity::ExpressionParserResult* result, const char* msg); #line 88 "expression_parser.cpp" -#ifndef YY_CAST -#ifdef __cplusplus -#define YY_CAST(Type, Val) static_cast(Val) -#define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast(Val) -#else -#define YY_CAST(Type, Val) ((Type)(Val)) -#define YY_REINTERPRET_CAST(Type, Val) ((Type)(Val)) -#endif -#endif -#ifndef YY_NULLPTR -#if defined __cplusplus -#if 201103L <= __cplusplus -#define YY_NULLPTR nullptr -#else -#define YY_NULLPTR 0 -#endif -#else -#define YY_NULLPTR ((void *)0) -#endif -#endif +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif #include "expression_parser.h" /* Symbol kind. */ -enum yysymbol_kind_t { - YYSYMBOL_YYEMPTY = -2, - YYSYMBOL_YYEOF = 0, /* "end of file" */ - YYSYMBOL_YYerror = 1, /* error */ - YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ - YYSYMBOL_IDENTIFIER = 3, /* IDENTIFIER */ - YYSYMBOL_STRING = 4, /* STRING */ - YYSYMBOL_DOUBLE_VALUE = 5, /* DOUBLE_VALUE */ - YYSYMBOL_LONG_VALUE = 6, /* LONG_VALUE */ - YYSYMBOL_CREATE = 7, /* CREATE */ - YYSYMBOL_SELECT = 8, /* SELECT */ - YYSYMBOL_INSERT = 9, /* INSERT */ - YYSYMBOL_DROP = 10, /* DROP */ - YYSYMBOL_UPDATE = 11, /* UPDATE */ - YYSYMBOL_DELETE = 12, /* DELETE */ - YYSYMBOL_COPY = 13, /* COPY */ - YYSYMBOL_SET = 14, /* SET */ - YYSYMBOL_EXPLAIN = 15, /* EXPLAIN */ - YYSYMBOL_SHOW = 16, /* SHOW */ - YYSYMBOL_ALTER = 17, /* ALTER */ - YYSYMBOL_EXECUTE = 18, /* EXECUTE */ - YYSYMBOL_PREPARE = 19, /* PREPARE */ - YYSYMBOL_UNION = 20, /* UNION */ - YYSYMBOL_ALL = 21, /* ALL */ - YYSYMBOL_INTERSECT = 22, /* INTERSECT */ - YYSYMBOL_COMPACT = 23, /* COMPACT */ - YYSYMBOL_EXCEPT = 24, /* EXCEPT */ - YYSYMBOL_FLUSH = 25, /* FLUSH */ - YYSYMBOL_USE = 26, /* USE */ - YYSYMBOL_OPTIMIZE = 27, /* OPTIMIZE */ - YYSYMBOL_PROPERTIES = 28, /* PROPERTIES */ - YYSYMBOL_DATABASE = 29, /* DATABASE */ - YYSYMBOL_TABLE = 30, /* TABLE */ - YYSYMBOL_COLLECTION = 31, /* COLLECTION */ - YYSYMBOL_TABLES = 32, /* TABLES */ - YYSYMBOL_INTO = 33, /* INTO */ - YYSYMBOL_VALUES = 34, /* VALUES */ - YYSYMBOL_AST = 35, /* AST */ - YYSYMBOL_PIPELINE = 36, /* PIPELINE */ - YYSYMBOL_RAW = 37, /* RAW */ - YYSYMBOL_LOGICAL = 38, /* LOGICAL */ - YYSYMBOL_PHYSICAL = 39, /* PHYSICAL */ - YYSYMBOL_FRAGMENT = 40, /* FRAGMENT */ - YYSYMBOL_VIEW = 41, /* VIEW */ - YYSYMBOL_INDEX = 42, /* INDEX */ - YYSYMBOL_ANALYZE = 43, /* ANALYZE */ - YYSYMBOL_VIEWS = 44, /* VIEWS */ - YYSYMBOL_DATABASES = 45, /* DATABASES */ - YYSYMBOL_SEGMENT = 46, /* SEGMENT */ - YYSYMBOL_SEGMENTS = 47, /* SEGMENTS */ - YYSYMBOL_BLOCK = 48, /* BLOCK */ - YYSYMBOL_BLOCKS = 49, /* BLOCKS */ - YYSYMBOL_COLUMNS = 50, /* COLUMNS */ - YYSYMBOL_INDEXES = 51, /* INDEXES */ - YYSYMBOL_GROUP = 52, /* GROUP */ - YYSYMBOL_BY = 53, /* BY */ - YYSYMBOL_HAVING = 54, /* HAVING */ - YYSYMBOL_AS = 55, /* AS */ - YYSYMBOL_NATURAL = 56, /* NATURAL */ - YYSYMBOL_JOIN = 57, /* JOIN */ - YYSYMBOL_LEFT = 58, /* LEFT */ - YYSYMBOL_RIGHT = 59, /* RIGHT */ - YYSYMBOL_OUTER = 60, /* OUTER */ - YYSYMBOL_FULL = 61, /* FULL */ - YYSYMBOL_ON = 62, /* ON */ - YYSYMBOL_INNER = 63, /* INNER */ - YYSYMBOL_CROSS = 64, /* CROSS */ - YYSYMBOL_DISTINCT = 65, /* DISTINCT */ - YYSYMBOL_WHERE = 66, /* WHERE */ - YYSYMBOL_ORDER = 67, /* ORDER */ - YYSYMBOL_LIMIT = 68, /* LIMIT */ - YYSYMBOL_OFFSET = 69, /* OFFSET */ - YYSYMBOL_ASC = 70, /* ASC */ - YYSYMBOL_DESC = 71, /* DESC */ - YYSYMBOL_IF = 72, /* IF */ - YYSYMBOL_NOT = 73, /* NOT */ - YYSYMBOL_EXISTS = 74, /* EXISTS */ - YYSYMBOL_IN = 75, /* IN */ - YYSYMBOL_FROM = 76, /* FROM */ - YYSYMBOL_TO = 77, /* TO */ - YYSYMBOL_WITH = 78, /* WITH */ - YYSYMBOL_DELIMITER = 79, /* DELIMITER */ - YYSYMBOL_FORMAT = 80, /* FORMAT */ - YYSYMBOL_HEADER = 81, /* HEADER */ - YYSYMBOL_CAST = 82, /* CAST */ - YYSYMBOL_END = 83, /* END */ - YYSYMBOL_CASE = 84, /* CASE */ - YYSYMBOL_ELSE = 85, /* ELSE */ - YYSYMBOL_THEN = 86, /* THEN */ - YYSYMBOL_WHEN = 87, /* WHEN */ - YYSYMBOL_BOOLEAN = 88, /* BOOLEAN */ - YYSYMBOL_INTEGER = 89, /* INTEGER */ - YYSYMBOL_INT = 90, /* INT */ - YYSYMBOL_TINYINT = 91, /* TINYINT */ - YYSYMBOL_SMALLINT = 92, /* SMALLINT */ - YYSYMBOL_BIGINT = 93, /* BIGINT */ - YYSYMBOL_HUGEINT = 94, /* HUGEINT */ - YYSYMBOL_VARCHAR = 95, /* VARCHAR */ - YYSYMBOL_FLOAT = 96, /* FLOAT */ - YYSYMBOL_DOUBLE = 97, /* DOUBLE */ - YYSYMBOL_REAL = 98, /* REAL */ - YYSYMBOL_DECIMAL = 99, /* DECIMAL */ - YYSYMBOL_DATE = 100, /* DATE */ - YYSYMBOL_TIME = 101, /* TIME */ - YYSYMBOL_DATETIME = 102, /* DATETIME */ - YYSYMBOL_TIMESTAMP = 103, /* TIMESTAMP */ - YYSYMBOL_UUID = 104, /* UUID */ - YYSYMBOL_POINT = 105, /* POINT */ - YYSYMBOL_LINE = 106, /* LINE */ - YYSYMBOL_LSEG = 107, /* LSEG */ - YYSYMBOL_BOX = 108, /* BOX */ - YYSYMBOL_PATH = 109, /* PATH */ - YYSYMBOL_POLYGON = 110, /* POLYGON */ - YYSYMBOL_CIRCLE = 111, /* CIRCLE */ - YYSYMBOL_BLOB = 112, /* BLOB */ - YYSYMBOL_BITMAP = 113, /* BITMAP */ - YYSYMBOL_EMBEDDING = 114, /* EMBEDDING */ - YYSYMBOL_VECTOR = 115, /* VECTOR */ - YYSYMBOL_BIT = 116, /* BIT */ - YYSYMBOL_SPARSE = 117, /* SPARSE */ - YYSYMBOL_PRIMARY = 118, /* PRIMARY */ - YYSYMBOL_KEY = 119, /* KEY */ - YYSYMBOL_UNIQUE = 120, /* UNIQUE */ - YYSYMBOL_NULLABLE = 121, /* NULLABLE */ - YYSYMBOL_IS = 122, /* IS */ - YYSYMBOL_TRUE = 123, /* TRUE */ - YYSYMBOL_FALSE = 124, /* FALSE */ - YYSYMBOL_INTERVAL = 125, /* INTERVAL */ - YYSYMBOL_SECOND = 126, /* SECOND */ - YYSYMBOL_SECONDS = 127, /* SECONDS */ - YYSYMBOL_MINUTE = 128, /* MINUTE */ - YYSYMBOL_MINUTES = 129, /* MINUTES */ - YYSYMBOL_HOUR = 130, /* HOUR */ - YYSYMBOL_HOURS = 131, /* HOURS */ - YYSYMBOL_DAY = 132, /* DAY */ - YYSYMBOL_DAYS = 133, /* DAYS */ - YYSYMBOL_MONTH = 134, /* MONTH */ - YYSYMBOL_MONTHS = 135, /* MONTHS */ - YYSYMBOL_YEAR = 136, /* YEAR */ - YYSYMBOL_YEARS = 137, /* YEARS */ - YYSYMBOL_EQUAL = 138, /* EQUAL */ - YYSYMBOL_NOT_EQ = 139, /* NOT_EQ */ - YYSYMBOL_LESS_EQ = 140, /* LESS_EQ */ - YYSYMBOL_GREATER_EQ = 141, /* GREATER_EQ */ - YYSYMBOL_BETWEEN = 142, /* BETWEEN */ - YYSYMBOL_AND = 143, /* AND */ - YYSYMBOL_OR = 144, /* OR */ - YYSYMBOL_EXTRACT = 145, /* EXTRACT */ - YYSYMBOL_LIKE = 146, /* LIKE */ - YYSYMBOL_DATA = 147, /* DATA */ - YYSYMBOL_LOG = 148, /* LOG */ - YYSYMBOL_BUFFER = 149, /* BUFFER */ - YYSYMBOL_KNN = 150, /* KNN */ - YYSYMBOL_USING = 151, /* USING */ - YYSYMBOL_SESSION = 152, /* SESSION */ - YYSYMBOL_GLOBAL = 153, /* GLOBAL */ - YYSYMBOL_OFF = 154, /* OFF */ - YYSYMBOL_EXPORT = 155, /* EXPORT */ - YYSYMBOL_PROFILE = 156, /* PROFILE */ - YYSYMBOL_CONFIGS = 157, /* CONFIGS */ - YYSYMBOL_PROFILES = 158, /* PROFILES */ - YYSYMBOL_STATUS = 159, /* STATUS */ - YYSYMBOL_VAR = 160, /* VAR */ - YYSYMBOL_SEARCH = 161, /* SEARCH */ - YYSYMBOL_MATCH = 162, /* MATCH */ - YYSYMBOL_QUERY = 163, /* QUERY */ - YYSYMBOL_FUSION = 164, /* FUSION */ - YYSYMBOL_NUMBER = 165, /* NUMBER */ - YYSYMBOL_166_ = 166, /* '=' */ - YYSYMBOL_167_ = 167, /* '<' */ - YYSYMBOL_168_ = 168, /* '>' */ - YYSYMBOL_169_ = 169, /* '+' */ - YYSYMBOL_170_ = 170, /* '-' */ - YYSYMBOL_171_ = 171, /* '*' */ - YYSYMBOL_172_ = 172, /* '/' */ - YYSYMBOL_173_ = 173, /* '%' */ - YYSYMBOL_174_ = 174, /* '[' */ - YYSYMBOL_175_ = 175, /* ']' */ - YYSYMBOL_176_ = 176, /* '(' */ - YYSYMBOL_177_ = 177, /* ')' */ - YYSYMBOL_178_ = 178, /* '.' */ - YYSYMBOL_179_ = 179, /* ',' */ - YYSYMBOL_YYACCEPT = 180, /* $accept */ - YYSYMBOL_input_pattern = 181, /* input_pattern */ - YYSYMBOL_expr_array = 182, /* expr_array */ - YYSYMBOL_expr_alias = 183, /* expr_alias */ - YYSYMBOL_expr = 184, /* expr */ - YYSYMBOL_operand = 185, /* operand */ - YYSYMBOL_match_expr = 186, /* match_expr */ - YYSYMBOL_query_expr = 187, /* query_expr */ - YYSYMBOL_fusion_expr = 188, /* fusion_expr */ - YYSYMBOL_function_expr = 189, /* function_expr */ - YYSYMBOL_conjunction_expr = 190, /* conjunction_expr */ - YYSYMBOL_between_expr = 191, /* between_expr */ - YYSYMBOL_in_expr = 192, /* in_expr */ - YYSYMBOL_column_type = 193, /* column_type */ - YYSYMBOL_cast_expr = 194, /* cast_expr */ - YYSYMBOL_column_expr = 195, /* column_expr */ - YYSYMBOL_constant_expr = 196, /* constant_expr */ - YYSYMBOL_long_array_expr = 197, /* long_array_expr */ - YYSYMBOL_unclosed_long_array_expr = 198, /* unclosed_long_array_expr */ - YYSYMBOL_double_array_expr = 199, /* double_array_expr */ - YYSYMBOL_unclosed_double_array_expr = 200, /* unclosed_double_array_expr */ - YYSYMBOL_interval_expr = 201 /* interval_expr */ +enum yysymbol_kind_t +{ + YYSYMBOL_YYEMPTY = -2, + YYSYMBOL_YYEOF = 0, /* "end of file" */ + YYSYMBOL_YYerror = 1, /* error */ + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ + YYSYMBOL_IDENTIFIER = 3, /* IDENTIFIER */ + YYSYMBOL_STRING = 4, /* STRING */ + YYSYMBOL_DOUBLE_VALUE = 5, /* DOUBLE_VALUE */ + YYSYMBOL_LONG_VALUE = 6, /* LONG_VALUE */ + YYSYMBOL_CREATE = 7, /* CREATE */ + YYSYMBOL_SELECT = 8, /* SELECT */ + YYSYMBOL_INSERT = 9, /* INSERT */ + YYSYMBOL_DROP = 10, /* DROP */ + YYSYMBOL_UPDATE = 11, /* UPDATE */ + YYSYMBOL_DELETE = 12, /* DELETE */ + YYSYMBOL_COPY = 13, /* COPY */ + YYSYMBOL_SET = 14, /* SET */ + YYSYMBOL_EXPLAIN = 15, /* EXPLAIN */ + YYSYMBOL_SHOW = 16, /* SHOW */ + YYSYMBOL_ALTER = 17, /* ALTER */ + YYSYMBOL_EXECUTE = 18, /* EXECUTE */ + YYSYMBOL_PREPARE = 19, /* PREPARE */ + YYSYMBOL_UNION = 20, /* UNION */ + YYSYMBOL_ALL = 21, /* ALL */ + YYSYMBOL_INTERSECT = 22, /* INTERSECT */ + YYSYMBOL_COMPACT = 23, /* COMPACT */ + YYSYMBOL_EXCEPT = 24, /* EXCEPT */ + YYSYMBOL_FLUSH = 25, /* FLUSH */ + YYSYMBOL_USE = 26, /* USE */ + YYSYMBOL_OPTIMIZE = 27, /* OPTIMIZE */ + YYSYMBOL_PROPERTIES = 28, /* PROPERTIES */ + YYSYMBOL_DATABASE = 29, /* DATABASE */ + YYSYMBOL_TABLE = 30, /* TABLE */ + YYSYMBOL_COLLECTION = 31, /* COLLECTION */ + YYSYMBOL_TABLES = 32, /* TABLES */ + YYSYMBOL_INTO = 33, /* INTO */ + YYSYMBOL_VALUES = 34, /* VALUES */ + YYSYMBOL_AST = 35, /* AST */ + YYSYMBOL_PIPELINE = 36, /* PIPELINE */ + YYSYMBOL_RAW = 37, /* RAW */ + YYSYMBOL_LOGICAL = 38, /* LOGICAL */ + YYSYMBOL_PHYSICAL = 39, /* PHYSICAL */ + YYSYMBOL_FRAGMENT = 40, /* FRAGMENT */ + YYSYMBOL_VIEW = 41, /* VIEW */ + YYSYMBOL_INDEX = 42, /* INDEX */ + YYSYMBOL_ANALYZE = 43, /* ANALYZE */ + YYSYMBOL_VIEWS = 44, /* VIEWS */ + YYSYMBOL_DATABASES = 45, /* DATABASES */ + YYSYMBOL_SEGMENT = 46, /* SEGMENT */ + YYSYMBOL_SEGMENTS = 47, /* SEGMENTS */ + YYSYMBOL_BLOCK = 48, /* BLOCK */ + YYSYMBOL_BLOCKS = 49, /* BLOCKS */ + YYSYMBOL_COLUMNS = 50, /* COLUMNS */ + YYSYMBOL_INDEXES = 51, /* INDEXES */ + YYSYMBOL_GROUP = 52, /* GROUP */ + YYSYMBOL_BY = 53, /* BY */ + YYSYMBOL_HAVING = 54, /* HAVING */ + YYSYMBOL_AS = 55, /* AS */ + YYSYMBOL_NATURAL = 56, /* NATURAL */ + YYSYMBOL_JOIN = 57, /* JOIN */ + YYSYMBOL_LEFT = 58, /* LEFT */ + YYSYMBOL_RIGHT = 59, /* RIGHT */ + YYSYMBOL_OUTER = 60, /* OUTER */ + YYSYMBOL_FULL = 61, /* FULL */ + YYSYMBOL_ON = 62, /* ON */ + YYSYMBOL_INNER = 63, /* INNER */ + YYSYMBOL_CROSS = 64, /* CROSS */ + YYSYMBOL_DISTINCT = 65, /* DISTINCT */ + YYSYMBOL_WHERE = 66, /* WHERE */ + YYSYMBOL_ORDER = 67, /* ORDER */ + YYSYMBOL_LIMIT = 68, /* LIMIT */ + YYSYMBOL_OFFSET = 69, /* OFFSET */ + YYSYMBOL_ASC = 70, /* ASC */ + YYSYMBOL_DESC = 71, /* DESC */ + YYSYMBOL_IF = 72, /* IF */ + YYSYMBOL_NOT = 73, /* NOT */ + YYSYMBOL_EXISTS = 74, /* EXISTS */ + YYSYMBOL_IN = 75, /* IN */ + YYSYMBOL_FROM = 76, /* FROM */ + YYSYMBOL_TO = 77, /* TO */ + YYSYMBOL_WITH = 78, /* WITH */ + YYSYMBOL_DELIMITER = 79, /* DELIMITER */ + YYSYMBOL_FORMAT = 80, /* FORMAT */ + YYSYMBOL_HEADER = 81, /* HEADER */ + YYSYMBOL_CAST = 82, /* CAST */ + YYSYMBOL_END = 83, /* END */ + YYSYMBOL_CASE = 84, /* CASE */ + YYSYMBOL_ELSE = 85, /* ELSE */ + YYSYMBOL_THEN = 86, /* THEN */ + YYSYMBOL_WHEN = 87, /* WHEN */ + YYSYMBOL_BOOLEAN = 88, /* BOOLEAN */ + YYSYMBOL_INTEGER = 89, /* INTEGER */ + YYSYMBOL_INT = 90, /* INT */ + YYSYMBOL_TINYINT = 91, /* TINYINT */ + YYSYMBOL_SMALLINT = 92, /* SMALLINT */ + YYSYMBOL_BIGINT = 93, /* BIGINT */ + YYSYMBOL_HUGEINT = 94, /* HUGEINT */ + YYSYMBOL_VARCHAR = 95, /* VARCHAR */ + YYSYMBOL_FLOAT = 96, /* FLOAT */ + YYSYMBOL_DOUBLE = 97, /* DOUBLE */ + YYSYMBOL_REAL = 98, /* REAL */ + YYSYMBOL_DECIMAL = 99, /* DECIMAL */ + YYSYMBOL_DATE = 100, /* DATE */ + YYSYMBOL_TIME = 101, /* TIME */ + YYSYMBOL_DATETIME = 102, /* DATETIME */ + YYSYMBOL_TIMESTAMP = 103, /* TIMESTAMP */ + YYSYMBOL_UUID = 104, /* UUID */ + YYSYMBOL_POINT = 105, /* POINT */ + YYSYMBOL_LINE = 106, /* LINE */ + YYSYMBOL_LSEG = 107, /* LSEG */ + YYSYMBOL_BOX = 108, /* BOX */ + YYSYMBOL_PATH = 109, /* PATH */ + YYSYMBOL_POLYGON = 110, /* POLYGON */ + YYSYMBOL_CIRCLE = 111, /* CIRCLE */ + YYSYMBOL_BLOB = 112, /* BLOB */ + YYSYMBOL_BITMAP = 113, /* BITMAP */ + YYSYMBOL_EMBEDDING = 114, /* EMBEDDING */ + YYSYMBOL_VECTOR = 115, /* VECTOR */ + YYSYMBOL_BIT = 116, /* BIT */ + YYSYMBOL_SPARSE = 117, /* SPARSE */ + YYSYMBOL_PRIMARY = 118, /* PRIMARY */ + YYSYMBOL_KEY = 119, /* KEY */ + YYSYMBOL_UNIQUE = 120, /* UNIQUE */ + YYSYMBOL_NULLABLE = 121, /* NULLABLE */ + YYSYMBOL_IS = 122, /* IS */ + YYSYMBOL_TRUE = 123, /* TRUE */ + YYSYMBOL_FALSE = 124, /* FALSE */ + YYSYMBOL_INTERVAL = 125, /* INTERVAL */ + YYSYMBOL_SECOND = 126, /* SECOND */ + YYSYMBOL_SECONDS = 127, /* SECONDS */ + YYSYMBOL_MINUTE = 128, /* MINUTE */ + YYSYMBOL_MINUTES = 129, /* MINUTES */ + YYSYMBOL_HOUR = 130, /* HOUR */ + YYSYMBOL_HOURS = 131, /* HOURS */ + YYSYMBOL_DAY = 132, /* DAY */ + YYSYMBOL_DAYS = 133, /* DAYS */ + YYSYMBOL_MONTH = 134, /* MONTH */ + YYSYMBOL_MONTHS = 135, /* MONTHS */ + YYSYMBOL_YEAR = 136, /* YEAR */ + YYSYMBOL_YEARS = 137, /* YEARS */ + YYSYMBOL_EQUAL = 138, /* EQUAL */ + YYSYMBOL_NOT_EQ = 139, /* NOT_EQ */ + YYSYMBOL_LESS_EQ = 140, /* LESS_EQ */ + YYSYMBOL_GREATER_EQ = 141, /* GREATER_EQ */ + YYSYMBOL_BETWEEN = 142, /* BETWEEN */ + YYSYMBOL_AND = 143, /* AND */ + YYSYMBOL_OR = 144, /* OR */ + YYSYMBOL_EXTRACT = 145, /* EXTRACT */ + YYSYMBOL_LIKE = 146, /* LIKE */ + YYSYMBOL_DATA = 147, /* DATA */ + YYSYMBOL_LOG = 148, /* LOG */ + YYSYMBOL_BUFFER = 149, /* BUFFER */ + YYSYMBOL_KNN = 150, /* KNN */ + YYSYMBOL_USING = 151, /* USING */ + YYSYMBOL_SESSION = 152, /* SESSION */ + YYSYMBOL_GLOBAL = 153, /* GLOBAL */ + YYSYMBOL_OFF = 154, /* OFF */ + YYSYMBOL_EXPORT = 155, /* EXPORT */ + YYSYMBOL_PROFILE = 156, /* PROFILE */ + YYSYMBOL_CONFIGS = 157, /* CONFIGS */ + YYSYMBOL_PROFILES = 158, /* PROFILES */ + YYSYMBOL_STATUS = 159, /* STATUS */ + YYSYMBOL_VAR = 160, /* VAR */ + YYSYMBOL_SEARCH = 161, /* SEARCH */ + YYSYMBOL_MATCH = 162, /* MATCH */ + YYSYMBOL_QUERY = 163, /* QUERY */ + YYSYMBOL_FUSION = 164, /* FUSION */ + YYSYMBOL_NUMBER = 165, /* NUMBER */ + YYSYMBOL_166_ = 166, /* '=' */ + YYSYMBOL_167_ = 167, /* '<' */ + YYSYMBOL_168_ = 168, /* '>' */ + YYSYMBOL_169_ = 169, /* '+' */ + YYSYMBOL_170_ = 170, /* '-' */ + YYSYMBOL_171_ = 171, /* '*' */ + YYSYMBOL_172_ = 172, /* '/' */ + YYSYMBOL_173_ = 173, /* '%' */ + YYSYMBOL_174_ = 174, /* '[' */ + YYSYMBOL_175_ = 175, /* ']' */ + YYSYMBOL_176_ = 176, /* '(' */ + YYSYMBOL_177_ = 177, /* ')' */ + YYSYMBOL_178_ = 178, /* '.' */ + YYSYMBOL_179_ = 179, /* ',' */ + YYSYMBOL_YYACCEPT = 180, /* $accept */ + YYSYMBOL_input_pattern = 181, /* input_pattern */ + YYSYMBOL_expr_array = 182, /* expr_array */ + YYSYMBOL_expr_alias = 183, /* expr_alias */ + YYSYMBOL_expr = 184, /* expr */ + YYSYMBOL_operand = 185, /* operand */ + YYSYMBOL_match_expr = 186, /* match_expr */ + YYSYMBOL_query_expr = 187, /* query_expr */ + YYSYMBOL_fusion_expr = 188, /* fusion_expr */ + YYSYMBOL_function_expr = 189, /* function_expr */ + YYSYMBOL_conjunction_expr = 190, /* conjunction_expr */ + YYSYMBOL_between_expr = 191, /* between_expr */ + YYSYMBOL_in_expr = 192, /* in_expr */ + YYSYMBOL_column_type = 193, /* column_type */ + YYSYMBOL_cast_expr = 194, /* cast_expr */ + YYSYMBOL_column_expr = 195, /* column_expr */ + YYSYMBOL_constant_expr = 196, /* constant_expr */ + YYSYMBOL_long_array_expr = 197, /* long_array_expr */ + YYSYMBOL_unclosed_long_array_expr = 198, /* unclosed_long_array_expr */ + YYSYMBOL_double_array_expr = 199, /* double_array_expr */ + YYSYMBOL_unclosed_double_array_expr = 200, /* unclosed_double_array_expr */ + YYSYMBOL_interval_expr = 201 /* interval_expr */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; + + /* Unqualified %code blocks. */ #line 77 "expression_parser.y" @@ -327,7 +330,7 @@ typedef enum yysymbol_kind_t yysymbol_kind_t; #line 331 "expression_parser.cpp" #ifdef short -#undef short +# undef short #endif /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure @@ -335,11 +338,11 @@ typedef enum yysymbol_kind_t yysymbol_kind_t; so that the code can choose integer types of a good width. */ #ifndef __PTRDIFF_MAX__ -#include /* INFRINGES ON USER NAME SPACE */ -#if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ -#include /* INFRINGES ON USER NAME SPACE */ -#define YY_STDINT_H -#endif +# include /* INFRINGES ON USER NAME SPACE */ +# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_STDINT_H +# endif #endif /* Narrow types that promote to a signed type and that can represent a @@ -369,15 +372,16 @@ typedef short yytype_int16; (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of . */ #ifdef __hpux -#undef UINT_LEAST8_MAX -#undef UINT_LEAST16_MAX -#define UINT_LEAST8_MAX 255 -#define UINT_LEAST16_MAX 65535 +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 #endif #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; -#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H && UINT_LEAST8_MAX <= INT_MAX) +#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST8_MAX <= INT_MAX) typedef uint_least8_t yytype_uint8; #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX typedef unsigned char yytype_uint8; @@ -387,7 +391,8 @@ typedef short yytype_uint8; #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ typedef __UINT_LEAST16_TYPE__ yytype_uint16; -#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H && UINT_LEAST16_MAX <= INT_MAX) +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST16_MAX <= INT_MAX) typedef uint_least16_t yytype_uint16; #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX typedef unsigned short yytype_uint16; @@ -396,37 +401,42 @@ typedef int yytype_uint16; #endif #ifndef YYPTRDIFF_T -#if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ -#define YYPTRDIFF_T __PTRDIFF_TYPE__ -#define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ -#elif defined PTRDIFF_MAX -#ifndef ptrdiff_t -#include /* INFRINGES ON USER NAME SPACE */ -#endif -#define YYPTRDIFF_T ptrdiff_t -#define YYPTRDIFF_MAXIMUM PTRDIFF_MAX -#else -#define YYPTRDIFF_T long -#define YYPTRDIFF_MAXIMUM LONG_MAX -#endif +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ +# define YYPTRDIFF_T __PTRDIFF_TYPE__ +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ +# elif defined PTRDIFF_MAX +# ifndef ptrdiff_t +# include /* INFRINGES ON USER NAME SPACE */ +# endif +# define YYPTRDIFF_T ptrdiff_t +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX +# else +# define YYPTRDIFF_T long +# define YYPTRDIFF_MAXIMUM LONG_MAX +# endif #endif #ifndef YYSIZE_T -#ifdef __SIZE_TYPE__ -#define YYSIZE_T __SIZE_TYPE__ -#elif defined size_t -#define YYSIZE_T size_t -#elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ -#include /* INFRINGES ON USER NAME SPACE */ -#define YYSIZE_T size_t -#else -#define YYSIZE_T unsigned -#endif +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned +# endif #endif -#define YYSIZE_MAXIMUM YY_CAST(YYPTRDIFF_T, (YYPTRDIFF_MAXIMUM < YY_CAST(YYSIZE_T, -1) ? YYPTRDIFF_MAXIMUM : YY_CAST(YYSIZE_T, -1))) +#define YYSIZE_MAXIMUM \ + YY_CAST (YYPTRDIFF_T, \ + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ + ? YYPTRDIFF_MAXIMUM \ + : YY_CAST (YYSIZE_T, -1))) + +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) -#define YYSIZEOF(X) YY_CAST(YYPTRDIFF_T, sizeof(X)) /* Stored state numbers (used for stacks). */ typedef yytype_int16 yy_state_t; @@ -435,594 +445,649 @@ typedef yytype_int16 yy_state_t; typedef int yy_state_fast_t; #ifndef YY_ -#if defined YYENABLE_NLS && YYENABLE_NLS -#if ENABLE_NLS -#include /* INFRINGES ON USER NAME SPACE */ -#define YY_(Msgid) dgettext("bison-runtime", Msgid) -#endif -#endif -#ifndef YY_ -#define YY_(Msgid) Msgid -#endif +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# endif +# endif +# ifndef YY_ +# define YY_(Msgid) Msgid +# endif #endif + #ifndef YY_ATTRIBUTE_PURE -#if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) -#define YY_ATTRIBUTE_PURE __attribute__((__pure__)) -#else -#define YY_ATTRIBUTE_PURE -#endif +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif #endif #ifndef YY_ATTRIBUTE_UNUSED -#if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) -#define YY_ATTRIBUTE_UNUSED __attribute__((__unused__)) -#else -#define YY_ATTRIBUTE_UNUSED -#endif +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif #endif /* Suppress unused-variable warnings by "using" E. */ -#if !defined lint || defined __GNUC__ -#define YY_USE(E) ((void)(E)) +#if ! defined lint || defined __GNUC__ +# define YY_USE(E) ((void) (E)) #else -#define YY_USE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -#if defined __GNUC__ && !defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ -#if __GNUC__ * 100 + __GNUC_MINOR__ < 407 -#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wuninitialized\"") -#else -#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wuninitialized\"") _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -#endif -#define YY_IGNORE_MAYBE_UNINITIALIZED_END _Pragma("GCC diagnostic pop") +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -#define YY_INITIAL_VALUE(Value) Value +# define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -#define YY_IGNORE_MAYBE_UNINITIALIZED_END +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE -#define YY_INITIAL_VALUE(Value) /* Nothing. */ +# define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif -#if defined __cplusplus && defined __GNUC__ && !defined __ICC && 6 <= __GNUC__ -#define YY_IGNORE_USELESS_CAST_BEGIN _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wuseless-cast\"") -#define YY_IGNORE_USELESS_CAST_END _Pragma("GCC diagnostic pop") +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") #endif #ifndef YY_IGNORE_USELESS_CAST_BEGIN -#define YY_IGNORE_USELESS_CAST_BEGIN -#define YY_IGNORE_USELESS_CAST_END +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END #endif -#define YY_ASSERT(E) ((void)(0 && (E))) + +#define YY_ASSERT(E) ((void) (0 && (E))) #if 1 /* The parser invokes alloca or malloc; define the necessary symbols. */ -#ifdef YYSTACK_USE_ALLOCA -#if YYSTACK_USE_ALLOCA -#ifdef __GNUC__ -#define YYSTACK_ALLOC __builtin_alloca -#elif defined __BUILTIN_VA_ARG_INCR -#include /* INFRINGES ON USER NAME SPACE */ -#elif defined _AIX -#define YYSTACK_ALLOC __alloca -#elif defined _MSC_VER -#include /* INFRINGES ON USER NAME SPACE */ -#define alloca _alloca -#else -#define YYSTACK_ALLOC alloca -#if !defined _ALLOCA_H && !defined EXIT_SUCCESS -#include /* INFRINGES ON USER NAME SPACE */ -/* Use EXIT_SUCCESS as a witness for stdlib.h. */ -#ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 -#endif -#endif -#endif -#endif -#endif - -#ifdef YYSTACK_ALLOC -/* Pacify GCC's 'empty if-body' warning. */ -#define YYSTACK_FREE(Ptr) \ - do { /* empty */ \ - ; \ - } while (0) -#ifndef YYSTACK_ALLOC_MAXIMUM -/* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -#define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -#endif -#else -#define YYSTACK_ALLOC YYMALLOC -#define YYSTACK_FREE YYFREE -#ifndef YYSTACK_ALLOC_MAXIMUM -#define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -#endif -#if (defined __cplusplus && !defined EXIT_SUCCESS && !((defined YYMALLOC || defined malloc) && (defined YYFREE || defined free))) -#include /* INFRINGES ON USER NAME SPACE */ -#ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 -#endif -#endif -#ifndef YYMALLOC -#define YYMALLOC malloc -#if !defined malloc && !defined EXIT_SUCCESS -void *malloc(YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -#endif -#endif -#ifndef YYFREE -#define YYFREE free -#if !defined free && !defined EXIT_SUCCESS -void free(void *); /* INFRINGES ON USER NAME SPACE */ -#endif -#endif -#endif +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +# include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif #endif /* 1 */ -#if (!defined yyoverflow && (!defined __cplusplus || (defined EXPRESSIONLTYPE_IS_TRIVIAL && EXPRESSIONLTYPE_IS_TRIVIAL && \ - defined EXPRESSIONSTYPE_IS_TRIVIAL && EXPRESSIONSTYPE_IS_TRIVIAL))) +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined EXPRESSIONLTYPE_IS_TRIVIAL && EXPRESSIONLTYPE_IS_TRIVIAL \ + && defined EXPRESSIONSTYPE_IS_TRIVIAL && EXPRESSIONSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ -union yyalloc { - yy_state_t yyss_alloc; - YYSTYPE yyvs_alloc; - YYLTYPE yyls_alloc; +union yyalloc +{ + yy_state_t yyss_alloc; + YYSTYPE yyvs_alloc; + YYLTYPE yyls_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ -#define YYSTACK_GAP_MAXIMUM (YYSIZEOF(union yyalloc) - 1) +# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ -#define YYSTACK_BYTES(N) ((N) * (YYSIZEOF(yy_state_t) + YYSIZEOF(YYSTYPE) + YYSIZEOF(YYLTYPE)) + 2 * YYSTACK_GAP_MAXIMUM) +# define YYSTACK_BYTES(N) \ + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \ + + YYSIZEOF (YYLTYPE)) \ + + 2 * YYSTACK_GAP_MAXIMUM) -#define YYCOPY_NEEDED 1 +# define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -#define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do { \ - YYPTRDIFF_T yynewbytes; \ - YYCOPY(&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * YYSIZEOF(*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / YYSIZEOF(*yyptr); \ - } while (0) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYPTRDIFF_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ + } \ + while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ -#ifndef YYCOPY -#if defined __GNUC__ && 1 < __GNUC__ -#define YYCOPY(Dst, Src, Count) __builtin_memcpy(Dst, Src, YY_CAST(YYSIZE_T, (Count)) * sizeof(*(Src))) -#else -#define YYCOPY(Dst, Src, Count) \ - do { \ - YYPTRDIFF_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } while (0) -#endif -#endif +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYPTRDIFF_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 73 +#define YYFINAL 73 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 386 +#define YYLAST 386 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 180 +#define YYNTOKENS 180 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 22 +#define YYNNTS 22 /* YYNRULES -- Number of rules. */ -#define YYNRULES 136 +#define YYNRULES 136 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 299 +#define YYNSTATES 299 /* YYMAXUTOK -- Last valid token kind. */ -#define YYMAXUTOK 420 +#define YYMAXUTOK 420 + /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) (0 <= (YYX) && (YYX) <= YYMAXUTOK ? YY_CAST(yysymbol_kind_t, yytranslate[YYX]) : YYSYMBOL_YYUNDEF) +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ -static const yytype_uint8 yytranslate[] = { - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 173, 2, 2, 176, 177, 171, 169, 179, 170, 178, 172, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 167, 166, 168, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 174, 2, 175, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165}; +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 173, 2, 2, + 176, 177, 171, 169, 179, 170, 178, 172, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 167, 166, 168, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 174, 2, 175, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165 +}; #if EXPRESSIONDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_int16 yyrline[] = { - 0, 170, 170, 178, 182, 187, 193, 197, 198, 199, 200, 202, 205, 208, 209, 210, 211, 212, 213, 215, 223, 234, 240, 249, 255, 264, 272, 280, - 289, 296, 303, 310, 317, 324, 332, 340, 348, 356, 364, 372, 380, 388, 396, 404, 412, 420, 450, 458, 467, 475, 484, 492, 498, 506, 507, 508, - 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 527, 529, 530, 531, 532, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 560, 584, 591, 598, 603, 613, 618, 623, 628, 633, 638, - 643, 648, 653, 658, 661, 664, 667, 671, 675, 680, 685, 689, 694, 699, 705, 711, 717, 723, 729, 735, 741, 747, 753, 759, 765}; +static const yytype_int16 yyrline[] = +{ + 0, 170, 170, 178, 182, 187, 193, 197, 198, 199, + 200, 202, 205, 208, 209, 210, 211, 212, 213, 215, + 223, 234, 240, 249, 255, 264, 272, 280, 289, 296, + 303, 310, 317, 324, 332, 340, 348, 356, 364, 372, + 380, 388, 396, 404, 412, 420, 450, 458, 467, 475, + 484, 492, 498, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, + 523, 524, 527, 529, 530, 531, 532, 535, 536, 537, + 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 560, 584, 591, 598, 603, 613, 618, 623, 628, + 633, 638, 643, 648, 653, 658, 661, 664, 667, 671, + 675, 680, 685, 689, 694, 699, 705, 711, 717, 723, + 729, 735, 741, 747, 753, 759, 765 +}; #endif /** Accessing symbol of state STATE. */ -#define YY_ACCESSING_SYMBOL(State) YY_CAST(yysymbol_kind_t, yystos[State]) +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) #if 1 /* The user-facing name of the symbol whose (internal) number is YYSYMBOL. No bounds checking. */ -static const char *yysymbol_name(yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = {"\"end of file\"", - "error", - "\"invalid token\"", - "IDENTIFIER", - "STRING", - "DOUBLE_VALUE", - "LONG_VALUE", - "CREATE", - "SELECT", - "INSERT", - "DROP", - "UPDATE", - "DELETE", - "COPY", - "SET", - "EXPLAIN", - "SHOW", - "ALTER", - "EXECUTE", - "PREPARE", - "UNION", - "ALL", - "INTERSECT", - "COMPACT", - "EXCEPT", - "FLUSH", - "USE", - "OPTIMIZE", - "PROPERTIES", - "DATABASE", - "TABLE", - "COLLECTION", - "TABLES", - "INTO", - "VALUES", - "AST", - "PIPELINE", - "RAW", - "LOGICAL", - "PHYSICAL", - "FRAGMENT", - "VIEW", - "INDEX", - "ANALYZE", - "VIEWS", - "DATABASES", - "SEGMENT", - "SEGMENTS", - "BLOCK", - "BLOCKS", - "COLUMNS", - "INDEXES", - "GROUP", - "BY", - "HAVING", - "AS", - "NATURAL", - "JOIN", - "LEFT", - "RIGHT", - "OUTER", - "FULL", - "ON", - "INNER", - "CROSS", - "DISTINCT", - "WHERE", - "ORDER", - "LIMIT", - "OFFSET", - "ASC", - "DESC", - "IF", - "NOT", - "EXISTS", - "IN", - "FROM", - "TO", - "WITH", - "DELIMITER", - "FORMAT", - "HEADER", - "CAST", - "END", - "CASE", - "ELSE", - "THEN", - "WHEN", - "BOOLEAN", - "INTEGER", - "INT", - "TINYINT", - "SMALLINT", - "BIGINT", - "HUGEINT", - "VARCHAR", - "FLOAT", - "DOUBLE", - "REAL", - "DECIMAL", - "DATE", - "TIME", - "DATETIME", - "TIMESTAMP", - "UUID", - "POINT", - "LINE", - "LSEG", - "BOX", - "PATH", - "POLYGON", - "CIRCLE", - "BLOB", - "BITMAP", - "EMBEDDING", - "VECTOR", - "BIT", - "SPARSE", - "PRIMARY", - "KEY", - "UNIQUE", - "NULLABLE", - "IS", - "TRUE", - "FALSE", - "INTERVAL", - "SECOND", - "SECONDS", - "MINUTE", - "MINUTES", - "HOUR", - "HOURS", - "DAY", - "DAYS", - "MONTH", - "MONTHS", - "YEAR", - "YEARS", - "EQUAL", - "NOT_EQ", - "LESS_EQ", - "GREATER_EQ", - "BETWEEN", - "AND", - "OR", - "EXTRACT", - "LIKE", - "DATA", - "LOG", - "BUFFER", - "KNN", - "USING", - "SESSION", - "GLOBAL", - "OFF", - "EXPORT", - "PROFILE", - "CONFIGS", - "PROFILES", - "STATUS", - "VAR", - "SEARCH", - "MATCH", - "QUERY", - "FUSION", - "NUMBER", - "'='", - "'<'", - "'>'", - "'+'", - "'-'", - "'*'", - "'/'", - "'%'", - "'['", - "']'", - "'('", - "')'", - "'.'", - "','", - "$accept", - "input_pattern", - "expr_array", - "expr_alias", - "expr", - "operand", - "match_expr", - "query_expr", - "fusion_expr", - "function_expr", - "conjunction_expr", - "between_expr", - "in_expr", - "column_type", - "cast_expr", - "column_expr", - "constant_expr", - "long_array_expr", - "unclosed_long_array_expr", - "double_array_expr", - "unclosed_double_array_expr", - "interval_expr", - YY_NULLPTR}; - -static const char *yysymbol_name(yysymbol_kind_t yysymbol) { return yytname[yysymbol]; } +static const char *const yytname[] = +{ + "\"end of file\"", "error", "\"invalid token\"", "IDENTIFIER", "STRING", + "DOUBLE_VALUE", "LONG_VALUE", "CREATE", "SELECT", "INSERT", "DROP", + "UPDATE", "DELETE", "COPY", "SET", "EXPLAIN", "SHOW", "ALTER", "EXECUTE", + "PREPARE", "UNION", "ALL", "INTERSECT", "COMPACT", "EXCEPT", "FLUSH", + "USE", "OPTIMIZE", "PROPERTIES", "DATABASE", "TABLE", "COLLECTION", + "TABLES", "INTO", "VALUES", "AST", "PIPELINE", "RAW", "LOGICAL", + "PHYSICAL", "FRAGMENT", "VIEW", "INDEX", "ANALYZE", "VIEWS", "DATABASES", + "SEGMENT", "SEGMENTS", "BLOCK", "BLOCKS", "COLUMNS", "INDEXES", "GROUP", + "BY", "HAVING", "AS", "NATURAL", "JOIN", "LEFT", "RIGHT", "OUTER", + "FULL", "ON", "INNER", "CROSS", "DISTINCT", "WHERE", "ORDER", "LIMIT", + "OFFSET", "ASC", "DESC", "IF", "NOT", "EXISTS", "IN", "FROM", "TO", + "WITH", "DELIMITER", "FORMAT", "HEADER", "CAST", "END", "CASE", "ELSE", + "THEN", "WHEN", "BOOLEAN", "INTEGER", "INT", "TINYINT", "SMALLINT", + "BIGINT", "HUGEINT", "VARCHAR", "FLOAT", "DOUBLE", "REAL", "DECIMAL", + "DATE", "TIME", "DATETIME", "TIMESTAMP", "UUID", "POINT", "LINE", "LSEG", + "BOX", "PATH", "POLYGON", "CIRCLE", "BLOB", "BITMAP", "EMBEDDING", + "VECTOR", "BIT", "SPARSE", "PRIMARY", "KEY", "UNIQUE", "NULLABLE", "IS", + "TRUE", "FALSE", "INTERVAL", "SECOND", "SECONDS", "MINUTE", "MINUTES", + "HOUR", "HOURS", "DAY", "DAYS", "MONTH", "MONTHS", "YEAR", "YEARS", + "EQUAL", "NOT_EQ", "LESS_EQ", "GREATER_EQ", "BETWEEN", "AND", "OR", + "EXTRACT", "LIKE", "DATA", "LOG", "BUFFER", "KNN", "USING", "SESSION", + "GLOBAL", "OFF", "EXPORT", "PROFILE", "CONFIGS", "PROFILES", "STATUS", + "VAR", "SEARCH", "MATCH", "QUERY", "FUSION", "NUMBER", "'='", "'<'", + "'>'", "'+'", "'-'", "'*'", "'/'", "'%'", "'['", "']'", "'('", "')'", + "'.'", "','", "$accept", "input_pattern", "expr_array", "expr_alias", + "expr", "operand", "match_expr", "query_expr", "fusion_expr", + "function_expr", "conjunction_expr", "between_expr", "in_expr", + "column_type", "cast_expr", "column_expr", "constant_expr", + "long_array_expr", "unclosed_long_array_expr", "double_array_expr", + "unclosed_double_array_expr", "interval_expr", YY_NULLPTR +}; + +static const char * +yysymbol_name (yysymbol_kind_t yysymbol) +{ + return yytname[yysymbol]; +} #endif #define YYPACT_NINF (-154) -#define yypact_value_is_default(Yyn) ((Yyn) == YYPACT_NINF) +#define yypact_value_is_default(Yyn) \ + ((Yyn) == YYPACT_NINF) #define YYTABLE_NINF (-1) -#define yytable_value_is_error(Yyn) ((Yyn) == YYTABLE_NINF) +#define yytable_value_is_error(Yyn) \ + ((Yyn) == YYTABLE_NINF) /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -static const yytype_int16 yypact[] = { - 13, -153, -154, -154, 245, 13, -145, 35, 59, 71, 79, -154, -154, 78, -91, -89, -88, -87, 13, 13, -154, 9, 13, - 90, -83, -154, -50, 115, -154, -154, -154, -154, -154, -154, -154, -154, -86, -154, -154, -146, -154, -135, -154, -3, -154, -154, - -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, 167, 13, -154, -154, -154, -154, 245, -154, 87, 99, 100, 101, -151, - -151, -154, -154, -134, -154, 13, 103, 13, 13, -69, -68, -61, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 1, -154, 105, -154, 102, 13, -154, -149, -37, -42, 36, -62, -132, -129, -154, -154, -154, -154, -25, -57, - 13, 13, 2, -154, -114, -114, 150, 150, 127, -114, -114, 150, 150, -151, -151, -154, -154, -154, -154, -154, -154, -154, -128, - -154, 253, 13, 120, -154, 121, -154, 122, 13, -114, -110, -154, 13, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, - -154, -154, -49, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -48, -47, -46, -45, 58, -106, -44, -43, -105, -154, - 167, 129, -55, 118, 155, -154, -154, -154, 135, -154, -154, -154, -101, -39, -38, -17, -16, -15, -14, -10, -9, 0, 6, - 7, 12, 14, 15, 16, 22, 23, 26, 27, 33, 37, 38, 39, 40, -34, -154, 175, 186, 214, 215, 216, 217, 226, - 227, 230, 232, 233, 235, 236, 237, 244, 252, 254, 256, 257, 258, 263, 268, 269, 270, 271, -154, 82, 124, 125, 126, - 132, 133, 134, 137, 138, 139, 147, 148, 149, 151, 152, 153, 154, 185, 188, 189, 192, 206, 207, 208, 209, -154, -154, - -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, -154}; +static const yytype_int16 yypact[] = +{ + 13, -153, -154, -154, 245, 13, -145, 35, 59, 71, + 79, -154, -154, 78, -91, -89, -88, -87, 13, 13, + -154, 9, 13, 90, -83, -154, -50, 115, -154, -154, + -154, -154, -154, -154, -154, -154, -86, -154, -154, -146, + -154, -135, -154, -3, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, 167, 13, -154, -154, + -154, -154, 245, -154, 87, 99, 100, 101, -151, -151, + -154, -154, -134, -154, 13, 103, 13, 13, -69, -68, + -61, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 1, -154, 105, -154, 102, + 13, -154, -149, -37, -42, 36, -62, -132, -129, -154, + -154, -154, -154, -25, -57, 13, 13, 2, -154, -114, + -114, 150, 150, 127, -114, -114, 150, 150, -151, -151, + -154, -154, -154, -154, -154, -154, -154, -128, -154, 253, + 13, 120, -154, 121, -154, 122, 13, -114, -110, -154, + 13, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -49, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -48, -47, -46, -45, 58, -106, + -44, -43, -105, -154, 167, 129, -55, 118, 155, -154, + -154, -154, 135, -154, -154, -154, -101, -39, -38, -17, + -16, -15, -14, -10, -9, 0, 6, 7, 12, 14, + 15, 16, 22, 23, 26, 27, 33, 37, 38, 39, + 40, -34, -154, 175, 186, 214, 215, 216, 217, 226, + 227, 230, 232, 233, 235, 236, 237, 244, 252, 254, + 256, 257, 258, 263, 268, 269, 270, 271, -154, 82, + 124, 125, 126, 132, 133, 134, 137, 138, 139, 147, + 148, 149, 151, 152, 153, 154, 185, 188, 189, 192, + 206, 207, 208, 209, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154 +}; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ -static const yytype_uint8 yydefact[] = { - 0, 102, 106, 109, 110, 0, 0, 0, 0, 0, 0, 107, 108, 0, 0, 0, 0, 0, 0, 0, 104, 0, 0, 0, 2, 3, 6, 7, 16, 17, - 18, 14, 10, 9, 8, 15, 13, 12, 117, 0, 118, 0, 116, 0, 126, 125, 128, 127, 130, 129, 132, 131, 134, 133, 136, 135, 30, 0, 111, 112, - 113, 114, 0, 115, 0, 0, 0, 0, 32, 31, 123, 120, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 119, 0, 122, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 11, 4, 5, 48, 49, 0, 0, 0, 0, 29, 39, - 40, 43, 44, 0, 46, 38, 41, 42, 34, 33, 35, 36, 37, 103, 105, 121, 124, 0, 26, 0, 0, 0, 21, 0, 23, 0, 0, 47, 0, 28, - 0, 27, 53, 56, 57, 54, 55, 58, 59, 73, 60, 62, 61, 76, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 51, 50, 0, 0, 0, 0, 101, 45, 19, 0, 22, 24, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 74, 80, 81, 78, 79, 82, 83, 84, 77, 88, 89, 86, 87, 90, 91, 92, 85, 96, 97, 94, 95, 98, 99, 100, 93}; +static const yytype_uint8 yydefact[] = +{ + 0, 102, 106, 109, 110, 0, 0, 0, 0, 0, + 0, 107, 108, 0, 0, 0, 0, 0, 0, 0, + 104, 0, 0, 0, 2, 3, 6, 7, 16, 17, + 18, 14, 10, 9, 8, 15, 13, 12, 117, 0, + 118, 0, 116, 0, 126, 125, 128, 127, 130, 129, + 132, 131, 134, 133, 136, 135, 30, 0, 111, 112, + 113, 114, 0, 115, 0, 0, 0, 0, 32, 31, + 123, 120, 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 119, 0, 122, 0, + 0, 25, 0, 0, 0, 0, 0, 0, 0, 11, + 4, 5, 48, 49, 0, 0, 0, 0, 29, 39, + 40, 43, 44, 0, 46, 38, 41, 42, 34, 33, + 35, 36, 37, 103, 105, 121, 124, 0, 26, 0, + 0, 0, 21, 0, 23, 0, 0, 47, 0, 28, + 0, 27, 53, 56, 57, 54, 55, 58, 59, 73, + 60, 62, 61, 76, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 51, 50, 0, 0, 0, 0, 101, + 45, 19, 0, 22, 24, 52, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 75, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 74, 80, 81, 78, 79, 82, + 83, 84, 77, 88, 89, 86, 87, 90, 91, 92, + 85, 96, 97, 94, 95, 98, 99, 100, 93 +}; /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = {-154, -154, -36, 204, -11, 63, -154, -154, -154, -154, -154, - -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, 266}; +static const yytype_int16 yypgoto[] = +{ + -154, -154, -36, 204, -11, 63, -154, -154, -154, -154, + -154, -154, -154, -154, -154, -154, -154, -154, -154, -154, + -154, 266 +}; /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_uint8 yydefgoto[] = {0, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 177, 35, 36, 37, 38, 39, 40, 41, 42}; +static const yytype_uint8 yydefgoto[] = +{ + 0, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 177, 35, 36, 37, 38, 39, 40, + 41, 42 +}; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_int16 yytable[] = { - 1, 2, 3, 4, 133, 75, 114, 102, 80, 76, 77, 72, 117, 139, 70, 71, 1, 2, 3, 4, 92, 93, 94, 43, -1, -1, 83, 84, - 138, 96, 74, 57, -1, 97, 197, 198, 199, 200, 201, 58, 98, 202, 203, 109, 99, 142, 104, 143, 144, 151, 145, 74, -1, 88, 89, 90, - 91, 92, 93, 94, 118, 204, 100, 59, 137, 112, 113, 183, 56, 74, 5, 191, 195, 192, 74, 60, 222, 115, 223, 6, 148, 68, 69, 61, - 62, 64, 5, 65, 66, 67, 73, 105, 95, 76, 77, 6, 74, 7, 8, 9, 10, 76, 77, 106, 107, 108, 111, 136, 116, 115, 182, 135, - 140, 7, 8, 9, 10, 141, 76, 146, 11, 12, 13, 149, 179, 180, 181, 185, 186, 187, 188, 103, 189, 193, 194, 196, 11, 12, 13, 221, - 224, 225, 14, 248, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 14, 15, 16, 17, 226, 227, 228, 229, 18, 19, - 20, 230, 231, 21, 134, 22, 101, 15, 16, 17, 147, 232, 80, 249, 18, 19, 20, 233, 234, 21, 78, 22, 79, 235, 250, 236, 237, 238, - 81, 82, 83, 84, 103, 239, 240, 178, 86, 241, 242, 205, 206, 207, 208, 209, 243, 184, 210, 211, 244, 245, 246, 247, 251, 252, 253, 254, - 87, 88, 89, 90, 91, 92, 93, 94, 255, 256, 212, 190, 257, 80, 258, 259, 103, 260, 261, 262, 213, 214, 215, 216, 217, 80, 263, 218, - 219, 81, 82, 83, 84, 85, 264, 274, 265, 86, 266, 267, 268, 81, 82, 83, 84, 269, 150, 220, 80, 86, 270, 271, 272, 273, 110, 63, - 0, 87, 88, 89, 90, 91, 92, 93, 94, 80, -1, -1, 0, 87, 88, 89, 90, 91, 92, 93, 94, 275, 276, 277, 0, 81, 82, 83, - 84, 278, 279, 280, 0, 86, 281, 282, 283, -1, -1, 90, 91, 92, 93, 94, 284, 285, 286, 0, 287, 288, 289, 290, 0, 87, 88, 89, - 90, 91, 92, 93, 94, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 291, 0, - 173, 292, 293, 174, 175, 294, 176, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 295, 296, 297, 298}; - -static const yytype_int16 yycheck[] = { - 3, 4, 5, 6, 3, 55, 75, 43, 122, 143, 144, 22, 73, 55, 5, 6, 3, 4, 5, 6, 171, 172, 173, 176, 138, 139, 140, 141, - 177, 175, 179, 176, 146, 179, 89, 90, 91, 92, 93, 4, 175, 96, 97, 177, 179, 177, 57, 179, 177, 177, 179, 179, 166, 167, 168, 169, - 170, 171, 172, 173, 121, 116, 65, 4, 100, 76, 77, 177, 5, 179, 73, 177, 177, 179, 179, 4, 177, 146, 179, 82, 116, 18, 19, 4, - 6, 176, 73, 176, 176, 176, 0, 4, 178, 143, 144, 82, 179, 100, 101, 102, 103, 143, 144, 4, 4, 4, 3, 5, 176, 146, 146, 6, - 76, 100, 101, 102, 103, 179, 143, 176, 123, 124, 125, 121, 4, 4, 4, 176, 176, 176, 176, 73, 177, 177, 177, 6, 123, 124, 125, 4, - 179, 179, 145, 177, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 145, 162, 163, 164, 179, 179, 179, 179, 169, 170, - 171, 179, 179, 174, 171, 176, 177, 162, 163, 164, 115, 179, 122, 6, 169, 170, 171, 179, 179, 174, 73, 176, 75, 179, 6, 179, 179, 179, - 138, 139, 140, 141, 73, 179, 179, 140, 146, 179, 179, 89, 90, 91, 92, 93, 179, 150, 96, 97, 179, 179, 179, 179, 6, 6, 6, 6, - 166, 167, 168, 169, 170, 171, 172, 173, 6, 6, 116, 177, 6, 122, 6, 6, 73, 6, 6, 6, 89, 90, 91, 92, 93, 122, 6, 96, - 97, 138, 139, 140, 141, 142, 6, 177, 6, 146, 6, 6, 6, 138, 139, 140, 141, 6, 143, 116, 122, 146, 6, 6, 6, 6, 74, 13, - -1, 166, 167, 168, 169, 170, 171, 172, 173, 122, 140, 141, -1, 166, 167, 168, 169, 170, 171, 172, 173, 177, 177, 177, -1, 138, 139, 140, - 141, 177, 177, 177, -1, 146, 177, 177, 177, 167, 168, 169, 170, 171, 172, 173, 177, 177, 177, -1, 177, 177, 177, 177, -1, 166, 167, 168, - 169, 170, 171, 172, 173, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 177, -1, - 111, 177, 177, 114, 115, 177, 117, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 177, 177, 177, 177}; +static const yytype_int16 yytable[] = +{ + 1, 2, 3, 4, 133, 75, 114, 102, 80, 76, + 77, 72, 117, 139, 70, 71, 1, 2, 3, 4, + 92, 93, 94, 43, -1, -1, 83, 84, 138, 96, + 74, 57, -1, 97, 197, 198, 199, 200, 201, 58, + 98, 202, 203, 109, 99, 142, 104, 143, 144, 151, + 145, 74, -1, 88, 89, 90, 91, 92, 93, 94, + 118, 204, 100, 59, 137, 112, 113, 183, 56, 74, + 5, 191, 195, 192, 74, 60, 222, 115, 223, 6, + 148, 68, 69, 61, 62, 64, 5, 65, 66, 67, + 73, 105, 95, 76, 77, 6, 74, 7, 8, 9, + 10, 76, 77, 106, 107, 108, 111, 136, 116, 115, + 182, 135, 140, 7, 8, 9, 10, 141, 76, 146, + 11, 12, 13, 149, 179, 180, 181, 185, 186, 187, + 188, 103, 189, 193, 194, 196, 11, 12, 13, 221, + 224, 225, 14, 248, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 14, 15, + 16, 17, 226, 227, 228, 229, 18, 19, 20, 230, + 231, 21, 134, 22, 101, 15, 16, 17, 147, 232, + 80, 249, 18, 19, 20, 233, 234, 21, 78, 22, + 79, 235, 250, 236, 237, 238, 81, 82, 83, 84, + 103, 239, 240, 178, 86, 241, 242, 205, 206, 207, + 208, 209, 243, 184, 210, 211, 244, 245, 246, 247, + 251, 252, 253, 254, 87, 88, 89, 90, 91, 92, + 93, 94, 255, 256, 212, 190, 257, 80, 258, 259, + 103, 260, 261, 262, 213, 214, 215, 216, 217, 80, + 263, 218, 219, 81, 82, 83, 84, 85, 264, 274, + 265, 86, 266, 267, 268, 81, 82, 83, 84, 269, + 150, 220, 80, 86, 270, 271, 272, 273, 110, 63, + 0, 87, 88, 89, 90, 91, 92, 93, 94, 80, + -1, -1, 0, 87, 88, 89, 90, 91, 92, 93, + 94, 275, 276, 277, 0, 81, 82, 83, 84, 278, + 279, 280, 0, 86, 281, 282, 283, -1, -1, 90, + 91, 92, 93, 94, 284, 285, 286, 0, 287, 288, + 289, 290, 0, 87, 88, 89, 90, 91, 92, 93, + 94, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 291, 0, 173, 292, 293, 174, 175, 294, + 176, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 295, 296, 297, 298 +}; + +static const yytype_int16 yycheck[] = +{ + 3, 4, 5, 6, 3, 55, 75, 43, 122, 143, + 144, 22, 73, 55, 5, 6, 3, 4, 5, 6, + 171, 172, 173, 176, 138, 139, 140, 141, 177, 175, + 179, 176, 146, 179, 89, 90, 91, 92, 93, 4, + 175, 96, 97, 177, 179, 177, 57, 179, 177, 177, + 179, 179, 166, 167, 168, 169, 170, 171, 172, 173, + 121, 116, 65, 4, 100, 76, 77, 177, 5, 179, + 73, 177, 177, 179, 179, 4, 177, 146, 179, 82, + 116, 18, 19, 4, 6, 176, 73, 176, 176, 176, + 0, 4, 178, 143, 144, 82, 179, 100, 101, 102, + 103, 143, 144, 4, 4, 4, 3, 5, 176, 146, + 146, 6, 76, 100, 101, 102, 103, 179, 143, 176, + 123, 124, 125, 121, 4, 4, 4, 176, 176, 176, + 176, 73, 177, 177, 177, 6, 123, 124, 125, 4, + 179, 179, 145, 177, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 145, 162, + 163, 164, 179, 179, 179, 179, 169, 170, 171, 179, + 179, 174, 171, 176, 177, 162, 163, 164, 115, 179, + 122, 6, 169, 170, 171, 179, 179, 174, 73, 176, + 75, 179, 6, 179, 179, 179, 138, 139, 140, 141, + 73, 179, 179, 140, 146, 179, 179, 89, 90, 91, + 92, 93, 179, 150, 96, 97, 179, 179, 179, 179, + 6, 6, 6, 6, 166, 167, 168, 169, 170, 171, + 172, 173, 6, 6, 116, 177, 6, 122, 6, 6, + 73, 6, 6, 6, 89, 90, 91, 92, 93, 122, + 6, 96, 97, 138, 139, 140, 141, 142, 6, 177, + 6, 146, 6, 6, 6, 138, 139, 140, 141, 6, + 143, 116, 122, 146, 6, 6, 6, 6, 74, 13, + -1, 166, 167, 168, 169, 170, 171, 172, 173, 122, + 140, 141, -1, 166, 167, 168, 169, 170, 171, 172, + 173, 177, 177, 177, -1, 138, 139, 140, 141, 177, + 177, 177, -1, 146, 177, 177, 177, 167, 168, 169, + 170, 171, 172, 173, 177, 177, 177, -1, 177, 177, + 177, 177, -1, 166, 167, 168, 169, 170, 171, 172, + 173, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 177, -1, 111, 177, 177, 114, 115, 177, + 117, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 177, 177, 177, 177 +}; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = { - 0, 3, 4, 5, 6, 73, 82, 100, 101, 102, 103, 123, 124, 125, 145, 162, 163, 164, 169, 170, 171, 174, 176, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 198, 199, 200, 201, 176, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 185, 176, 4, 4, 4, 4, 6, 201, 176, 176, 176, 176, 185, 185, 5, 6, 184, 0, 179, 55, 143, 144, 73, 75, 122, 138, 139, 140, - 141, 142, 146, 166, 167, 168, 169, 170, 171, 172, 173, 178, 175, 179, 175, 179, 65, 177, 182, 73, 184, 4, 4, 4, 4, 177, 183, 3, - 184, 184, 75, 146, 176, 73, 121, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 3, 171, 6, 5, 182, 177, 55, - 76, 179, 177, 179, 177, 179, 176, 185, 182, 121, 143, 177, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 111, 114, 115, 117, 193, 185, 4, 4, 4, 182, 177, 185, 176, 176, 176, 176, 177, 177, 177, 179, 177, 177, 177, - 6, 89, 90, 91, 92, 93, 96, 97, 116, 89, 90, 91, 92, 93, 96, 97, 116, 89, 90, 91, 92, 93, 96, 97, 116, 4, 177, 179, - 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 177, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177}; +static const yytype_uint8 yystos[] = +{ + 0, 3, 4, 5, 6, 73, 82, 100, 101, 102, + 103, 123, 124, 125, 145, 162, 163, 164, 169, 170, + 171, 174, 176, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 194, 195, 196, 197, 198, + 199, 200, 201, 176, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 185, 176, 4, 4, + 4, 4, 6, 201, 176, 176, 176, 176, 185, 185, + 5, 6, 184, 0, 179, 55, 143, 144, 73, 75, + 122, 138, 139, 140, 141, 142, 146, 166, 167, 168, + 169, 170, 171, 172, 173, 178, 175, 179, 175, 179, + 65, 177, 182, 73, 184, 4, 4, 4, 4, 177, + 183, 3, 184, 184, 75, 146, 176, 73, 121, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 3, 171, 6, 5, 182, 177, 55, + 76, 179, 177, 179, 177, 179, 176, 185, 182, 121, + 143, 177, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 111, 114, 115, 117, 193, 185, 4, + 4, 4, 182, 177, 185, 176, 176, 176, 176, 177, + 177, 177, 179, 177, 177, 177, 6, 89, 90, 91, + 92, 93, 96, 97, 116, 89, 90, 91, 92, 93, + 96, 97, 116, 89, 90, 91, 92, 93, 96, 97, + 116, 4, 177, 179, 179, 179, 179, 179, 179, 179, + 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, + 179, 179, 179, 179, 179, 179, 179, 179, 177, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 177 +}; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ -static const yytype_uint8 yyr1[] = {0, 180, 181, 182, 182, 183, 183, 184, 184, 184, 184, 185, 185, 185, 185, 185, 185, 185, 185, 186, 186, 187, 187, - 188, 188, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, - 189, 189, 190, 190, 191, 192, 192, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 194, 195, 195, 195, 195, 196, 196, 196, 196, 196, 196, 196, 196, 196, - 196, 196, 196, 196, 197, 198, 198, 199, 200, 200, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201}; +static const yytype_uint8 yyr1[] = +{ + 0, 180, 181, 182, 182, 183, 183, 184, 184, 184, + 184, 185, 185, 185, 185, 185, 185, 185, 185, 186, + 186, 187, 187, 188, 188, 189, 189, 189, 189, 189, + 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, + 189, 189, 189, 189, 189, 189, 189, 189, 190, 190, + 191, 192, 192, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, + 193, 194, 195, 195, 195, 195, 196, 196, 196, 196, + 196, 196, 196, 196, 196, 196, 196, 196, 196, 197, + 198, 198, 199, 200, 200, 201, 201, 201, 201, 201, + 201, 201, 201, 201, 201, 201, 201 +}; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ -static const yytype_int8 yyr2[] = {0, 2, 1, 1, 3, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 6, 8, 4, 6, 4, 6, 3, 4, 5, 4, 3, 2, 2, 2, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 6, 3, 4, 3, 3, 5, 5, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 6, 4, 1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 1, 3, 1, - 3, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 3, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}; +static const yytype_int8 yyr2[] = +{ + 0, 2, 1, 1, 3, 3, 1, 1, 1, 1, + 1, 3, 1, 1, 1, 1, 1, 1, 1, 6, + 8, 4, 6, 4, 6, 3, 4, 5, 4, 3, + 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 6, 3, 4, 3, 3, + 5, 5, 6, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 6, 4, 1, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 1, 3, 1, 3, 1, 1, 1, 1, + 1, 2, 2, 2, 2, 2, 1, 1, 1, 2, + 2, 3, 2, 2, 3, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2 +}; + enum { YYENOMEM = -2 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = EXPRESSIONEMPTY) - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab -#define YYNOMEM goto yyexhaustedlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ - do \ - if (yychar == EXPRESSIONEMPTY) { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK(yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } else { \ - yyerror(&yylloc, scanner, result, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ - while (0) +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = EXPRESSIONEMPTY) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab + + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == EXPRESSIONEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (&yylloc, scanner, result, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) /* Backward compatibility with an undocumented macro. Use EXPRESSIONerror or EXPRESSIONUNDEF. */ @@ -1033,135 +1098,150 @@ enum { YYENOMEM = -2 }; the previous symbol: RHS[0] (always defined). */ #ifndef YYLLOC_DEFAULT -#define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) { \ - (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC(Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC(Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC(Rhs, N).last_column; \ - } else { \ - (Current).first_line = (Current).last_line = YYRHSLOC(Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = YYRHSLOC(Rhs, 0).last_column; \ - } \ +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ while (0) #endif #define YYRHSLOC(Rhs, K) ((Rhs)[K]) + /* Enable debugging if requested. */ #if EXPRESSIONDEBUG -#ifndef YYFPRINTF -#include /* INFRINGES ON USER NAME SPACE */ -#define YYFPRINTF fprintf -#endif +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) -#define YYDPRINTF(Args) \ - do { \ - if (yydebug) \ - YYFPRINTF Args; \ - } while (0) /* YYLOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ -#ifndef YYLOCATION_PRINT +# ifndef YYLOCATION_PRINT -#if defined YY_LOCATION_PRINT +# if defined YY_LOCATION_PRINT -/* Temporary convenience wrapper in case some people defined the - undocumented and private YY_LOCATION_PRINT macros. */ -#define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc)) + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc)) -#elif defined EXPRESSIONLTYPE_IS_TRIVIAL && EXPRESSIONLTYPE_IS_TRIVIAL +# elif defined EXPRESSIONLTYPE_IS_TRIVIAL && EXPRESSIONLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. Private, do not rely on its existence. */ YY_ATTRIBUTE_UNUSED -static int yy_location_print_(FILE *yyo, YYLTYPE const *const yylocp) { - int res = 0; - int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; - if (0 <= yylocp->first_line) { - res += YYFPRINTF(yyo, "%d", yylocp->first_line); - if (0 <= yylocp->first_column) - res += YYFPRINTF(yyo, ".%d", yylocp->first_column); +static int +yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) +{ + int res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += YYFPRINTF (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += YYFPRINTF (yyo, ".%d", yylocp->first_column); } - if (0 <= yylocp->last_line) { - if (yylocp->first_line < yylocp->last_line) { - res += YYFPRINTF(yyo, "-%d", yylocp->last_line); - if (0 <= end_col) - res += YYFPRINTF(yyo, ".%d", end_col); - } else if (0 <= end_col && yylocp->first_column < end_col) - res += YYFPRINTF(yyo, "-%d", end_col); + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += YYFPRINTF (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += YYFPRINTF (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += YYFPRINTF (yyo, "-%d", end_col); } - return res; + return res; } -#define YYLOCATION_PRINT yy_location_print_ +# define YYLOCATION_PRINT yy_location_print_ -/* Temporary convenience wrapper in case some people defined the - undocumented and private YY_LOCATION_PRINT macros. */ -#define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc)) + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc)) -#else +# else -#define YYLOCATION_PRINT(File, Loc) ((void)0) -/* Temporary convenience wrapper in case some people defined the - undocumented and private YY_LOCATION_PRINT macros. */ -#define YY_LOCATION_PRINT YYLOCATION_PRINT +# define YYLOCATION_PRINT(File, Loc) ((void) 0) + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YY_LOCATION_PRINT YYLOCATION_PRINT + +# endif +# endif /* !defined YYLOCATION_PRINT */ -#endif -#endif /* !defined YYLOCATION_PRINT */ -#define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ - do { \ - if (yydebug) { \ - YYFPRINTF(stderr, "%s ", Title); \ - yy_symbol_print(stderr, Kind, Value, Location, scanner, result); \ - YYFPRINTF(stderr, "\n"); \ - } \ - } while (0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Kind, Value, Location, scanner, result); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + /*-----------------------------------. | Print this symbol's value on YYO. | `-----------------------------------*/ -static void yy_symbol_value_print(FILE *yyo, - yysymbol_kind_t yykind, - YYSTYPE const *const yyvaluep, - YYLTYPE const *const yylocationp, - void *scanner, - infinity::ExpressionParserResult *result) { - FILE *yyoutput = yyo; - YY_USE(yyoutput); - YY_USE(yylocationp); - YY_USE(scanner); - YY_USE(result); - if (!yyvaluep) - return; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YY_USE(yykind); - YY_IGNORE_MAYBE_UNINITIALIZED_END +static void +yy_symbol_value_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner, infinity::ExpressionParserResult* result) +{ + FILE *yyoutput = yyo; + YY_USE (yyoutput); + YY_USE (yylocationp); + YY_USE (scanner); + YY_USE (result); + if (!yyvaluep) + return; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END } + /*---------------------------. | Print this symbol on YYO. | `---------------------------*/ -static void yy_symbol_print(FILE *yyo, - yysymbol_kind_t yykind, - YYSTYPE const *const yyvaluep, - YYLTYPE const *const yylocationp, - void *scanner, - infinity::ExpressionParserResult *result) { - YYFPRINTF(yyo, "%s %s (", yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name(yykind)); - - YYLOCATION_PRINT(yyo, yylocationp); - YYFPRINTF(yyo, ": "); - yy_symbol_value_print(yyo, yykind, yyvaluep, yylocationp, scanner, result); - YYFPRINTF(yyo, ")"); +static void +yy_symbol_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner, infinity::ExpressionParserResult* result) +{ + YYFPRINTF (yyo, "%s %s (", + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); + + YYLOCATION_PRINT (yyo, yylocationp); + YYFPRINTF (yyo, ": "); + yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, scanner, result); + YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. @@ -1169,62 +1249,70 @@ static void yy_symbol_print(FILE *yyo, | TOP (included). | `------------------------------------------------------------------*/ -static void yy_stack_print(yy_state_t *yybottom, yy_state_t *yytop) { - YYFPRINTF(stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) { - int yybot = *yybottom; - YYFPRINTF(stderr, " %d", yybot); +static void +yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); } - YYFPRINTF(stderr, "\n"); + YYFPRINTF (stderr, "\n"); } -#define YY_STACK_PRINT(Bottom, Top) \ - do { \ - if (yydebug) \ - yy_stack_print((Bottom), (Top)); \ - } while (0) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -static void yy_reduce_print(yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, void *scanner, infinity::ExpressionParserResult *result) { - int yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF(stderr, "Reducing stack by rule %d (line %d):\n", yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) { - YYFPRINTF(stderr, " $%d = ", yyi + 1); - yy_symbol_print(stderr, - YY_ACCESSING_SYMBOL(+yyssp[yyi + 1 - yynrhs]), - &yyvsp[(yyi + 1) - (yynrhs)], - &(yylsp[(yyi + 1) - (yynrhs)]), - scanner, - result); - YYFPRINTF(stderr, "\n"); +static void +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, + int yyrule, void *scanner, infinity::ExpressionParserResult* result) +{ + int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), + &yyvsp[(yyi + 1) - (yynrhs)], + &(yylsp[(yyi + 1) - (yynrhs)]), scanner, result); + YYFPRINTF (stderr, "\n"); } } -#define YY_REDUCE_PRINT(Rule) \ - do { \ - if (yydebug) \ - yy_reduce_print(yyssp, yyvsp, yylsp, Rule, scanner, result); \ - } while (0) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, yylsp, Rule, scanner, result); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !EXPRESSIONDEBUG */ -#define YYDPRINTF(Args) ((void)0) -#define YY_SYMBOL_PRINT(Title, Kind, Value, Location) -#define YY_STACK_PRINT(Bottom, Top) -#define YY_REDUCE_PRINT(Rule) +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) #endif /* !EXPRESSIONDEBUG */ + /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH -#define YYINITDEPTH 200 +# define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only @@ -1235,14 +1323,16 @@ int yydebug; evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 +# define YYMAXDEPTH 10000 #endif + /* Context of a parse error. */ -typedef struct { - yy_state_t *yyssp; - yysymbol_kind_t yytoken; - YYLTYPE *yylloc; +typedef struct +{ + yy_state_t *yyssp; + yysymbol_kind_t yytoken; + YYLTYPE *yylloc; } yypcontext_t; /* Put in YYARG at most YYARGN of the expected tokens given the @@ -1251,64 +1341,77 @@ typedef struct { be less than YYNTOKENS). Return YYENOMEM on memory exhaustion. Return 0 if there are more than YYARGN expected tokens, yet fill YYARG up to YYARGN. */ -static int yypcontext_expected_tokens(const yypcontext_t *yyctx, yysymbol_kind_t yyarg[], int yyargn) { - /* Actual size of YYARG. */ - int yycount = 0; - int yyn = yypact[+*yyctx->yyssp]; - if (!yypact_value_is_default(yyn)) { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror && !yytable_value_is_error(yytable[yyx + yyn])) { - if (!yyarg) - ++yycount; - else if (yycount == yyargn) - return 0; - else - yyarg[yycount++] = YY_CAST(yysymbol_kind_t, yyx); - } +static int +yypcontext_expected_tokens (const yypcontext_t *yyctx, + yysymbol_kind_t yyarg[], int yyargn) +{ + /* Actual size of YYARG. */ + int yycount = 0; + int yyn = yypact[+*yyctx->yyssp]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (!yyarg) + ++yycount; + else if (yycount == yyargn) + return 0; + else + yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx); + } } - if (yyarg && yycount == 0 && 0 < yyargn) - yyarg[0] = YYSYMBOL_YYEMPTY; - return yycount; + if (yyarg && yycount == 0 && 0 < yyargn) + yyarg[0] = YYSYMBOL_YYEMPTY; + return yycount; } + + + #ifndef yystrlen -#if defined __GLIBC__ && defined _STRING_H -#define yystrlen(S) (YY_CAST(YYPTRDIFF_T, strlen(S))) -#else +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) +# else /* Return the length of YYSTR. */ -static YYPTRDIFF_T yystrlen(const char *yystr) { - YYPTRDIFF_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; +static YYPTRDIFF_T +yystrlen (const char *yystr) +{ + YYPTRDIFF_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; } -#endif +# endif #endif #ifndef yystpcpy -#if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -#define yystpcpy stpcpy -#else +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -static char *yystpcpy(char *yydest, const char *yysrc) { - char *yyd = yydest; - const char *yys = yysrc; +static char * +yystpcpy (char *yydest, const char *yysrc) +{ + char *yyd = yydest; + const char *yys = yysrc; - while ((*yyd++ = *yys++) != '\0') - continue; + while ((*yyd++ = *yys++) != '\0') + continue; - return yyd - 1; + return yyd - 1; } -#endif +# endif #endif #ifndef yytnamerr @@ -1319,82 +1422,92 @@ static char *yystpcpy(char *yydest, const char *yysrc) { backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ -static YYPTRDIFF_T yytnamerr(char *yyres, const char *yystr) { - if (*yystr == '"') { - YYPTRDIFF_T yyn = 0; - char const *yyp = yystr; - for (;;) - switch (*++yyp) { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes:; +static YYPTRDIFF_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYPTRDIFF_T yyn = 0; + char const *yyp = yystr; + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + else + goto append; + + append: + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; } - if (yyres) - return yystpcpy(yyres, yystr) - yyres; - else - return yystrlen(yystr); + if (yyres) + return yystpcpy (yyres, yystr) - yyres; + else + return yystrlen (yystr); } #endif -static int yy_syntax_error_arguments(const yypcontext_t *yyctx, yysymbol_kind_t yyarg[], int yyargn) { - /* Actual size of YYARG. */ - int yycount = 0; - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yyctx->yytoken != YYSYMBOL_YYEMPTY) { - int yyn; - if (yyarg) - yyarg[yycount] = yyctx->yytoken; - ++yycount; - yyn = yypcontext_expected_tokens(yyctx, yyarg ? yyarg + 1 : yyarg, yyargn - 1); - if (yyn == YYENOMEM) - return YYENOMEM; - else - yycount += yyn; + +static int +yy_syntax_error_arguments (const yypcontext_t *yyctx, + yysymbol_kind_t yyarg[], int yyargn) +{ + /* Actual size of YYARG. */ + int yycount = 0; + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yyctx->yytoken != YYSYMBOL_YYEMPTY) + { + int yyn; + if (yyarg) + yyarg[yycount] = yyctx->yytoken; + ++yycount; + yyn = yypcontext_expected_tokens (yyctx, + yyarg ? yyarg + 1 : yyarg, yyargn - 1); + if (yyn == YYENOMEM) + return YYENOMEM; + else + yycount += yyn; } - return yycount; + return yycount; } /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message @@ -1405,280 +1518,299 @@ static int yy_syntax_error_arguments(const yypcontext_t *yyctx, yysymbol_kind_t not large enough to hold the message. In that case, also set *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the required number of bytes is too large to store. */ -static int yysyntax_error(YYPTRDIFF_T *yymsg_alloc, char **yymsg, const yypcontext_t *yyctx) { - enum { YYARGS_MAX = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat: reported tokens (one for the "unexpected", - one per "expected"). */ - yysymbol_kind_t yyarg[YYARGS_MAX]; - /* Cumulated lengths of YYARG. */ - YYPTRDIFF_T yysize = 0; - - /* Actual size of YYARG. */ - int yycount = yy_syntax_error_arguments(yyctx, yyarg, YYARGS_MAX); - if (yycount == YYENOMEM) - return YYENOMEM; - - switch (yycount) { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ +static int +yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, + const yypcontext_t *yyctx) +{ + enum { YYARGS_MAX = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat: reported tokens (one for the "unexpected", + one per "expected"). */ + yysymbol_kind_t yyarg[YYARGS_MAX]; + /* Cumulated lengths of YYARG. */ + YYPTRDIFF_T yysize = 0; + + /* Actual size of YYARG. */ + int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX); + if (yycount == YYENOMEM) + return YYENOMEM; + + switch (yycount) + { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ break - default: /* Avoid compiler warnings. */ - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); + default: /* Avoid compiler warnings. */ + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); #undef YYCASE_ } - /* Compute error message size. Don't count the "%s"s, but reserve - room for the terminator. */ - yysize = yystrlen(yyformat) - 2 * yycount + 1; - { - int yyi; - for (yyi = 0; yyi < yycount; ++yyi) { - YYPTRDIFF_T yysize1 = yysize + yytnamerr(YY_NULLPTR, yytname[yyarg[yyi]]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return YYENOMEM; - } - } - - if (*yymsg_alloc < yysize) { - *yymsg_alloc = 2 * yysize; - if (!(yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return -1; - } + /* Compute error message size. Don't count the "%s"s, but reserve + room for the terminator. */ + yysize = yystrlen (yyformat) - 2 * yycount + 1; + { + int yyi; + for (yyi = 0; yyi < yycount; ++yyi) + { + YYPTRDIFF_T yysize1 + = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]); + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else + return YYENOMEM; + } + } - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ + if (*yymsg_alloc < yysize) { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { - yyp += yytnamerr(yyp, yytname[yyarg[yyi++]]); - yyformat += 2; - } else { - ++yyp; - ++yyformat; - } + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return -1; } - return 0; + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]); + yyformat += 2; + } + else + { + ++yyp; + ++yyformat; + } + } + return 0; } + /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -static void yydestruct(const char *yymsg, - yysymbol_kind_t yykind, - YYSTYPE *yyvaluep, - YYLTYPE *yylocationp, - void *scanner, - infinity::ExpressionParserResult *result) { - YY_USE(yyvaluep); - YY_USE(yylocationp); - YY_USE(scanner); - YY_USE(result); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT(yymsg, yykind, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - switch (yykind) { - case YYSYMBOL_expr_array: /* expr_array */ +static void +yydestruct (const char *yymsg, + yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, void *scanner, infinity::ExpressionParserResult* result) +{ + YY_USE (yyvaluep); + YY_USE (yylocationp); + YY_USE (scanner); + YY_USE (result); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + switch (yykind) + { + case YYSYMBOL_expr_array: /* expr_array */ #line 97 "expression_parser.y" - { - fprintf(stderr, "destroy expression array\n"); - if ((((*yyvaluep).expr_array_t)) != nullptr) { - for (auto ptr : *(((*yyvaluep).expr_array_t))) { - delete ptr; - } - delete (((*yyvaluep).expr_array_t)); - } + { + fprintf(stderr, "destroy expression array\n"); + if ((((*yyvaluep).expr_array_t)) != nullptr) { + for (auto ptr : *(((*yyvaluep).expr_array_t))) { + delete ptr; } + delete (((*yyvaluep).expr_array_t)); + } +} #line 1633 "expression_parser.cpp" break; - case YYSYMBOL_expr_alias: /* expr_alias */ + case YYSYMBOL_expr_alias: /* expr_alias */ #line 107 "expression_parser.y" - { - delete (((*yyvaluep).expr_t)); - } + { + delete (((*yyvaluep).expr_t)); +} #line 1641 "expression_parser.cpp" break; - case YYSYMBOL_expr: /* expr */ + case YYSYMBOL_expr: /* expr */ #line 107 "expression_parser.y" - { - delete (((*yyvaluep).expr_t)); - } + { + delete (((*yyvaluep).expr_t)); +} #line 1649 "expression_parser.cpp" break; - case YYSYMBOL_operand: /* operand */ + case YYSYMBOL_operand: /* operand */ #line 107 "expression_parser.y" - { - delete (((*yyvaluep).expr_t)); - } + { + delete (((*yyvaluep).expr_t)); +} #line 1657 "expression_parser.cpp" break; - case YYSYMBOL_match_expr: /* match_expr */ + case YYSYMBOL_match_expr: /* match_expr */ #line 107 "expression_parser.y" - { - delete (((*yyvaluep).expr_t)); - } + { + delete (((*yyvaluep).expr_t)); +} #line 1665 "expression_parser.cpp" break; - case YYSYMBOL_query_expr: /* query_expr */ + case YYSYMBOL_query_expr: /* query_expr */ #line 107 "expression_parser.y" - { - delete (((*yyvaluep).expr_t)); - } + { + delete (((*yyvaluep).expr_t)); +} #line 1673 "expression_parser.cpp" break; - case YYSYMBOL_fusion_expr: /* fusion_expr */ + case YYSYMBOL_fusion_expr: /* fusion_expr */ #line 107 "expression_parser.y" - { - delete (((*yyvaluep).expr_t)); - } + { + delete (((*yyvaluep).expr_t)); +} #line 1681 "expression_parser.cpp" break; - case YYSYMBOL_function_expr: /* function_expr */ + case YYSYMBOL_function_expr: /* function_expr */ #line 107 "expression_parser.y" - { - delete (((*yyvaluep).expr_t)); - } + { + delete (((*yyvaluep).expr_t)); +} #line 1689 "expression_parser.cpp" break; - case YYSYMBOL_conjunction_expr: /* conjunction_expr */ + case YYSYMBOL_conjunction_expr: /* conjunction_expr */ #line 107 "expression_parser.y" - { - delete (((*yyvaluep).expr_t)); - } + { + delete (((*yyvaluep).expr_t)); +} #line 1697 "expression_parser.cpp" break; - case YYSYMBOL_between_expr: /* between_expr */ + case YYSYMBOL_between_expr: /* between_expr */ #line 107 "expression_parser.y" - { - delete (((*yyvaluep).expr_t)); - } + { + delete (((*yyvaluep).expr_t)); +} #line 1705 "expression_parser.cpp" break; - case YYSYMBOL_in_expr: /* in_expr */ + case YYSYMBOL_in_expr: /* in_expr */ #line 107 "expression_parser.y" - { - delete (((*yyvaluep).expr_t)); - } + { + delete (((*yyvaluep).expr_t)); +} #line 1713 "expression_parser.cpp" break; - case YYSYMBOL_cast_expr: /* cast_expr */ + case YYSYMBOL_cast_expr: /* cast_expr */ #line 107 "expression_parser.y" - { - delete (((*yyvaluep).expr_t)); - } + { + delete (((*yyvaluep).expr_t)); +} #line 1721 "expression_parser.cpp" break; - case YYSYMBOL_column_expr: /* column_expr */ + case YYSYMBOL_column_expr: /* column_expr */ #line 107 "expression_parser.y" - { - delete (((*yyvaluep).expr_t)); - } + { + delete (((*yyvaluep).expr_t)); +} #line 1729 "expression_parser.cpp" break; - case YYSYMBOL_constant_expr: /* constant_expr */ + case YYSYMBOL_constant_expr: /* constant_expr */ #line 111 "expression_parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } + { + delete (((*yyvaluep).const_expr_t)); +} #line 1737 "expression_parser.cpp" break; - case YYSYMBOL_long_array_expr: /* long_array_expr */ + case YYSYMBOL_long_array_expr: /* long_array_expr */ #line 111 "expression_parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } + { + delete (((*yyvaluep).const_expr_t)); +} #line 1745 "expression_parser.cpp" break; - case YYSYMBOL_unclosed_long_array_expr: /* unclosed_long_array_expr */ + case YYSYMBOL_unclosed_long_array_expr: /* unclosed_long_array_expr */ #line 111 "expression_parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } + { + delete (((*yyvaluep).const_expr_t)); +} #line 1753 "expression_parser.cpp" break; - case YYSYMBOL_double_array_expr: /* double_array_expr */ + case YYSYMBOL_double_array_expr: /* double_array_expr */ #line 111 "expression_parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } + { + delete (((*yyvaluep).const_expr_t)); +} #line 1761 "expression_parser.cpp" break; - case YYSYMBOL_unclosed_double_array_expr: /* unclosed_double_array_expr */ + case YYSYMBOL_unclosed_double_array_expr: /* unclosed_double_array_expr */ #line 111 "expression_parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } + { + delete (((*yyvaluep).const_expr_t)); +} #line 1769 "expression_parser.cpp" break; - case YYSYMBOL_interval_expr: /* interval_expr */ + case YYSYMBOL_interval_expr: /* interval_expr */ #line 111 "expression_parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } + { + delete (((*yyvaluep).const_expr_t)); +} #line 1777 "expression_parser.cpp" break; - default: - break; + default: + break; } - YY_IGNORE_MAYBE_UNINITIALIZED_END + YY_IGNORE_MAYBE_UNINITIALIZED_END } + + + + + /*----------. | yyparse. | `----------*/ -int yyparse(void *scanner, infinity::ExpressionParserResult *result) { - /* Lookahead token kind. */ - int yychar; +int +yyparse (void *scanner, infinity::ExpressionParserResult* result) +{ +/* Lookahead token kind. */ +int yychar; - /* The semantic value of the lookahead symbol. */ - /* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ - YY_INITIAL_VALUE(static YYSTYPE yyval_default;) - YYSTYPE yylval YY_INITIAL_VALUE(= yyval_default); - /* Location data for the lookahead symbol. */ - static YYLTYPE yyloc_default -#if defined EXPRESSIONLTYPE_IS_TRIVIAL && EXPRESSIONLTYPE_IS_TRIVIAL - = {1, 1, 1, 1} -#endif - ; - YYLTYPE yylloc = yyloc_default; +/* The semantic value of the lookahead symbol. */ +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); + +/* Location data for the lookahead symbol. */ +static YYLTYPE yyloc_default +# if defined EXPRESSIONLTYPE_IS_TRIVIAL && EXPRESSIONLTYPE_IS_TRIVIAL + = { 1, 1, 1, 1 } +# endif +; +YYLTYPE yylloc = yyloc_default; /* Number of syntax errors so far. */ int yynerrs = 0; @@ -1708,1759 +1840,1680 @@ int yyparse(void *scanner, infinity::ExpressionParserResult *result) { YYLTYPE *yyls = yylsa; YYLTYPE *yylsp = yyls; - int yyn; - /* The return value of yyparse. */ - int yyresult; - /* Lookahead symbol kind. */ - yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - YYLTYPE yyloc; + int yyn; + /* The return value of yyparse. */ + int yyresult; + /* Lookahead symbol kind. */ + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + YYLTYPE yyloc; + + /* The locations where the error started and ended. */ + YYLTYPE yyerror_range[3]; - /* The locations where the error started and ended. */ - YYLTYPE yyerror_range[3]; + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; + YYDPRINTF ((stderr, "Starting parse\n")); - YYDPRINTF((stderr, "Starting parse\n")); + yychar = EXPRESSIONEMPTY; /* Cause a token to be read. */ - yychar = EXPRESSIONEMPTY; /* Cause a token to be read. */ /* User initialization code. */ #line 67 "expression_parser.y" - { - // Initialize - yylloc.first_column = 0; - yylloc.last_column = 0; - yylloc.first_line = 0; - yylloc.last_line = 0; - yylloc.total_column = 0; - yylloc.string_length = 0; - } +{ + // Initialize + yylloc.first_column = 0; + yylloc.last_column = 0; + yylloc.first_line = 0; + yylloc.last_line = 0; + yylloc.total_column = 0; + yylloc.string_length = 0; +} #line 1885 "expression_parser.cpp" - yylsp[0] = yylloc; - goto yysetstate; + yylsp[0] = yylloc; + goto yysetstate; + /*------------------------------------------------------------. | yynewstate -- push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + /*--------------------------------------------------------------------. | yysetstate -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: - YYDPRINTF((stderr, "Entering state %d\n", yystate)); - YY_ASSERT(0 <= yystate && yystate < YYNSTATES); - YY_IGNORE_USELESS_CAST_BEGIN - *yyssp = YY_CAST(yy_state_t, yystate); - YY_IGNORE_USELESS_CAST_END - YY_STACK_PRINT(yyss, yyssp); - - if (yyss + yystacksize - 1 <= yyssp) + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + YY_IGNORE_USELESS_CAST_BEGIN + *yyssp = YY_CAST (yy_state_t, yystate); + YY_IGNORE_USELESS_CAST_END + YY_STACK_PRINT (yyss, yyssp); + + if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE - YYNOMEM; + YYNOMEM; #else { - /* Get the current used size of the three stacks, in elements. */ - YYPTRDIFF_T yysize = yyssp - yyss + 1; - -#if defined yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - yy_state_t *yyss1 = yyss; - YYSTYPE *yyvs1 = yyvs; - YYLTYPE *yyls1 = yyls; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow(YY_("memory exhausted"), - &yyss1, - yysize * YYSIZEOF(*yyssp), - &yyvs1, - yysize * YYSIZEOF(*yyvsp), - &yyls1, - yysize * YYSIZEOF(*yylsp), - &yystacksize); - yyss = yyss1; - yyvs = yyvs1; - yyls = yyls1; - } -#else /* defined YYSTACK_RELOCATE */ - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - YYNOMEM; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yy_state_t *yyss1 = yyss; - union yyalloc *yyptr = YY_CAST(union yyalloc *, YYSTACK_ALLOC(YY_CAST(YYSIZE_T, YYSTACK_BYTES(yystacksize)))); - if (!yyptr) - YYNOMEM; - YYSTACK_RELOCATE(yyss_alloc, yyss); - YYSTACK_RELOCATE(yyvs_alloc, yyvs); - YYSTACK_RELOCATE(yyls_alloc, yyls); -#undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE(yyss1); - } -#endif - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - yylsp = yyls + yysize - 1; - - YY_IGNORE_USELESS_CAST_BEGIN - YYDPRINTF((stderr, "Stack size increased to %ld\n", YY_CAST(long, yystacksize))); - YY_IGNORE_USELESS_CAST_END - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + /* Get the current used size of the three stacks, in elements. */ + YYPTRDIFF_T yysize = yyssp - yyss + 1; + +# if defined yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + yy_state_t *yyss1 = yyss; + YYSTYPE *yyvs1 = yyvs; + YYLTYPE *yyls1 = yyls; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * YYSIZEOF (*yyssp), + &yyvs1, yysize * YYSIZEOF (*yyvsp), + &yyls1, yysize * YYSIZEOF (*yylsp), + &yystacksize); + yyss = yyss1; + yyvs = yyvs1; + yyls = yyls1; + } +# else /* defined YYSTACK_RELOCATE */ + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + YYNOMEM; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yy_state_t *yyss1 = yyss; + union yyalloc *yyptr = + YY_CAST (union yyalloc *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); + if (! yyptr) + YYNOMEM; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyls_alloc, yyls); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + yylsp = yyls + yysize - 1; + + YY_IGNORE_USELESS_CAST_BEGIN + YYDPRINTF ((stderr, "Stack size increased to %ld\n", + YY_CAST (long, yystacksize))); + YY_IGNORE_USELESS_CAST_END + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - if (yystate == YYFINAL) - YYACCEPT; - goto yybackup; + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + /*-----------. | yybackup. | `-----------*/ yybackup: - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default(yyn)) - goto yydefault; + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ - if (yychar == EXPRESSIONEMPTY) { - YYDPRINTF((stderr, "Reading a token\n")); - yychar = yylex(&yylval, &yylloc, scanner); + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ + if (yychar == EXPRESSIONEMPTY) + { + YYDPRINTF ((stderr, "Reading a token\n")); + yychar = yylex (&yylval, &yylloc, scanner); } - if (yychar <= EXPRESSIONEOF) { - yychar = EXPRESSIONEOF; - yytoken = YYSYMBOL_YYEOF; - YYDPRINTF((stderr, "Now at end of input.\n")); - } else if (yychar == EXPRESSIONerror) { - /* The scanner already issued an error message, process directly - to error recovery. But do not keep the error token as - lookahead, it is too special and may lead us to an endless - loop in error recovery. */ - yychar = EXPRESSIONUNDEF; - yytoken = YYSYMBOL_YYerror; - yyerror_range[1] = yylloc; - goto yyerrlab1; - } else { - yytoken = YYTRANSLATE(yychar); - YY_SYMBOL_PRINT("Next token is", yytoken, &yylval, &yylloc); + if (yychar <= EXPRESSIONEOF) + { + yychar = EXPRESSIONEOF; + yytoken = YYSYMBOL_YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else if (yychar == EXPRESSIONerror) + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + yychar = EXPRESSIONUNDEF; + yytoken = YYSYMBOL_YYerror; + yyerror_range[1] = yylloc; + goto yyerrlab1; + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) { - if (yytable_value_is_error(yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yytable_value_is_error (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; } - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + *++yylsp = yylloc; - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT("Shifting", yytoken, &yylval, &yylloc); - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - *++yylsp = yylloc; + /* Discard the shifted token. */ + yychar = EXPRESSIONEMPTY; + goto yynewstate; - /* Discard the shifted token. */ - yychar = EXPRESSIONEMPTY; - goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + /*-----------------------------. | yyreduce -- do a reduction. | `-----------------------------*/ yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1 - yylen]; - - /* Default location. */ - YYLLOC_DEFAULT(yyloc, (yylsp - yylen), yylen); - yyerror_range[1] = yyloc; - YY_REDUCE_PRINT(yyn); - switch (yyn) { - case 2: /* input_pattern: expr_array */ + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + /* Default location. */ + YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); + yyerror_range[1] = yyloc; + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: /* input_pattern: expr_array */ #line 170 "expression_parser.y" - { - result->exprs_ptr_ = (yyvsp[0].expr_array_t); - } + { + result->exprs_ptr_ = (yyvsp[0].expr_array_t); +} #line 2100 "expression_parser.cpp" - break; + break; - case 3: /* expr_array: expr_alias */ + case 3: /* expr_array: expr_alias */ #line 178 "expression_parser.y" - { - (yyval.expr_array_t) = new std::vector(); - (yyval.expr_array_t)->emplace_back((yyvsp[0].expr_t)); - } + { + (yyval.expr_array_t) = new std::vector(); + (yyval.expr_array_t)->emplace_back((yyvsp[0].expr_t)); +} #line 2109 "expression_parser.cpp" - break; + break; - case 4: /* expr_array: expr_array ',' expr_alias */ + case 4: /* expr_array: expr_array ',' expr_alias */ #line 182 "expression_parser.y" - { - (yyvsp[-2].expr_array_t)->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_array_t) = (yyvsp[-2].expr_array_t); - } + { + (yyvsp[-2].expr_array_t)->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_array_t) = (yyvsp[-2].expr_array_t); +} #line 2118 "expression_parser.cpp" - break; + break; - case 5: /* expr_alias: expr AS IDENTIFIER */ + case 5: /* expr_alias: expr AS IDENTIFIER */ #line 187 "expression_parser.y" - { - (yyval.expr_t) = (yyvsp[-2].expr_t); - ParserHelper::ToLower((yyvsp[0].str_value)); - (yyval.expr_t)->alias_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - } + { + (yyval.expr_t) = (yyvsp[-2].expr_t); + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.expr_t)->alias_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); +} #line 2129 "expression_parser.cpp" - break; + break; - case 6: /* expr_alias: expr */ + case 6: /* expr_alias: expr */ #line 193 "expression_parser.y" - { - (yyval.expr_t) = (yyvsp[0].expr_t); - } + { + (yyval.expr_t) = (yyvsp[0].expr_t); +} #line 2137 "expression_parser.cpp" - break; + break; - case 11: /* operand: '(' expr ')' */ + case 11: /* operand: '(' expr ')' */ #line 202 "expression_parser.y" - { - (yyval.expr_t) = (yyvsp[-1].expr_t); - } + { + (yyval.expr_t) = (yyvsp[-1].expr_t); +} #line 2145 "expression_parser.cpp" - break; + break; - case 12: /* operand: constant_expr */ + case 12: /* operand: constant_expr */ #line 205 "expression_parser.y" - { - (yyval.expr_t) = (yyvsp[0].const_expr_t); - } + { + (yyval.expr_t) = (yyvsp[0].const_expr_t); +} #line 2153 "expression_parser.cpp" - break; + break; - case 19: /* match_expr: MATCH '(' STRING ',' STRING ')' */ + case 19: /* match_expr: MATCH '(' STRING ',' STRING ')' */ #line 215 "expression_parser.y" - { - infinity::MatchExpr *match_expr = new infinity::MatchExpr(); - match_expr->fields_ = std::string((yyvsp[-3].str_value)); - match_expr->matching_text_ = std::string((yyvsp[-1].str_value)); - free((yyvsp[-3].str_value)); - free((yyvsp[-1].str_value)); - (yyval.expr_t) = match_expr; - } + { + infinity::MatchExpr* match_expr = new infinity::MatchExpr(); + match_expr->fields_ = std::string((yyvsp[-3].str_value)); + match_expr->matching_text_ = std::string((yyvsp[-1].str_value)); + free((yyvsp[-3].str_value)); + free((yyvsp[-1].str_value)); + (yyval.expr_t) = match_expr; +} #line 2166 "expression_parser.cpp" - break; + break; - case 20: /* match_expr: MATCH '(' STRING ',' STRING ',' STRING ')' */ + case 20: /* match_expr: MATCH '(' STRING ',' STRING ',' STRING ')' */ #line 223 "expression_parser.y" - { - infinity::MatchExpr *match_expr = new infinity::MatchExpr(); - match_expr->fields_ = std::string((yyvsp[-5].str_value)); - match_expr->matching_text_ = std::string((yyvsp[-3].str_value)); - match_expr->options_text_ = std::string((yyvsp[-1].str_value)); - free((yyvsp[-5].str_value)); - free((yyvsp[-3].str_value)); - free((yyvsp[-1].str_value)); - (yyval.expr_t) = match_expr; - } + { + infinity::MatchExpr* match_expr = new infinity::MatchExpr(); + match_expr->fields_ = std::string((yyvsp[-5].str_value)); + match_expr->matching_text_ = std::string((yyvsp[-3].str_value)); + match_expr->options_text_ = std::string((yyvsp[-1].str_value)); + free((yyvsp[-5].str_value)); + free((yyvsp[-3].str_value)); + free((yyvsp[-1].str_value)); + (yyval.expr_t) = match_expr; +} #line 2181 "expression_parser.cpp" - break; + break; - case 21: /* query_expr: QUERY '(' STRING ')' */ + case 21: /* query_expr: QUERY '(' STRING ')' */ #line 234 "expression_parser.y" - { - infinity::MatchExpr *match_expr = new infinity::MatchExpr(); - match_expr->matching_text_ = std::string((yyvsp[-1].str_value)); - free((yyvsp[-1].str_value)); - (yyval.expr_t) = match_expr; - } + { + infinity::MatchExpr* match_expr = new infinity::MatchExpr(); + match_expr->matching_text_ = std::string((yyvsp[-1].str_value)); + free((yyvsp[-1].str_value)); + (yyval.expr_t) = match_expr; +} #line 2192 "expression_parser.cpp" - break; + break; - case 22: /* query_expr: QUERY '(' STRING ',' STRING ')' */ + case 22: /* query_expr: QUERY '(' STRING ',' STRING ')' */ #line 240 "expression_parser.y" - { - infinity::MatchExpr *match_expr = new infinity::MatchExpr(); - match_expr->matching_text_ = std::string((yyvsp[-3].str_value)); - match_expr->options_text_ = std::string((yyvsp[-1].str_value)); - free((yyvsp[-3].str_value)); - free((yyvsp[-1].str_value)); - (yyval.expr_t) = match_expr; - } + { + infinity::MatchExpr* match_expr = new infinity::MatchExpr(); + match_expr->matching_text_ = std::string((yyvsp[-3].str_value)); + match_expr->options_text_ = std::string((yyvsp[-1].str_value)); + free((yyvsp[-3].str_value)); + free((yyvsp[-1].str_value)); + (yyval.expr_t) = match_expr; +} #line 2205 "expression_parser.cpp" - break; + break; - case 23: /* fusion_expr: FUSION '(' STRING ')' */ + case 23: /* fusion_expr: FUSION '(' STRING ')' */ #line 249 "expression_parser.y" - { - infinity::FusionExpr *fusion_expr = new infinity::FusionExpr(); - fusion_expr->method_ = std::string((yyvsp[-1].str_value)); - free((yyvsp[-1].str_value)); - (yyval.expr_t) = fusion_expr; - } + { + infinity::FusionExpr* fusion_expr = new infinity::FusionExpr(); + fusion_expr->method_ = std::string((yyvsp[-1].str_value)); + free((yyvsp[-1].str_value)); + (yyval.expr_t) = fusion_expr; +} #line 2216 "expression_parser.cpp" - break; + break; - case 24: /* fusion_expr: FUSION '(' STRING ',' STRING ')' */ + case 24: /* fusion_expr: FUSION '(' STRING ',' STRING ')' */ #line 255 "expression_parser.y" - { - infinity::FusionExpr *fusion_expr = new infinity::FusionExpr(); - fusion_expr->method_ = std::string((yyvsp[-3].str_value)); - free((yyvsp[-3].str_value)); - fusion_expr->SetOptions((yyvsp[-1].str_value)); - free((yyvsp[-1].str_value)); - (yyval.expr_t) = fusion_expr; - } + { + infinity::FusionExpr* fusion_expr = new infinity::FusionExpr(); + fusion_expr->method_ = std::string((yyvsp[-3].str_value)); + free((yyvsp[-3].str_value)); + fusion_expr->SetOptions((yyvsp[-1].str_value)); + free((yyvsp[-1].str_value)); + (yyval.expr_t) = fusion_expr; +} #line 2229 "expression_parser.cpp" - break; + break; - case 25: /* function_expr: IDENTIFIER '(' ')' */ + case 25: /* function_expr: IDENTIFIER '(' ')' */ #line 264 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - ParserHelper::ToLower((yyvsp[-2].str_value)); - func_expr->func_name_ = (yyvsp[-2].str_value); - free((yyvsp[-2].str_value)); - func_expr->arguments_ = nullptr; - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + ParserHelper::ToLower((yyvsp[-2].str_value)); + func_expr->func_name_ = (yyvsp[-2].str_value); + free((yyvsp[-2].str_value)); + func_expr->arguments_ = nullptr; + (yyval.expr_t) = func_expr; +} #line 2242 "expression_parser.cpp" - break; + break; - case 26: /* function_expr: IDENTIFIER '(' expr_array ')' */ + case 26: /* function_expr: IDENTIFIER '(' expr_array ')' */ #line 272 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - ParserHelper::ToLower((yyvsp[-3].str_value)); - func_expr->func_name_ = (yyvsp[-3].str_value); - free((yyvsp[-3].str_value)); - func_expr->arguments_ = (yyvsp[-1].expr_array_t); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + ParserHelper::ToLower((yyvsp[-3].str_value)); + func_expr->func_name_ = (yyvsp[-3].str_value); + free((yyvsp[-3].str_value)); + func_expr->arguments_ = (yyvsp[-1].expr_array_t); + (yyval.expr_t) = func_expr; +} #line 2255 "expression_parser.cpp" - break; + break; - case 27: /* function_expr: IDENTIFIER '(' DISTINCT expr_array ')' */ + case 27: /* function_expr: IDENTIFIER '(' DISTINCT expr_array ')' */ #line 280 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - ParserHelper::ToLower((yyvsp[-4].str_value)); - func_expr->func_name_ = (yyvsp[-4].str_value); - free((yyvsp[-4].str_value)); - func_expr->arguments_ = (yyvsp[-1].expr_array_t); - func_expr->distinct_ = true; - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + ParserHelper::ToLower((yyvsp[-4].str_value)); + func_expr->func_name_ = (yyvsp[-4].str_value); + free((yyvsp[-4].str_value)); + func_expr->arguments_ = (yyvsp[-1].expr_array_t); + func_expr->distinct_ = true; + (yyval.expr_t) = func_expr; +} #line 2269 "expression_parser.cpp" - break; + break; - case 28: /* function_expr: operand IS NOT NULLABLE */ + case 28: /* function_expr: operand IS NOT NULLABLE */ #line 289 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "is_not_null"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-3].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "is_not_null"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-3].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2281 "expression_parser.cpp" - break; + break; - case 29: /* function_expr: operand IS NULLABLE */ + case 29: /* function_expr: operand IS NULLABLE */ #line 296 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "is_null"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "is_null"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2293 "expression_parser.cpp" - break; + break; - case 30: /* function_expr: NOT operand */ + case 30: /* function_expr: NOT operand */ #line 303 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "not"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "not"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2305 "expression_parser.cpp" - break; + break; - case 31: /* function_expr: '-' operand */ + case 31: /* function_expr: '-' operand */ #line 310 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "-"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "-"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2317 "expression_parser.cpp" - break; + break; - case 32: /* function_expr: '+' operand */ + case 32: /* function_expr: '+' operand */ #line 317 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "+"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "+"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2329 "expression_parser.cpp" - break; + break; - case 33: /* function_expr: operand '-' operand */ + case 33: /* function_expr: operand '-' operand */ #line 324 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "-"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "-"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2342 "expression_parser.cpp" - break; + break; - case 34: /* function_expr: operand '+' operand */ + case 34: /* function_expr: operand '+' operand */ #line 332 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "+"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "+"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2355 "expression_parser.cpp" - break; + break; - case 35: /* function_expr: operand '*' operand */ + case 35: /* function_expr: operand '*' operand */ #line 340 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "*"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "*"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2368 "expression_parser.cpp" - break; + break; - case 36: /* function_expr: operand '/' operand */ + case 36: /* function_expr: operand '/' operand */ #line 348 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "/"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "/"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2381 "expression_parser.cpp" - break; + break; - case 37: /* function_expr: operand '%' operand */ + case 37: /* function_expr: operand '%' operand */ #line 356 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "%"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "%"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2394 "expression_parser.cpp" - break; + break; - case 38: /* function_expr: operand '=' operand */ + case 38: /* function_expr: operand '=' operand */ #line 364 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "="; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "="; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2407 "expression_parser.cpp" - break; + break; - case 39: /* function_expr: operand EQUAL operand */ + case 39: /* function_expr: operand EQUAL operand */ #line 372 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "="; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "="; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2420 "expression_parser.cpp" - break; + break; - case 40: /* function_expr: operand NOT_EQ operand */ + case 40: /* function_expr: operand NOT_EQ operand */ #line 380 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "<>"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "<>"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2433 "expression_parser.cpp" - break; + break; - case 41: /* function_expr: operand '<' operand */ + case 41: /* function_expr: operand '<' operand */ #line 388 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "<"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "<"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2446 "expression_parser.cpp" - break; + break; - case 42: /* function_expr: operand '>' operand */ + case 42: /* function_expr: operand '>' operand */ #line 396 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = ">"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = ">"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2459 "expression_parser.cpp" - break; + break; - case 43: /* function_expr: operand LESS_EQ operand */ + case 43: /* function_expr: operand LESS_EQ operand */ #line 404 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "<="; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "<="; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2472 "expression_parser.cpp" - break; + break; - case 44: /* function_expr: operand GREATER_EQ operand */ + case 44: /* function_expr: operand GREATER_EQ operand */ #line 412 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = ">="; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = ">="; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2485 "expression_parser.cpp" - break; + break; - case 45: /* function_expr: EXTRACT '(' STRING FROM operand ')' */ + case 45: /* function_expr: EXTRACT '(' STRING FROM operand ')' */ #line 420 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - ParserHelper::ToLower((yyvsp[-3].str_value)); - if (strcmp((yyvsp[-3].str_value), "year") == 0) { - func_expr->func_name_ = "extract_year"; - func_expr->arguments_ = new std::vector(); - } else if (strcmp((yyvsp[-3].str_value), "month") == 0) { - func_expr->func_name_ = "extract_month"; - func_expr->arguments_ = new std::vector(); - } else if (strcmp((yyvsp[-3].str_value), "day") == 0) { - func_expr->func_name_ = "extract_day"; - func_expr->arguments_ = new std::vector(); - } else if (strcmp((yyvsp[-3].str_value), "hour") == 0) { - func_expr->func_name_ = "extract_hour"; - func_expr->arguments_ = new std::vector(); - } else if (strcmp((yyvsp[-3].str_value), "minute") == 0) { - func_expr->func_name_ = "extract_minute"; - func_expr->arguments_ = new std::vector(); - } else if (strcmp((yyvsp[-3].str_value), "second") == 0) { - func_expr->func_name_ = "extract_second"; - func_expr->arguments_ = new std::vector(); - } else { - delete func_expr; - expressionerror(&yyloc, scanner, result, "Invalid column expression format"); - YYERROR; - } - free((yyvsp[-3].str_value)); - func_expr->arguments_->emplace_back((yyvsp[-1].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + ParserHelper::ToLower((yyvsp[-3].str_value)); + if(strcmp((yyvsp[-3].str_value), "year") == 0) { + func_expr->func_name_ = "extract_year"; + func_expr->arguments_ = new std::vector(); + } else if(strcmp((yyvsp[-3].str_value), "month") == 0) { + func_expr->func_name_ = "extract_month"; + func_expr->arguments_ = new std::vector(); + } else if(strcmp((yyvsp[-3].str_value), "day") == 0) { + func_expr->func_name_ = "extract_day"; + func_expr->arguments_ = new std::vector(); + } else if(strcmp((yyvsp[-3].str_value), "hour") == 0) { + func_expr->func_name_ = "extract_hour"; + func_expr->arguments_ = new std::vector(); + } else if(strcmp((yyvsp[-3].str_value), "minute") == 0) { + func_expr->func_name_ = "extract_minute"; + func_expr->arguments_ = new std::vector(); + } else if(strcmp((yyvsp[-3].str_value), "second") == 0) { + func_expr->func_name_ = "extract_second"; + func_expr->arguments_ = new std::vector(); + } else { + delete func_expr; + expressionerror(&yyloc, scanner, result, "Invalid column expression format"); + YYERROR; + } + free((yyvsp[-3].str_value)); + func_expr->arguments_->emplace_back((yyvsp[-1].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2520 "expression_parser.cpp" - break; + break; - case 46: /* function_expr: operand LIKE operand */ + case 46: /* function_expr: operand LIKE operand */ #line 450 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "like"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "like"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2533 "expression_parser.cpp" - break; + break; - case 47: /* function_expr: operand NOT LIKE operand */ + case 47: /* function_expr: operand NOT LIKE operand */ #line 458 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "not_like"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-3].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "not_like"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-3].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2546 "expression_parser.cpp" - break; + break; - case 48: /* conjunction_expr: expr AND expr */ + case 48: /* conjunction_expr: expr AND expr */ #line 467 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "and"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "and"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2559 "expression_parser.cpp" - break; + break; - case 49: /* conjunction_expr: expr OR expr */ + case 49: /* conjunction_expr: expr OR expr */ #line 475 "expression_parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "or"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "or"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} #line 2572 "expression_parser.cpp" - break; + break; - case 50: /* between_expr: operand BETWEEN operand AND operand */ + case 50: /* between_expr: operand BETWEEN operand AND operand */ #line 484 "expression_parser.y" - { - infinity::BetweenExpr *between_expr = new infinity::BetweenExpr(); - between_expr->value_ = (yyvsp[-4].expr_t); - between_expr->lower_bound_ = (yyvsp[-2].expr_t); - between_expr->upper_bound_ = (yyvsp[0].expr_t); - (yyval.expr_t) = between_expr; - } + { + infinity::BetweenExpr* between_expr = new infinity::BetweenExpr(); + between_expr->value_ = (yyvsp[-4].expr_t); + between_expr->lower_bound_ = (yyvsp[-2].expr_t); + between_expr->upper_bound_ = (yyvsp[0].expr_t); + (yyval.expr_t) = between_expr; +} #line 2584 "expression_parser.cpp" - break; + break; - case 51: /* in_expr: operand IN '(' expr_array ')' */ + case 51: /* in_expr: operand IN '(' expr_array ')' */ #line 492 "expression_parser.y" - { - infinity::InExpr *in_expr = new infinity::InExpr(true); - in_expr->left_ = (yyvsp[-4].expr_t); - in_expr->arguments_ = (yyvsp[-1].expr_array_t); - (yyval.expr_t) = in_expr; - } + { + infinity::InExpr* in_expr = new infinity::InExpr(true); + in_expr->left_ = (yyvsp[-4].expr_t); + in_expr->arguments_ = (yyvsp[-1].expr_array_t); + (yyval.expr_t) = in_expr; +} #line 2595 "expression_parser.cpp" - break; + break; - case 52: /* in_expr: operand NOT IN '(' expr_array ')' */ + case 52: /* in_expr: operand NOT IN '(' expr_array ')' */ #line 498 "expression_parser.y" - { - infinity::InExpr *in_expr = new infinity::InExpr(false); - in_expr->left_ = (yyvsp[-5].expr_t); - in_expr->arguments_ = (yyvsp[-1].expr_array_t); - (yyval.expr_t) = in_expr; - } + { + infinity::InExpr* in_expr = new infinity::InExpr(false); + in_expr->left_ = (yyvsp[-5].expr_t); + in_expr->arguments_ = (yyvsp[-1].expr_array_t); + (yyval.expr_t) = in_expr; +} #line 2606 "expression_parser.cpp" - break; + break; - case 53: /* column_type: BOOLEAN */ + case 53: /* column_type: BOOLEAN */ #line 506 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kBoolean, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kBoolean, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2612 "expression_parser.cpp" - break; + break; - case 54: /* column_type: TINYINT */ + case 54: /* column_type: TINYINT */ #line 507 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTinyInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTinyInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2618 "expression_parser.cpp" - break; + break; - case 55: /* column_type: SMALLINT */ + case 55: /* column_type: SMALLINT */ #line 508 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSmallInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSmallInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2624 "expression_parser.cpp" - break; + break; - case 56: /* column_type: INTEGER */ + case 56: /* column_type: INTEGER */ #line 509 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kInteger, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kInteger, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2630 "expression_parser.cpp" - break; + break; - case 57: /* column_type: INT */ + case 57: /* column_type: INT */ #line 510 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kInteger, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kInteger, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2636 "expression_parser.cpp" - break; + break; - case 58: /* column_type: BIGINT */ + case 58: /* column_type: BIGINT */ #line 511 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kBigInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kBigInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2642 "expression_parser.cpp" - break; + break; - case 59: /* column_type: HUGEINT */ + case 59: /* column_type: HUGEINT */ #line 512 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kHugeInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kHugeInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2648 "expression_parser.cpp" - break; + break; - case 60: /* column_type: FLOAT */ + case 60: /* column_type: FLOAT */ #line 513 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kFloat, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kFloat, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2654 "expression_parser.cpp" - break; + break; - case 61: /* column_type: REAL */ + case 61: /* column_type: REAL */ #line 514 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kFloat, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kFloat, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2660 "expression_parser.cpp" - break; + break; - case 62: /* column_type: DOUBLE */ + case 62: /* column_type: DOUBLE */ #line 515 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDouble, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDouble, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2666 "expression_parser.cpp" - break; + break; - case 63: /* column_type: DATE */ + case 63: /* column_type: DATE */ #line 516 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDate, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDate, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2672 "expression_parser.cpp" - break; + break; - case 64: /* column_type: TIME */ + case 64: /* column_type: TIME */ #line 517 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTime, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTime, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2678 "expression_parser.cpp" - break; + break; - case 65: /* column_type: DATETIME */ + case 65: /* column_type: DATETIME */ #line 518 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDateTime, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDateTime, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2684 "expression_parser.cpp" - break; + break; - case 66: /* column_type: TIMESTAMP */ + case 66: /* column_type: TIMESTAMP */ #line 519 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTimestamp, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTimestamp, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2690 "expression_parser.cpp" - break; + break; - case 67: /* column_type: UUID */ + case 67: /* column_type: UUID */ #line 520 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kUuid, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kUuid, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2696 "expression_parser.cpp" - break; + break; - case 68: /* column_type: POINT */ + case 68: /* column_type: POINT */ #line 521 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kPoint, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kPoint, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2702 "expression_parser.cpp" - break; + break; - case 69: /* column_type: LINE */ + case 69: /* column_type: LINE */ #line 522 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kLine, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kLine, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2708 "expression_parser.cpp" - break; + break; - case 70: /* column_type: LSEG */ + case 70: /* column_type: LSEG */ #line 523 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kLineSeg, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kLineSeg, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2714 "expression_parser.cpp" - break; + break; - case 71: /* column_type: BOX */ + case 71: /* column_type: BOX */ #line 524 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kBox, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kBox, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2720 "expression_parser.cpp" - break; + break; - case 72: /* column_type: CIRCLE */ + case 72: /* column_type: CIRCLE */ #line 527 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kCircle, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kCircle, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2726 "expression_parser.cpp" - break; + break; - case 73: /* column_type: VARCHAR */ + case 73: /* column_type: VARCHAR */ #line 529 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kVarchar, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kVarchar, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2732 "expression_parser.cpp" - break; + break; - case 74: /* column_type: DECIMAL '(' LONG_VALUE ',' LONG_VALUE ')' */ + case 74: /* column_type: DECIMAL '(' LONG_VALUE ',' LONG_VALUE ')' */ #line 530 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDecimal, - 0, - (yyvsp[-3].long_value), - (yyvsp[-1].long_value), - infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDecimal, 0, (yyvsp[-3].long_value), (yyvsp[-1].long_value), infinity::EmbeddingDataType::kElemInvalid}; } #line 2738 "expression_parser.cpp" - break; + break; - case 75: /* column_type: DECIMAL '(' LONG_VALUE ')' */ + case 75: /* column_type: DECIMAL '(' LONG_VALUE ')' */ #line 531 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kDecimal, 0, (yyvsp[-1].long_value), 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDecimal, 0, (yyvsp[-1].long_value), 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2744 "expression_parser.cpp" - break; + break; - case 76: /* column_type: DECIMAL */ + case 76: /* column_type: DECIMAL */ #line 532 "expression_parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDecimal, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDecimal, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } #line 2750 "expression_parser.cpp" - break; + break; - case 77: /* column_type: EMBEDDING '(' BIT ',' LONG_VALUE ')' */ + case 77: /* column_type: EMBEDDING '(' BIT ',' LONG_VALUE ')' */ #line 535 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; } #line 2756 "expression_parser.cpp" - break; + break; - case 78: /* column_type: EMBEDDING '(' TINYINT ',' LONG_VALUE ')' */ + case 78: /* column_type: EMBEDDING '(' TINYINT ',' LONG_VALUE ')' */ #line 536 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; } #line 2762 "expression_parser.cpp" - break; + break; - case 79: /* column_type: EMBEDDING '(' SMALLINT ',' LONG_VALUE ')' */ + case 79: /* column_type: EMBEDDING '(' SMALLINT ',' LONG_VALUE ')' */ #line 537 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; } #line 2768 "expression_parser.cpp" - break; + break; - case 80: /* column_type: EMBEDDING '(' INTEGER ',' LONG_VALUE ')' */ + case 80: /* column_type: EMBEDDING '(' INTEGER ',' LONG_VALUE ')' */ #line 538 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } #line 2774 "expression_parser.cpp" - break; + break; - case 81: /* column_type: EMBEDDING '(' INT ',' LONG_VALUE ')' */ + case 81: /* column_type: EMBEDDING '(' INT ',' LONG_VALUE ')' */ #line 539 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } #line 2780 "expression_parser.cpp" - break; + break; - case 82: /* column_type: EMBEDDING '(' BIGINT ',' LONG_VALUE ')' */ + case 82: /* column_type: EMBEDDING '(' BIGINT ',' LONG_VALUE ')' */ #line 540 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; } #line 2786 "expression_parser.cpp" - break; + break; - case 83: /* column_type: EMBEDDING '(' FLOAT ',' LONG_VALUE ')' */ + case 83: /* column_type: EMBEDDING '(' FLOAT ',' LONG_VALUE ')' */ #line 541 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; } #line 2792 "expression_parser.cpp" - break; + break; - case 84: /* column_type: EMBEDDING '(' DOUBLE ',' LONG_VALUE ')' */ + case 84: /* column_type: EMBEDDING '(' DOUBLE ',' LONG_VALUE ')' */ #line 542 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; } #line 2798 "expression_parser.cpp" - break; + break; - case 85: /* column_type: VECTOR '(' BIT ',' LONG_VALUE ')' */ + case 85: /* column_type: VECTOR '(' BIT ',' LONG_VALUE ')' */ #line 543 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; } #line 2804 "expression_parser.cpp" - break; + break; - case 86: /* column_type: VECTOR '(' TINYINT ',' LONG_VALUE ')' */ + case 86: /* column_type: VECTOR '(' TINYINT ',' LONG_VALUE ')' */ #line 544 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; } #line 2810 "expression_parser.cpp" - break; + break; - case 87: /* column_type: VECTOR '(' SMALLINT ',' LONG_VALUE ')' */ + case 87: /* column_type: VECTOR '(' SMALLINT ',' LONG_VALUE ')' */ #line 545 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; } #line 2816 "expression_parser.cpp" - break; + break; - case 88: /* column_type: VECTOR '(' INTEGER ',' LONG_VALUE ')' */ + case 88: /* column_type: VECTOR '(' INTEGER ',' LONG_VALUE ')' */ #line 546 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } #line 2822 "expression_parser.cpp" - break; + break; - case 89: /* column_type: VECTOR '(' INT ',' LONG_VALUE ')' */ + case 89: /* column_type: VECTOR '(' INT ',' LONG_VALUE ')' */ #line 547 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } #line 2828 "expression_parser.cpp" - break; + break; - case 90: /* column_type: VECTOR '(' BIGINT ',' LONG_VALUE ')' */ + case 90: /* column_type: VECTOR '(' BIGINT ',' LONG_VALUE ')' */ #line 548 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; } #line 2834 "expression_parser.cpp" - break; + break; - case 91: /* column_type: VECTOR '(' FLOAT ',' LONG_VALUE ')' */ + case 91: /* column_type: VECTOR '(' FLOAT ',' LONG_VALUE ')' */ #line 549 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; } #line 2840 "expression_parser.cpp" - break; + break; - case 92: /* column_type: VECTOR '(' DOUBLE ',' LONG_VALUE ')' */ + case 92: /* column_type: VECTOR '(' DOUBLE ',' LONG_VALUE ')' */ #line 550 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; } #line 2846 "expression_parser.cpp" - break; + break; - case 93: /* column_type: SPARSE '(' BIT ',' LONG_VALUE ')' */ + case 93: /* column_type: SPARSE '(' BIT ',' LONG_VALUE ')' */ #line 551 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; } #line 2852 "expression_parser.cpp" - break; + break; - case 94: /* column_type: SPARSE '(' TINYINT ',' LONG_VALUE ')' */ + case 94: /* column_type: SPARSE '(' TINYINT ',' LONG_VALUE ')' */ #line 552 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; } #line 2858 "expression_parser.cpp" - break; + break; - case 95: /* column_type: SPARSE '(' SMALLINT ',' LONG_VALUE ')' */ + case 95: /* column_type: SPARSE '(' SMALLINT ',' LONG_VALUE ')' */ #line 553 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; } #line 2864 "expression_parser.cpp" - break; + break; - case 96: /* column_type: SPARSE '(' INTEGER ',' LONG_VALUE ')' */ + case 96: /* column_type: SPARSE '(' INTEGER ',' LONG_VALUE ')' */ #line 554 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } #line 2870 "expression_parser.cpp" - break; + break; - case 97: /* column_type: SPARSE '(' INT ',' LONG_VALUE ')' */ + case 97: /* column_type: SPARSE '(' INT ',' LONG_VALUE ')' */ #line 555 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } #line 2876 "expression_parser.cpp" - break; + break; - case 98: /* column_type: SPARSE '(' BIGINT ',' LONG_VALUE ')' */ + case 98: /* column_type: SPARSE '(' BIGINT ',' LONG_VALUE ')' */ #line 556 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; } #line 2882 "expression_parser.cpp" - break; + break; - case 99: /* column_type: SPARSE '(' FLOAT ',' LONG_VALUE ')' */ + case 99: /* column_type: SPARSE '(' FLOAT ',' LONG_VALUE ')' */ #line 557 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; } #line 2888 "expression_parser.cpp" - break; + break; - case 100: /* column_type: SPARSE '(' DOUBLE ',' LONG_VALUE ')' */ + case 100: /* column_type: SPARSE '(' DOUBLE ',' LONG_VALUE ')' */ #line 558 "expression_parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; - } + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; } #line 2894 "expression_parser.cpp" - break; + break; - case 101: /* cast_expr: CAST '(' expr AS column_type ')' */ + case 101: /* cast_expr: CAST '(' expr AS column_type ')' */ #line 560 "expression_parser.y" - { - std::shared_ptr type_info_ptr{nullptr}; - switch ((yyvsp[-1].column_type_t).logical_type_) { - case infinity::LogicalType::kDecimal: { - type_info_ptr = infinity::DecimalInfo::Make((yyvsp[-1].column_type_t).precision, (yyvsp[-1].column_type_t).scale); - break; - } - // case infinity::LogicalType::kBitmap: { - // type_info_ptr = infinity::BitmapInfo::Make($5.width); - // break; - // } - case infinity::LogicalType::kEmbedding: { - type_info_ptr = infinity::EmbeddingInfo::Make((yyvsp[-1].column_type_t).embedding_type_, (yyvsp[-1].column_type_t).width); - break; - } - default: { - break; - } - } - infinity::CastExpr *cast_expr = new infinity::CastExpr((yyvsp[-1].column_type_t).logical_type_, type_info_ptr); - cast_expr->expr_ = (yyvsp[-3].expr_t); - (yyval.expr_t) = cast_expr; + { + std::shared_ptr type_info_ptr{nullptr}; + switch((yyvsp[-1].column_type_t).logical_type_) { + case infinity::LogicalType::kDecimal: { + type_info_ptr = infinity::DecimalInfo::Make((yyvsp[-1].column_type_t).precision, (yyvsp[-1].column_type_t).scale); + break; } +// case infinity::LogicalType::kBitmap: { +// type_info_ptr = infinity::BitmapInfo::Make($5.width); +// break; +// } + case infinity::LogicalType::kEmbedding: { + type_info_ptr = infinity::EmbeddingInfo::Make((yyvsp[-1].column_type_t).embedding_type_, (yyvsp[-1].column_type_t).width); + break; + } + default: { + break; + } + } + infinity::CastExpr* cast_expr = new infinity::CastExpr((yyvsp[-1].column_type_t).logical_type_, type_info_ptr); + cast_expr->expr_ = (yyvsp[-3].expr_t); + (yyval.expr_t) = cast_expr; +} #line 2922 "expression_parser.cpp" - break; + break; - case 102: /* column_expr: IDENTIFIER */ + case 102: /* column_expr: IDENTIFIER */ #line 584 "expression_parser.y" - { - infinity::ColumnExpr *column_expr = new infinity::ColumnExpr(); - ParserHelper::ToLower((yyvsp[0].str_value)); - column_expr->names_.emplace_back((yyvsp[0].str_value)); - free((yyvsp[0].str_value)); - (yyval.expr_t) = column_expr; - } + { + infinity::ColumnExpr* column_expr = new infinity::ColumnExpr(); + ParserHelper::ToLower((yyvsp[0].str_value)); + column_expr->names_.emplace_back((yyvsp[0].str_value)); + free((yyvsp[0].str_value)); + (yyval.expr_t) = column_expr; +} #line 2934 "expression_parser.cpp" - break; + break; - case 103: /* column_expr: column_expr '.' IDENTIFIER */ + case 103: /* column_expr: column_expr '.' IDENTIFIER */ #line 591 "expression_parser.y" - { - infinity::ColumnExpr *column_expr = (infinity::ColumnExpr *)(yyvsp[-2].expr_t); - ParserHelper::ToLower((yyvsp[0].str_value)); - column_expr->names_.emplace_back((yyvsp[0].str_value)); - free((yyvsp[0].str_value)); - (yyval.expr_t) = column_expr; - } + { + infinity::ColumnExpr* column_expr = (infinity::ColumnExpr*)(yyvsp[-2].expr_t); + ParserHelper::ToLower((yyvsp[0].str_value)); + column_expr->names_.emplace_back((yyvsp[0].str_value)); + free((yyvsp[0].str_value)); + (yyval.expr_t) = column_expr; +} #line 2946 "expression_parser.cpp" - break; + break; - case 104: /* column_expr: '*' */ + case 104: /* column_expr: '*' */ #line 598 "expression_parser.y" - { - infinity::ColumnExpr *column_expr = new infinity::ColumnExpr(); - column_expr->star_ = true; - (yyval.expr_t) = column_expr; - } + { + infinity::ColumnExpr* column_expr = new infinity::ColumnExpr(); + column_expr->star_ = true; + (yyval.expr_t) = column_expr; +} #line 2956 "expression_parser.cpp" - break; + break; - case 105: /* column_expr: column_expr '.' '*' */ + case 105: /* column_expr: column_expr '.' '*' */ #line 603 "expression_parser.y" - { - infinity::ColumnExpr *column_expr = (infinity::ColumnExpr *)(yyvsp[-2].expr_t); - if (column_expr->star_) { - expressionerror(&yyloc, scanner, result, "Invalid column expression format"); - YYERROR; - } - column_expr->star_ = true; - (yyval.expr_t) = column_expr; - } + { + infinity::ColumnExpr* column_expr = (infinity::ColumnExpr*)(yyvsp[-2].expr_t); + if(column_expr->star_) { + expressionerror(&yyloc, scanner, result, "Invalid column expression format"); + YYERROR; + } + column_expr->star_ = true; + (yyval.expr_t) = column_expr; +} #line 2970 "expression_parser.cpp" - break; + break; - case 106: /* constant_expr: STRING */ + case 106: /* constant_expr: STRING */ #line 613 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kString); - const_expr->str_value_ = (yyvsp[0].str_value); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kString); + const_expr->str_value_ = (yyvsp[0].str_value); + (yyval.const_expr_t) = const_expr; +} #line 2980 "expression_parser.cpp" - break; + break; - case 107: /* constant_expr: TRUE */ + case 107: /* constant_expr: TRUE */ #line 618 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kBoolean); - const_expr->bool_value_ = true; - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kBoolean); + const_expr->bool_value_ = true; + (yyval.const_expr_t) = const_expr; +} #line 2990 "expression_parser.cpp" - break; + break; - case 108: /* constant_expr: FALSE */ + case 108: /* constant_expr: FALSE */ #line 623 "expression_parser.y" { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kBoolean); - const_expr->bool_value_ = false; - (yyval.const_expr_t) = const_expr; - } + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kBoolean); + const_expr->bool_value_ = false; + (yyval.const_expr_t) = const_expr; +} #line 3000 "expression_parser.cpp" - break; + break; - case 109: /* constant_expr: DOUBLE_VALUE */ + case 109: /* constant_expr: DOUBLE_VALUE */ #line 628 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDouble); - const_expr->double_value_ = (yyvsp[0].double_value); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDouble); + const_expr->double_value_ = (yyvsp[0].double_value); + (yyval.const_expr_t) = const_expr; +} #line 3010 "expression_parser.cpp" - break; + break; - case 110: /* constant_expr: LONG_VALUE */ + case 110: /* constant_expr: LONG_VALUE */ #line 633 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInteger); - const_expr->integer_value_ = (yyvsp[0].long_value); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInteger); + const_expr->integer_value_ = (yyvsp[0].long_value); + (yyval.const_expr_t) = const_expr; +} #line 3020 "expression_parser.cpp" - break; + break; - case 111: /* constant_expr: DATE STRING */ + case 111: /* constant_expr: DATE STRING */ #line 638 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDate); - const_expr->date_value_ = (yyvsp[0].str_value); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDate); + const_expr->date_value_ = (yyvsp[0].str_value); + (yyval.const_expr_t) = const_expr; +} #line 3030 "expression_parser.cpp" - break; + break; - case 112: /* constant_expr: TIME STRING */ + case 112: /* constant_expr: TIME STRING */ #line 643 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kTime); - const_expr->date_value_ = (yyvsp[0].str_value); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kTime); + const_expr->date_value_ = (yyvsp[0].str_value); + (yyval.const_expr_t) = const_expr; +} #line 3040 "expression_parser.cpp" - break; + break; - case 113: /* constant_expr: DATETIME STRING */ + case 113: /* constant_expr: DATETIME STRING */ #line 648 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDateTime); - const_expr->date_value_ = (yyvsp[0].str_value); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDateTime); + const_expr->date_value_ = (yyvsp[0].str_value); + (yyval.const_expr_t) = const_expr; +} #line 3050 "expression_parser.cpp" - break; + break; - case 114: /* constant_expr: TIMESTAMP STRING */ + case 114: /* constant_expr: TIMESTAMP STRING */ #line 653 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kTimestamp); - const_expr->date_value_ = (yyvsp[0].str_value); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kTimestamp); + const_expr->date_value_ = (yyvsp[0].str_value); + (yyval.const_expr_t) = const_expr; +} #line 3060 "expression_parser.cpp" - break; + break; - case 115: /* constant_expr: INTERVAL interval_expr */ + case 115: /* constant_expr: INTERVAL interval_expr */ #line 658 "expression_parser.y" - { - (yyval.const_expr_t) = (yyvsp[0].const_expr_t); - } + { + (yyval.const_expr_t) = (yyvsp[0].const_expr_t); +} #line 3068 "expression_parser.cpp" - break; + break; - case 116: /* constant_expr: interval_expr */ + case 116: /* constant_expr: interval_expr */ #line 661 "expression_parser.y" - { - (yyval.const_expr_t) = (yyvsp[0].const_expr_t); - } + { + (yyval.const_expr_t) = (yyvsp[0].const_expr_t); +} #line 3076 "expression_parser.cpp" - break; + break; - case 117: /* constant_expr: long_array_expr */ + case 117: /* constant_expr: long_array_expr */ #line 664 "expression_parser.y" - { - (yyval.const_expr_t) = (yyvsp[0].const_expr_t); - } + { + (yyval.const_expr_t) = (yyvsp[0].const_expr_t); +} #line 3084 "expression_parser.cpp" - break; + break; - case 118: /* constant_expr: double_array_expr */ + case 118: /* constant_expr: double_array_expr */ #line 667 "expression_parser.y" - { - (yyval.const_expr_t) = (yyvsp[0].const_expr_t); - } + { + (yyval.const_expr_t) = (yyvsp[0].const_expr_t); +} #line 3092 "expression_parser.cpp" - break; + break; - case 119: /* long_array_expr: unclosed_long_array_expr ']' */ + case 119: /* long_array_expr: unclosed_long_array_expr ']' */ #line 671 "expression_parser.y" - { - (yyval.const_expr_t) = (yyvsp[-1].const_expr_t); - } + { + (yyval.const_expr_t) = (yyvsp[-1].const_expr_t); +} #line 3100 "expression_parser.cpp" - break; + break; - case 120: /* unclosed_long_array_expr: '[' LONG_VALUE */ + case 120: /* unclosed_long_array_expr: '[' LONG_VALUE */ #line 675 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kIntegerArray); - const_expr->long_array_.emplace_back((yyvsp[0].long_value)); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kIntegerArray); + const_expr->long_array_.emplace_back((yyvsp[0].long_value)); + (yyval.const_expr_t) = const_expr; +} #line 3110 "expression_parser.cpp" - break; + break; - case 121: /* unclosed_long_array_expr: unclosed_long_array_expr ',' LONG_VALUE */ + case 121: /* unclosed_long_array_expr: unclosed_long_array_expr ',' LONG_VALUE */ #line 680 "expression_parser.y" - { - (yyvsp[-2].const_expr_t)->long_array_.emplace_back((yyvsp[0].long_value)); - (yyval.const_expr_t) = (yyvsp[-2].const_expr_t); - } + { + (yyvsp[-2].const_expr_t)->long_array_.emplace_back((yyvsp[0].long_value)); + (yyval.const_expr_t) = (yyvsp[-2].const_expr_t); +} #line 3119 "expression_parser.cpp" - break; + break; - case 122: /* double_array_expr: unclosed_double_array_expr ']' */ + case 122: /* double_array_expr: unclosed_double_array_expr ']' */ #line 685 "expression_parser.y" - { - (yyval.const_expr_t) = (yyvsp[-1].const_expr_t); - } + { + (yyval.const_expr_t) = (yyvsp[-1].const_expr_t); +} #line 3127 "expression_parser.cpp" - break; + break; - case 123: /* unclosed_double_array_expr: '[' DOUBLE_VALUE */ + case 123: /* unclosed_double_array_expr: '[' DOUBLE_VALUE */ #line 689 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDoubleArray); - const_expr->double_array_.emplace_back((yyvsp[0].double_value)); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDoubleArray); + const_expr->double_array_.emplace_back((yyvsp[0].double_value)); + (yyval.const_expr_t) = const_expr; +} #line 3137 "expression_parser.cpp" - break; + break; - case 124: /* unclosed_double_array_expr: unclosed_double_array_expr ',' DOUBLE_VALUE */ + case 124: /* unclosed_double_array_expr: unclosed_double_array_expr ',' DOUBLE_VALUE */ #line 694 "expression_parser.y" - { - (yyvsp[-2].const_expr_t)->double_array_.emplace_back((yyvsp[0].double_value)); - (yyval.const_expr_t) = (yyvsp[-2].const_expr_t); - } + { + (yyvsp[-2].const_expr_t)->double_array_.emplace_back((yyvsp[0].double_value)); + (yyval.const_expr_t) = (yyvsp[-2].const_expr_t); +} #line 3146 "expression_parser.cpp" - break; + break; - case 125: /* interval_expr: LONG_VALUE SECONDS */ + case 125: /* interval_expr: LONG_VALUE SECONDS */ #line 699 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kSecond; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kSecond; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} #line 3157 "expression_parser.cpp" - break; + break; - case 126: /* interval_expr: LONG_VALUE SECOND */ + case 126: /* interval_expr: LONG_VALUE SECOND */ #line 705 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kSecond; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kSecond; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} #line 3168 "expression_parser.cpp" - break; + break; - case 127: /* interval_expr: LONG_VALUE MINUTES */ + case 127: /* interval_expr: LONG_VALUE MINUTES */ #line 711 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kMinute; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kMinute; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} #line 3179 "expression_parser.cpp" - break; + break; - case 128: /* interval_expr: LONG_VALUE MINUTE */ + case 128: /* interval_expr: LONG_VALUE MINUTE */ #line 717 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kMinute; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kMinute; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} #line 3190 "expression_parser.cpp" - break; + break; - case 129: /* interval_expr: LONG_VALUE HOURS */ + case 129: /* interval_expr: LONG_VALUE HOURS */ #line 723 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kHour; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kHour; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} #line 3201 "expression_parser.cpp" - break; + break; - case 130: /* interval_expr: LONG_VALUE HOUR */ + case 130: /* interval_expr: LONG_VALUE HOUR */ #line 729 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kHour; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kHour; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} #line 3212 "expression_parser.cpp" - break; + break; - case 131: /* interval_expr: LONG_VALUE DAYS */ + case 131: /* interval_expr: LONG_VALUE DAYS */ #line 735 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kDay; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kDay; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} #line 3223 "expression_parser.cpp" - break; + break; - case 132: /* interval_expr: LONG_VALUE DAY */ + case 132: /* interval_expr: LONG_VALUE DAY */ #line 741 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kDay; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kDay; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} #line 3234 "expression_parser.cpp" - break; + break; - case 133: /* interval_expr: LONG_VALUE MONTHS */ + case 133: /* interval_expr: LONG_VALUE MONTHS */ #line 747 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kMonth; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kMonth; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} #line 3245 "expression_parser.cpp" - break; + break; - case 134: /* interval_expr: LONG_VALUE MONTH */ + case 134: /* interval_expr: LONG_VALUE MONTH */ #line 753 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kMonth; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kMonth; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} #line 3256 "expression_parser.cpp" - break; + break; - case 135: /* interval_expr: LONG_VALUE YEARS */ + case 135: /* interval_expr: LONG_VALUE YEARS */ #line 759 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kYear; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kYear; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} #line 3267 "expression_parser.cpp" - break; + break; - case 136: /* interval_expr: LONG_VALUE YEAR */ + case 136: /* interval_expr: LONG_VALUE YEAR */ #line 765 "expression_parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kYear; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kYear; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} #line 3278 "expression_parser.cpp" - break; + break; + #line 3282 "expression_parser.cpp" - default: - break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT("-> $$ =", YY_CAST(yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); - - YYPOPSTACK(yylen); - yylen = 0; - - *++yyvsp = yyval; - *++yylsp = yyloc; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - { - const int yylhs = yyr1[yyn] - YYNTOKENS; - const int yyi = yypgoto[yylhs] + *yyssp; - yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp ? yytable[yyi] : yydefgoto[yylhs]); + default: break; } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + + *++yyvsp = yyval; + *++yylsp = yyloc; + + /* Now 'shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + { + const int yylhs = yyr1[yyn] - YYNTOKENS; + const int yyi = yypgoto[yylhs] + *yyssp; + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp + ? yytable[yyi] + : yydefgoto[yylhs]); + } + + goto yynewstate; - goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == EXPRESSIONEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE(yychar); - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) { - ++yynerrs; - { - yypcontext_t yyctx = {yyssp, yytoken, &yylloc}; - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = yysyntax_error(&yymsg_alloc, &yymsg, &yyctx); - if (yysyntax_error_status == 0) + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == EXPRESSIONEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; + { + yypcontext_t yyctx + = {yyssp, yytoken, &yylloc}; + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == -1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = YY_CAST (char *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); + if (yymsg) + { + yysyntax_error_status + = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); yymsgp = yymsg; - else if (yysyntax_error_status == -1) { - if (yymsg != yymsgbuf) - YYSTACK_FREE(yymsg); - yymsg = YY_CAST(char *, YYSTACK_ALLOC(YY_CAST(YYSIZE_T, yymsg_alloc))); - if (yymsg) { - yysyntax_error_status = yysyntax_error(&yymsg_alloc, &yymsg, &yyctx); - yymsgp = yymsg; - } else { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = YYENOMEM; - } - } - yyerror(&yylloc, scanner, result, yymsgp); - if (yysyntax_error_status == YYENOMEM) - YYNOMEM; - } + } + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = YYENOMEM; + } + } + yyerror (&yylloc, scanner, result, yymsgp); + if (yysyntax_error_status == YYENOMEM) + YYNOMEM; + } } - yyerror_range[1] = yylloc; - if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= EXPRESSIONEOF) { - /* Return failure if at end of input. */ - if (yychar == EXPRESSIONEOF) - YYABORT; - } else { - yydestruct("Error: discarding", yytoken, &yylval, &yylloc, scanner, result); - yychar = EXPRESSIONEMPTY; + yyerror_range[1] = yylloc; + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= EXPRESSIONEOF) + { + /* Return failure if at end of input. */ + if (yychar == EXPRESSIONEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval, &yylloc, scanner, result); + yychar = EXPRESSIONEMPTY; } } - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and the - label yyerrorlab therefore never appears in user code. */ - if (0) - YYERROR; - ++yynerrs; + /* Pacify compilers when the user code never invokes YYERROR and the + label yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR; + ++yynerrs; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK(yylen); - yylen = 0; - YY_STACK_PRINT(yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - /* Pop stack until we find a state that shifts the error token. */ - for (;;) { - yyn = yypact[yystate]; - if (!yypact_value_is_default(yyn)) { - yyn += YYSYMBOL_YYerror; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) { - yyn = yytable[yyn]; - if (0 < yyn) - break; + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + /* Pop stack until we find a state that shifts the error token. */ + for (;;) + { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; } } - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; - yyerror_range[1] = *yylsp; - yydestruct("Error: popping", YY_ACCESSING_SYMBOL(yystate), yyvsp, yylsp, scanner, result); - YYPOPSTACK(1); - yystate = *yyssp; - YY_STACK_PRINT(yyss, yyssp); + yyerror_range[1] = *yylsp; + yydestruct ("Error: popping", + YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, scanner, result); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); } - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END - yyerror_range[2] = yylloc; - ++yylsp; - YYLLOC_DEFAULT(*yylsp, yyerror_range, 2); + yyerror_range[2] = yylloc; + ++yylsp; + YYLLOC_DEFAULT (*yylsp, yyerror_range, 2); - /* Shift the error token. */ - YY_SYMBOL_PRINT("Shifting", YY_ACCESSING_SYMBOL(yyn), yyvsp, yylsp); + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; - yystate = yyn; - goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: - yyresult = 0; - goto yyreturnlab; + yyresult = 0; + goto yyreturnlab; + /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: - yyresult = 1; - goto yyreturnlab; + yyresult = 1; + goto yyreturnlab; + /*-----------------------------------------------------------. | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | `-----------------------------------------------------------*/ yyexhaustedlab: - yyerror(&yylloc, scanner, result, YY_("memory exhausted")); - yyresult = 2; - goto yyreturnlab; + yyerror (&yylloc, scanner, result, YY_("memory exhausted")); + yyresult = 2; + goto yyreturnlab; + /*----------------------------------------------------------. | yyreturnlab -- parsing is finished, clean up and return. | `----------------------------------------------------------*/ yyreturnlab: - if (yychar != EXPRESSIONEMPTY) { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE(yychar); - yydestruct("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc, scanner, result); + if (yychar != EXPRESSIONEMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, &yylloc, scanner, result); } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK(yylen); - YY_STACK_PRINT(yyss, yyssp); - while (yyssp != yyss) { - yydestruct("Cleanup: popping", YY_ACCESSING_SYMBOL(+*yyssp), yyvsp, yylsp, scanner, result); - YYPOPSTACK(1); + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, scanner, result); + YYPOPSTACK (1); } #ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE(yyss); + if (yyss != yyssa) + YYSTACK_FREE (yyss); #endif - if (yymsg != yymsgbuf) - YYSTACK_FREE(yymsg); - return yyresult; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + return yyresult; } #line 772 "expression_parser.y" -void expressionerror(YYLTYPE *llocp, void *lexer, infinity::ExpressionParserResult *result, const char *msg) { - if (result->IsError()) - return; + +void +expressionerror(YYLTYPE * llocp, void* lexer, infinity::ExpressionParserResult* result, const char* msg) { + if(result->IsError()) return ; result->error_message_ = std::string(msg) + ", " + std::to_string(llocp->first_column); - fprintf(stderr, "Error: %s, %d:%d\n", msg, llocp->first_line, llocp->first_column); + fprintf(stderr, "Error: %s, %d:%d\n", msg, llocp->first_line, llocp->first_column); } diff --git a/src/parser/expression_parser.h b/src/parser/expression_parser.h index f6df6c8da0..3c890da234 100644 --- a/src/parser/expression_parser.h +++ b/src/parser/expression_parser.h @@ -36,28 +36,29 @@ private implementation details that can be changed or removed. */ #ifndef YY_EXPRESSION_EXPRESSION_PARSER_H_INCLUDED -#define YY_EXPRESSION_EXPRESSION_PARSER_H_INCLUDED +# define YY_EXPRESSION_EXPRESSION_PARSER_H_INCLUDED /* Debug traces. */ #ifndef EXPRESSIONDEBUG -#if defined YYDEBUG +# if defined YYDEBUG #if YYDEBUG -#define EXPRESSIONDEBUG 1 -#else -#define EXPRESSIONDEBUG 0 -#endif -#else /* ! defined YYDEBUG */ -#define EXPRESSIONDEBUG 1 -#endif /* ! defined YYDEBUG */ -#endif /* ! defined EXPRESSIONDEBUG */ +# define EXPRESSIONDEBUG 1 +# else +# define EXPRESSIONDEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define EXPRESSIONDEBUG 1 +# endif /* ! defined YYDEBUG */ +#endif /* ! defined EXPRESSIONDEBUG */ #if EXPRESSIONDEBUG extern int expressiondebug; #endif /* "%code requires" blocks. */ #line 12 "expression_parser.y" -#include "definition/column_def.h" + #include "expression.h" #include "expression_parser_result.h" +#include "definition/column_def.h" #include "type/info/decimal_info.h" #include "type/info/embedding_info.h" @@ -75,239 +76,247 @@ struct EXPRESSION_LTYPE { int total_column; int string_length; - std::vector parameters; + std::vector parameters; }; #define EXPRESSIONLTYPE EXPRESSION_LTYPE #define EXPRESSIONLTYPE_IS_DECLARED 1 -#define YY_USER_ACTION \ - yylloc->first_line = yylloc->last_line; \ - yylloc->first_column = yylloc->last_column; \ - for (int i = 0; yytext[i] != '\0'; ++i) { \ - yylloc->total_column++; \ - yylloc->string_length++; \ - if (yytext[i] == '\n') { \ - yylloc->last_line++; \ - yylloc->last_column = 0; \ - } else { \ - yylloc->last_column++; \ - } \ +#define YY_USER_ACTION \ + yylloc->first_line = yylloc->last_line; \ + yylloc->first_column = yylloc->last_column; \ + for(int i = 0; yytext[i] != '\0'; ++ i) { \ + yylloc->total_column++; \ + yylloc->string_length++; \ + if (yytext[i] == '\n') { \ + yylloc->last_line++; \ + yylloc->last_column = 0; \ + } else { \ + yylloc->last_column++; \ + } \ } #line 100 "expression_parser.h" /* Token kinds. */ #ifndef EXPRESSIONTOKENTYPE -#define EXPRESSIONTOKENTYPE -enum expressiontokentype { +# define EXPRESSIONTOKENTYPE + enum expressiontokentype + { EXPRESSIONEMPTY = -2, - EXPRESSIONEOF = 0, /* "end of file" */ - EXPRESSIONerror = 256, /* error */ - EXPRESSIONUNDEF = 257, /* "invalid token" */ - IDENTIFIER = 258, /* IDENTIFIER */ - STRING = 259, /* STRING */ - DOUBLE_VALUE = 260, /* DOUBLE_VALUE */ - LONG_VALUE = 261, /* LONG_VALUE */ - CREATE = 262, /* CREATE */ - SELECT = 263, /* SELECT */ - INSERT = 264, /* INSERT */ - DROP = 265, /* DROP */ - UPDATE = 266, /* UPDATE */ - DELETE = 267, /* DELETE */ - COPY = 268, /* COPY */ - SET = 269, /* SET */ - EXPLAIN = 270, /* EXPLAIN */ - SHOW = 271, /* SHOW */ - ALTER = 272, /* ALTER */ - EXECUTE = 273, /* EXECUTE */ - PREPARE = 274, /* PREPARE */ - UNION = 275, /* UNION */ - ALL = 276, /* ALL */ - INTERSECT = 277, /* INTERSECT */ - COMPACT = 278, /* COMPACT */ - EXCEPT = 279, /* EXCEPT */ - FLUSH = 280, /* FLUSH */ - USE = 281, /* USE */ - OPTIMIZE = 282, /* OPTIMIZE */ - PROPERTIES = 283, /* PROPERTIES */ - DATABASE = 284, /* DATABASE */ - TABLE = 285, /* TABLE */ - COLLECTION = 286, /* COLLECTION */ - TABLES = 287, /* TABLES */ - INTO = 288, /* INTO */ - VALUES = 289, /* VALUES */ - AST = 290, /* AST */ - PIPELINE = 291, /* PIPELINE */ - RAW = 292, /* RAW */ - LOGICAL = 293, /* LOGICAL */ - PHYSICAL = 294, /* PHYSICAL */ - FRAGMENT = 295, /* FRAGMENT */ - VIEW = 296, /* VIEW */ - INDEX = 297, /* INDEX */ - ANALYZE = 298, /* ANALYZE */ - VIEWS = 299, /* VIEWS */ - DATABASES = 300, /* DATABASES */ - SEGMENT = 301, /* SEGMENT */ - SEGMENTS = 302, /* SEGMENTS */ - BLOCK = 303, /* BLOCK */ - BLOCKS = 304, /* BLOCKS */ - COLUMNS = 305, /* COLUMNS */ - INDEXES = 306, /* INDEXES */ - GROUP = 307, /* GROUP */ - BY = 308, /* BY */ - HAVING = 309, /* HAVING */ - AS = 310, /* AS */ - NATURAL = 311, /* NATURAL */ - JOIN = 312, /* JOIN */ - LEFT = 313, /* LEFT */ - RIGHT = 314, /* RIGHT */ - OUTER = 315, /* OUTER */ - FULL = 316, /* FULL */ - ON = 317, /* ON */ - INNER = 318, /* INNER */ - CROSS = 319, /* CROSS */ - DISTINCT = 320, /* DISTINCT */ - WHERE = 321, /* WHERE */ - ORDER = 322, /* ORDER */ - LIMIT = 323, /* LIMIT */ - OFFSET = 324, /* OFFSET */ - ASC = 325, /* ASC */ - DESC = 326, /* DESC */ - IF = 327, /* IF */ - NOT = 328, /* NOT */ - EXISTS = 329, /* EXISTS */ - IN = 330, /* IN */ - FROM = 331, /* FROM */ - TO = 332, /* TO */ - WITH = 333, /* WITH */ - DELIMITER = 334, /* DELIMITER */ - FORMAT = 335, /* FORMAT */ - HEADER = 336, /* HEADER */ - CAST = 337, /* CAST */ - END = 338, /* END */ - CASE = 339, /* CASE */ - ELSE = 340, /* ELSE */ - THEN = 341, /* THEN */ - WHEN = 342, /* WHEN */ - BOOLEAN = 343, /* BOOLEAN */ - INTEGER = 344, /* INTEGER */ - INT = 345, /* INT */ - TINYINT = 346, /* TINYINT */ - SMALLINT = 347, /* SMALLINT */ - BIGINT = 348, /* BIGINT */ - HUGEINT = 349, /* HUGEINT */ - VARCHAR = 350, /* VARCHAR */ - FLOAT = 351, /* FLOAT */ - DOUBLE = 352, /* DOUBLE */ - REAL = 353, /* REAL */ - DECIMAL = 354, /* DECIMAL */ - DATE = 355, /* DATE */ - TIME = 356, /* TIME */ - DATETIME = 357, /* DATETIME */ - TIMESTAMP = 358, /* TIMESTAMP */ - UUID = 359, /* UUID */ - POINT = 360, /* POINT */ - LINE = 361, /* LINE */ - LSEG = 362, /* LSEG */ - BOX = 363, /* BOX */ - PATH = 364, /* PATH */ - POLYGON = 365, /* POLYGON */ - CIRCLE = 366, /* CIRCLE */ - BLOB = 367, /* BLOB */ - BITMAP = 368, /* BITMAP */ - EMBEDDING = 369, /* EMBEDDING */ - VECTOR = 370, /* VECTOR */ - BIT = 371, /* BIT */ - SPARSE = 372, /* SPARSE */ - PRIMARY = 373, /* PRIMARY */ - KEY = 374, /* KEY */ - UNIQUE = 375, /* UNIQUE */ - NULLABLE = 376, /* NULLABLE */ - IS = 377, /* IS */ - TRUE = 378, /* TRUE */ - FALSE = 379, /* FALSE */ - INTERVAL = 380, /* INTERVAL */ - SECOND = 381, /* SECOND */ - SECONDS = 382, /* SECONDS */ - MINUTE = 383, /* MINUTE */ - MINUTES = 384, /* MINUTES */ - HOUR = 385, /* HOUR */ - HOURS = 386, /* HOURS */ - DAY = 387, /* DAY */ - DAYS = 388, /* DAYS */ - MONTH = 389, /* MONTH */ - MONTHS = 390, /* MONTHS */ - YEAR = 391, /* YEAR */ - YEARS = 392, /* YEARS */ - EQUAL = 393, /* EQUAL */ - NOT_EQ = 394, /* NOT_EQ */ - LESS_EQ = 395, /* LESS_EQ */ - GREATER_EQ = 396, /* GREATER_EQ */ - BETWEEN = 397, /* BETWEEN */ - AND = 398, /* AND */ - OR = 399, /* OR */ - EXTRACT = 400, /* EXTRACT */ - LIKE = 401, /* LIKE */ - DATA = 402, /* DATA */ - LOG = 403, /* LOG */ - BUFFER = 404, /* BUFFER */ - KNN = 405, /* KNN */ - USING = 406, /* USING */ - SESSION = 407, /* SESSION */ - GLOBAL = 408, /* GLOBAL */ - OFF = 409, /* OFF */ - EXPORT = 410, /* EXPORT */ - PROFILE = 411, /* PROFILE */ - CONFIGS = 412, /* CONFIGS */ - PROFILES = 413, /* PROFILES */ - STATUS = 414, /* STATUS */ - VAR = 415, /* VAR */ - SEARCH = 416, /* SEARCH */ - MATCH = 417, /* MATCH */ - QUERY = 418, /* QUERY */ - FUSION = 419, /* FUSION */ - NUMBER = 420 /* NUMBER */ -}; -typedef enum expressiontokentype expressiontoken_kind_t; + EXPRESSIONEOF = 0, /* "end of file" */ + EXPRESSIONerror = 256, /* error */ + EXPRESSIONUNDEF = 257, /* "invalid token" */ + IDENTIFIER = 258, /* IDENTIFIER */ + STRING = 259, /* STRING */ + DOUBLE_VALUE = 260, /* DOUBLE_VALUE */ + LONG_VALUE = 261, /* LONG_VALUE */ + CREATE = 262, /* CREATE */ + SELECT = 263, /* SELECT */ + INSERT = 264, /* INSERT */ + DROP = 265, /* DROP */ + UPDATE = 266, /* UPDATE */ + DELETE = 267, /* DELETE */ + COPY = 268, /* COPY */ + SET = 269, /* SET */ + EXPLAIN = 270, /* EXPLAIN */ + SHOW = 271, /* SHOW */ + ALTER = 272, /* ALTER */ + EXECUTE = 273, /* EXECUTE */ + PREPARE = 274, /* PREPARE */ + UNION = 275, /* UNION */ + ALL = 276, /* ALL */ + INTERSECT = 277, /* INTERSECT */ + COMPACT = 278, /* COMPACT */ + EXCEPT = 279, /* EXCEPT */ + FLUSH = 280, /* FLUSH */ + USE = 281, /* USE */ + OPTIMIZE = 282, /* OPTIMIZE */ + PROPERTIES = 283, /* PROPERTIES */ + DATABASE = 284, /* DATABASE */ + TABLE = 285, /* TABLE */ + COLLECTION = 286, /* COLLECTION */ + TABLES = 287, /* TABLES */ + INTO = 288, /* INTO */ + VALUES = 289, /* VALUES */ + AST = 290, /* AST */ + PIPELINE = 291, /* PIPELINE */ + RAW = 292, /* RAW */ + LOGICAL = 293, /* LOGICAL */ + PHYSICAL = 294, /* PHYSICAL */ + FRAGMENT = 295, /* FRAGMENT */ + VIEW = 296, /* VIEW */ + INDEX = 297, /* INDEX */ + ANALYZE = 298, /* ANALYZE */ + VIEWS = 299, /* VIEWS */ + DATABASES = 300, /* DATABASES */ + SEGMENT = 301, /* SEGMENT */ + SEGMENTS = 302, /* SEGMENTS */ + BLOCK = 303, /* BLOCK */ + BLOCKS = 304, /* BLOCKS */ + COLUMNS = 305, /* COLUMNS */ + INDEXES = 306, /* INDEXES */ + GROUP = 307, /* GROUP */ + BY = 308, /* BY */ + HAVING = 309, /* HAVING */ + AS = 310, /* AS */ + NATURAL = 311, /* NATURAL */ + JOIN = 312, /* JOIN */ + LEFT = 313, /* LEFT */ + RIGHT = 314, /* RIGHT */ + OUTER = 315, /* OUTER */ + FULL = 316, /* FULL */ + ON = 317, /* ON */ + INNER = 318, /* INNER */ + CROSS = 319, /* CROSS */ + DISTINCT = 320, /* DISTINCT */ + WHERE = 321, /* WHERE */ + ORDER = 322, /* ORDER */ + LIMIT = 323, /* LIMIT */ + OFFSET = 324, /* OFFSET */ + ASC = 325, /* ASC */ + DESC = 326, /* DESC */ + IF = 327, /* IF */ + NOT = 328, /* NOT */ + EXISTS = 329, /* EXISTS */ + IN = 330, /* IN */ + FROM = 331, /* FROM */ + TO = 332, /* TO */ + WITH = 333, /* WITH */ + DELIMITER = 334, /* DELIMITER */ + FORMAT = 335, /* FORMAT */ + HEADER = 336, /* HEADER */ + CAST = 337, /* CAST */ + END = 338, /* END */ + CASE = 339, /* CASE */ + ELSE = 340, /* ELSE */ + THEN = 341, /* THEN */ + WHEN = 342, /* WHEN */ + BOOLEAN = 343, /* BOOLEAN */ + INTEGER = 344, /* INTEGER */ + INT = 345, /* INT */ + TINYINT = 346, /* TINYINT */ + SMALLINT = 347, /* SMALLINT */ + BIGINT = 348, /* BIGINT */ + HUGEINT = 349, /* HUGEINT */ + VARCHAR = 350, /* VARCHAR */ + FLOAT = 351, /* FLOAT */ + DOUBLE = 352, /* DOUBLE */ + REAL = 353, /* REAL */ + DECIMAL = 354, /* DECIMAL */ + DATE = 355, /* DATE */ + TIME = 356, /* TIME */ + DATETIME = 357, /* DATETIME */ + TIMESTAMP = 358, /* TIMESTAMP */ + UUID = 359, /* UUID */ + POINT = 360, /* POINT */ + LINE = 361, /* LINE */ + LSEG = 362, /* LSEG */ + BOX = 363, /* BOX */ + PATH = 364, /* PATH */ + POLYGON = 365, /* POLYGON */ + CIRCLE = 366, /* CIRCLE */ + BLOB = 367, /* BLOB */ + BITMAP = 368, /* BITMAP */ + EMBEDDING = 369, /* EMBEDDING */ + VECTOR = 370, /* VECTOR */ + BIT = 371, /* BIT */ + SPARSE = 372, /* SPARSE */ + PRIMARY = 373, /* PRIMARY */ + KEY = 374, /* KEY */ + UNIQUE = 375, /* UNIQUE */ + NULLABLE = 376, /* NULLABLE */ + IS = 377, /* IS */ + TRUE = 378, /* TRUE */ + FALSE = 379, /* FALSE */ + INTERVAL = 380, /* INTERVAL */ + SECOND = 381, /* SECOND */ + SECONDS = 382, /* SECONDS */ + MINUTE = 383, /* MINUTE */ + MINUTES = 384, /* MINUTES */ + HOUR = 385, /* HOUR */ + HOURS = 386, /* HOURS */ + DAY = 387, /* DAY */ + DAYS = 388, /* DAYS */ + MONTH = 389, /* MONTH */ + MONTHS = 390, /* MONTHS */ + YEAR = 391, /* YEAR */ + YEARS = 392, /* YEARS */ + EQUAL = 393, /* EQUAL */ + NOT_EQ = 394, /* NOT_EQ */ + LESS_EQ = 395, /* LESS_EQ */ + GREATER_EQ = 396, /* GREATER_EQ */ + BETWEEN = 397, /* BETWEEN */ + AND = 398, /* AND */ + OR = 399, /* OR */ + EXTRACT = 400, /* EXTRACT */ + LIKE = 401, /* LIKE */ + DATA = 402, /* DATA */ + LOG = 403, /* LOG */ + BUFFER = 404, /* BUFFER */ + KNN = 405, /* KNN */ + USING = 406, /* USING */ + SESSION = 407, /* SESSION */ + GLOBAL = 408, /* GLOBAL */ + OFF = 409, /* OFF */ + EXPORT = 410, /* EXPORT */ + PROFILE = 411, /* PROFILE */ + CONFIGS = 412, /* CONFIGS */ + PROFILES = 413, /* PROFILES */ + STATUS = 414, /* STATUS */ + VAR = 415, /* VAR */ + SEARCH = 416, /* SEARCH */ + MATCH = 417, /* MATCH */ + QUERY = 418, /* QUERY */ + FUSION = 419, /* FUSION */ + NUMBER = 420 /* NUMBER */ + }; + typedef enum expressiontokentype expressiontoken_kind_t; #endif /* Value type. */ -#if !defined EXPRESSIONSTYPE && !defined EXPRESSIONSTYPE_IS_DECLARED -union EXPRESSIONSTYPE { +#if ! defined EXPRESSIONSTYPE && ! defined EXPRESSIONSTYPE_IS_DECLARED +union EXPRESSIONSTYPE +{ #line 84 "expression_parser.y" - bool bool_value; - char *str_value; - double double_value; + bool bool_value; + char* str_value; + double double_value; int64_t long_value; - infinity::ColumnType column_type_t; + infinity::ColumnType column_type_t; - infinity::ParsedExpr *expr_t; - infinity::ConstantExpr *const_expr_t; - std::vector *expr_array_t; + infinity::ParsedExpr* expr_t; + infinity::ConstantExpr* const_expr_t; + std::vector* expr_array_t; #line 295 "expression_parser.h" + }; typedef union EXPRESSIONSTYPE EXPRESSIONSTYPE; -#define EXPRESSIONSTYPE_IS_TRIVIAL 1 -#define EXPRESSIONSTYPE_IS_DECLARED 1 +# define EXPRESSIONSTYPE_IS_TRIVIAL 1 +# define EXPRESSIONSTYPE_IS_DECLARED 1 #endif /* Location type. */ -#if !defined EXPRESSIONLTYPE && !defined EXPRESSIONLTYPE_IS_DECLARED +#if ! defined EXPRESSIONLTYPE && ! defined EXPRESSIONLTYPE_IS_DECLARED typedef struct EXPRESSIONLTYPE EXPRESSIONLTYPE; -struct EXPRESSIONLTYPE { - int first_line; - int first_column; - int last_line; - int last_column; +struct EXPRESSIONLTYPE +{ + int first_line; + int first_column; + int last_line; + int last_column; }; -#define EXPRESSIONLTYPE_IS_DECLARED 1 -#define EXPRESSIONLTYPE_IS_TRIVIAL 1 +# define EXPRESSIONLTYPE_IS_DECLARED 1 +# define EXPRESSIONLTYPE_IS_TRIVIAL 1 #endif -int expressionparse(void *scanner, infinity::ExpressionParserResult *result); + + + +int expressionparse (void *scanner, infinity::ExpressionParserResult* result); + #endif /* !YY_EXPRESSION_EXPRESSION_PARSER_H_INCLUDED */ diff --git a/src/parser/lexer.cpp b/src/parser/lexer.cpp index cade8138a3..2a79ce1e1b 100644 --- a/src/parser/lexer.cpp +++ b/src/parser/lexer.cpp @@ -2,7 +2,7 @@ #line 4 "lexer.cpp" -#define YY_INT_ALIGNED short int +#define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ @@ -269,10 +269,10 @@ /* begin standard C headers. */ /* %if-c-only */ -#include #include -#include #include +#include +#include /* %endif */ /* %if-tables-serialization */ @@ -287,10 +287,10 @@ /* C99 systems have . Non-C99 systems may or may not. */ -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -307,41 +307,41 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN -#define INT8_MIN (-128) +#define INT8_MIN (-128) #endif #ifndef INT16_MIN -#define INT16_MIN (-32767 - 1) +#define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN -#define INT32_MIN (-2147483647 - 1) +#define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX -#define INT8_MAX (127) +#define INT8_MAX (127) #endif #ifndef INT16_MAX -#define INT16_MAX (32767) +#define INT16_MAX (32767) #endif #ifndef INT32_MAX -#define INT32_MAX (2147483647) +#define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX -#define UINT8_MAX (255U) +#define UINT8_MAX (255U) #endif #ifndef UINT16_MAX -#define UINT16_MAX (65535U) +#define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) +#define UINT32_MAX (4294967295U) #endif #ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) +#define SIZE_MAX (~(size_t)0) #endif #endif /* ! C99 */ @@ -372,7 +372,7 @@ typedef unsigned int flex_uint32_t; /* Promotes a possibly negative, possibly signed char to an * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((YY_CHAR)(c)) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* %ok-for-header */ /* %if-reentrant */ @@ -380,7 +380,7 @@ typedef unsigned int flex_uint32_t; /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T #define YY_TYPEDEF_YY_SCANNER_T -typedef void *yyscan_t; +typedef void* yyscan_t; #endif /* For convenience, these vars (plus the bison vars far below) @@ -413,7 +413,7 @@ typedef void *yyscan_t; /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin, yyscanner) +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -431,7 +431,7 @@ typedef void *yyscan_t; /* The state buf must be large enough to hold one state per character in the main buffer. */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE @@ -454,89 +454,93 @@ typedef size_t yy_size_t; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - -#define YY_LESS_LINENO(n) -#define YY_LINENO_REWIND_TO(ptr) - + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + /* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg); \ - *yy_cp = yyg->yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } while (0) -#define unput(c) yyunput(c, yyg->yytext_ptr, yyscanner) +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state { - /* %if-c-only */ - FILE *yy_input_file; - /* %endif */ - - /* %if-c++-only */ - /* %endif */ - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; +struct yy_buffer_state + { +/* %if-c-only */ + FILE *yy_input_file; +/* %endif */ - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; +/* %if-c++-only */ +/* %endif */ - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; - int yy_buffer_status; + int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ #define YY_BUFFER_EOF_PENDING 2 -}; + + }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* %if-c-only Standard (non-C++) definition */ @@ -553,7 +557,9 @@ struct yy_buffer_state { * * Returns the top of the stack, or NULL. */ -#define YY_CURRENT_BUFFER (yyg->yy_buffer_stack ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] : NULL) +#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ @@ -567,52 +573,54 @@ struct yy_buffer_state { /* %endif */ -void yyrestart(FILE *input_file, yyscan_t yyscanner); -void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner); -YY_BUFFER_STATE yy_create_buffer(FILE *file, int size, yyscan_t yyscanner); -void yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner); -void yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner); -void yypush_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner); -void yypop_buffer_state(yyscan_t yyscanner); +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); -static void yyensure_buffer_stack(yyscan_t yyscanner); -static void yy_load_buffer_state(yyscan_t yyscanner); -static void yy_init_buffer(YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner); -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER, yyscanner) +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) -YY_BUFFER_STATE yy_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner); -YY_BUFFER_STATE yy_scan_string(const char *yy_str, yyscan_t yyscanner); -YY_BUFFER_STATE yy_scan_bytes(const char *bytes, int len, yyscan_t yyscanner); +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); /* %endif */ -void *yyalloc(yy_size_t, yyscan_t yyscanner); -void *yyrealloc(void *, yy_size_t, yyscan_t yyscanner); -void yyfree(void *, yyscan_t yyscanner); +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); #define yy_new_buffer yy_create_buffer -#define yy_set_interactive(is_interactive) \ - { \ - if (!YY_CURRENT_BUFFER) { \ - yyensure_buffer_stack(yyscanner); \ - YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } -#define yy_set_bol(at_bol) \ - { \ - if (!YY_CURRENT_BUFFER) { \ - yyensure_buffer_stack(yyscanner); \ - YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */ /* Begin user sect3 */ -#define sqlwrap(yyscanner) (/*CONSTCOND*/ 1) +#define sqlwrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP #define FLEX_DEBUG @@ -626,352 +634,740 @@ typedef int yy_state_type; /* %if-c-only Standard (non-C++) definition */ -static yy_state_type yy_get_previous_state(yyscan_t yyscanner); -static yy_state_type yy_try_NUL_trans(yy_state_type current_state, yyscan_t yyscanner); -static int yy_get_next_buffer(yyscan_t yyscanner); -static void yynoreturn yy_fatal_error(const char *msg, yyscan_t yyscanner); +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); +static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); /* %endif */ /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ -#define YY_DO_BEFORE_ACTION \ - yyg->yytext_ptr = yy_bp; \ - /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */ \ - yyleng = (int)(yy_cp - yy_bp); \ - yyg->yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */ \ - yyg->yy_c_buf_p = yy_cp; +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ +/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\ + yyleng = (int) (yy_cp - yy_bp); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ +/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\ + yyg->yy_c_buf_p = yy_cp; /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */ -#define YY_NUM_RULES 210 -#define YY_END_OF_BUFFER 211 +#define YY_NUM_RULES 212 +#define YY_END_OF_BUFFER 213 /* This struct is not used in this scanner, but its presence is necessary. */ -struct yy_trans_info { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; -}; -static const flex_int16_t yy_accept[759] = { - 0, 0, 0, 207, 207, 211, 209, 1, 1, 209, 209, 199, 205, 199, 199, 202, 199, 199, 199, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, - 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 207, 208, 1, 195, 0, 202, 201, 200, 197, 196, 194, 198, 204, 204, - 204, 204, 8, 204, 204, 204, 204, 204, 204, 21, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, - 204, 204, 204, 204, 204, 204, 204, 204, 82, 204, 84, 94, 204, 204, - - 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 125, 204, 127, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, - 204, 204, 204, 204, 204, 204, 204, 169, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 207, 206, 203, 200, 0, 2, 204, 4, 204, 7, - 9, 204, 204, 204, 13, 204, 204, 16, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 44, 204, 204, 204, 204, 204, 204, 204, 204, - 204, 57, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, - - 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 90, 204, 96, 204, 204, 204, 204, 204, 204, 104, 204, 204, 204, 204, 204, - 204, 204, 204, 204, 120, 204, 204, 123, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, - 204, 151, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 181, 204, 204, 204, 204, 204, 204, 204, 204, - 204, 0, 200, 204, 204, 204, 204, 204, 204, 204, 17, 204, 204, - - 204, 22, 23, 204, 204, 204, 204, 204, 204, 204, 204, 204, 36, 204, 204, 39, 42, 45, 204, 204, 204, 204, 204, 53, 204, 204, 54, 55, 204, - 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 71, 72, 204, 204, 204, 204, 204, 204, 79, 204, 204, 204, 204, 204, 204, 93, 95, - 204, 204, 99, 100, 204, 102, 103, 105, 106, 204, 204, 204, 204, 204, 204, 204, 204, 118, 117, 204, 204, 204, 204, 204, 130, 204, 204, 204, 204, - 204, 204, 204, 204, 140, 204, 204, 204, 204, 204, 204, 204, 204, - - 204, 204, 154, 204, 204, 204, 204, 204, 204, 164, 165, 166, 204, 204, 172, 204, 204, 204, 204, 204, 204, 204, 180, 204, 204, 204, 204, 187, 189, - 204, 191, 192, 3, 204, 6, 204, 204, 204, 204, 18, 204, 204, 204, 26, 204, 204, 204, 204, 204, 204, 204, 204, 38, 204, 204, 204, 204, 204, - 204, 52, 204, 204, 204, 204, 204, 204, 204, 204, 204, 64, 65, 66, 68, 204, 204, 204, 204, 75, 204, 204, 204, 80, 204, 204, 85, 87, 204, - 204, 204, 204, 204, 101, 107, 204, 204, 204, 204, 113, 204, 204, - - 119, 204, 204, 204, 128, 129, 204, 132, 204, 204, 204, 204, 204, 204, 139, 204, 204, 204, 144, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, - 160, 204, 204, 204, 204, 173, 204, 204, 204, 204, 204, 178, 204, 204, 204, 204, 188, 190, 193, 204, 204, 204, 12, 14, 19, 204, 20, 204, 27, - 204, 29, 204, 204, 34, 204, 37, 204, 204, 204, 204, 50, 204, 204, 47, 204, 58, 204, 61, 204, 63, 204, 204, 204, 70, 73, 74, 76, 77, - 204, 204, 83, 204, 88, 204, 204, 204, 97, 204, 108, 204, 109, - - 111, 114, 204, 204, 121, 124, 204, 204, 204, 204, 204, 204, 204, 204, 204, 143, 142, 204, 146, 147, 204, 149, 204, 204, 204, 158, 204, 161, 162, - 204, 204, 204, 174, 175, 176, 204, 179, 182, 204, 204, 186, 204, 10, 204, 15, 24, 204, 30, 31, 32, 33, 35, 204, 204, 48, 49, 204, 204, - 204, 60, 62, 59, 67, 204, 204, 81, 86, 89, 204, 204, 98, 204, 112, 204, 116, 122, 204, 204, 133, 134, 135, 204, 204, 138, 141, 204, 148, - 152, 150, 204, 204, 204, 204, 204, 168, 204, 204, 185, 204, 204, - - 11, 25, 204, 40, 43, 204, 46, 204, 69, 204, 204, 92, 110, 204, 126, 204, 136, 204, 145, 153, 155, 156, 204, 204, 204, 204, 177, 183, 204, - 204, 41, 51, 56, 78, 91, 204, 204, 204, 157, 204, 204, 167, 204, 184, 5, 28, 204, 204, 137, 159, 204, 204, 115, 131, 163, 170, 171, 0}; - -static const YY_CHAR yy_ec[256] = { - 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, - 5, 1, 1, 6, 1, 7, 6, 6, 6, 6, 6, 8, 9, 6, 10, 11, 10, 10, 10, 10, 12, 10, 10, 10, 6, 6, 13, 14, 15, 6, 1, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 6, 1, 6, 6, 42, 1, 43, 44, 45, 46, - - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - -static const YY_CHAR yy_meta[69] = {0, 1, 1, 2, 1, 2, 1, 3, 1, 1, 4, 4, 4, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}; - -static const flex_int16_t yy_base[763] = { - 0, 0, 0, 258, 237, 241, 1555, 67, 69, 219, 0, 1555, 1555, 63, 66, 70, 69, 178, 149, 66, 108, - 73, 74, 112, 163, 59, 134, 173, 57, 68, 181, 188, 173, 235, 227, 55, 229, 279, 326, 275, 129, 86, - 0, 79, 0, 153, 99, 1555, 152, 306, 172, 310, 1555, 1555, 1555, 1555, 0, 191, 213, 123, 128, 112, 134, - 228, 156, 239, 177, 0, 220, 164, 225, 316, 328, 257, 333, 227, 226, 243, 267, 295, 294, 364, 298, 326, - 360, 364, 332, 366, 335, 349, 361, 385, 380, 367, 382, 0, 376, 414, 0, 383, 368, - - 398, 384, 420, 416, 412, 416, 416, 421, 425, 418, 438, 427, 430, 435, 0, 423, 440, 426, 427, 431, 463, - 472, 446, 479, 445, 460, 520, 469, 485, 487, 488, 489, 489, 510, 490, 512, 0, 528, 519, 499, 532, 526, - 524, 540, 539, 540, 526, 546, 0, 1555, 1555, 582, 501, 0, 548, 560, 575, 0, 0, 558, 567, 574, 572, - 586, 574, 0, 584, 586, 591, 579, 591, 583, 583, 591, 573, 599, 582, 629, 592, 620, 634, 631, 634, 619, - 639, 626, 638, 639, 0, 640, 643, 628, 637, 630, 631, 648, 653, 636, 646, 646, - - 647, 653, 674, 682, 667, 680, 686, 683, 675, 689, 680, 691, 692, 693, 694, 686, 0, 701, 681, 697, 694, - 699, 695, 688, 701, 709, 694, 728, 693, 718, 722, 723, 740, 0, 735, 743, 730, 741, 746, 747, 745, 735, - 741, 731, 741, 745, 757, 741, 748, 746, 747, 765, 759, 756, 773, 777, 783, 792, 779, 0, 776, 789, 786, - 785, 790, 793, 787, 787, 794, 804, 785, 797, 807, 798, 799, 811, 808, 819, 0, 807, 818, 806, 842, 826, - 827, 838, 845, 837, 862, 865, 849, 861, 847, 861, 866, 854, 868, 0, 859, 866, - - 869, 0, 0, 863, 865, 869, 879, 872, 881, 886, 879, 884, 0, 879, 881, 902, 885, 0, 893, 886, 889, - 897, 916, 0, 909, 907, 0, 0, 916, 905, 901, 903, 923, 907, 927, 924, 911, 915, 930, 924, 939, 0, - 0, 926, 941, 927, 939, 949, 946, 940, 951, 943, 939, 946, 953, 965, 0, 0, 968, 960, 0, 0, 955, - 0, 0, 0, 0, 968, 968, 964, 961, 962, 976, 980, 974, 974, 0, 991, 990, 983, 979, 989, 0, 999, - 992, 1006, 1013, 1014, 1008, 1013, 1018, 0, 1003, 1004, 1015, 1009, 1021, 1028, 1018, 1028, - - 1033, 1028, 0, 1026, 1027, 1028, 1044, 1044, 1035, 0, 0, 1032, 1052, 1043, 0, 1052, 1046, 1065, 1050, 1064, 1052, - 1072, 0, 1075, 1073, 1081, 1068, 1065, 0, 1080, 0, 1067, 0, 1086, 0, 1085, 1071, 1072, 1081, 1081, 1100, 1084, - 1088, 0, 1099, 1102, 1101, 1102, 1117, 1114, 1119, 1118, 0, 1124, 1117, 1132, 1122, 1130, 1127, 0, 1123, 1133, 1135, - 1120, 1121, 1125, 1136, 1126, 1148, 0, 0, 141, 0, 1131, 1135, 1142, 1145, 0, 1151, 1141, 1160, 0, 1156, 1169, - 1170, 0, 1156, 1172, 1168, 1161, 1175, 0, 0, 1175, 1185, 1166, 1187, 1174, 1172, 1194, - - 0, 1178, 1179, 1191, 0, 0, 1186, 0, 1193, 1191, 1192, 1199, 1194, 1208, 0, 1218, 1219, 1223, 0, 1216, 1222, - 1227, 1219, 1214, 1226, 1233, 1235, 1239, 1244, 1227, 1229, 1228, 1235, 1251, 0, 1248, 1243, 1239, 1248, 1258, 0, 1245, - 1264, 1264, 1249, 0, 0, 0, 1257, 1264, 132, 0, 0, 0, 1268, 0, 1276, 0, 1264, 1266, 1267, 1268, 1276, - 1276, 0, 1278, 1285, 1287, 1280, 0, 1281, 1299, 0, 1294, 0, 1301, 0, 1293, 0, 1288, 99, 1308, 0, 0, - 0, 0, 0, 1309, 1297, 0, 1299, 0, 1301, 1315, 1320, 0, 1313, 0, 1327, 0, - - 1317, 0, 1332, 1326, 1320, 0, 1315, 1322, 1335, 1345, 1326, 1347, 1333, 1335, 1337, 0, 0, 1347, 0, 1338, 1340, - 0, 1347, 1348, 1352, 0, 1358, 0, 1370, 1371, 1353, 1371, 0, 0, 0, 1370, 0, 0, 1367, 1374, 0, 1381, - 0, 96, 0, 1372, 1383, 0, 0, 0, 0, 0, 1388, 1390, 0, 0, 1391, 1383, 1390, 0, 0, 0, 0, - 1387, 1398, 0, 0, 0, 1404, 1396, 0, 1385, 0, 1407, 0, 0, 1406, 1409, 0, 0, 0, 1396, 1407, 0, - 0, 1401, 0, 1405, 0, 1405, 1406, 1412, 1410, 1416, 0, 1419, 1436, 0, 1439, 1430, - - 0, 0, 1431, 1428, 0, 1431, 0, 1443, 0, 1437, 1438, 0, 0, 1439, 0, 1446, 0, 1456, 0, 0, 0, - 1443, 1449, 1446, 1449, 1459, 0, 1450, 1456, 1461, 0, 0, 0, 0, 0, 1463, 1476, 1461, 0, 1476, 1481, 0, - 1468, 0, 0, 0, 1475, 1489, 0, 0, 1473, 1485, 0, 0, 0, 1481, 0, 1555, 1542, 1546, 101, 1550}; - -static const flex_int16_t yy_def[763] = { - 0, 758, 1, 759, 759, 758, 758, 758, 758, 758, 760, 758, 758, 758, 758, 758, 758, 758, 758, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 762, 758, 758, 758, 760, 758, 758, 758, - 758, 758, 758, 758, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 762, 758, 758, 758, - 758, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 758, 758, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, - 761, 761, 761, 761, 761, 0, 758, 758, 758, 758}; - -static const flex_int16_t yy_nxt[1624] = { - 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 42, 6, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 42, 46, 46, 46, 46, 49, 49, 49, 50, 50, - 50, 51, 49, 49, 49, 52, 53, 57, 88, 99, 100, 68, 73, 123, 89, 58, 74, 59, 69, 70, 75, 148, 60, - - 46, 46, 71, 76, 56, 72, 77, 701, 146, 147, 663, 57, 88, 99, 100, 68, 73, 123, 89, 58, 74, 59, 69, 70, 75, 148, - 60, 61, 62, 71, 76, 63, 72, 77, 64, 146, 147, 65, 78, 79, 80, 158, 644, 66, 143, 159, 160, 67, 144, 90, 81, 581, - 145, 91, 61, 62, 151, 92, 63, 150, 161, 64, 55, 93, 65, 78, 79, 80, 158, 94, 66, 143, 159, 160, 67, 144, 90, 81, - 82, 145, 91, 50, 50, 50, 92, 164, 83, 161, 110, 84, 93, 54, 85, 95, 96, 86, 94, 167, 87, 170, - - 101, 97, 111, 105, 102, 82, 98, 106, 112, 154, 103, 107, 164, 83, 104, 110, 84, 108, 155, 85, 95, 96, 86, 109, 167, 87, - 170, 101, 97, 111, 105, 102, 47, 98, 106, 112, 154, 103, 107, 156, 758, 104, 119, 45, 108, 155, 120, 157, 124, 162, 109, 113, - 125, 168, 169, 114, 121, 171, 126, 122, 184, 185, 163, 115, 45, 116, 156, 117, 165, 119, 118, 758, 186, 120, 157, 124, 162, 166, - 113, 125, 168, 169, 114, 121, 171, 126, 122, 184, 185, 163, 115, 178, 116, 758, 117, 165, 179, 118, 127, 186, - - 187, 128, 758, 139, 166, 140, 129, 130, 141, 131, 142, 188, 189, 132, 51, 49, 49, 49, 178, 152, 152, 152, 758, 179, 195, 127, - 758, 187, 128, 153, 139, 758, 140, 129, 130, 141, 131, 142, 188, 189, 132, 133, 172, 173, 174, 134, 175, 176, 135, 136, 180, 195, - 196, 181, 758, 137, 153, 177, 138, 182, 758, 201, 758, 758, 204, 758, 183, 758, 133, 172, 173, 174, 134, 175, 176, 135, 136, 180, - 205, 196, 181, 190, 137, 191, 177, 138, 182, 192, 201, 197, 199, 204, 202, 183, 193, 198, 200, 206, 194, 203, - - 207, 208, 209, 210, 211, 205, 216, 217, 190, 220, 191, 221, 222, 218, 192, 758, 197, 199, 219, 202, 758, 193, 198, 200, 206, 194, - 203, 207, 208, 209, 210, 211, 212, 216, 217, 225, 220, 223, 221, 222, 218, 224, 213, 228, 229, 219, 226, 214, 215, 230, 227, 231, - 232, 235, 236, 237, 233, 238, 239, 212, 240, 241, 225, 242, 223, 248, 253, 758, 224, 213, 228, 229, 234, 226, 214, 215, 230, 227, - 231, 232, 235, 236, 237, 233, 238, 239, 243, 240, 241, 244, 242, 245, 248, 253, 249, 246, 250, 254, 261, 234, - - 262, 247, 263, 264, 265, 266, 251, 252, 289, 269, 290, 290, 290, 243, 758, 758, 244, 278, 245, 758, 758, 249, 246, 250, 254, 261, - 758, 262, 247, 263, 264, 265, 266, 251, 252, 255, 269, 256, 267, 270, 271, 257, 274, 272, 278, 275, 258, 276, 268, 281, 282, 279, - 277, 259, 260, 280, 283, 284, 285, 286, 287, 288, 255, 273, 256, 267, 270, 271, 257, 274, 272, 291, 275, 258, 276, 268, 281, 282, - 279, 277, 259, 260, 280, 283, 284, 285, 286, 287, 288, 292, 273, 152, 152, 152, 293, 294, 295, 296, 291, 297, - - 300, 153, 298, 299, 301, 302, 304, 305, 306, 307, 309, 311, 313, 310, 314, 315, 292, 758, 308, 312, 303, 293, 294, 295, 296, 318, - 297, 300, 153, 298, 299, 301, 302, 304, 305, 306, 307, 309, 311, 313, 310, 314, 315, 319, 316, 308, 312, 303, 317, 320, 321, 324, - 318, 325, 322, 326, 327, 328, 329, 330, 331, 332, 335, 333, 336, 323, 334, 337, 338, 339, 319, 316, 340, 341, 342, 317, 320, 321, - 324, 343, 325, 322, 326, 327, 328, 329, 330, 331, 332, 335, 333, 336, 323, 334, 337, 338, 339, 344, 345, 340, - - 341, 342, 346, 347, 348, 349, 343, 350, 351, 352, 353, 354, 355, 356, 358, 361, 362, 363, 364, 359, 365, 366, 367, 357, 344, 345, - 368, 369, 372, 346, 347, 348, 349, 360, 350, 351, 352, 353, 354, 355, 356, 358, 361, 362, 363, 364, 359, 365, 366, 367, 357, 370, - 373, 368, 369, 372, 374, 371, 375, 376, 360, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 391, 392, 393, 394, 389, - 370, 373, 395, 396, 397, 374, 371, 375, 376, 390, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, - - 391, 392, 393, 394, 389, 398, 399, 395, 396, 397, 400, 401, 402, 403, 390, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 418, 417, 419, 420, 398, 399, 421, 422, 423, 400, 401, 402, 403, 424, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, - 414, 415, 416, 418, 417, 419, 420, 425, 427, 421, 422, 423, 428, 426, 429, 431, 424, 432, 430, 290, 290, 290, 290, 290, 290, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 425, 427, 442, 443, 444, 428, 426, 429, 431, 445, 432, 430, 446, 447, - - 448, 449, 450, 451, 433, 434, 435, 436, 437, 438, 439, 440, 441, 452, 453, 442, 443, 444, 454, 455, 456, 457, 445, 458, 459, 446, - 447, 448, 449, 450, 451, 460, 461, 462, 463, 464, 465, 466, 467, 468, 452, 453, 469, 470, 471, 454, 455, 456, 457, 472, 458, 459, - 473, 474, 475, 476, 477, 478, 460, 461, 462, 463, 464, 465, 466, 467, 468, 479, 480, 469, 470, 471, 481, 482, 483, 484, 472, 485, - 486, 473, 474, 475, 476, 477, 478, 487, 488, 490, 491, 492, 493, 494, 495, 496, 479, 480, 497, 489, 498, 481, - - 482, 483, 484, 499, 485, 486, 500, 501, 502, 503, 504, 505, 487, 488, 490, 491, 492, 493, 494, 495, 496, 506, 507, 497, 489, 498, - 508, 509, 510, 511, 499, 512, 513, 500, 501, 502, 503, 504, 505, 516, 517, 514, 518, 519, 520, 521, 522, 523, 506, 507, 524, 525, - 526, 508, 509, 510, 511, 515, 512, 513, 527, 528, 529, 530, 531, 532, 516, 517, 514, 518, 519, 520, 521, 522, 523, 533, 534, 524, - 525, 526, 535, 536, 537, 538, 515, 539, 540, 527, 528, 529, 530, 531, 532, 541, 542, 543, 544, 545, 546, 547, - - 548, 549, 533, 534, 550, 551, 552, 535, 536, 537, 538, 553, 539, 540, 554, 555, 556, 557, 558, 559, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 560, 561, 550, 551, 552, 562, 563, 564, 565, 553, 566, 567, 554, 555, 556, 557, 558, 559, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 560, 561, 577, 578, 579, 562, 563, 564, 565, 580, 566, 567, 582, 583, 584, 585, 586, 587, 568, 569, 570, 571, - 572, 573, 574, 575, 576, 588, 589, 577, 578, 579, 590, 591, 592, 593, 580, 596, 597, 582, 583, 584, 585, 586, - - 587, 594, 598, 599, 595, 600, 601, 602, 603, 604, 588, 589, 605, 606, 607, 590, 591, 592, 593, 608, 596, 597, 609, 610, 611, 612, - 613, 614, 594, 598, 599, 595, 600, 601, 602, 603, 604, 615, 616, 605, 606, 607, 617, 618, 619, 620, 608, 621, 622, 609, 610, 611, - 612, 613, 614, 623, 624, 625, 626, 627, 628, 629, 630, 631, 615, 616, 632, 633, 634, 617, 618, 619, 620, 635, 621, 622, 636, 637, - 638, 639, 640, 641, 623, 624, 625, 626, 627, 628, 629, 630, 631, 642, 643, 632, 633, 634, 645, 646, 647, 648, - - 635, 649, 650, 636, 637, 638, 639, 640, 641, 651, 652, 653, 654, 655, 656, 657, 658, 659, 642, 643, 660, 661, 662, 645, 646, 647, - 648, 664, 649, 650, 665, 666, 667, 668, 669, 670, 651, 652, 653, 654, 655, 656, 657, 658, 659, 671, 672, 660, 661, 662, 673, 674, - 675, 676, 664, 677, 678, 665, 666, 667, 668, 669, 670, 679, 680, 681, 682, 683, 684, 685, 686, 687, 671, 672, 688, 689, 690, 673, - 674, 675, 676, 691, 677, 678, 692, 693, 694, 695, 696, 697, 679, 680, 681, 682, 683, 684, 685, 686, 687, 698, - - 699, 688, 689, 690, 700, 702, 703, 704, 691, 705, 706, 692, 693, 694, 695, 696, 697, 707, 708, 709, 710, 711, 712, 713, 714, 715, - 698, 699, 716, 717, 718, 700, 702, 703, 704, 719, 705, 706, 720, 721, 722, 723, 724, 725, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 726, 727, 716, 717, 718, 728, 729, 730, 731, 719, 732, 733, 720, 721, 722, 723, 724, 725, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 726, 727, 743, 744, 745, 728, 729, 730, 731, 746, 732, 733, 747, 748, 749, 750, 751, 752, 734, 735, - - 736, 737, 738, 739, 740, 741, 742, 753, 754, 743, 744, 745, 755, 756, 757, 758, 746, 758, 758, 747, 748, 749, 750, 751, 752, 758, - 758, 758, 758, 758, 758, 758, 758, 758, 753, 754, 758, 758, 758, 755, 756, 757, 44, 44, 44, 44, 48, 758, 48, 48, 149, 149, - 758, 149, 5, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, - 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, - - 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758}; - -static const flex_int16_t yy_chk[1624] = { - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 7, 8, 8, 13, 13, 13, 14, 14, - 14, 15, 15, 15, 15, 16, 16, 19, 25, 28, 29, 21, 22, 35, 25, 19, 22, 19, 21, 21, 22, 43, 19, - - 46, 46, 21, 22, 761, 21, 22, 644, 41, 41, 581, 19, 25, 28, 29, 21, 22, 35, 25, 19, 22, 19, 21, 21, 22, 43, - 19, 20, 20, 21, 22, 20, 21, 22, 20, 41, 41, 20, 23, 23, 23, 59, 551, 20, 40, 60, 61, 20, 40, 26, 23, 472, - 40, 26, 20, 20, 48, 26, 20, 45, 62, 20, 18, 26, 20, 23, 23, 23, 59, 26, 20, 40, 60, 61, 20, 40, 26, 23, - 24, 40, 26, 50, 50, 50, 26, 64, 24, 62, 32, 24, 26, 17, 24, 27, 27, 24, 26, 66, 24, 69, - - 30, 27, 32, 31, 30, 24, 27, 31, 32, 57, 30, 31, 64, 24, 30, 32, 24, 31, 57, 24, 27, 27, 24, 31, 66, 24, - 69, 30, 27, 32, 31, 30, 9, 27, 31, 32, 57, 30, 31, 58, 5, 30, 34, 4, 31, 57, 34, 58, 36, 63, 31, 33, - 36, 68, 68, 33, 34, 70, 36, 34, 75, 76, 63, 33, 3, 33, 58, 33, 65, 34, 33, 0, 77, 34, 58, 36, 63, 65, - 33, 36, 68, 68, 33, 34, 70, 36, 34, 75, 76, 63, 33, 73, 33, 0, 33, 65, 73, 33, 37, 77, - - 78, 37, 0, 39, 65, 39, 37, 37, 39, 37, 39, 79, 80, 37, 49, 49, 49, 49, 73, 51, 51, 51, 0, 73, 82, 37, - 0, 78, 37, 51, 39, 0, 39, 37, 37, 39, 37, 39, 79, 80, 37, 38, 71, 71, 71, 38, 71, 72, 38, 38, 74, 82, - 83, 74, 0, 38, 51, 72, 38, 74, 0, 86, 0, 0, 88, 0, 74, 0, 38, 71, 71, 71, 38, 71, 72, 38, 38, 74, - 89, 83, 74, 81, 38, 81, 72, 38, 74, 81, 86, 84, 85, 88, 87, 74, 81, 84, 85, 90, 81, 87, - - 91, 92, 93, 94, 96, 89, 99, 100, 81, 102, 81, 102, 102, 101, 81, 0, 84, 85, 101, 87, 0, 81, 84, 85, 90, 81, - 87, 91, 92, 93, 94, 96, 97, 99, 100, 104, 102, 103, 102, 102, 101, 103, 97, 106, 107, 101, 105, 97, 97, 108, 105, 109, - 110, 112, 113, 114, 111, 116, 117, 97, 118, 119, 104, 120, 103, 123, 125, 0, 103, 97, 106, 107, 111, 105, 97, 97, 108, 105, - 109, 110, 112, 113, 114, 111, 116, 117, 121, 118, 119, 121, 120, 122, 123, 125, 124, 122, 124, 126, 128, 111, - - 129, 122, 130, 131, 132, 133, 124, 124, 153, 135, 153, 153, 153, 121, 0, 0, 121, 140, 122, 0, 0, 124, 122, 124, 126, 128, - 0, 129, 122, 130, 131, 132, 133, 124, 124, 127, 135, 127, 134, 136, 136, 127, 139, 138, 140, 139, 127, 139, 134, 142, 143, 141, - 139, 127, 127, 141, 143, 144, 145, 146, 147, 148, 127, 138, 127, 134, 136, 136, 127, 139, 138, 155, 139, 127, 139, 134, 142, 143, - 141, 139, 127, 127, 141, 143, 144, 145, 146, 147, 148, 156, 138, 152, 152, 152, 157, 160, 161, 162, 155, 163, - - 165, 152, 164, 164, 167, 168, 169, 170, 171, 172, 173, 174, 175, 173, 176, 177, 156, 0, 172, 174, 168, 157, 160, 161, 162, 179, - 163, 165, 152, 164, 164, 167, 168, 169, 170, 171, 172, 173, 174, 175, 173, 176, 177, 180, 178, 172, 174, 168, 178, 181, 182, 183, - 179, 184, 182, 185, 186, 187, 188, 190, 191, 192, 194, 193, 195, 182, 193, 196, 197, 198, 180, 178, 199, 200, 201, 178, 181, 182, - 183, 202, 184, 182, 185, 186, 187, 188, 190, 191, 192, 194, 193, 195, 182, 193, 196, 197, 198, 203, 204, 199, - - 200, 201, 205, 206, 207, 208, 202, 209, 210, 211, 212, 213, 214, 215, 216, 219, 220, 221, 222, 218, 223, 224, 225, 215, 203, 204, - 226, 227, 229, 205, 206, 207, 208, 218, 209, 210, 211, 212, 213, 214, 215, 216, 219, 220, 221, 222, 218, 223, 224, 225, 215, 228, - 230, 226, 227, 229, 231, 228, 232, 233, 218, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 248, 249, 250, 251, 247, - 228, 230, 252, 253, 254, 231, 228, 232, 233, 247, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - - 248, 249, 250, 251, 247, 255, 256, 252, 253, 254, 257, 258, 259, 261, 247, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 274, 276, 277, 255, 256, 278, 280, 281, 257, 258, 259, 261, 282, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 274, 276, 277, 283, 284, 278, 280, 281, 285, 283, 286, 287, 282, 288, 286, 289, 289, 289, 290, 290, 290, 291, - 292, 293, 294, 295, 296, 297, 299, 300, 283, 284, 301, 304, 305, 285, 283, 286, 287, 306, 288, 286, 307, 308, - - 309, 310, 311, 312, 291, 292, 293, 294, 295, 296, 297, 299, 300, 314, 315, 301, 304, 305, 316, 317, 319, 320, 306, 321, 322, 307, - 308, 309, 310, 311, 312, 323, 325, 326, 329, 330, 331, 332, 333, 334, 314, 315, 335, 336, 337, 316, 317, 319, 320, 338, 321, 322, - 339, 340, 341, 344, 345, 346, 323, 325, 326, 329, 330, 331, 332, 333, 334, 347, 348, 335, 336, 337, 349, 350, 351, 352, 338, 353, - 354, 339, 340, 341, 344, 345, 346, 355, 356, 359, 360, 363, 368, 369, 370, 371, 347, 348, 372, 356, 373, 349, - - 350, 351, 352, 374, 353, 354, 375, 376, 378, 379, 380, 381, 355, 356, 359, 360, 363, 368, 369, 370, 371, 382, 384, 372, 356, 373, - 385, 386, 387, 388, 374, 389, 390, 375, 376, 378, 379, 380, 381, 393, 394, 391, 395, 396, 397, 398, 399, 400, 382, 384, 401, 402, - 404, 385, 386, 387, 388, 391, 389, 390, 405, 406, 407, 408, 409, 412, 393, 394, 391, 395, 396, 397, 398, 399, 400, 413, 414, 401, - 402, 404, 416, 417, 418, 419, 391, 420, 421, 405, 406, 407, 408, 409, 412, 422, 424, 425, 426, 427, 428, 430, - - 432, 434, 413, 414, 436, 437, 438, 416, 417, 418, 419, 439, 420, 421, 440, 441, 442, 443, 445, 446, 422, 424, 425, 426, 427, 428, - 430, 432, 434, 447, 448, 436, 437, 438, 449, 450, 451, 452, 439, 454, 455, 440, 441, 442, 443, 445, 446, 456, 457, 458, 459, 461, - 462, 463, 464, 465, 447, 448, 466, 467, 468, 449, 450, 451, 452, 469, 454, 455, 474, 475, 476, 477, 479, 480, 456, 457, 458, 459, - 461, 462, 463, 464, 465, 481, 483, 466, 467, 468, 484, 485, 487, 488, 469, 490, 491, 474, 475, 476, 477, 479, - - 480, 489, 494, 495, 489, 496, 497, 498, 499, 500, 481, 483, 502, 503, 504, 484, 485, 487, 488, 507, 490, 491, 509, 510, 511, 512, - 513, 514, 489, 494, 495, 489, 496, 497, 498, 499, 500, 516, 517, 502, 503, 504, 518, 520, 521, 522, 507, 523, 524, 509, 510, 511, - 512, 513, 514, 525, 526, 527, 528, 529, 530, 531, 532, 533, 516, 517, 534, 536, 537, 518, 520, 521, 522, 538, 523, 524, 539, 540, - 542, 543, 544, 545, 525, 526, 527, 528, 529, 530, 531, 532, 533, 549, 550, 534, 536, 537, 555, 557, 559, 560, - - 538, 561, 562, 539, 540, 542, 543, 544, 545, 563, 564, 566, 567, 568, 569, 571, 572, 574, 549, 550, 576, 578, 580, 555, 557, 559, - 560, 582, 561, 562, 588, 589, 591, 593, 594, 595, 563, 564, 566, 567, 568, 569, 571, 572, 574, 597, 599, 576, 578, 580, 601, 603, - 604, 605, 582, 607, 608, 588, 589, 591, 593, 594, 595, 609, 610, 611, 612, 613, 614, 615, 618, 620, 597, 599, 621, 623, 624, 601, - 603, 604, 605, 625, 607, 608, 627, 629, 630, 631, 632, 636, 609, 610, 611, 612, 613, 614, 615, 618, 620, 639, - - 640, 621, 623, 624, 642, 646, 647, 653, 625, 654, 657, 627, 629, 630, 631, 632, 636, 658, 659, 664, 665, 669, 670, 672, 674, 677, - 639, 640, 678, 682, 683, 642, 646, 647, 653, 686, 654, 657, 688, 690, 691, 692, 693, 694, 658, 659, 664, 665, 669, 670, 672, 674, - 677, 696, 697, 678, 682, 683, 699, 700, 703, 704, 686, 706, 708, 688, 690, 691, 692, 693, 694, 710, 711, 714, 716, 718, 722, 723, - 724, 725, 696, 697, 726, 728, 729, 699, 700, 703, 704, 730, 706, 708, 736, 737, 738, 740, 741, 743, 710, 711, - - 714, 716, 718, 722, 723, 724, 725, 747, 748, 726, 728, 729, 751, 752, 756, 0, 730, 0, 0, 736, 737, 738, 740, 741, 743, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 747, 748, 0, 0, 0, 751, 752, 756, 759, 759, 759, 759, 760, 0, 760, 760, 762, 762, - 0, 762, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, - 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, - - 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758}; - -static const flex_int16_t yy_rule_linenum[210] = { - 0, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 224, 225, 226, 227, 228, 230, 232, - - 233, 238, 248, 257, 262, 263, 264, 265, 268}; +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[769] = + { 0, + 0, 0, 209, 209, 213, 211, 1, 1, 211, 211, + 201, 207, 201, 201, 204, 201, 201, 201, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 209, 210, 1, 197, 0, 204, 203, + 202, 199, 198, 196, 200, 206, 206, 206, 206, 8, + 206, 206, 206, 206, 206, 206, 21, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 82, 206, 84, 94, 206, 206, + + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 125, 206, 127, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 171, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 209, + 208, 205, 202, 0, 2, 206, 4, 206, 7, 9, + 206, 206, 206, 13, 206, 206, 16, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 44, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 57, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 90, 206, 96, 206, 206, + 206, 206, 206, 206, 104, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 120, 206, 206, 123, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 152, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 183, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 0, 202, 206, 206, 206, 206, 206, 206, 206, + + 17, 206, 206, 206, 22, 23, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 36, 206, 206, 39, 42, + 45, 206, 206, 206, 206, 206, 53, 206, 206, 54, + 55, 206, 206, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 71, 72, 206, 206, 206, 206, + 206, 206, 79, 206, 206, 206, 206, 206, 206, 93, + 95, 206, 206, 99, 100, 206, 102, 103, 105, 106, + 206, 206, 206, 206, 206, 206, 206, 206, 118, 117, + 206, 206, 206, 206, 206, 130, 206, 206, 206, 206, + 206, 206, 206, 206, 140, 206, 206, 206, 206, 206, + + 206, 206, 206, 206, 206, 206, 155, 206, 206, 206, + 206, 206, 206, 206, 166, 167, 168, 206, 206, 174, + 206, 206, 206, 206, 206, 206, 206, 182, 206, 206, + 206, 206, 189, 191, 206, 193, 194, 3, 206, 6, + 206, 206, 206, 206, 18, 206, 206, 206, 26, 206, + 206, 206, 206, 206, 206, 206, 206, 38, 206, 206, + 206, 206, 206, 206, 52, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 64, 65, 66, 68, 206, 206, + 206, 206, 75, 206, 206, 206, 80, 206, 206, 85, + 87, 206, 206, 206, 206, 206, 101, 107, 206, 206, + + 206, 206, 113, 206, 206, 119, 206, 206, 206, 128, + 129, 206, 132, 206, 206, 206, 206, 206, 206, 139, + 206, 206, 206, 206, 145, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 162, 206, 206, 206, + 206, 175, 206, 206, 206, 206, 206, 180, 206, 206, + 206, 206, 190, 192, 195, 206, 206, 206, 12, 14, + 19, 206, 20, 206, 27, 206, 29, 206, 206, 34, + 206, 37, 206, 206, 206, 206, 50, 206, 206, 47, + 206, 58, 206, 61, 206, 63, 206, 206, 206, 70, + 73, 74, 76, 77, 206, 206, 83, 206, 88, 206, + + 206, 206, 97, 206, 108, 206, 109, 111, 114, 206, + 206, 121, 124, 206, 206, 206, 206, 206, 206, 206, + 206, 206, 144, 143, 206, 206, 147, 148, 206, 150, + 206, 206, 206, 159, 206, 161, 163, 164, 206, 206, + 206, 176, 177, 178, 206, 181, 184, 206, 206, 188, + 206, 10, 206, 15, 24, 206, 30, 31, 32, 33, + 35, 206, 206, 48, 49, 206, 206, 206, 60, 62, + 59, 67, 206, 206, 81, 86, 89, 206, 206, 98, + 206, 112, 206, 116, 122, 206, 206, 133, 134, 135, + 206, 206, 138, 141, 142, 206, 149, 153, 151, 206, + + 206, 206, 206, 206, 170, 206, 206, 187, 206, 206, + 11, 25, 206, 40, 43, 206, 46, 206, 69, 206, + 206, 92, 110, 206, 126, 206, 136, 206, 146, 154, + 156, 157, 206, 206, 206, 206, 179, 185, 206, 206, + 41, 51, 56, 78, 91, 206, 206, 206, 158, 206, + 206, 169, 206, 186, 5, 28, 206, 206, 137, 160, + 206, 206, 115, 131, 165, 172, 173, 0 + } ; + +static const YY_CHAR yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 5, 1, 1, 6, 1, 7, 6, + 6, 6, 6, 6, 8, 9, 6, 10, 11, 10, + 10, 10, 10, 12, 10, 10, 10, 6, 6, 13, + 14, 15, 6, 1, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 6, 1, 6, 6, 42, 1, 43, 44, 45, 46, + + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 6, 6, 6, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static const YY_CHAR yy_meta[69] = + { 0, + 1, 1, 2, 1, 2, 1, 3, 1, 1, 4, + 4, 4, 1, 1, 1, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4 + } ; + +static const flex_int16_t yy_base[773] = + { 0, + 0, 0, 265, 237, 241, 1576, 67, 69, 219, 0, + 1576, 1576, 63, 66, 70, 69, 178, 149, 66, 108, + 73, 74, 112, 163, 59, 134, 173, 57, 68, 181, + 188, 173, 235, 227, 55, 229, 279, 331, 275, 129, + 86, 0, 79, 0, 153, 99, 1576, 152, 306, 172, + 310, 1576, 1576, 1576, 1576, 0, 191, 213, 123, 128, + 112, 134, 228, 156, 239, 177, 0, 220, 164, 225, + 321, 312, 304, 362, 227, 226, 235, 239, 280, 282, + 366, 286, 316, 337, 360, 315, 331, 338, 368, 362, + 386, 381, 368, 383, 0, 377, 408, 0, 384, 369, + + 418, 393, 422, 398, 412, 410, 412, 421, 425, 418, + 437, 428, 432, 437, 0, 424, 441, 427, 428, 440, + 464, 472, 456, 477, 459, 456, 523, 467, 482, 485, + 488, 491, 475, 493, 487, 493, 518, 0, 519, 525, + 498, 536, 518, 534, 530, 531, 543, 529, 549, 0, + 1576, 1576, 585, 590, 0, 556, 559, 573, 0, 0, + 561, 573, 580, 578, 591, 583, 0, 590, 592, 597, + 585, 597, 592, 590, 596, 582, 607, 590, 627, 595, + 610, 637, 638, 639, 624, 643, 632, 644, 645, 0, + 646, 649, 634, 642, 638, 641, 656, 661, 644, 652, + + 653, 654, 656, 664, 680, 665, 683, 692, 689, 680, + 694, 686, 697, 698, 699, 700, 692, 0, 703, 688, + 705, 702, 707, 703, 697, 710, 715, 701, 731, 701, + 707, 716, 729, 746, 0, 740, 748, 736, 747, 752, + 753, 751, 741, 747, 737, 748, 752, 760, 750, 757, + 755, 756, 771, 754, 767, 769, 772, 779, 787, 799, + 786, 0, 783, 795, 793, 792, 797, 792, 801, 795, + 795, 802, 813, 794, 806, 817, 808, 809, 821, 819, + 828, 0, 816, 831, 823, 845, 838, 836, 846, 853, + 845, 870, 873, 858, 870, 856, 871, 876, 864, 878, + + 0, 869, 877, 878, 0, 0, 872, 878, 880, 888, + 881, 890, 895, 888, 893, 0, 882, 889, 910, 893, + 0, 901, 894, 897, 905, 925, 0, 918, 916, 0, + 0, 926, 915, 911, 913, 933, 918, 936, 933, 924, + 926, 939, 933, 948, 0, 0, 935, 950, 936, 942, + 957, 954, 948, 959, 951, 947, 954, 962, 974, 0, + 0, 977, 970, 0, 0, 965, 0, 0, 0, 0, + 978, 978, 974, 972, 971, 989, 991, 983, 983, 0, + 1000, 999, 992, 988, 992, 0, 1007, 1000, 1014, 1021, + 1022, 1016, 1021, 1026, 0, 1012, 1014, 1025, 1024, 1020, + + 1032, 1039, 1030, 1040, 1043, 1045, 0, 1043, 1037, 1038, + 1054, 1054, 1055, 1049, 0, 0, 1051, 1065, 1056, 0, + 1062, 1056, 1076, 1061, 1081, 1069, 1083, 0, 1087, 1085, + 1093, 1080, 1077, 0, 1093, 0, 1080, 0, 1099, 0, + 1100, 1088, 1089, 1094, 1092, 1111, 1095, 1099, 0, 1113, + 1121, 1114, 1115, 1127, 1124, 1130, 1129, 0, 1141, 1134, + 1143, 1134, 1142, 1139, 0, 1135, 1145, 1148, 1133, 1134, + 1140, 1153, 1143, 1161, 0, 0, 141, 0, 1142, 1146, + 1153, 1156, 0, 1165, 1160, 1173, 0, 1169, 1179, 1180, + 0, 1167, 1183, 1178, 1178, 1193, 0, 0, 1188, 1198, + + 1178, 1199, 1187, 1185, 1207, 0, 1193, 1196, 1208, 0, + 0, 1199, 0, 1204, 1202, 1203, 1210, 1208, 1227, 0, + 1231, 1232, 1233, 1221, 0, 1228, 1234, 1246, 1237, 1232, + 1239, 1246, 1248, 1252, 1257, 1247, 1242, 1244, 1247, 1256, + 1270, 0, 1267, 1262, 1254, 1261, 1271, 0, 1261, 1285, + 1288, 1273, 0, 0, 0, 1272, 1279, 132, 0, 0, + 0, 1281, 0, 1289, 0, 1284, 1286, 1286, 1288, 1290, + 1290, 0, 1292, 1299, 1302, 1295, 0, 1296, 1318, 0, + 1315, 0, 1320, 0, 1312, 0, 1307, 99, 1323, 0, + 0, 0, 0, 0, 1322, 1310, 0, 1315, 0, 1322, + + 1339, 1344, 0, 1328, 0, 1342, 0, 1330, 0, 1345, + 1346, 1340, 0, 1334, 1342, 1349, 1359, 1340, 1361, 1348, + 1350, 1352, 0, 0, 1370, 1369, 0, 1360, 1360, 0, + 1367, 1368, 1368, 0, 1372, 0, 0, 1387, 1393, 1378, + 1396, 0, 0, 0, 1395, 0, 0, 1383, 1391, 0, + 1395, 0, 96, 0, 1393, 1404, 0, 0, 0, 0, + 0, 1409, 1411, 0, 0, 1412, 1398, 1405, 0, 0, + 0, 0, 1402, 1414, 0, 0, 0, 1420, 1412, 0, + 1405, 0, 1429, 0, 0, 1428, 1429, 0, 0, 0, + 1416, 1427, 0, 0, 0, 1417, 0, 1419, 0, 1422, + + 1428, 1437, 1435, 1441, 0, 1435, 1453, 0, 1453, 1451, + 0, 0, 1452, 1449, 0, 1452, 0, 1464, 0, 1452, + 1453, 0, 0, 1454, 0, 1462, 0, 1472, 0, 0, + 0, 1459, 1469, 1468, 1471, 1479, 0, 1470, 1476, 1477, + 0, 0, 0, 0, 0, 1477, 1493, 1483, 0, 1501, + 1506, 0, 1493, 0, 0, 0, 1491, 1506, 0, 0, + 1487, 1506, 0, 0, 0, 1502, 0, 1576, 1563, 1567, + 101, 1571 + } ; + +static const flex_int16_t yy_def[773] = + { 0, + 768, 1, 769, 769, 768, 768, 768, 768, 768, 770, + 768, 768, 768, 768, 768, 768, 768, 768, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 772, 768, 768, 768, 770, 768, 768, + 768, 768, 768, 768, 768, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 772, + 768, 768, 768, 768, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 768, 768, 771, 771, 771, 771, 771, 771, 771, + + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 0, 768, 768, + 768, 768 + } ; + +static const flex_int16_t yy_nxt[1645] = + { 0, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 15, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 42, 6, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 42, 46, 46, + 46, 46, 49, 49, 49, 50, 50, 50, 51, 49, + 49, 49, 52, 53, 57, 88, 99, 100, 68, 73, + 123, 89, 58, 74, 59, 69, 70, 75, 149, 60, + + 46, 46, 71, 76, 56, 72, 77, 711, 147, 148, + 672, 57, 88, 99, 100, 68, 73, 123, 89, 58, + 74, 59, 69, 70, 75, 149, 60, 61, 62, 71, + 76, 63, 72, 77, 64, 147, 148, 65, 78, 79, + 80, 159, 653, 66, 144, 160, 161, 67, 145, 90, + 81, 588, 146, 91, 61, 62, 152, 92, 63, 151, + 162, 64, 55, 93, 65, 78, 79, 80, 159, 94, + 66, 144, 160, 161, 67, 145, 90, 81, 82, 146, + 91, 50, 50, 50, 92, 165, 83, 162, 110, 84, + 93, 54, 85, 95, 96, 86, 94, 168, 87, 171, + + 101, 97, 111, 105, 102, 82, 98, 106, 112, 155, + 103, 107, 165, 83, 104, 110, 84, 108, 156, 85, + 95, 96, 86, 109, 168, 87, 171, 101, 97, 111, + 105, 102, 47, 98, 106, 112, 155, 103, 107, 157, + 768, 104, 119, 45, 108, 156, 120, 158, 124, 163, + 109, 113, 125, 169, 170, 114, 121, 172, 126, 122, + 185, 186, 164, 115, 187, 116, 157, 117, 166, 119, + 118, 45, 188, 120, 158, 124, 163, 167, 113, 125, + 169, 170, 114, 121, 172, 126, 122, 185, 186, 164, + 115, 187, 116, 768, 117, 166, 189, 118, 127, 188, + + 190, 128, 768, 140, 167, 141, 129, 130, 142, 131, + 143, 768, 196, 132, 51, 49, 49, 49, 133, 153, + 153, 153, 768, 189, 768, 127, 768, 190, 128, 154, + 140, 177, 141, 129, 130, 142, 131, 143, 179, 196, + 132, 178, 197, 180, 202, 133, 134, 173, 174, 175, + 135, 176, 768, 136, 137, 768, 154, 203, 177, 768, + 138, 768, 768, 139, 204, 179, 198, 205, 178, 197, + 180, 202, 199, 134, 173, 174, 175, 135, 176, 181, + 136, 137, 182, 191, 203, 192, 200, 138, 183, 193, + 139, 204, 201, 198, 205, 184, 194, 206, 207, 199, + + 195, 208, 209, 210, 211, 212, 181, 217, 218, 182, + 191, 768, 192, 200, 768, 183, 193, 226, 221, 201, + 222, 223, 184, 194, 206, 207, 213, 195, 208, 209, + 210, 211, 212, 219, 217, 218, 214, 229, 220, 224, + 230, 215, 216, 225, 226, 221, 227, 222, 223, 231, + 228, 232, 233, 213, 236, 234, 237, 238, 239, 240, + 219, 241, 242, 214, 229, 220, 224, 230, 215, 216, + 225, 235, 243, 227, 768, 249, 231, 228, 232, 233, + 255, 236, 234, 237, 238, 239, 240, 244, 241, 242, + 245, 246, 250, 256, 251, 247, 263, 264, 235, 243, + + 265, 248, 249, 266, 252, 253, 267, 255, 268, 269, + 254, 768, 272, 768, 244, 270, 281, 245, 246, 250, + 256, 251, 247, 263, 264, 271, 768, 265, 248, 768, + 266, 252, 253, 267, 275, 268, 269, 254, 257, 272, + 258, 284, 270, 281, 259, 273, 274, 287, 277, 260, + 288, 278, 271, 279, 276, 282, 261, 262, 280, 283, + 285, 275, 289, 290, 291, 257, 286, 258, 284, 768, + 768, 259, 273, 274, 287, 277, 260, 288, 278, 294, + 279, 276, 282, 261, 262, 280, 283, 285, 295, 289, + 290, 291, 296, 286, 153, 153, 153, 292, 297, 293, + + 293, 293, 298, 299, 154, 300, 294, 301, 302, 303, + 304, 305, 307, 308, 309, 295, 314, 312, 310, 296, + 313, 316, 317, 318, 315, 297, 306, 311, 321, 298, + 299, 154, 300, 322, 301, 302, 303, 304, 305, 307, + 308, 309, 319, 314, 312, 310, 320, 313, 316, 317, + 318, 315, 323, 306, 311, 321, 327, 324, 328, 329, + 322, 325, 330, 331, 332, 333, 334, 335, 336, 319, + 338, 337, 326, 320, 339, 340, 341, 342, 343, 323, + 344, 345, 346, 327, 324, 328, 329, 347, 325, 330, + 331, 332, 333, 334, 335, 336, 348, 338, 337, 326, + + 349, 339, 340, 341, 342, 343, 350, 344, 345, 346, + 351, 352, 353, 354, 347, 355, 356, 357, 358, 359, + 361, 362, 364, 348, 365, 366, 367, 349, 368, 360, + 369, 370, 371, 350, 372, 363, 375, 351, 352, 353, + 354, 376, 355, 356, 357, 358, 359, 361, 362, 364, + 377, 365, 366, 367, 373, 368, 360, 369, 370, 371, + 374, 372, 363, 375, 378, 379, 380, 381, 376, 382, + 383, 384, 385, 386, 387, 388, 389, 377, 390, 391, + 392, 373, 394, 395, 396, 397, 398, 374, 399, 400, + 393, 378, 379, 380, 381, 401, 382, 383, 384, 385, + + 386, 387, 388, 389, 402, 390, 391, 392, 403, 394, + 395, 396, 397, 398, 404, 399, 400, 393, 405, 406, + 407, 408, 401, 409, 410, 411, 412, 413, 414, 415, + 416, 402, 417, 418, 419, 403, 420, 421, 423, 422, + 424, 404, 425, 426, 427, 405, 406, 407, 408, 428, + 409, 410, 411, 412, 413, 414, 415, 416, 429, 417, + 418, 419, 430, 420, 421, 423, 422, 424, 431, 425, + 426, 427, 432, 433, 434, 436, 428, 437, 435, 293, + 293, 293, 293, 293, 293, 429, 438, 439, 440, 430, + 441, 442, 443, 444, 445, 431, 446, 447, 448, 432, + + 433, 434, 436, 449, 437, 435, 450, 451, 452, 453, + 454, 455, 456, 438, 439, 440, 457, 441, 442, 443, + 444, 445, 458, 446, 447, 448, 459, 460, 461, 462, + 449, 463, 464, 450, 451, 452, 453, 454, 455, 456, + 465, 466, 467, 457, 468, 469, 470, 471, 472, 458, + 473, 474, 475, 459, 460, 461, 462, 476, 463, 464, + 477, 478, 479, 480, 481, 482, 483, 465, 466, 467, + 484, 468, 469, 470, 471, 472, 485, 473, 474, 475, + 486, 487, 488, 489, 476, 490, 491, 477, 478, 479, + 480, 481, 482, 483, 492, 493, 495, 484, 496, 497, + + 498, 499, 500, 485, 501, 502, 494, 486, 487, 488, + 489, 503, 490, 491, 504, 505, 506, 507, 508, 509, + 510, 492, 493, 495, 511, 496, 497, 498, 499, 500, + 512, 501, 502, 494, 513, 514, 515, 516, 503, 517, + 518, 504, 505, 506, 507, 508, 509, 510, 521, 519, + 522, 511, 523, 524, 525, 526, 527, 512, 528, 529, + 530, 513, 514, 515, 516, 520, 517, 518, 531, 532, + 533, 534, 535, 536, 537, 521, 519, 522, 538, 523, + 524, 525, 526, 527, 539, 528, 529, 530, 540, 541, + 542, 543, 520, 544, 545, 531, 532, 533, 534, 535, + + 536, 537, 546, 547, 548, 538, 549, 550, 551, 552, + 553, 539, 554, 555, 556, 540, 541, 542, 543, 557, + 544, 545, 558, 559, 560, 561, 562, 563, 564, 546, + 547, 548, 565, 549, 550, 551, 552, 553, 566, 554, + 555, 556, 567, 568, 569, 570, 557, 571, 572, 558, + 559, 560, 561, 562, 563, 564, 573, 574, 575, 565, + 576, 577, 578, 579, 580, 566, 581, 582, 583, 567, + 568, 569, 570, 584, 571, 572, 585, 586, 587, 589, + 590, 591, 592, 573, 574, 575, 593, 576, 577, 578, + 579, 580, 594, 581, 582, 583, 595, 596, 597, 598, + + 584, 599, 600, 585, 586, 587, 589, 590, 591, 592, + 603, 601, 604, 593, 602, 605, 606, 607, 608, 594, + 609, 610, 611, 595, 596, 597, 598, 612, 599, 600, + 613, 614, 615, 616, 617, 618, 619, 603, 601, 604, + 620, 602, 605, 606, 607, 608, 621, 609, 610, 611, + 622, 623, 624, 625, 612, 626, 627, 613, 614, 615, + 616, 617, 618, 619, 628, 629, 630, 620, 631, 632, + 633, 634, 635, 621, 636, 637, 638, 622, 623, 624, + 625, 639, 626, 627, 640, 641, 642, 643, 644, 645, + 646, 628, 629, 630, 647, 631, 632, 633, 634, 635, + + 648, 636, 637, 638, 649, 650, 651, 652, 639, 654, + 655, 640, 641, 642, 643, 644, 645, 646, 656, 657, + 658, 647, 659, 660, 661, 662, 663, 648, 664, 665, + 666, 649, 650, 651, 652, 667, 654, 655, 668, 669, + 670, 671, 673, 674, 675, 656, 657, 658, 676, 659, + 660, 661, 662, 663, 677, 664, 665, 666, 678, 679, + 680, 681, 667, 682, 683, 668, 669, 670, 671, 673, + 674, 675, 684, 685, 686, 676, 687, 688, 689, 690, + 691, 677, 692, 693, 694, 678, 679, 680, 681, 695, + 682, 683, 696, 697, 698, 699, 700, 701, 702, 684, + + 685, 686, 703, 687, 688, 689, 690, 691, 704, 692, + 693, 694, 705, 706, 707, 708, 695, 709, 710, 696, + 697, 698, 699, 700, 701, 702, 712, 713, 714, 703, + 715, 716, 717, 718, 719, 704, 720, 721, 722, 705, + 706, 707, 708, 723, 709, 710, 724, 725, 726, 727, + 728, 729, 730, 712, 713, 714, 731, 715, 716, 717, + 718, 719, 732, 720, 721, 722, 733, 734, 735, 736, + 723, 737, 738, 724, 725, 726, 727, 728, 729, 730, + 739, 740, 741, 731, 742, 743, 744, 745, 746, 732, + 747, 748, 749, 733, 734, 735, 736, 750, 737, 738, + + 751, 752, 753, 754, 755, 756, 757, 739, 740, 741, + 758, 742, 743, 744, 745, 746, 759, 747, 748, 749, + 760, 761, 762, 763, 750, 764, 765, 751, 752, 753, + 754, 755, 756, 757, 766, 767, 768, 758, 768, 768, + 768, 768, 768, 759, 768, 768, 768, 760, 761, 762, + 763, 768, 764, 765, 768, 768, 768, 768, 768, 768, + 768, 766, 767, 44, 44, 44, 44, 48, 768, 48, + 48, 150, 150, 768, 150, 5, 768, 768, 768, 768, + 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, + 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, + + 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, + 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, + 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, + 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, + 768, 768, 768, 768 + } ; + +static const flex_int16_t yy_chk[1645] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 7, 7, + 8, 8, 13, 13, 13, 14, 14, 14, 15, 15, + 15, 15, 16, 16, 19, 25, 28, 29, 21, 22, + 35, 25, 19, 22, 19, 21, 21, 22, 43, 19, + + 46, 46, 21, 22, 771, 21, 22, 653, 41, 41, + 588, 19, 25, 28, 29, 21, 22, 35, 25, 19, + 22, 19, 21, 21, 22, 43, 19, 20, 20, 21, + 22, 20, 21, 22, 20, 41, 41, 20, 23, 23, + 23, 59, 558, 20, 40, 60, 61, 20, 40, 26, + 23, 477, 40, 26, 20, 20, 48, 26, 20, 45, + 62, 20, 18, 26, 20, 23, 23, 23, 59, 26, + 20, 40, 60, 61, 20, 40, 26, 23, 24, 40, + 26, 50, 50, 50, 26, 64, 24, 62, 32, 24, + 26, 17, 24, 27, 27, 24, 26, 66, 24, 69, + + 30, 27, 32, 31, 30, 24, 27, 31, 32, 57, + 30, 31, 64, 24, 30, 32, 24, 31, 57, 24, + 27, 27, 24, 31, 66, 24, 69, 30, 27, 32, + 31, 30, 9, 27, 31, 32, 57, 30, 31, 58, + 5, 30, 34, 4, 31, 57, 34, 58, 36, 63, + 31, 33, 36, 68, 68, 33, 34, 70, 36, 34, + 75, 76, 63, 33, 77, 33, 58, 33, 65, 34, + 33, 3, 78, 34, 58, 36, 63, 65, 33, 36, + 68, 68, 33, 34, 70, 36, 34, 75, 76, 63, + 33, 77, 33, 0, 33, 65, 79, 33, 37, 78, + + 80, 37, 0, 39, 65, 39, 37, 37, 39, 37, + 39, 0, 82, 37, 49, 49, 49, 49, 37, 51, + 51, 51, 0, 79, 0, 37, 0, 80, 37, 51, + 39, 72, 39, 37, 37, 39, 37, 39, 73, 82, + 37, 72, 83, 73, 86, 37, 38, 71, 71, 71, + 38, 71, 0, 38, 38, 0, 51, 87, 72, 0, + 38, 0, 0, 38, 87, 73, 84, 88, 72, 83, + 73, 86, 84, 38, 71, 71, 71, 38, 71, 74, + 38, 38, 74, 81, 87, 81, 85, 38, 74, 81, + 38, 87, 85, 84, 88, 74, 81, 89, 90, 84, + + 81, 91, 92, 93, 94, 96, 74, 99, 100, 74, + 81, 0, 81, 85, 0, 74, 81, 104, 102, 85, + 102, 102, 74, 81, 89, 90, 97, 81, 91, 92, + 93, 94, 96, 101, 99, 100, 97, 106, 101, 103, + 107, 97, 97, 103, 104, 102, 105, 102, 102, 108, + 105, 109, 110, 97, 112, 111, 113, 114, 116, 117, + 101, 118, 119, 97, 106, 101, 103, 107, 97, 97, + 103, 111, 120, 105, 0, 123, 108, 105, 109, 110, + 125, 112, 111, 113, 114, 116, 117, 121, 118, 119, + 121, 122, 124, 126, 124, 122, 128, 129, 111, 120, + + 130, 122, 123, 131, 124, 124, 132, 125, 133, 134, + 124, 0, 136, 0, 121, 135, 141, 121, 122, 124, + 126, 124, 122, 128, 129, 135, 0, 130, 122, 0, + 131, 124, 124, 132, 139, 133, 134, 124, 127, 136, + 127, 143, 135, 141, 127, 137, 137, 145, 140, 127, + 146, 140, 135, 140, 139, 142, 127, 127, 140, 142, + 144, 139, 147, 148, 149, 127, 144, 127, 143, 0, + 0, 127, 137, 137, 145, 140, 127, 146, 140, 156, + 140, 139, 142, 127, 127, 140, 142, 144, 157, 147, + 148, 149, 158, 144, 153, 153, 153, 154, 161, 154, + + 154, 154, 162, 163, 153, 164, 156, 165, 165, 166, + 168, 169, 170, 171, 172, 157, 175, 174, 173, 158, + 174, 176, 177, 178, 175, 161, 169, 173, 180, 162, + 163, 153, 164, 181, 165, 165, 166, 168, 169, 170, + 171, 172, 179, 175, 174, 173, 179, 174, 176, 177, + 178, 175, 182, 169, 173, 180, 184, 183, 185, 186, + 181, 183, 187, 188, 189, 191, 192, 193, 194, 179, + 195, 194, 183, 179, 196, 197, 198, 199, 200, 182, + 201, 202, 203, 184, 183, 185, 186, 204, 183, 187, + 188, 189, 191, 192, 193, 194, 205, 195, 194, 183, + + 206, 196, 197, 198, 199, 200, 207, 201, 202, 203, + 208, 209, 210, 211, 204, 212, 213, 214, 215, 216, + 217, 219, 220, 205, 221, 222, 223, 206, 224, 216, + 225, 226, 227, 207, 228, 219, 230, 208, 209, 210, + 211, 231, 212, 213, 214, 215, 216, 217, 219, 220, + 232, 221, 222, 223, 229, 224, 216, 225, 226, 227, + 229, 228, 219, 230, 233, 234, 236, 237, 231, 238, + 239, 240, 241, 242, 243, 244, 245, 232, 246, 247, + 248, 229, 249, 250, 251, 252, 253, 229, 254, 255, + 248, 233, 234, 236, 237, 256, 238, 239, 240, 241, + + 242, 243, 244, 245, 257, 246, 247, 248, 258, 249, + 250, 251, 252, 253, 259, 254, 255, 248, 260, 261, + 263, 264, 256, 265, 266, 267, 268, 269, 270, 271, + 272, 257, 273, 274, 275, 258, 276, 277, 278, 277, + 279, 259, 280, 281, 283, 260, 261, 263, 264, 284, + 265, 266, 267, 268, 269, 270, 271, 272, 285, 273, + 274, 275, 286, 276, 277, 278, 277, 279, 286, 280, + 281, 283, 287, 288, 289, 290, 284, 291, 289, 292, + 292, 292, 293, 293, 293, 285, 294, 295, 296, 286, + 297, 298, 299, 300, 302, 286, 303, 304, 307, 287, + + 288, 289, 290, 308, 291, 289, 309, 310, 311, 312, + 313, 314, 315, 294, 295, 296, 317, 297, 298, 299, + 300, 302, 318, 303, 304, 307, 319, 320, 322, 323, + 308, 324, 325, 309, 310, 311, 312, 313, 314, 315, + 326, 328, 329, 317, 332, 333, 334, 335, 336, 318, + 337, 338, 339, 319, 320, 322, 323, 340, 324, 325, + 341, 342, 343, 344, 347, 348, 349, 326, 328, 329, + 350, 332, 333, 334, 335, 336, 351, 337, 338, 339, + 352, 353, 354, 355, 340, 356, 357, 341, 342, 343, + 344, 347, 348, 349, 358, 359, 362, 350, 363, 366, + + 371, 372, 373, 351, 374, 375, 359, 352, 353, 354, + 355, 376, 356, 357, 377, 378, 379, 381, 382, 383, + 384, 358, 359, 362, 385, 363, 366, 371, 372, 373, + 387, 374, 375, 359, 388, 389, 390, 391, 376, 392, + 393, 377, 378, 379, 381, 382, 383, 384, 396, 394, + 397, 385, 398, 399, 400, 401, 402, 387, 403, 404, + 405, 388, 389, 390, 391, 394, 392, 393, 406, 408, + 409, 410, 411, 412, 413, 396, 394, 397, 414, 398, + 399, 400, 401, 402, 417, 403, 404, 405, 418, 419, + 421, 422, 394, 423, 424, 406, 408, 409, 410, 411, + + 412, 413, 425, 426, 427, 414, 429, 430, 431, 432, + 433, 417, 435, 437, 439, 418, 419, 421, 422, 441, + 423, 424, 442, 443, 444, 445, 446, 447, 448, 425, + 426, 427, 450, 429, 430, 431, 432, 433, 451, 435, + 437, 439, 452, 453, 454, 455, 441, 456, 457, 442, + 443, 444, 445, 446, 447, 448, 459, 460, 461, 450, + 462, 463, 464, 466, 467, 451, 468, 469, 470, 452, + 453, 454, 455, 471, 456, 457, 472, 473, 474, 479, + 480, 481, 482, 459, 460, 461, 484, 462, 463, 464, + 466, 467, 485, 468, 469, 470, 486, 488, 489, 490, + + 471, 492, 493, 472, 473, 474, 479, 480, 481, 482, + 495, 494, 496, 484, 494, 499, 500, 501, 502, 485, + 503, 504, 505, 486, 488, 489, 490, 507, 492, 493, + 508, 509, 512, 514, 515, 516, 517, 495, 494, 496, + 518, 494, 499, 500, 501, 502, 519, 503, 504, 505, + 521, 522, 523, 524, 507, 526, 527, 508, 509, 512, + 514, 515, 516, 517, 528, 529, 530, 518, 531, 532, + 533, 534, 535, 519, 536, 537, 538, 521, 522, 523, + 524, 539, 526, 527, 540, 541, 543, 544, 545, 546, + 547, 528, 529, 530, 549, 531, 532, 533, 534, 535, + + 550, 536, 537, 538, 551, 552, 556, 557, 539, 562, + 564, 540, 541, 543, 544, 545, 546, 547, 566, 567, + 568, 549, 569, 570, 571, 573, 574, 550, 575, 576, + 578, 551, 552, 556, 557, 579, 562, 564, 581, 583, + 585, 587, 589, 595, 596, 566, 567, 568, 598, 569, + 570, 571, 573, 574, 600, 575, 576, 578, 601, 602, + 604, 606, 579, 608, 610, 581, 583, 585, 587, 589, + 595, 596, 611, 612, 614, 598, 615, 616, 617, 618, + 619, 600, 620, 621, 622, 601, 602, 604, 606, 625, + 608, 610, 626, 628, 629, 631, 632, 633, 635, 611, + + 612, 614, 638, 615, 616, 617, 618, 619, 639, 620, + 621, 622, 640, 641, 645, 648, 625, 649, 651, 626, + 628, 629, 631, 632, 633, 635, 655, 656, 662, 638, + 663, 666, 667, 668, 673, 639, 674, 678, 679, 640, + 641, 645, 648, 681, 649, 651, 683, 686, 687, 691, + 692, 696, 698, 655, 656, 662, 700, 663, 666, 667, + 668, 673, 701, 674, 678, 679, 702, 703, 704, 706, + 681, 707, 709, 683, 686, 687, 691, 692, 696, 698, + 710, 713, 714, 700, 716, 718, 720, 721, 724, 701, + 726, 728, 732, 702, 703, 704, 706, 733, 707, 709, + + 734, 735, 736, 738, 739, 740, 746, 710, 713, 714, + 747, 716, 718, 720, 721, 724, 748, 726, 728, 732, + 750, 751, 753, 757, 733, 758, 761, 734, 735, 736, + 738, 739, 740, 746, 762, 766, 0, 747, 0, 0, + 0, 0, 0, 748, 0, 0, 0, 750, 751, 753, + 757, 0, 758, 761, 0, 0, 0, 0, 0, 0, + 0, 762, 766, 769, 769, 769, 769, 770, 0, 770, + 770, 772, 772, 0, 772, 768, 768, 768, 768, 768, + 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, + 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, + + 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, + 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, + 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, + 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, + 768, 768, 768, 768 + } ; + +static const flex_int16_t yy_rule_linenum[212] = + { 0, + 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 226, 227, 228, 229, 230, + + 232, 234, 235, 240, 250, 259, 264, 265, 266, 267, + 270 + } ; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. @@ -989,10 +1385,10 @@ static const flex_int16_t yy_rule_linenum[210] = { static thread_local std::stringstream string_buffer; -#line 1381 "lexer.cpp" +#line 1389 "lexer.cpp" #define YY_NO_INPUT 1 -#line 1384 "lexer.cpp" +#line 1392 "lexer.cpp" #define INITIAL 0 #define SINGLE_QUOTED_STRING 1 @@ -1017,16 +1413,17 @@ static thread_local std::stringstream string_buffer; /* %if-reentrant */ /* Holds the entire state of the reentrant scanner. */ -struct yyguts_t { +struct yyguts_t + { /* User-defined. Not touched by flex. */ YY_EXTRA_TYPE yyextra_r; /* The rest are the same as the globals declared in the non-reentrant scanner. */ FILE *yyin_r, *yyout_r; - size_t yy_buffer_stack_top; /**< index of top of stack. */ - size_t yy_buffer_stack_max; /**< capacity of stack. */ - YY_BUFFER_STATE *yy_buffer_stack; /**< Stack as an array. */ + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; int yy_n_chars; int yyleng_r; @@ -1038,7 +1435,7 @@ struct yyguts_t { int yy_start_stack_depth; int *yy_start_stack; yy_state_type yy_last_accepting_state; - char *yy_last_accepting_cpos; + char* yy_last_accepting_cpos; int yylineno_r; int yy_flex_debug_r; @@ -1047,29 +1444,29 @@ struct yyguts_t { int yy_more_flag; int yy_more_len; - YYSTYPE *yylval_r; + YYSTYPE * yylval_r; - YYLTYPE *yylloc_r; + YYLTYPE * yylloc_r; -}; /* end struct yyguts_t */ + }; /* end struct yyguts_t */ /* %if-c-only */ -static int yy_init_globals(yyscan_t yyscanner); +static int yy_init_globals ( yyscan_t yyscanner ); /* %endif */ /* %if-reentrant */ -/* This must go here because YYSTYPE and YYLTYPE are included - * from bison output in section 1.*/ -#define yylval yyg->yylval_r + /* This must go here because YYSTYPE and YYLTYPE are included + * from bison output in section 1.*/ + # define yylval yyg->yylval_r + + # define yylloc yyg->yylloc_r + +int yylex_init (yyscan_t* scanner); -#define yylloc yyg->yylloc_r - -int yylex_init(yyscan_t *scanner); - -int yylex_init_extra(YY_EXTRA_TYPE user_defined, yyscan_t *scanner); +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); /* %endif */ @@ -1078,46 +1475,46 @@ int yylex_init_extra(YY_EXTRA_TYPE user_defined, yyscan_t *scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int yylex_destroy(yyscan_t yyscanner); +int yylex_destroy ( yyscan_t yyscanner ); -int yyget_debug(yyscan_t yyscanner); +int yyget_debug ( yyscan_t yyscanner ); -void yyset_debug(int debug_flag, yyscan_t yyscanner); +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); -YY_EXTRA_TYPE yyget_extra(yyscan_t yyscanner); +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); -void yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner); +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); -FILE *yyget_in(yyscan_t yyscanner); +FILE *yyget_in ( yyscan_t yyscanner ); -void yyset_in(FILE *_in_str, yyscan_t yyscanner); +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); -FILE *yyget_out(yyscan_t yyscanner); +FILE *yyget_out ( yyscan_t yyscanner ); -void yyset_out(FILE *_out_str, yyscan_t yyscanner); +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); -int yyget_leng(yyscan_t yyscanner); + int yyget_leng ( yyscan_t yyscanner ); -char *yyget_text(yyscan_t yyscanner); +char *yyget_text ( yyscan_t yyscanner ); -int yyget_lineno(yyscan_t yyscanner); +int yyget_lineno ( yyscan_t yyscanner ); -void yyset_lineno(int _line_number, yyscan_t yyscanner); +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); -int yyget_column(yyscan_t yyscanner); +int yyget_column ( yyscan_t yyscanner ); -void yyset_column(int _column_no, yyscan_t yyscanner); +void yyset_column ( int _column_no , yyscan_t yyscanner ); /* %if-bison-bridge */ -YYSTYPE *yyget_lval(yyscan_t yyscanner); - -void yyset_lval(YYSTYPE *yylval_param, yyscan_t yyscanner); +YYSTYPE * yyget_lval ( yyscan_t yyscanner ); -YYLTYPE *yyget_lloc(yyscan_t yyscanner); - -void yyset_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner); +void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); + YYLTYPE *yyget_lloc ( yyscan_t yyscanner ); + + void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner ); + /* %endif */ /* Macros after this point can all be overridden by user definitions in @@ -1126,35 +1523,35 @@ void yyset_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap(yyscan_t yyscanner); +extern "C" int yywrap ( yyscan_t yyscanner ); #else -extern int yywrap(yyscan_t yyscanner); +extern int yywrap ( yyscan_t yyscanner ); #endif #endif /* %not-for-header */ #ifndef YY_NO_UNPUT - + #endif /* %ok-for-header */ /* %endif */ #ifndef yytext_ptr -static void yy_flex_strncpy(char *, const char *, int, yyscan_t yyscanner); +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen(const char *, yyscan_t yyscanner); +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT /* %if-c-only Standard (non-C++) definition */ /* %not-for-header */ #ifdef __cplusplus -static int yyinput(yyscan_t yyscanner); +static int yyinput ( yyscan_t yyscanner ); #else -static int input(yyscan_t yyscanner); +static int input ( yyscan_t yyscanner ); #endif /* %ok-for-header */ @@ -1181,11 +1578,7 @@ static int input(yyscan_t yyscanner); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO \ - do { \ - if (fwrite(yytext, (size_t)yyleng, 1, yyout)) { \ - } \ - } while (0) +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) /* %endif */ /* %if-c++-only C++ definition */ /* %endif */ @@ -1195,32 +1588,38 @@ static int input(yyscan_t yyscanner); * is returned in "result". */ #ifndef YY_INPUT -#define YY_INPUT(buf, result, max_size) \ - /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */ \ - if (YY_CURRENT_BUFFER_LVALUE->yy_is_interactive) { \ - int c = '*'; \ - int n; \ - for (n = 0; n < max_size && (c = getc(yyin)) != EOF && c != '\n'; ++n) \ - buf[n] = (char)c; \ - if (c == '\n') \ - buf[n++] = (char)c; \ - if (c == EOF && ferror(yyin)) \ - YY_FATAL_ERROR("input in flex scanner failed"); \ - result = n; \ - } else { \ - errno = 0; \ - while ((result = (int)fread(buf, 1, (yy_size_t)max_size, yyin)) == 0 && ferror(yyin)) { \ - if (errno != EINTR) { \ - YY_FATAL_ERROR("input in flex scanner failed"); \ - break; \ - } \ - errno = 0; \ - clearerr(yyin); \ - } \ - } \ - \ - /* %if-c++-only C++ definition \ */ \ - /* %endif */ +#define YY_INPUT(buf,result,max_size) \ +/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + int n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ +/* %if-c++-only C++ definition \ */\ +/* %endif */ #endif @@ -1240,7 +1639,7 @@ static int input(yyscan_t yyscanner); /* Report a fatal error. */ #ifndef YY_FATAL_ERROR /* %if-c-only */ -#define YY_FATAL_ERROR(msg) yy_fatal_error(msg, yyscanner) +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ @@ -1264,9 +1663,11 @@ static int input(yyscan_t yyscanner); #define YY_DECL_IS_OURS 1 /* %if-c-only Standard (non-C++) definition */ -extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner); +extern int yylex \ + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner); -#define YY_DECL int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner) +#define YY_DECL int yylex \ + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) /* %endif */ /* %if-c++-only C++ definition */ /* %endif */ @@ -1281,1744 +1682,1364 @@ extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanne /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK /*LINTED*/ break; +#define YY_BREAK /*LINTED*/break; #endif /* %% [6.0] YY_RULE_SETUP definition goes here */ -#define YY_RULE_SETUP YY_USER_ACTION +#define YY_RULE_SETUP \ + YY_USER_ACTION /* %not-for-header */ /** The main scanner function which does all the work. */ -YY_DECL { - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylval = yylval_param; yylloc = yylloc_param; - if (!yyg->yy_init) { - yyg->yy_init = 1; + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; #ifdef YY_USER_INIT - YY_USER_INIT; + YY_USER_INIT; #endif - if (!yyg->yy_start) - yyg->yy_start = 1; /* first start state */ - - if (!yyin) - /* %if-c-only */ - yyin = stdin; - /* %endif */ - /* %if-c++-only */ - /* %endif */ - - if (!yyout) - /* %if-c-only */ - yyout = stdout; - /* %endif */ - /* %if-c++-only */ - /* %endif */ - - if (!YY_CURRENT_BUFFER) { - yyensure_buffer_stack(yyscanner); - YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner); - } - - yy_load_buffer_state(yyscanner); - } + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ - { + if ( ! yyin ) +/* %if-c-only */ + yyin = stdin; +/* %endif */ +/* %if-c++-only */ +/* %endif */ + + if ( ! yyout ) +/* %if-c-only */ + yyout = stdout; +/* %endif */ +/* %if-c++-only */ +/* %endif */ + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_load_buffer_state( yyscanner ); + } + + { /* %% [7.0] user's declarations go here */ #line 27 "lexer.l" -#line 1738 "lexer.cpp" - - while (/*CONSTCOND*/ 1) /* loops until end-of-file is reached */ - { - /* %% [8.0] yymore()-related code goes here */ - yy_cp = yyg->yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yyg->yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - /* %% [9.0] code to set up and find next match goes here */ - yy_current_state = yyg->yy_start; - yy_match: - do { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if (yy_accept[yy_current_state]) { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { - yy_current_state = (int)yy_def[yy_current_state]; - if (yy_current_state >= 759) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - ++yy_cp; - } while (yy_current_state != 758); - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - - yy_find_action: - /* %% [10.0] code to find the action number goes here */ - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - - /* %% [11.0] code for yylineno update goes here */ - - do_action: /* This label is used only to access EOF actions. */ - - /* %% [12.0] debug code goes here */ - if (yy_flex_debug) { - if (yy_act == 0) - fprintf(stderr, "--scanner backing up\n"); - else if (yy_act < 210) - fprintf(stderr, "--accepting rule at line %ld (\"%s\")\n", (long)yy_rule_linenum[yy_act], yytext); - else if (yy_act == 210) - fprintf(stderr, "--accepting default rule (\"%s\")\n", yytext); - else if (yy_act == 211) - fprintf(stderr, "--(end of buffer or a NUL)\n"); - else - fprintf(stderr, "--EOF (start condition %d)\n", YY_START); - } - - switch (yy_act) { /* beginning of action switch */ - /* %% [13.0] actions go here */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yyg->yy_hold_char; - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - goto yy_find_action; - - case 1: - /* rule 1 can match eol */ - YY_RULE_SETUP + +#line 1746 "lexer.cpp" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { +/* %% [8.0] yymore()-related code goes here */ + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + +/* %% [9.0] code to set up and find next match goes here */ + yy_current_state = yyg->yy_start; +yy_match: + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 769 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + ++yy_cp; + } + while ( yy_current_state != 768 ); + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + +yy_find_action: +/* %% [10.0] code to find the action number goes here */ + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +/* %% [11.0] code for yylineno update goes here */ + +do_action: /* This label is used only to access EOF actions. */ + +/* %% [12.0] debug code goes here */ + if ( yy_flex_debug ) + { + if ( yy_act == 0 ) + fprintf( stderr, "--scanner backing up\n" ); + else if ( yy_act < 212 ) + fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n", + (long)yy_rule_linenum[yy_act], yytext ); + else if ( yy_act == 212 ) + fprintf( stderr, "--accepting default rule (\"%s\")\n", + yytext ); + else if ( yy_act == 213 ) + fprintf( stderr, "--(end of buffer or a NUL)\n" ); + else + fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); + } + + switch ( yy_act ) + { /* beginning of action switch */ +/* %% [13.0] actions go here */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + +case 1: +/* rule 1 can match eol */ +YY_RULE_SETUP #line 29 "lexer.l" - /* ignore \t\n and space */; - YY_BREAK - case 2: - YY_RULE_SETUP +/* ignore \t\n and space */; + YY_BREAK +case 2: +YY_RULE_SETUP #line 31 "lexer.l" - { - return ADD; - } - YY_BREAK - case 3: - YY_RULE_SETUP +{ return ADD; } + YY_BREAK +case 3: +YY_RULE_SETUP #line 32 "lexer.l" - { - return ADMIN; - } - YY_BREAK - case 4: - YY_RULE_SETUP +{ return ADMIN; } + YY_BREAK +case 4: +YY_RULE_SETUP #line 33 "lexer.l" - { - return ALL; - } - YY_BREAK - case 5: - YY_RULE_SETUP +{ return ALL; } + YY_BREAK +case 5: +YY_RULE_SETUP #line 34 "lexer.l" - { - return ALLOCATION; - } - YY_BREAK - case 6: - YY_RULE_SETUP +{ return ALLOCATION; } + YY_BREAK +case 6: +YY_RULE_SETUP #line 35 "lexer.l" - { - return ALTER; - } - YY_BREAK - case 7: - YY_RULE_SETUP +{ return ALTER; } + YY_BREAK +case 7: +YY_RULE_SETUP #line 36 "lexer.l" - { - return AND; - } - YY_BREAK - case 8: - YY_RULE_SETUP +{ return AND; } + YY_BREAK +case 8: +YY_RULE_SETUP #line 37 "lexer.l" - { - return AS; - } - YY_BREAK - case 9: - YY_RULE_SETUP +{ return AS; } + YY_BREAK +case 9: +YY_RULE_SETUP #line 38 "lexer.l" - { - return ASC; - } - YY_BREAK - case 10: - YY_RULE_SETUP +{ return ASC; } + YY_BREAK +case 10: +YY_RULE_SETUP #line 39 "lexer.l" - { - return BETWEEN; - } - YY_BREAK - case 11: - YY_RULE_SETUP +{ return BETWEEN; } + YY_BREAK +case 11: +YY_RULE_SETUP #line 40 "lexer.l" - { - return BFLOAT16; - } - YY_BREAK - case 12: - YY_RULE_SETUP +{ return BFLOAT16; } + YY_BREAK +case 12: +YY_RULE_SETUP #line 41 "lexer.l" - { - return BIGINT; - } - YY_BREAK - case 13: - YY_RULE_SETUP +{ return BIGINT; } + YY_BREAK +case 13: +YY_RULE_SETUP #line 42 "lexer.l" - { - return BIT; - } - YY_BREAK - case 14: - YY_RULE_SETUP +{ return BIT; } + YY_BREAK +case 14: +YY_RULE_SETUP #line 43 "lexer.l" - { - return BITMAP; - } - YY_BREAK - case 15: - YY_RULE_SETUP +{ return BITMAP; } + YY_BREAK +case 15: +YY_RULE_SETUP #line 44 "lexer.l" - { - return BOOLEAN; - } - YY_BREAK - case 16: - YY_RULE_SETUP +{ return BOOLEAN; } + YY_BREAK +case 16: +YY_RULE_SETUP #line 45 "lexer.l" - { - return BOX; - } - YY_BREAK - case 17: - YY_RULE_SETUP +{ return BOX; } + YY_BREAK +case 17: +YY_RULE_SETUP #line 46 "lexer.l" - { - return BLOB; - } - YY_BREAK - case 18: - YY_RULE_SETUP +{ return BLOB; } + YY_BREAK +case 18: +YY_RULE_SETUP #line 47 "lexer.l" - { - return BLOCK; - } - YY_BREAK - case 19: - YY_RULE_SETUP +{ return BLOCK; } + YY_BREAK +case 19: +YY_RULE_SETUP #line 48 "lexer.l" - { - return BLOCKS; - } - YY_BREAK - case 20: - YY_RULE_SETUP +{ return BLOCKS; } + YY_BREAK +case 20: +YY_RULE_SETUP #line 49 "lexer.l" - { - return BUFFER; - } - YY_BREAK - case 21: - YY_RULE_SETUP +{ return BUFFER; } + YY_BREAK +case 21: +YY_RULE_SETUP #line 50 "lexer.l" - { - return BY; - } - YY_BREAK - case 22: - YY_RULE_SETUP +{ return BY; } + YY_BREAK +case 22: +YY_RULE_SETUP #line 51 "lexer.l" - { - return CASE; - } - YY_BREAK - case 23: - YY_RULE_SETUP +{ return CASE; } + YY_BREAK +case 23: +YY_RULE_SETUP #line 52 "lexer.l" - { - return CAST; - } - YY_BREAK - case 24: - YY_RULE_SETUP +{ return CAST; } + YY_BREAK +case 24: +YY_RULE_SETUP #line 53 "lexer.l" - { - return CATALOG; - } - YY_BREAK - case 25: - YY_RULE_SETUP +{ return CATALOG; } + YY_BREAK +case 25: +YY_RULE_SETUP #line 54 "lexer.l" - { - return CATALOGS; - } - YY_BREAK - case 26: - YY_RULE_SETUP +{ return CATALOGS; } + YY_BREAK +case 26: +YY_RULE_SETUP #line 55 "lexer.l" - { - return CHUNK; - } - YY_BREAK - case 27: - YY_RULE_SETUP +{ return CHUNK; } + YY_BREAK +case 27: +YY_RULE_SETUP #line 56 "lexer.l" - { - return CIRCLE; - } - YY_BREAK - case 28: - YY_RULE_SETUP +{ return CIRCLE; } + YY_BREAK +case 28: +YY_RULE_SETUP #line 57 "lexer.l" - { - return COLLECTION; - } - YY_BREAK - case 29: - YY_RULE_SETUP +{ return COLLECTION; } + YY_BREAK +case 29: +YY_RULE_SETUP #line 58 "lexer.l" - { - return COLUMN; - } - YY_BREAK - case 30: - YY_RULE_SETUP +{ return COLUMN; } + YY_BREAK +case 30: +YY_RULE_SETUP #line 59 "lexer.l" - { - return COLUMNS; - } - YY_BREAK - case 31: - YY_RULE_SETUP +{ return COLUMNS; } + YY_BREAK +case 31: +YY_RULE_SETUP #line 60 "lexer.l" - { - return COMMENT; - } - YY_BREAK - case 32: - YY_RULE_SETUP +{ return COMMENT; } + YY_BREAK +case 32: +YY_RULE_SETUP #line 61 "lexer.l" - { - return COMPACT; - } - YY_BREAK - case 33: - YY_RULE_SETUP +{ return COMPACT; } + YY_BREAK +case 33: +YY_RULE_SETUP #line 62 "lexer.l" - { - return CONFIGS; - } - YY_BREAK - case 34: - YY_RULE_SETUP +{ return CONFIGS; } + YY_BREAK +case 34: +YY_RULE_SETUP #line 63 "lexer.l" - { - return CONFIG; - } - YY_BREAK - case 35: - YY_RULE_SETUP +{ return CONFIG; } + YY_BREAK +case 35: +YY_RULE_SETUP #line 64 "lexer.l" - { - return CONNECT; - } - YY_BREAK - case 36: - YY_RULE_SETUP +{ return CONNECT; } + YY_BREAK +case 36: +YY_RULE_SETUP #line 65 "lexer.l" - { - return COPY; - } - YY_BREAK - case 37: - YY_RULE_SETUP +{ return COPY; } + YY_BREAK +case 37: +YY_RULE_SETUP #line 66 "lexer.l" - { - return CREATE; - } - YY_BREAK - case 38: - YY_RULE_SETUP +{ return CREATE; } + YY_BREAK +case 38: +YY_RULE_SETUP #line 67 "lexer.l" - { - return CROSS; - } - YY_BREAK - case 39: - YY_RULE_SETUP +{ return CROSS; } + YY_BREAK +case 39: +YY_RULE_SETUP #line 68 "lexer.l" - { - return DATA; - } - YY_BREAK - case 40: - YY_RULE_SETUP +{ return DATA; } + YY_BREAK +case 40: +YY_RULE_SETUP #line 69 "lexer.l" - { - return DATABASE; - } - YY_BREAK - case 41: - YY_RULE_SETUP +{ return DATABASE; } + YY_BREAK +case 41: +YY_RULE_SETUP #line 70 "lexer.l" - { - return DATABASES; - } - YY_BREAK - case 42: - YY_RULE_SETUP +{ return DATABASES; } + YY_BREAK +case 42: +YY_RULE_SETUP #line 71 "lexer.l" - { - return DATE; - } - YY_BREAK - case 43: - YY_RULE_SETUP +{ return DATE; } + YY_BREAK +case 43: +YY_RULE_SETUP #line 72 "lexer.l" - { - return DATETIME; - } - YY_BREAK - case 44: - YY_RULE_SETUP +{ return DATETIME; } + YY_BREAK +case 44: +YY_RULE_SETUP #line 73 "lexer.l" - { - return DAY; - } - YY_BREAK - case 45: - YY_RULE_SETUP +{ return DAY; } + YY_BREAK +case 45: +YY_RULE_SETUP #line 74 "lexer.l" - { - return DAYS; - } - YY_BREAK - case 46: - YY_RULE_SETUP +{ return DAYS; } + YY_BREAK +case 46: +YY_RULE_SETUP #line 75 "lexer.l" - { - return DISTINCT; - } - YY_BREAK - case 47: - YY_RULE_SETUP +{ return DISTINCT; } + YY_BREAK +case 47: +YY_RULE_SETUP #line 76 "lexer.l" - { - return DOUBLE; - } - YY_BREAK - case 48: - YY_RULE_SETUP +{ return DOUBLE; } + YY_BREAK +case 48: +YY_RULE_SETUP #line 77 "lexer.l" - { - return DECIMAL; - } - YY_BREAK - case 49: - YY_RULE_SETUP +{ return DECIMAL; } + YY_BREAK +case 49: +YY_RULE_SETUP #line 78 "lexer.l" - { - return DEFAULT; - } - YY_BREAK - case 50: - YY_RULE_SETUP +{ return DEFAULT; } + YY_BREAK +case 50: +YY_RULE_SETUP #line 79 "lexer.l" - { - return DELETE; - } - YY_BREAK - case 51: - YY_RULE_SETUP +{ return DELETE; } + YY_BREAK +case 51: +YY_RULE_SETUP #line 80 "lexer.l" - { - return DELIMITER; - } - YY_BREAK - case 52: - YY_RULE_SETUP +{ return DELIMITER; } + YY_BREAK +case 52: +YY_RULE_SETUP #line 81 "lexer.l" - { - return DELTA; - } - YY_BREAK - case 53: - YY_RULE_SETUP +{ return DELTA; } + YY_BREAK +case 53: +YY_RULE_SETUP #line 82 "lexer.l" - { - return DESC; - } - YY_BREAK - case 54: - YY_RULE_SETUP +{ return DESC; } + YY_BREAK +case 54: +YY_RULE_SETUP #line 83 "lexer.l" - { - return DROP; - } - YY_BREAK - case 55: - YY_RULE_SETUP +{ return DROP; } + YY_BREAK +case 55: +YY_RULE_SETUP #line 84 "lexer.l" - { - return ELSE; - } - YY_BREAK - case 56: - YY_RULE_SETUP +{ return ELSE; } + YY_BREAK +case 56: +YY_RULE_SETUP #line 85 "lexer.l" - { - return EMBEDDING; - } - YY_BREAK - case 57: - YY_RULE_SETUP +{ return EMBEDDING; } + YY_BREAK +case 57: +YY_RULE_SETUP #line 86 "lexer.l" - { - return END; - } - YY_BREAK - case 58: - YY_RULE_SETUP +{ return END; } + YY_BREAK +case 58: +YY_RULE_SETUP #line 87 "lexer.l" - { - return EXCEPT; - } - YY_BREAK - case 59: - YY_RULE_SETUP +{ return EXCEPT; } + YY_BREAK +case 59: +YY_RULE_SETUP #line 88 "lexer.l" - { - return EXTRACT; - } - YY_BREAK - case 60: - YY_RULE_SETUP +{ return EXTRACT; } + YY_BREAK +case 60: +YY_RULE_SETUP #line 89 "lexer.l" - { - return EXECUTE; - } - YY_BREAK - case 61: - YY_RULE_SETUP +{ return EXECUTE; } + YY_BREAK +case 61: +YY_RULE_SETUP #line 90 "lexer.l" - { - return EXISTS; - } - YY_BREAK - case 62: - YY_RULE_SETUP +{ return EXISTS; } + YY_BREAK +case 62: +YY_RULE_SETUP #line 91 "lexer.l" - { - return EXPLAIN; - } - YY_BREAK - case 63: - YY_RULE_SETUP +{ return EXPLAIN; } + YY_BREAK +case 63: +YY_RULE_SETUP #line 92 "lexer.l" - { - return EXPORT; - } - YY_BREAK - case 64: - YY_RULE_SETUP +{ return EXPORT; } + YY_BREAK +case 64: +YY_RULE_SETUP #line 93 "lexer.l" - { - return FALSE; - } - YY_BREAK - case 65: - YY_RULE_SETUP +{ return FALSE; } + YY_BREAK +case 65: +YY_RULE_SETUP #line 94 "lexer.l" - { - return FILES; - } - YY_BREAK - case 66: - YY_RULE_SETUP +{ return FILES; } + YY_BREAK +case 66: +YY_RULE_SETUP #line 95 "lexer.l" - { - return FLOAT; - } - YY_BREAK - case 67: - YY_RULE_SETUP +{ return FLOAT; } + YY_BREAK +case 67: +YY_RULE_SETUP #line 96 "lexer.l" - { - return FLOAT16; - } - YY_BREAK - case 68: - YY_RULE_SETUP +{ return FLOAT16; } + YY_BREAK +case 68: +YY_RULE_SETUP #line 97 "lexer.l" - { - return FLUSH; - } - YY_BREAK - case 69: - YY_RULE_SETUP +{ return FLUSH; } + YY_BREAK +case 69: +YY_RULE_SETUP #line 98 "lexer.l" - { - return FOLLOWER; - } - YY_BREAK - case 70: - YY_RULE_SETUP +{ return FOLLOWER; } + YY_BREAK +case 70: +YY_RULE_SETUP #line 99 "lexer.l" - { - return FORMAT; - } - YY_BREAK - case 71: - YY_RULE_SETUP +{ return FORMAT; } + YY_BREAK +case 71: +YY_RULE_SETUP #line 100 "lexer.l" - { - return FROM; - } - YY_BREAK - case 72: - YY_RULE_SETUP +{ return FROM; } + YY_BREAK +case 72: +YY_RULE_SETUP #line 101 "lexer.l" - { - return FULL; - } - YY_BREAK - case 73: - YY_RULE_SETUP +{ return FULL; } + YY_BREAK +case 73: +YY_RULE_SETUP #line 102 "lexer.l" - { - return FUSION; - } - YY_BREAK - case 74: - YY_RULE_SETUP +{ return FUSION; } + YY_BREAK +case 74: +YY_RULE_SETUP #line 103 "lexer.l" - { - return GLOBAL; - } - YY_BREAK - case 75: - YY_RULE_SETUP +{ return GLOBAL; } + YY_BREAK +case 75: +YY_RULE_SETUP #line 104 "lexer.l" - { - return GROUP; - } - YY_BREAK - case 76: - YY_RULE_SETUP +{ return GROUP; } + YY_BREAK +case 76: +YY_RULE_SETUP #line 105 "lexer.l" - { - return HAVING; - } - YY_BREAK - case 77: - YY_RULE_SETUP +{ return HAVING; } + YY_BREAK +case 77: +YY_RULE_SETUP #line 106 "lexer.l" - { - return HEADER; - } - YY_BREAK - case 78: - YY_RULE_SETUP +{ return HEADER; } + YY_BREAK +case 78: +YY_RULE_SETUP #line 107 "lexer.l" - { - return HIGHLIGHT; - } - YY_BREAK - case 79: - YY_RULE_SETUP +{ return HIGHLIGHT; } + YY_BREAK +case 79: +YY_RULE_SETUP #line 108 "lexer.l" - { - return HOUR; - } - YY_BREAK - case 80: - YY_RULE_SETUP +{ return HOUR; } + YY_BREAK +case 80: +YY_RULE_SETUP #line 109 "lexer.l" - { - return HOURS; - } - YY_BREAK - case 81: - YY_RULE_SETUP +{ return HOURS; } + YY_BREAK +case 81: +YY_RULE_SETUP #line 110 "lexer.l" - { - return HUGEINT; - } - YY_BREAK - case 82: - YY_RULE_SETUP +{ return HUGEINT; } + YY_BREAK +case 82: +YY_RULE_SETUP #line 111 "lexer.l" - { - return IF; - } - YY_BREAK - case 83: - YY_RULE_SETUP +{ return IF; } + YY_BREAK +case 83: +YY_RULE_SETUP #line 112 "lexer.l" - { - return IGNORE; - } - YY_BREAK - case 84: - YY_RULE_SETUP +{ return IGNORE; } + YY_BREAK +case 84: +YY_RULE_SETUP #line 113 "lexer.l" - { - return IN; - } - YY_BREAK - case 85: - YY_RULE_SETUP +{ return IN; } + YY_BREAK +case 85: +YY_RULE_SETUP #line 114 "lexer.l" - { - return INDEX; - } - YY_BREAK - case 86: - YY_RULE_SETUP +{ return INDEX; } + YY_BREAK +case 86: +YY_RULE_SETUP #line 115 "lexer.l" - { - return INDEXES; - } - YY_BREAK - case 87: - YY_RULE_SETUP +{ return INDEXES; } + YY_BREAK +case 87: +YY_RULE_SETUP #line 116 "lexer.l" - { - return INNER; - } - YY_BREAK - case 88: - YY_RULE_SETUP +{ return INNER; } + YY_BREAK +case 88: +YY_RULE_SETUP #line 117 "lexer.l" - { - return INSERT; - } - YY_BREAK - case 89: - YY_RULE_SETUP +{ return INSERT; } + YY_BREAK +case 89: +YY_RULE_SETUP #line 118 "lexer.l" - { - return INTEGER; - } - YY_BREAK - case 90: - YY_RULE_SETUP +{ return INTEGER; } + YY_BREAK +case 90: +YY_RULE_SETUP #line 119 "lexer.l" - { - return INT; - } - YY_BREAK - case 91: - YY_RULE_SETUP +{ return INT; } + YY_BREAK +case 91: +YY_RULE_SETUP #line 120 "lexer.l" - { - return INTERSECT; - } - YY_BREAK - case 92: - YY_RULE_SETUP +{ return INTERSECT; } + YY_BREAK +case 92: +YY_RULE_SETUP #line 121 "lexer.l" - { - return INTERVAL; - } - YY_BREAK - case 93: - YY_RULE_SETUP +{ return INTERVAL; } + YY_BREAK +case 93: +YY_RULE_SETUP #line 122 "lexer.l" - { - return INTO; - } - YY_BREAK - case 94: - YY_RULE_SETUP +{ return INTO; } + YY_BREAK +case 94: +YY_RULE_SETUP #line 123 "lexer.l" - { - return IS; - } - YY_BREAK - case 95: - YY_RULE_SETUP +{ return IS; } + YY_BREAK +case 95: +YY_RULE_SETUP #line 124 "lexer.l" - { - return JOIN; - } - YY_BREAK - case 96: - YY_RULE_SETUP +{ return JOIN; } + YY_BREAK +case 96: +YY_RULE_SETUP #line 125 "lexer.l" - { - return KEY; - } - YY_BREAK - case 97: - YY_RULE_SETUP +{ return KEY; } + YY_BREAK +case 97: +YY_RULE_SETUP #line 126 "lexer.l" - { - return LEADER; - } - YY_BREAK - case 98: - YY_RULE_SETUP +{ return LEADER; } + YY_BREAK +case 98: +YY_RULE_SETUP #line 127 "lexer.l" - { - return LEARNER; - } - YY_BREAK - case 99: - YY_RULE_SETUP +{ return LEARNER; } + YY_BREAK +case 99: +YY_RULE_SETUP #line 128 "lexer.l" - { - return LEFT; - } - YY_BREAK - case 100: - YY_RULE_SETUP +{ return LEFT; } + YY_BREAK +case 100: +YY_RULE_SETUP #line 129 "lexer.l" - { - return LIKE; - } - YY_BREAK - case 101: - YY_RULE_SETUP +{ return LIKE; } + YY_BREAK +case 101: +YY_RULE_SETUP #line 130 "lexer.l" - { - return LIMIT; - } - YY_BREAK - case 102: - YY_RULE_SETUP +{ return LIMIT; } + YY_BREAK +case 102: +YY_RULE_SETUP #line 131 "lexer.l" - { - return LINE; - } - YY_BREAK - case 103: - YY_RULE_SETUP +{ return LINE; } + YY_BREAK +case 103: +YY_RULE_SETUP #line 132 "lexer.l" - { - return LOCK; - } - YY_BREAK - case 104: - YY_RULE_SETUP +{ return LOCK; } + YY_BREAK +case 104: +YY_RULE_SETUP #line 133 "lexer.l" - { - return LOG; - } - YY_BREAK - case 105: - YY_RULE_SETUP +{ return LOG; } + YY_BREAK +case 105: +YY_RULE_SETUP #line 134 "lexer.l" - { - return LOGS; - } - YY_BREAK - case 106: - YY_RULE_SETUP +{ return LOGS; } + YY_BREAK +case 106: +YY_RULE_SETUP #line 135 "lexer.l" - { - return LSEG; - } - YY_BREAK - case 107: - YY_RULE_SETUP +{ return LSEG; } + YY_BREAK +case 107: +YY_RULE_SETUP #line 136 "lexer.l" - { - return MATCH; - } - YY_BREAK - case 108: - YY_RULE_SETUP +{ return MATCH; } + YY_BREAK +case 108: +YY_RULE_SETUP #line 137 "lexer.l" - { - return MAXSIM; - } - YY_BREAK - case 109: - YY_RULE_SETUP +{ return MAXSIM; } + YY_BREAK +case 109: +YY_RULE_SETUP #line 138 "lexer.l" - { - return MEMORY; - } - YY_BREAK - case 110: - YY_RULE_SETUP +{ return MEMORY; } + YY_BREAK +case 110: +YY_RULE_SETUP #line 139 "lexer.l" - { - return MEMINDEX; - } - YY_BREAK - case 111: - YY_RULE_SETUP +{ return MEMINDEX; } + YY_BREAK +case 111: +YY_RULE_SETUP #line 140 "lexer.l" - { - return MINUTE; - } - YY_BREAK - case 112: - YY_RULE_SETUP +{ return MINUTE; } + YY_BREAK +case 112: +YY_RULE_SETUP #line 141 "lexer.l" - { - return MINUTES; - } - YY_BREAK - case 113: - YY_RULE_SETUP +{ return MINUTES; } + YY_BREAK +case 113: +YY_RULE_SETUP #line 142 "lexer.l" - { - return MONTH; - } - YY_BREAK - case 114: - YY_RULE_SETUP +{ return MONTH; } + YY_BREAK +case 114: +YY_RULE_SETUP #line 143 "lexer.l" - { - return MONTHS; - } - YY_BREAK - case 115: - YY_RULE_SETUP +{ return MONTHS; } + YY_BREAK +case 115: +YY_RULE_SETUP #line 144 "lexer.l" - { - return MULTIVECTOR; - } - YY_BREAK - case 116: - YY_RULE_SETUP +{ return MULTIVECTOR; } + YY_BREAK +case 116: +YY_RULE_SETUP #line 145 "lexer.l" - { - return NATURAL; - } - YY_BREAK - case 117: - YY_RULE_SETUP +{ return NATURAL; } + YY_BREAK +case 117: +YY_RULE_SETUP #line 146 "lexer.l" - { - return NULLABLE; - } - YY_BREAK - case 118: - YY_RULE_SETUP +{ return NULLABLE; } + YY_BREAK +case 118: +YY_RULE_SETUP #line 147 "lexer.l" - { - return NODE; - } - YY_BREAK - case 119: - YY_RULE_SETUP +{ return NODE; } + YY_BREAK +case 119: +YY_RULE_SETUP #line 148 "lexer.l" - { - return NODES; - } - YY_BREAK - case 120: - YY_RULE_SETUP +{ return NODES; } + YY_BREAK +case 120: +YY_RULE_SETUP #line 149 "lexer.l" - { - return NOT; - } - YY_BREAK - case 121: - YY_RULE_SETUP +{ return NOT; } + YY_BREAK +case 121: +YY_RULE_SETUP #line 150 "lexer.l" - { - return OBJECT; - } - YY_BREAK - case 122: - YY_RULE_SETUP +{ return OBJECT; } + YY_BREAK +case 122: +YY_RULE_SETUP #line 151 "lexer.l" - { - return OBJECTS; - } - YY_BREAK - case 123: - YY_RULE_SETUP +{ return OBJECTS; } + YY_BREAK +case 123: +YY_RULE_SETUP #line 152 "lexer.l" - { - return OFF; - } - YY_BREAK - case 124: - YY_RULE_SETUP +{ return OFF; } + YY_BREAK +case 124: +YY_RULE_SETUP #line 153 "lexer.l" - { - return OFFSET; - } - YY_BREAK - case 125: - YY_RULE_SETUP +{ return OFFSET; } + YY_BREAK +case 125: +YY_RULE_SETUP #line 154 "lexer.l" - { - return ON; - } - YY_BREAK - case 126: - YY_RULE_SETUP +{ return ON; } + YY_BREAK +case 126: +YY_RULE_SETUP #line 155 "lexer.l" - { - return OPTIMIZE; - } - YY_BREAK - case 127: - YY_RULE_SETUP +{ return OPTIMIZE; } + YY_BREAK +case 127: +YY_RULE_SETUP #line 156 "lexer.l" - { - return OR; - } - YY_BREAK - case 128: - YY_RULE_SETUP +{ return OR; } + YY_BREAK +case 128: +YY_RULE_SETUP #line 157 "lexer.l" - { - return ORDER; - } - YY_BREAK - case 129: - YY_RULE_SETUP +{ return ORDER; } + YY_BREAK +case 129: +YY_RULE_SETUP #line 158 "lexer.l" - { - return OUTER; - } - YY_BREAK - case 130: - YY_RULE_SETUP +{ return OUTER; } + YY_BREAK +case 130: +YY_RULE_SETUP #line 159 "lexer.l" - { - return PATH; - } - YY_BREAK - case 131: - YY_RULE_SETUP +{ return PATH; } + YY_BREAK +case 131: +YY_RULE_SETUP #line 160 "lexer.l" - { - return PERSISTENCE; - } - YY_BREAK - case 132: - YY_RULE_SETUP +{ return PERSISTENCE; } + YY_BREAK +case 132: +YY_RULE_SETUP #line 161 "lexer.l" - { - return POINT; - } - YY_BREAK - case 133: - YY_RULE_SETUP +{ return POINT; } + YY_BREAK +case 133: +YY_RULE_SETUP #line 162 "lexer.l" - { - return POLYGON; - } - YY_BREAK - case 134: - YY_RULE_SETUP +{ return POLYGON; } + YY_BREAK +case 134: +YY_RULE_SETUP #line 163 "lexer.l" - { - return PREPARE; - } - YY_BREAK - case 135: - YY_RULE_SETUP +{ return PREPARE; } + YY_BREAK +case 135: +YY_RULE_SETUP #line 164 "lexer.l" - { - return PRIMARY; - } - YY_BREAK - case 136: - YY_RULE_SETUP +{ return PRIMARY; } + YY_BREAK +case 136: +YY_RULE_SETUP #line 165 "lexer.l" - { - return PROFILES; - } - YY_BREAK - case 137: - YY_RULE_SETUP +{ return PROFILES; } + YY_BREAK +case 137: +YY_RULE_SETUP #line 166 "lexer.l" - { - return PROPERTIES; - } - YY_BREAK - case 138: - YY_RULE_SETUP +{ return PROPERTIES; } + YY_BREAK +case 138: +YY_RULE_SETUP #line 167 "lexer.l" - { - return QUERIES; - } - YY_BREAK - case 139: - YY_RULE_SETUP +{ return QUERIES; } + YY_BREAK +case 139: +YY_RULE_SETUP #line 168 "lexer.l" - { - return QUERY; - } - YY_BREAK - case 140: - YY_RULE_SETUP +{ return QUERY; } + YY_BREAK +case 140: +YY_RULE_SETUP #line 169 "lexer.l" - { - return REAL; - } - YY_BREAK - case 141: - YY_RULE_SETUP +{ return REAL; } + YY_BREAK +case 141: +YY_RULE_SETUP #line 170 "lexer.l" - { - return RECOVER; - } - YY_BREAK - case 142: - YY_RULE_SETUP +{ return RECOVER; } + YY_BREAK +case 142: +YY_RULE_SETUP #line 171 "lexer.l" - { - return RENAME; - } - YY_BREAK - case 143: - YY_RULE_SETUP +{ return RESTORE; } + YY_BREAK +case 143: +YY_RULE_SETUP #line 172 "lexer.l" - { - return REMOVE; - } - YY_BREAK - case 144: - YY_RULE_SETUP +{ return RENAME; } + YY_BREAK +case 144: +YY_RULE_SETUP #line 173 "lexer.l" - { - return RIGHT; - } - YY_BREAK - case 145: - YY_RULE_SETUP +{ return REMOVE; } + YY_BREAK +case 145: +YY_RULE_SETUP #line 174 "lexer.l" - { - return ROWLIMIT; - } - YY_BREAK - case 146: - YY_RULE_SETUP +{ return RIGHT; } + YY_BREAK +case 146: +YY_RULE_SETUP #line 175 "lexer.l" - { - return SEARCH; - } - YY_BREAK - case 147: - YY_RULE_SETUP +{ return ROWLIMIT; } + YY_BREAK +case 147: +YY_RULE_SETUP #line 176 "lexer.l" - { - return SECOND; - } - YY_BREAK - case 148: - YY_RULE_SETUP +{ return SEARCH; } + YY_BREAK +case 148: +YY_RULE_SETUP #line 177 "lexer.l" - { - return SECONDS; - } - YY_BREAK - case 149: - YY_RULE_SETUP +{ return SECOND; } + YY_BREAK +case 149: +YY_RULE_SETUP #line 178 "lexer.l" - { - return SELECT; - } - YY_BREAK - case 150: - YY_RULE_SETUP +{ return SECONDS; } + YY_BREAK +case 150: +YY_RULE_SETUP #line 179 "lexer.l" - { - return SESSION; - } - YY_BREAK - case 151: - YY_RULE_SETUP +{ return SELECT; } + YY_BREAK +case 151: +YY_RULE_SETUP #line 180 "lexer.l" - { - return SET; - } - YY_BREAK - case 152: - YY_RULE_SETUP +{ return SESSION; } + YY_BREAK +case 152: +YY_RULE_SETUP #line 181 "lexer.l" - { - return SEGMENT; - } - YY_BREAK - case 153: - YY_RULE_SETUP +{ return SET; } + YY_BREAK +case 153: +YY_RULE_SETUP #line 182 "lexer.l" - { - return SEGMENTS; - } - YY_BREAK - case 154: - YY_RULE_SETUP +{ return SEGMENT; } + YY_BREAK +case 154: +YY_RULE_SETUP #line 183 "lexer.l" - { - return SHOW; - } - YY_BREAK - case 155: - YY_RULE_SETUP +{ return SEGMENTS; } + YY_BREAK +case 155: +YY_RULE_SETUP #line 184 "lexer.l" - { - return SMALLINT; - } - YY_BREAK - case 156: - YY_RULE_SETUP +{ return SHOW; } + YY_BREAK +case 156: +YY_RULE_SETUP #line 185 "lexer.l" - { - return SNAPSHOT; - } - YY_BREAK - case 157: - YY_RULE_SETUP +{ return SMALLINT; } + YY_BREAK +case 157: +YY_RULE_SETUP #line 186 "lexer.l" - { - return SNAPSHOTS; - } - YY_BREAK - case 158: - YY_RULE_SETUP +{ return SNAPSHOT; } + YY_BREAK +case 158: +YY_RULE_SETUP #line 187 "lexer.l" - { - return SPARSE; - } - YY_BREAK - case 159: - YY_RULE_SETUP +{ return SNAPSHOTS; } + YY_BREAK +case 159: +YY_RULE_SETUP #line 188 "lexer.l" - { - return STANDALONE; - } - YY_BREAK - case 160: - YY_RULE_SETUP +{ return SPARSE; } + YY_BREAK +case 160: +YY_RULE_SETUP #line 189 "lexer.l" - { - return TABLE; - } - YY_BREAK - case 161: - YY_RULE_SETUP +{ return STANDALONE; } + YY_BREAK +case 161: +YY_RULE_SETUP #line 190 "lexer.l" - { - return TABLES; - } - YY_BREAK - case 162: - YY_RULE_SETUP +{ return SYSTEM; } + YY_BREAK +case 162: +YY_RULE_SETUP #line 191 "lexer.l" - { - return TENSOR; - } - YY_BREAK - case 163: - YY_RULE_SETUP +{ return TABLE; } + YY_BREAK +case 163: +YY_RULE_SETUP #line 192 "lexer.l" - { - return TENSORARRAY; - } - YY_BREAK - case 164: - YY_RULE_SETUP +{ return TABLES; } + YY_BREAK +case 164: +YY_RULE_SETUP #line 193 "lexer.l" - { - return TEXT; - } - YY_BREAK - case 165: - YY_RULE_SETUP +{ return TENSOR; } + YY_BREAK +case 165: +YY_RULE_SETUP #line 194 "lexer.l" - { - return THEN; - } - YY_BREAK - case 166: - YY_RULE_SETUP +{ return TENSORARRAY; } + YY_BREAK +case 166: +YY_RULE_SETUP #line 195 "lexer.l" - { - return TIME; - } - YY_BREAK - case 167: - YY_RULE_SETUP +{ return TEXT; } + YY_BREAK +case 167: +YY_RULE_SETUP #line 196 "lexer.l" - { - return TIMESTAMP; - } - YY_BREAK - case 168: - YY_RULE_SETUP +{ return THEN; } + YY_BREAK +case 168: +YY_RULE_SETUP #line 197 "lexer.l" - { - return TINYINT; - } - YY_BREAK - case 169: - YY_RULE_SETUP +{ return TIME; } + YY_BREAK +case 169: +YY_RULE_SETUP #line 198 "lexer.l" - { - return TO; - } - YY_BREAK - case 170: - YY_RULE_SETUP +{ return TIMESTAMP; } + YY_BREAK +case 170: +YY_RULE_SETUP #line 199 "lexer.l" - { - return TRANSACTION; - } - YY_BREAK - case 171: - YY_RULE_SETUP +{ return TINYINT; } + YY_BREAK +case 171: +YY_RULE_SETUP #line 200 "lexer.l" - { - return TRANSACTIONS; - } - YY_BREAK - case 172: - YY_RULE_SETUP +{ return TO; } + YY_BREAK +case 172: +YY_RULE_SETUP #line 201 "lexer.l" - { - return TRUE; - } - YY_BREAK - case 173: - YY_RULE_SETUP +{ return TRANSACTION; } + YY_BREAK +case 173: +YY_RULE_SETUP #line 202 "lexer.l" - { - return UNION; - } - YY_BREAK - case 174: - YY_RULE_SETUP +{ return TRANSACTIONS; } + YY_BREAK +case 174: +YY_RULE_SETUP #line 203 "lexer.l" - { - return UNIQUE; - } - YY_BREAK - case 175: - YY_RULE_SETUP +{ return TRUE; } + YY_BREAK +case 175: +YY_RULE_SETUP #line 204 "lexer.l" - { - return UNLOCK; - } - YY_BREAK - case 176: - YY_RULE_SETUP +{ return UNION; } + YY_BREAK +case 176: +YY_RULE_SETUP #line 205 "lexer.l" - { - return UNNEST; - } - YY_BREAK - case 177: - YY_RULE_SETUP +{ return UNIQUE; } + YY_BREAK +case 177: +YY_RULE_SETUP #line 206 "lexer.l" - { - return UNSIGNED; - } - YY_BREAK - case 178: - YY_RULE_SETUP +{ return UNLOCK; } + YY_BREAK +case 178: +YY_RULE_SETUP #line 207 "lexer.l" - { - return USING; - } - YY_BREAK - case 179: - YY_RULE_SETUP +{ return UNNEST; } + YY_BREAK +case 179: +YY_RULE_SETUP #line 208 "lexer.l" - { - return UPDATE; - } - YY_BREAK - case 180: - YY_RULE_SETUP +{ return UNSIGNED; } + YY_BREAK +case 180: +YY_RULE_SETUP #line 209 "lexer.l" - { - return UUID; - } - YY_BREAK - case 181: - YY_RULE_SETUP +{ return USING; } + YY_BREAK +case 181: +YY_RULE_SETUP #line 210 "lexer.l" - { - return USE; - } - YY_BREAK - case 182: - YY_RULE_SETUP +{ return UPDATE; } + YY_BREAK +case 182: +YY_RULE_SETUP #line 211 "lexer.l" - { - return VALUES; - } - YY_BREAK - case 183: - YY_RULE_SETUP +{ return UUID; } + YY_BREAK +case 183: +YY_RULE_SETUP #line 212 "lexer.l" - { - return VARIABLE; - } - YY_BREAK - case 184: - YY_RULE_SETUP +{ return USE; } + YY_BREAK +case 184: +YY_RULE_SETUP #line 213 "lexer.l" - { - return VARIABLES; - } - YY_BREAK - case 185: - YY_RULE_SETUP +{ return VALUES; } + YY_BREAK +case 185: +YY_RULE_SETUP #line 214 "lexer.l" - { - return VARCHAR; - } - YY_BREAK - case 186: - YY_RULE_SETUP +{ return VARIABLE; } + YY_BREAK +case 186: +YY_RULE_SETUP #line 215 "lexer.l" - { - return VECTOR; - } - YY_BREAK - case 187: - YY_RULE_SETUP +{ return VARIABLES; } + YY_BREAK +case 187: +YY_RULE_SETUP #line 216 "lexer.l" - { - return VIEW; - } - YY_BREAK - case 188: - YY_RULE_SETUP +{ return VARCHAR; } + YY_BREAK +case 188: +YY_RULE_SETUP #line 217 "lexer.l" - { - return VIEWS; - } - YY_BREAK - case 189: - YY_RULE_SETUP +{ return VECTOR; } + YY_BREAK +case 189: +YY_RULE_SETUP #line 218 "lexer.l" - { - return WHEN; - } - YY_BREAK - case 190: - YY_RULE_SETUP +{ return VIEW; } + YY_BREAK +case 190: +YY_RULE_SETUP #line 219 "lexer.l" - { - return WHERE; - } - YY_BREAK - case 191: - YY_RULE_SETUP +{ return VIEWS; } + YY_BREAK +case 191: +YY_RULE_SETUP #line 220 "lexer.l" - { - return WITH; - } - YY_BREAK - case 192: - YY_RULE_SETUP +{ return WHEN; } + YY_BREAK +case 192: +YY_RULE_SETUP #line 221 "lexer.l" - { - return YEAR; - } - YY_BREAK - case 193: - YY_RULE_SETUP +{ return WHERE; } + YY_BREAK +case 193: +YY_RULE_SETUP #line 222 "lexer.l" - { - return YEARS; - } - YY_BREAK - case 194: - YY_RULE_SETUP +{ return WITH; } + YY_BREAK +case 194: +YY_RULE_SETUP +#line 223 "lexer.l" +{ return YEAR; } + YY_BREAK +case 195: +YY_RULE_SETUP #line 224 "lexer.l" - { - return EQUAL; - } - YY_BREAK - case 195: - YY_RULE_SETUP -#line 225 "lexer.l" - { - return NOT_EQ; - } - YY_BREAK - case 196: - YY_RULE_SETUP +{ return YEARS; } + YY_BREAK +case 196: +YY_RULE_SETUP #line 226 "lexer.l" - { - return NOT_EQ; - } - YY_BREAK - case 197: - YY_RULE_SETUP +{ return EQUAL; } + YY_BREAK +case 197: +YY_RULE_SETUP #line 227 "lexer.l" - { - return LESS_EQ; - } - YY_BREAK - case 198: - YY_RULE_SETUP +{ return NOT_EQ; } + YY_BREAK +case 198: +YY_RULE_SETUP #line 228 "lexer.l" - { - return GREATER_EQ; - } - YY_BREAK - case 199: - YY_RULE_SETUP +{ return NOT_EQ; } + YY_BREAK +case 199: +YY_RULE_SETUP +#line 229 "lexer.l" +{ return LESS_EQ; } + YY_BREAK +case 200: +YY_RULE_SETUP #line 230 "lexer.l" - { - return yytext[0]; - } - YY_BREAK - case 200: -#line 233 "lexer.l" - case 201: - YY_RULE_SETUP -#line 233 "lexer.l" - { - yylval->double_value = atof(yytext); - return DOUBLE_VALUE; - } - YY_BREAK - case 202: - YY_RULE_SETUP -#line 238 "lexer.l" - { - errno = 0; - yylval->long_value = strtoll(yytext, nullptr, 0); - if (errno) { - return fprintf(stderr, "[SQL-Lexer-Error] Integer cannot be parsed - is it out of range?"); - return 0; - } - return LONG_VALUE; - } - YY_BREAK - case 203: - YY_RULE_SETUP -#line 248 "lexer.l" - { - // total length - 2 of quota + 1 null char - long str_len = strlen(yytext) - 1; - yylval->str_value = (char *)malloc(str_len); - memset(yylval->str_value, 0, str_len); - memcpy(yylval->str_value, (char *)(yytext + 1), str_len - 1); - return IDENTIFIER; - } - YY_BREAK - case 204: - YY_RULE_SETUP -#line 257 "lexer.l" - { - yylval->str_value = strdup(yytext); - return IDENTIFIER; - } - YY_BREAK - case 205: - YY_RULE_SETUP -#line 262 "lexer.l" - { - BEGIN SINGLE_QUOTED_STRING; - string_buffer.clear(); - string_buffer.str(""); - } // Clear strbuf manually, see #170 - YY_BREAK - case 206: - YY_RULE_SETUP -#line 263 "lexer.l" - { - string_buffer << '\''; - } - YY_BREAK - case 207: - /* rule 207 can match eol */ - YY_RULE_SETUP +{ return GREATER_EQ; } + YY_BREAK +case 201: +YY_RULE_SETUP +#line 232 "lexer.l" +{ return yytext[0]; } + YY_BREAK +case 202: +#line 235 "lexer.l" +case 203: +YY_RULE_SETUP +#line 235 "lexer.l" +{ + yylval->double_value = atof(yytext); + return DOUBLE_VALUE; +} + YY_BREAK +case 204: +YY_RULE_SETUP +#line 240 "lexer.l" +{ + errno = 0; + yylval->long_value = strtoll(yytext, nullptr, 0); + if (errno) { + return fprintf(stderr, "[SQL-Lexer-Error] Integer cannot be parsed - is it out of range?"); + return 0; + } + return LONG_VALUE; +} + YY_BREAK +case 205: +YY_RULE_SETUP +#line 250 "lexer.l" +{ + // total length - 2 of quota + 1 null char + long str_len = strlen(yytext) - 1; + yylval->str_value = (char*)malloc(str_len); + memset(yylval->str_value, 0, str_len); + memcpy(yylval->str_value, (char*)(yytext + 1), str_len - 1); + return IDENTIFIER; +} + YY_BREAK +case 206: +YY_RULE_SETUP +#line 259 "lexer.l" +{ + yylval->str_value = strdup(yytext); + return IDENTIFIER; +} + YY_BREAK +case 207: +YY_RULE_SETUP #line 264 "lexer.l" - { - string_buffer << yytext; - } - YY_BREAK - case 208: - YY_RULE_SETUP +{ BEGIN SINGLE_QUOTED_STRING; string_buffer.clear(); string_buffer.str(""); } // Clear strbuf manually, see #170 + YY_BREAK +case 208: +YY_RULE_SETUP #line 265 "lexer.l" - { - BEGIN INITIAL; - yylval->str_value = strdup(string_buffer.str().c_str()); - return STRING; - } - YY_BREAK - case YY_STATE_EOF(SINGLE_QUOTED_STRING): +{ string_buffer << '\''; } + YY_BREAK +case 209: +/* rule 209 can match eol */ +YY_RULE_SETUP #line 266 "lexer.l" - { - fprintf(stderr, "[SQL-Lexer-Error] Unterminated string\n"); - return 0; - } - YY_BREAK - case 209: - YY_RULE_SETUP +{ string_buffer << yytext; } + YY_BREAK +case 210: +YY_RULE_SETUP +#line 267 "lexer.l" +{ BEGIN INITIAL; yylval->str_value = strdup(string_buffer.str().c_str()); return STRING; } + YY_BREAK +case YY_STATE_EOF(SINGLE_QUOTED_STRING): #line 268 "lexer.l" - { - fprintf(stderr, "[SQL-Lexer-Error] Unknown Character: %c\n", yytext[0]); - return 0; - } - YY_BREAK - case 210: - YY_RULE_SETUP +{ fprintf(stderr, "[SQL-Lexer-Error] Unterminated string\n"); return 0; } + YY_BREAK +case 211: +YY_RULE_SETUP #line 270 "lexer.l" - ECHO; - YY_BREAK -#line 2888 "lexer.cpp" - case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int)(yy_cp - yyg->yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yyg->yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW) { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - /* %if-c-only */ - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - /* %endif */ - /* %if-c++-only */ - /* %endif */ - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if (yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]) { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(yyscanner); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans(yy_current_state, yyscanner); - - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - - if (yy_next_state) { - /* Consume the NUL. */ - yy_cp = ++yyg->yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else { - /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - goto yy_find_action; - } - } - - else - switch (yy_get_next_buffer(yyscanner)) { - case EOB_ACT_END_OF_FILE: { - yyg->yy_did_buffer_switch_on_eof = 0; - - if (yywrap(yyscanner)) { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else { - if (!yyg->yy_did_buffer_switch_on_eof) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(yyscanner); - - yy_cp = yyg->yy_c_buf_p; - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yyg->yy_c_buf_p = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; - - yy_current_state = yy_get_previous_state(yyscanner); - - yy_cp = yyg->yy_c_buf_p; - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR("fatal flex scanner internal error--no action found"); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ +{ fprintf(stderr, "[SQL-Lexer-Error] Unknown Character: %c\n", yytext[0]); return 0; } + YY_BREAK +case 212: +YY_RULE_SETUP +#line 272 "lexer.l" +ECHO; + YY_BREAK +#line 2906 "lexer.cpp" +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; +/* %if-c-only */ + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; +/* %endif */ +/* %if-c++-only */ +/* %endif */ + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { +/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( yywrap( yyscanner ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* %ok-for-header */ @@ -3036,158 +3057,181 @@ YY_DECL { * EOB_ACT_END_OF_FILE - end of file */ /* %if-c-only */ -static int yy_get_next_buffer(yyscan_t yyscanner) +static int yy_get_next_buffer (yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = yyg->yytext_ptr; - int number_to_move, i; - int ret_val; - - if (yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1]) - YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed"); - - if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0) { /* Don't try to fill the buffer, so this is an EOF. */ - if (yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1) { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int)(yyg->yy_c_buf_p - yyg->yytext_ptr - 1); - - for (i = 0; i < number_to_move; ++i) - *(dest++) = *(source++); - - if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; - - else { - int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while (num_to_read <= 0) { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = (int)(yyg->yy_c_buf_p - b->yy_ch_buf); - - if (b->yy_is_our_buffer) { - int new_size = b->yy_buf_size * 2; - - if (new_size <= 0) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc((void *)b->yy_ch_buf, (yy_size_t)(b->yy_buf_size + 2), yyscanner); - } else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; - - if (!b->yy_ch_buf) - YY_FATAL_ERROR("fatal error - scanner input buffer overflow"); - - yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - } - - if (num_to_read > YY_READ_BUF_SIZE) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), yyg->yy_n_chars, num_to_read); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - if (yyg->yy_n_chars == 0) { - if (number_to_move == YY_MORE_ADJ) { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin, yyscanner); - } - - else { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *)yyrealloc((void *)YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t)new_size, yyscanner); - if (!YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) - YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()"); - /* "- 2" to take care of EOB's */ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int)(new_size - 2); - } - - yyg->yy_n_chars += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + yyg->yy_n_chars, num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin , yyscanner); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ /* %if-c-only */ /* %not-for-header */ -static yy_state_type yy_get_previous_state(yyscan_t yyscanner) + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - yy_state_type yy_current_state; - char *yy_cp; - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - - /* %% [15.0] code to get the start state into yy_current_state goes here */ - yy_current_state = yyg->yy_start; - - for (yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp) { - /* %% [16.0] code to find the next state goes here */ - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if (yy_accept[yy_current_state]) { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { - yy_current_state = (int)yy_def[yy_current_state]; - if (yy_current_state >= 759) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - } - - return yy_current_state; + yy_state_type yy_current_state; + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + +/* %% [15.0] code to get the start state into yy_current_state goes here */ + yy_current_state = yyg->yy_start; + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { +/* %% [16.0] code to find the next state goes here */ + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 769 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + } + + return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character @@ -3196,31 +3240,33 @@ static yy_state_type yy_get_previous_state(yyscan_t yyscanner) * next_state = yy_try_NUL_trans( current_state ); */ /* %if-c-only */ -static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state, yyscan_t yyscanner) + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - int yy_is_jam; - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; /* This var may be unused depending upon options. */ - /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ - char *yy_cp = yyg->yy_c_buf_p; - - YY_CHAR yy_c = 1; - if (yy_accept[yy_current_state]) { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { - yy_current_state = (int)yy_def[yy_current_state]; - if (yy_current_state >= 759) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 758); - - (void)yyg; - return yy_is_jam ? 0 : yy_current_state; + int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ +/* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ + char *yy_cp = yyg->yy_c_buf_p; + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 769 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 768); + + (void)yyg; + return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT @@ -3232,81 +3278,85 @@ static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state, yyscan_t y /* %if-c-only */ #ifndef YY_NO_INPUT #ifdef __cplusplus -static int yyinput(yyscan_t yyscanner) + static int yyinput (yyscan_t yyscanner) #else -static int input(yyscan_t yyscanner) + static int input (yyscan_t yyscanner) #endif /* %endif */ /* %if-c++-only */ /* %endif */ { - int c; - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - - *yyg->yy_c_buf_p = yyg->yy_hold_char; - - if (*yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR) { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if (yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]) - /* This was really a NUL. */ - *yyg->yy_c_buf_p = '\0'; - - else { /* need more input */ - int offset = (int)(yyg->yy_c_buf_p - yyg->yytext_ptr); - ++yyg->yy_c_buf_p; - - switch (yy_get_next_buffer(yyscanner)) { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart(yyin, yyscanner); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: { - if (yywrap(yyscanner)) - return 0; - - if (!yyg->yy_did_buffer_switch_on_eof) - YY_NEW_FILE; + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin , yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( yyscanner ) ) + return 0; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; #ifdef __cplusplus - return yyinput(yyscanner); + return yyinput(yyscanner); #else - return input(yyscanner); + return input(yyscanner); #endif - } + } - case EOB_ACT_CONTINUE_SCAN: - yyg->yy_c_buf_p = yyg->yytext_ptr + offset; - break; - } - } - } + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } - c = *(unsigned char *)yyg->yy_c_buf_p; /* cast for 8-bit char's */ - *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ - yyg->yy_hold_char = *++yyg->yy_c_buf_p; + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; - /* %% [19.0] update BOL and yylineno */ +/* %% [19.0] update BOL and yylineno */ - return c; + return c; } /* %if-c-only */ -#endif /* ifndef YY_NO_INPUT */ - /* %endif */ +#endif /* ifndef YY_NO_INPUT */ +/* %endif */ /** Immediately switch to a different input stream. * @param input_file A readable stream. @@ -3314,20 +3364,21 @@ static int input(yyscan_t yyscanner) * @note This function does not reset the start condition to @c INITIAL . */ /* %if-c-only */ -void yyrestart(FILE *input_file, yyscan_t yyscanner) + void yyrestart (FILE * input_file , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (!YY_CURRENT_BUFFER) { - yyensure_buffer_stack(yyscanner); - YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner); - } + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } - yy_init_buffer(YY_CURRENT_BUFFER, input_file, yyscanner); - yy_load_buffer_state(yyscanner); + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); } /* %if-c++-only */ @@ -3338,55 +3389,56 @@ void yyrestart(FILE *input_file, yyscan_t yyscanner) * @param yyscanner The scanner object. */ /* %if-c-only */ -void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner) + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); */ - yyensure_buffer_stack(yyscanner); - if (YY_CURRENT_BUFFER == new_buffer) - return; - - if (YY_CURRENT_BUFFER) { - /* Flush out information for old buffer. */ - *yyg->yy_c_buf_p = yyg->yy_hold_char; - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state(yyscanner); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yyg->yy_did_buffer_switch_on_eof = 1; + yyensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( yyscanner ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yyg->yy_did_buffer_switch_on_eof = 1; } /* %if-c-only */ -static void yy_load_buffer_state(yyscan_t yyscanner) +static void yy_load_buffer_state (yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - /* %if-c-only */ - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - /* %endif */ - /* %if-c++-only */ - /* %endif */ - yyg->yy_hold_char = *yyg->yy_c_buf_p; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; +/* %if-c-only */ + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; +/* %endif */ +/* %if-c++-only */ +/* %endif */ + yyg->yy_hold_char = *yyg->yy_c_buf_p; } /** Allocate and initialize an input buffer state. @@ -3396,31 +3448,31 @@ static void yy_load_buffer_state(yyscan_t yyscanner) * @return the allocated buffer state. */ /* %if-c-only */ -YY_BUFFER_STATE yy_create_buffer(FILE *file, int size, yyscan_t yyscanner) + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE)yyalloc(sizeof(struct yy_buffer_state), yyscanner); - if (!b) - YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = size; - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *)yyalloc((yy_size_t)(b->yy_buf_size + 2), yyscanner); - if (!b->yy_ch_buf) - YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_is_our_buffer = 1; + b->yy_is_our_buffer = 1; - yy_init_buffer(b, file, yyscanner); + yy_init_buffer( b, file , yyscanner); - return b; + return b; } /* %if-c++-only */ @@ -3431,23 +3483,23 @@ YY_BUFFER_STATE yy_create_buffer(FILE *file, int size, yyscan_t yyscanner) * @param yyscanner The scanner object. */ /* %if-c-only */ -void yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner) + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (!b) - return; + if ( ! b ) + return; - if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE)0; + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - if (b->yy_is_our_buffer) - yyfree((void *)b->yy_ch_buf, yyscanner); + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf , yyscanner ); - yyfree((void *)b, yyscanner); + yyfree( (void *) b , yyscanner ); } /* Initializes or reinitializes a buffer. @@ -3455,41 +3507,41 @@ void yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner) * such as during a yyrestart() or at EOF. */ /* %if-c-only */ -static void yy_init_buffer(YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner) + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - int oerrno = errno; - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flush_buffer(b, yyscanner); + yy_flush_buffer( b , yyscanner); - /* %if-c-only */ - b->yy_input_file = file; - /* %endif */ - /* %if-c++-only */ - /* %endif */ - b->yy_fill_buffer = 1; +/* %if-c-only */ + b->yy_input_file = file; +/* %endif */ +/* %if-c++-only */ +/* %endif */ + b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ - if (b != YY_CURRENT_BUFFER) { + if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } - /* %if-c-only */ - - b->yy_is_interactive = 0; +/* %if-c-only */ - /* %endif */ - /* %if-c++-only */ - /* %endif */ - errno = oerrno; + b->yy_is_interactive = 0; + +/* %endif */ +/* %if-c++-only */ +/* %endif */ + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. @@ -3497,31 +3549,31 @@ static void yy_init_buffer(YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner) * @param yyscanner The scanner object. */ /* %if-c-only */ -void yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner) + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - if (!b) - return; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if ( ! b ) + return; - b->yy_n_chars = 0; + b->yy_n_chars = 0; - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - b->yy_buf_pos = &b->yy_ch_buf[0]; + b->yy_buf_pos = &b->yy_ch_buf[0]; - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; - if (b == YY_CURRENT_BUFFER) - yy_load_buffer_state(yyscanner); + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( yyscanner ); } /* %if-c-or-c++ */ @@ -3532,33 +3584,34 @@ void yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner) * @param yyscanner The scanner object. */ /* %if-c-only */ -void yypush_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner) +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(yyscanner); - - /* This block is copied from yy_switch_to_buffer. */ - if (YY_CURRENT_BUFFER) { - /* Flush out information for old buffer. */ - *yyg->yy_c_buf_p = yyg->yy_hold_char; - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - yyg->yy_buffer_stack_top++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state(yyscanner); - yyg->yy_did_buffer_switch_on_eof = 1; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(yyscanner); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; } /* %endif */ @@ -3568,24 +3621,24 @@ void yypush_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner) * @param yyscanner The scanner object. */ /* %if-c-only */ -void yypop_buffer_state(yyscan_t yyscanner) +void yypop_buffer_state (yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner); - YY_CURRENT_BUFFER_LVALUE = NULL; - if (yyg->yy_buffer_stack_top > 0) - --yyg->yy_buffer_stack_top; - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state(yyscanner); - yyg->yy_did_buffer_switch_on_eof = 1; - } + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; + } } /* %endif */ @@ -3594,46 +3647,51 @@ void yypop_buffer_state(yyscan_t yyscanner) * Guarantees space for at least one push. */ /* %if-c-only */ -static void yyensure_buffer_stack(yyscan_t yyscanner) +static void yyensure_buffer_stack (yyscan_t yyscanner) /* %endif */ /* %if-c++-only */ /* %endif */ { - yy_size_t num_to_alloc; - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (!yyg->yy_buffer_stack) { + if (!yyg->yy_buffer_stack) { - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ - yyg->yy_buffer_stack = (struct yy_buffer_state **)yyalloc(num_to_alloc * sizeof(struct yy_buffer_state *), yyscanner); - if (!yyg->yy_buffer_stack) - YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); - - memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state *)); - - yyg->yy_buffer_stack_max = num_to_alloc; - yyg->yy_buffer_stack_top = 0; - return; - } - - if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1) { - - /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = yyg->yy_buffer_stack_max + grow_size; - yyg->yy_buffer_stack = (struct yy_buffer_state **)yyrealloc(yyg->yy_buffer_stack, num_to_alloc * sizeof(struct yy_buffer_state *), yyscanner); - if (!yyg->yy_buffer_stack) - YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); - - /* zero only the new slots.*/ - memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state *)); - yyg->yy_buffer_stack_max = num_to_alloc; - } + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->yy_buffer_stack_max = num_to_alloc; + } } /* %endif */ @@ -3644,30 +3702,33 @@ static void yyensure_buffer_stack(yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner) { - YY_BUFFER_STATE b; - - if (size < 2 || base[size - 2] != YY_END_OF_BUFFER_CHAR || base[size - 1] != YY_END_OF_BUFFER_CHAR) - /* They forgot to leave room for the EOB's. */ - return NULL; - - b = (YY_BUFFER_STATE)yyalloc(sizeof(struct yy_buffer_state), yyscanner); - if (!b) - YY_FATAL_ERROR("out of dynamic memory in yy_scan_buffer()"); - - b->yy_buf_size = (int)(size - 2); /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = NULL; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer(b, yyscanner); - - return b; +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b , yyscanner ); + + return b; } /* %endif */ @@ -3680,7 +3741,11 @@ YY_BUFFER_STATE yy_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner) { * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ -YY_BUFFER_STATE yy_scan_string(const char *yystr, yyscan_t yyscanner) { return yy_scan_bytes(yystr, (int)strlen(yystr), yyscanner); } +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); +} /* %endif */ /* %if-c-only */ @@ -3691,33 +3756,34 @@ YY_BUFFER_STATE yy_scan_string(const char *yystr, yyscan_t yyscanner) { return y * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes(const char *yybytes, int _yybytes_len, yyscan_t yyscanner) { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = (yy_size_t)(_yybytes_len + 2); - buf = (char *)yyalloc(n, yyscanner); - if (!buf) - YY_FATAL_ERROR("out of dynamic memory in yy_scan_bytes()"); - - for (i = 0; i < _yybytes_len; ++i) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len + 1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer(buf, n, yyscanner); - if (!b) - YY_FATAL_ERROR("bad buffer in yy_scan_bytes()"); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n , yyscanner); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; } /* %endif */ @@ -3726,11 +3792,12 @@ YY_BUFFER_STATE yy_scan_bytes(const char *yybytes, int _yybytes_len, yyscan_t yy #endif /* %if-c-only */ -static void yynoreturn yy_fatal_error(const char *msg, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - (void)yyg; - fprintf(stderr, "%s\n", msg); - exit(YY_EXIT_FAILURE); +static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); } /* %endif */ /* %if-c++-only */ @@ -3739,17 +3806,19 @@ static void yynoreturn yy_fatal_error(const char *msg, yyscan_t yyscanner) { /* Redefine yyless() so it works in section 3 code. */ #undef yyless -#define yyless(n) \ - do { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg); \ - yytext[yyleng] = yyg->yy_hold_char; \ - yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ - yyg->yy_hold_char = *yyg->yy_c_buf_p; \ - *yyg->yy_c_buf_p = '\0'; \ - yyleng = yyless_macro_arg; \ - } while (0) +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ @@ -3759,8 +3828,9 @@ static void yynoreturn yy_fatal_error(const char *msg, yyscan_t yyscanner) { /** Get the user-defined data for this scanner. * @param yyscanner The scanner object. */ -YY_EXTRA_TYPE yyget_extra(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyextra; } @@ -3769,48 +3839,53 @@ YY_EXTRA_TYPE yyget_extra(yyscan_t yyscanner) { /** Get the current line number. * @param yyscanner The scanner object. */ -int yyget_lineno(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - - if (!YY_CURRENT_BUFFER) - return 0; +int yyget_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (! YY_CURRENT_BUFFER) + return 0; + return yylineno; } /** Get the current column number. * @param yyscanner The scanner object. */ -int yyget_column(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - - if (!YY_CURRENT_BUFFER) - return 0; +int yyget_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (! YY_CURRENT_BUFFER) + return 0; + return yycolumn; } /** Get the input stream. * @param yyscanner The scanner object. */ -FILE *yyget_in(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +FILE *yyget_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyin; } /** Get the output stream. * @param yyscanner The scanner object. */ -FILE *yyget_out(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +FILE *yyget_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyout; } /** Get the length of the current token. * @param yyscanner The scanner object. */ -int yyget_leng(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +int yyget_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; } @@ -3818,8 +3893,9 @@ int yyget_leng(yyscan_t yyscanner) { * @param yyscanner The scanner object. */ -char *yyget_text(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +char *yyget_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yytext; } @@ -3829,9 +3905,10 @@ char *yyget_text(yyscan_t yyscanner) { * @param user_defined The data to be associated with this scanner. * @param yyscanner The scanner object. */ -void yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - yyextra = user_defined; +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; } /* %endif */ @@ -3840,13 +3917,14 @@ void yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner) { * @param _line_number line number * @param yyscanner The scanner object. */ -void yyset_lineno(int _line_number, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - - /* lineno is only valid if an input buffer exists. */ - if (!YY_CURRENT_BUFFER) - YY_FATAL_ERROR("yyset_lineno called with no buffer"); +void yyset_lineno (int _line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + yylineno = _line_number; } @@ -3854,13 +3932,14 @@ void yyset_lineno(int _line_number, yyscan_t yyscanner) { * @param _column_no column number * @param yyscanner The scanner object. */ -void yyset_column(int _column_no, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - - /* column is only valid if an input buffer exists. */ - if (!YY_CURRENT_BUFFER) - YY_FATAL_ERROR("yyset_column called with no buffer"); +void yyset_column (int _column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + yycolumn = _column_no; } @@ -3870,24 +3949,28 @@ void yyset_column(int _column_no, yyscan_t yyscanner) { * @param yyscanner The scanner object. * @see yy_switch_to_buffer */ -void yyset_in(FILE *_in_str, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - yyin = _in_str; +void yyset_in (FILE * _in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; } -void yyset_out(FILE *_out_str, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - yyout = _out_str; +void yyset_out (FILE * _out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; } -int yyget_debug(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +int yyget_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yy_flex_debug; } -void yyset_debug(int _bdebug, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - yy_flex_debug = _bdebug; +void yyset_debug (int _bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; } /* %endif */ @@ -3897,26 +3980,30 @@ void yyset_debug(int _bdebug, yyscan_t yyscanner) { /* %if-bison-bridge */ -YYSTYPE *yyget_lval(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +YYSTYPE * yyget_lval (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylval; } -void yyset_lval(YYSTYPE *yylval_param, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylval = yylval_param; } -YYLTYPE *yyget_lloc(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +YYLTYPE *yyget_lloc (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylloc; } - -void yyset_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; + +void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylloc = yylloc_param; } - + /* %endif */ /* User-visible API */ @@ -3925,23 +4012,24 @@ void yyset_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner) { * the ONLY reentrant function that doesn't take the scanner as the last argument. * That's why we explicitly handle the declaration, instead of using our macros. */ -int yylex_init(yyscan_t *ptr_yy_globals) { - if (ptr_yy_globals == NULL) { +int yylex_init(yyscan_t* ptr_yy_globals) +{ + if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } - *ptr_yy_globals = (yyscan_t)yyalloc(sizeof(struct yyguts_t), NULL); + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); - if (*ptr_yy_globals == NULL) { + if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals, 0x00, sizeof(struct yyguts_t)); + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - return yy_init_globals(*ptr_yy_globals); + return yy_init_globals ( *ptr_yy_globals ); } /* yylex_init_extra has the same functionality as yylex_init, but follows the @@ -3951,37 +4039,39 @@ int yylex_init(yyscan_t *ptr_yy_globals) { * The user defined value in the first argument will be available to yyalloc in * the yyextra field. */ -int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined, yyscan_t *ptr_yy_globals) { +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) +{ struct yyguts_t dummy_yyguts; - yyset_extra(yy_user_defined, &dummy_yyguts); + yyset_extra (yy_user_defined, &dummy_yyguts); - if (ptr_yy_globals == NULL) { + if (ptr_yy_globals == NULL){ errno = EINVAL; return 1; } - *ptr_yy_globals = (yyscan_t)yyalloc(sizeof(struct yyguts_t), &dummy_yyguts); + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - if (*ptr_yy_globals == NULL) { + if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals, 0x00, sizeof(struct yyguts_t)); + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - yyset_extra(yy_user_defined, *ptr_yy_globals); + yyset_extra (yy_user_defined, *ptr_yy_globals); - return yy_init_globals(*ptr_yy_globals); + return yy_init_globals ( *ptr_yy_globals ); } /* %endif if-c-only */ /* %if-c-only */ -static int yy_init_globals(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ @@ -3995,7 +4085,7 @@ static int yy_init_globals(yyscan_t yyscanner) { yyg->yy_start_stack_ptr = 0; yyg->yy_start_stack_depth = 0; - yyg->yy_start_stack = NULL; + yyg->yy_start_stack = NULL; /* Defined in main.c */ #ifdef YY_STDINIT @@ -4015,33 +4105,34 @@ static int yy_init_globals(yyscan_t yyscanner) { /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */ /* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy(yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; +int yylex_destroy (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* Pop the buffer stack, destroying each element. */ - while (YY_CURRENT_BUFFER) { - yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(yyscanner); - } + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(yyscanner); + } - /* Destroy the stack itself. */ - yyfree(yyg->yy_buffer_stack, yyscanner); - yyg->yy_buffer_stack = NULL; + /* Destroy the stack itself. */ + yyfree(yyg->yy_buffer_stack , yyscanner); + yyg->yy_buffer_stack = NULL; /* Destroy the start condition stack. */ - yyfree(yyg->yy_start_stack, yyscanner); - yyg->yy_start_stack = NULL; + yyfree( yyg->yy_start_stack , yyscanner ); + yyg->yy_start_stack = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ - yy_init_globals(yyscanner); + yy_init_globals( yyscanner); - /* %if-reentrant */ +/* %if-reentrant */ /* Destroy the main struct (reentrant only). */ - yyfree(yyscanner, yyscanner); + yyfree ( yyscanner , yyscanner ); yyscanner = NULL; - /* %endif */ +/* %endif */ return 0; } /* %endif */ @@ -4051,50 +4142,55 @@ int yylex_destroy(yyscan_t yyscanner) { */ #ifndef yytext_ptr -static void yy_flex_strncpy(char *s1, const char *s2, int n, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - (void)yyg; +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; - int i; - for (i = 0; i < n; ++i) - s1[i] = s2[i]; + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen(const char *s, yyscan_t yyscanner) { - int n; - for (n = 0; s[n]; ++n) - ; +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; - return n; + return n; } #endif -void *yyalloc(yy_size_t size, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - (void)yyg; - return malloc(size); +void *yyalloc (yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + return malloc(size); } -void *yyrealloc(void *ptr, yy_size_t size, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - (void)yyg; - - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return realloc(ptr, size); +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); } -void yyfree(void *ptr, yyscan_t yyscanner) { - struct yyguts_t *yyg = (struct yyguts_t *)yyscanner; - (void)yyg; - free((char *)ptr); /* see yyrealloc() for (char *) cast */ +void yyfree (void * ptr , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } /* %if-tables-serialization definitions */ @@ -4104,9 +4200,10 @@ void yyfree(void *ptr, yyscan_t yyscanner) { /* %ok-for-header */ -#line 270 "lexer.l" +#line 272 "lexer.l" + int yyerror(const char *msg) { - fprintf(stderr, "[Why here?] %s\n", msg); - return 0; + fprintf(stderr, "[Why here?] %s\n",msg); return 0; } + diff --git a/src/parser/lexer.h b/src/parser/lexer.h index 19b0676035..5c1e2b622f 100644 --- a/src/parser/lexer.h +++ b/src/parser/lexer.h @@ -6,7 +6,7 @@ #line 8 "lexer.h" -#define YY_INT_ALIGNED short int +#define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ @@ -268,10 +268,10 @@ /* begin standard C headers. */ /* %if-c-only */ -#include #include -#include #include +#include +#include /* %endif */ /* %if-tables-serialization */ @@ -286,10 +286,10 @@ /* C99 systems have . Non-C99 systems may or may not. */ -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -306,41 +306,41 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN -#define INT8_MIN (-128) +#define INT8_MIN (-128) #endif #ifndef INT16_MIN -#define INT16_MIN (-32767 - 1) +#define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN -#define INT32_MIN (-2147483647 - 1) +#define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX -#define INT8_MAX (127) +#define INT8_MAX (127) #endif #ifndef INT16_MAX -#define INT16_MAX (32767) +#define INT16_MAX (32767) #endif #ifndef INT32_MAX -#define INT32_MAX (2147483647) +#define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX -#define UINT8_MAX (255U) +#define UINT8_MAX (255U) #endif #ifndef UINT16_MAX -#define UINT16_MAX (65535U) +#define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) +#define UINT32_MAX (4294967295U) #endif #ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) +#define SIZE_MAX (~(size_t)0) #endif #endif /* ! C99 */ @@ -371,7 +371,7 @@ typedef unsigned int flex_uint32_t; /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T #define YY_TYPEDEF_YY_SCANNER_T -typedef void *yyscan_t; +typedef void* yyscan_t; #endif /* For convenience, these vars (plus the bison vars far below) @@ -423,56 +423,58 @@ typedef size_t yy_size_t; #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state { - /* %if-c-only */ - FILE *yy_input_file; - /* %endif */ - - /* %if-c++-only */ - /* %endif */ - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; +struct yy_buffer_state + { +/* %if-c-only */ + FILE *yy_input_file; +/* %endif */ + +/* %if-c++-only */ +/* %endif */ + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; - int yy_buffer_status; -}; + }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* %if-c-only Standard (non-C++) definition */ @@ -487,28 +489,28 @@ struct yy_buffer_state { /* %endif */ -void yyrestart(FILE *input_file, yyscan_t yyscanner); -void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner); -YY_BUFFER_STATE yy_create_buffer(FILE *file, int size, yyscan_t yyscanner); -void yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner); -void yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner); -void yypush_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner); -void yypop_buffer_state(yyscan_t yyscanner); +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); -YY_BUFFER_STATE yy_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner); -YY_BUFFER_STATE yy_scan_string(const char *yy_str, yyscan_t yyscanner); -YY_BUFFER_STATE yy_scan_bytes(const char *bytes, int len, yyscan_t yyscanner); +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner ); /* %endif */ -void *yyalloc(yy_size_t, yyscan_t yyscanner); -void *yyrealloc(void *, yy_size_t, yyscan_t yyscanner); -void yyfree(void *, yyscan_t yyscanner); +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */ /* Begin user sect3 */ -#define sqlwrap(yyscanner) (/*CONSTCOND*/ 1) +#define sqlwrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP #define FLEX_DEBUG @@ -550,9 +552,9 @@ void yyfree(void *, yyscan_t yyscanner); /* %if-reentrant */ -int yylex_init(yyscan_t *scanner); +int yylex_init (yyscan_t* scanner); -int yylex_init_extra(YY_EXTRA_TYPE user_defined, yyscan_t *scanner); +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); /* %endif */ @@ -561,46 +563,46 @@ int yylex_init_extra(YY_EXTRA_TYPE user_defined, yyscan_t *scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -int yylex_destroy(yyscan_t yyscanner); +int yylex_destroy ( yyscan_t yyscanner ); -int yyget_debug(yyscan_t yyscanner); +int yyget_debug ( yyscan_t yyscanner ); -void yyset_debug(int debug_flag, yyscan_t yyscanner); +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); -YY_EXTRA_TYPE yyget_extra(yyscan_t yyscanner); +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); -void yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner); +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); -FILE *yyget_in(yyscan_t yyscanner); +FILE *yyget_in ( yyscan_t yyscanner ); -void yyset_in(FILE *_in_str, yyscan_t yyscanner); +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); -FILE *yyget_out(yyscan_t yyscanner); +FILE *yyget_out ( yyscan_t yyscanner ); -void yyset_out(FILE *_out_str, yyscan_t yyscanner); +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); -int yyget_leng(yyscan_t yyscanner); + int yyget_leng ( yyscan_t yyscanner ); -char *yyget_text(yyscan_t yyscanner); +char *yyget_text ( yyscan_t yyscanner ); -int yyget_lineno(yyscan_t yyscanner); +int yyget_lineno ( yyscan_t yyscanner ); -void yyset_lineno(int _line_number, yyscan_t yyscanner); +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); -int yyget_column(yyscan_t yyscanner); +int yyget_column ( yyscan_t yyscanner ); -void yyset_column(int _column_no, yyscan_t yyscanner); +void yyset_column ( int _column_no , yyscan_t yyscanner ); /* %if-bison-bridge */ -YYSTYPE *yyget_lval(yyscan_t yyscanner); +YYSTYPE * yyget_lval ( yyscan_t yyscanner ); -void yyset_lval(YYSTYPE *yylval_param, yyscan_t yyscanner); - -YYLTYPE *yyget_lloc(yyscan_t yyscanner); - -void yyset_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner); +void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); + YYLTYPE *yyget_lloc ( yyscan_t yyscanner ); + + void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner ); + /* %endif */ /* Macros after this point can all be overridden by user definitions in @@ -609,9 +611,9 @@ void yyset_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap(yyscan_t yyscanner); +extern "C" int yywrap ( yyscan_t yyscanner ); #else -extern int yywrap(yyscan_t yyscanner); +extern int yywrap ( yyscan_t yyscanner ); #endif #endif @@ -620,11 +622,11 @@ extern int yywrap(yyscan_t yyscanner); /* %endif */ #ifndef yytext_ptr -static void yy_flex_strncpy(char *, const char *, int, yyscan_t yyscanner); +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen(const char *, yyscan_t yyscanner); +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #endif #ifndef YY_NO_INPUT @@ -665,9 +667,11 @@ static int yy_flex_strlen(const char *, yyscan_t yyscanner); #define YY_DECL_IS_OURS 1 /* %if-c-only Standard (non-C++) definition */ -extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner); +extern int yylex \ + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner); -#define YY_DECL int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner) +#define YY_DECL int yylex \ + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) /* %endif */ /* %if-c++-only C++ definition */ /* %endif */ @@ -842,7 +846,8 @@ extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanne #undef yyTABLES_NAME #endif -#line 270 "lexer.l" +#line 272 "lexer.l" + #line 853 "lexer.h" #undef sqlIN_HEADER diff --git a/src/parser/lexer.l b/src/parser/lexer.l index 7e726d7cc3..697cb48819 100644 --- a/src/parser/lexer.l +++ b/src/parser/lexer.l @@ -168,6 +168,7 @@ QUERIES { return QUERIES; } QUERY { return QUERY; } REAL { return REAL; } RECOVER { return RECOVER; } +RESTORE { return RESTORE; } RENAME { return RENAME; } REMOVE { return REMOVE; } RIGHT { return RIGHT; } @@ -186,6 +187,7 @@ SNAPSHOT { return SNAPSHOT; } SNAPSHOTS { return SNAPSHOTS; } SPARSE { return SPARSE; } STANDALONE { return STANDALONE; } +SYSTEM { return SYSTEM; } TABLE { return TABLE; } TABLES { return TABLES; } TENSOR { return TENSOR; } diff --git a/src/parser/parser.cpp b/src/parser/parser.cpp index 9957acc4ed..b27dbe086f 100644 --- a/src/parser/parser.cpp +++ b/src/parser/parser.cpp @@ -64,392 +64,397 @@ #define YYPULL 1 /* Substitute the type names. */ -#define YYSTYPE SQLSTYPE -#define YYLTYPE SQLLTYPE +#define YYSTYPE SQLSTYPE +#define YYLTYPE SQLLTYPE /* Substitute the variable and function names. */ -#define yyparse sqlparse -#define yylex sqllex -#define yyerror sqlerror -#define yydebug sqldebug -#define yynerrs sqlnerrs +#define yyparse sqlparse +#define yylex sqllex +#define yyerror sqlerror +#define yydebug sqldebug +#define yynerrs sqlnerrs /* First part of user prologue. */ #line 2 "parser.y" -#include "parser.h" -#include "lexer.h" #include #include +#include "parser.h" +#include "lexer.h" -void yyerror(YYLTYPE *llocp, void *lexer, infinity::ParserResult *result, const char *msg); +void yyerror(YYLTYPE * llocp, void* lexer, infinity::ParserResult* result, const char* msg); #line 87 "parser.cpp" -#ifndef YY_CAST -#ifdef __cplusplus -#define YY_CAST(Type, Val) static_cast(Val) -#define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast(Val) -#else -#define YY_CAST(Type, Val) ((Type)(Val)) -#define YY_REINTERPRET_CAST(Type, Val) ((Type)(Val)) -#endif -#endif -#ifndef YY_NULLPTR -#if defined __cplusplus -#if 201103L <= __cplusplus -#define YY_NULLPTR nullptr -#else -#define YY_NULLPTR 0 -#endif -#else -#define YY_NULLPTR ((void *)0) -#endif -#endif +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif #include "parser.h" /* Symbol kind. */ -enum yysymbol_kind_t { - YYSYMBOL_YYEMPTY = -2, - YYSYMBOL_YYEOF = 0, /* "end of file" */ - YYSYMBOL_YYerror = 1, /* error */ - YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ - YYSYMBOL_IDENTIFIER = 3, /* IDENTIFIER */ - YYSYMBOL_STRING = 4, /* STRING */ - YYSYMBOL_DOUBLE_VALUE = 5, /* DOUBLE_VALUE */ - YYSYMBOL_LONG_VALUE = 6, /* LONG_VALUE */ - YYSYMBOL_CREATE = 7, /* CREATE */ - YYSYMBOL_SELECT = 8, /* SELECT */ - YYSYMBOL_INSERT = 9, /* INSERT */ - YYSYMBOL_DROP = 10, /* DROP */ - YYSYMBOL_UPDATE = 11, /* UPDATE */ - YYSYMBOL_DELETE = 12, /* DELETE */ - YYSYMBOL_COPY = 13, /* COPY */ - YYSYMBOL_SET = 14, /* SET */ - YYSYMBOL_EXPLAIN = 15, /* EXPLAIN */ - YYSYMBOL_SHOW = 16, /* SHOW */ - YYSYMBOL_ALTER = 17, /* ALTER */ - YYSYMBOL_EXECUTE = 18, /* EXECUTE */ - YYSYMBOL_PREPARE = 19, /* PREPARE */ - YYSYMBOL_UNION = 20, /* UNION */ - YYSYMBOL_ALL = 21, /* ALL */ - YYSYMBOL_INTERSECT = 22, /* INTERSECT */ - YYSYMBOL_COMPACT = 23, /* COMPACT */ - YYSYMBOL_LOCK = 24, /* LOCK */ - YYSYMBOL_UNLOCK = 25, /* UNLOCK */ - YYSYMBOL_ADD = 26, /* ADD */ - YYSYMBOL_RENAME = 27, /* RENAME */ - YYSYMBOL_EXCEPT = 28, /* EXCEPT */ - YYSYMBOL_FLUSH = 29, /* FLUSH */ - YYSYMBOL_USE = 30, /* USE */ - YYSYMBOL_OPTIMIZE = 31, /* OPTIMIZE */ - YYSYMBOL_PROPERTIES = 32, /* PROPERTIES */ - YYSYMBOL_DATABASE = 33, /* DATABASE */ - YYSYMBOL_TABLE = 34, /* TABLE */ - YYSYMBOL_COLLECTION = 35, /* COLLECTION */ - YYSYMBOL_TABLES = 36, /* TABLES */ - YYSYMBOL_INTO = 37, /* INTO */ - YYSYMBOL_VALUES = 38, /* VALUES */ - YYSYMBOL_VIEW = 39, /* VIEW */ - YYSYMBOL_INDEX = 40, /* INDEX */ - YYSYMBOL_VIEWS = 41, /* VIEWS */ - YYSYMBOL_DATABASES = 42, /* DATABASES */ - YYSYMBOL_SEGMENT = 43, /* SEGMENT */ - YYSYMBOL_SEGMENTS = 44, /* SEGMENTS */ - YYSYMBOL_BLOCK = 45, /* BLOCK */ - YYSYMBOL_BLOCKS = 46, /* BLOCKS */ - YYSYMBOL_COLUMN = 47, /* COLUMN */ - YYSYMBOL_COLUMNS = 48, /* COLUMNS */ - YYSYMBOL_INDEXES = 49, /* INDEXES */ - YYSYMBOL_CHUNK = 50, /* CHUNK */ - YYSYMBOL_GROUP = 51, /* GROUP */ - YYSYMBOL_BY = 52, /* BY */ - YYSYMBOL_HAVING = 53, /* HAVING */ - YYSYMBOL_AS = 54, /* AS */ - YYSYMBOL_NATURAL = 55, /* NATURAL */ - YYSYMBOL_JOIN = 56, /* JOIN */ - YYSYMBOL_LEFT = 57, /* LEFT */ - YYSYMBOL_RIGHT = 58, /* RIGHT */ - YYSYMBOL_OUTER = 59, /* OUTER */ - YYSYMBOL_FULL = 60, /* FULL */ - YYSYMBOL_ON = 61, /* ON */ - YYSYMBOL_INNER = 62, /* INNER */ - YYSYMBOL_CROSS = 63, /* CROSS */ - YYSYMBOL_DISTINCT = 64, /* DISTINCT */ - YYSYMBOL_WHERE = 65, /* WHERE */ - YYSYMBOL_ORDER = 66, /* ORDER */ - YYSYMBOL_LIMIT = 67, /* LIMIT */ - YYSYMBOL_OFFSET = 68, /* OFFSET */ - YYSYMBOL_ASC = 69, /* ASC */ - YYSYMBOL_DESC = 70, /* DESC */ - YYSYMBOL_IF = 71, /* IF */ - YYSYMBOL_NOT = 72, /* NOT */ - YYSYMBOL_EXISTS = 73, /* EXISTS */ - YYSYMBOL_IN = 74, /* IN */ - YYSYMBOL_FROM = 75, /* FROM */ - YYSYMBOL_TO = 76, /* TO */ - YYSYMBOL_WITH = 77, /* WITH */ - YYSYMBOL_DELIMITER = 78, /* DELIMITER */ - YYSYMBOL_FORMAT = 79, /* FORMAT */ - YYSYMBOL_HEADER = 80, /* HEADER */ - YYSYMBOL_HIGHLIGHT = 81, /* HIGHLIGHT */ - YYSYMBOL_CAST = 82, /* CAST */ - YYSYMBOL_END = 83, /* END */ - YYSYMBOL_CASE = 84, /* CASE */ - YYSYMBOL_ELSE = 85, /* ELSE */ - YYSYMBOL_THEN = 86, /* THEN */ - YYSYMBOL_WHEN = 87, /* WHEN */ - YYSYMBOL_UNNEST = 88, /* UNNEST */ - YYSYMBOL_BOOLEAN = 89, /* BOOLEAN */ - YYSYMBOL_INTEGER = 90, /* INTEGER */ - YYSYMBOL_INT = 91, /* INT */ - YYSYMBOL_TINYINT = 92, /* TINYINT */ - YYSYMBOL_SMALLINT = 93, /* SMALLINT */ - YYSYMBOL_BIGINT = 94, /* BIGINT */ - YYSYMBOL_HUGEINT = 95, /* HUGEINT */ - YYSYMBOL_VARCHAR = 96, /* VARCHAR */ - YYSYMBOL_FLOAT = 97, /* FLOAT */ - YYSYMBOL_DOUBLE = 98, /* DOUBLE */ - YYSYMBOL_REAL = 99, /* REAL */ - YYSYMBOL_DECIMAL = 100, /* DECIMAL */ - YYSYMBOL_DATE = 101, /* DATE */ - YYSYMBOL_TIME = 102, /* TIME */ - YYSYMBOL_DATETIME = 103, /* DATETIME */ - YYSYMBOL_FLOAT16 = 104, /* FLOAT16 */ - YYSYMBOL_BFLOAT16 = 105, /* BFLOAT16 */ - YYSYMBOL_UNSIGNED = 106, /* UNSIGNED */ - YYSYMBOL_TIMESTAMP = 107, /* TIMESTAMP */ - YYSYMBOL_UUID = 108, /* UUID */ - YYSYMBOL_POINT = 109, /* POINT */ - YYSYMBOL_LINE = 110, /* LINE */ - YYSYMBOL_LSEG = 111, /* LSEG */ - YYSYMBOL_BOX = 112, /* BOX */ - YYSYMBOL_PATH = 113, /* PATH */ - YYSYMBOL_POLYGON = 114, /* POLYGON */ - YYSYMBOL_CIRCLE = 115, /* CIRCLE */ - YYSYMBOL_BLOB = 116, /* BLOB */ - YYSYMBOL_BITMAP = 117, /* BITMAP */ - YYSYMBOL_EMBEDDING = 118, /* EMBEDDING */ - YYSYMBOL_VECTOR = 119, /* VECTOR */ - YYSYMBOL_BIT = 120, /* BIT */ - YYSYMBOL_TEXT = 121, /* TEXT */ - YYSYMBOL_MULTIVECTOR = 122, /* MULTIVECTOR */ - YYSYMBOL_TENSOR = 123, /* TENSOR */ - YYSYMBOL_SPARSE = 124, /* SPARSE */ - YYSYMBOL_TENSORARRAY = 125, /* TENSORARRAY */ - YYSYMBOL_IGNORE = 126, /* IGNORE */ - YYSYMBOL_PRIMARY = 127, /* PRIMARY */ - YYSYMBOL_KEY = 128, /* KEY */ - YYSYMBOL_UNIQUE = 129, /* UNIQUE */ - YYSYMBOL_NULLABLE = 130, /* NULLABLE */ - YYSYMBOL_IS = 131, /* IS */ - YYSYMBOL_DEFAULT = 132, /* DEFAULT */ - YYSYMBOL_COMMENT = 133, /* COMMENT */ - YYSYMBOL_TRUE = 134, /* TRUE */ - YYSYMBOL_FALSE = 135, /* FALSE */ - YYSYMBOL_INTERVAL = 136, /* INTERVAL */ - YYSYMBOL_SECOND = 137, /* SECOND */ - YYSYMBOL_SECONDS = 138, /* SECONDS */ - YYSYMBOL_MINUTE = 139, /* MINUTE */ - YYSYMBOL_MINUTES = 140, /* MINUTES */ - YYSYMBOL_HOUR = 141, /* HOUR */ - YYSYMBOL_HOURS = 142, /* HOURS */ - YYSYMBOL_DAY = 143, /* DAY */ - YYSYMBOL_DAYS = 144, /* DAYS */ - YYSYMBOL_MONTH = 145, /* MONTH */ - YYSYMBOL_MONTHS = 146, /* MONTHS */ - YYSYMBOL_YEAR = 147, /* YEAR */ - YYSYMBOL_YEARS = 148, /* YEARS */ - YYSYMBOL_EQUAL = 149, /* EQUAL */ - YYSYMBOL_NOT_EQ = 150, /* NOT_EQ */ - YYSYMBOL_LESS_EQ = 151, /* LESS_EQ */ - YYSYMBOL_GREATER_EQ = 152, /* GREATER_EQ */ - YYSYMBOL_BETWEEN = 153, /* BETWEEN */ - YYSYMBOL_AND = 154, /* AND */ - YYSYMBOL_OR = 155, /* OR */ - YYSYMBOL_EXTRACT = 156, /* EXTRACT */ - YYSYMBOL_LIKE = 157, /* LIKE */ - YYSYMBOL_DATA = 158, /* DATA */ - YYSYMBOL_LOG = 159, /* LOG */ - YYSYMBOL_BUFFER = 160, /* BUFFER */ - YYSYMBOL_TRANSACTIONS = 161, /* TRANSACTIONS */ - YYSYMBOL_TRANSACTION = 162, /* TRANSACTION */ - YYSYMBOL_MEMINDEX = 163, /* MEMINDEX */ - YYSYMBOL_USING = 164, /* USING */ - YYSYMBOL_SESSION = 165, /* SESSION */ - YYSYMBOL_GLOBAL = 166, /* GLOBAL */ - YYSYMBOL_OFF = 167, /* OFF */ - YYSYMBOL_EXPORT = 168, /* EXPORT */ - YYSYMBOL_CONFIGS = 169, /* CONFIGS */ - YYSYMBOL_CONFIG = 170, /* CONFIG */ - YYSYMBOL_PROFILES = 171, /* PROFILES */ - YYSYMBOL_VARIABLES = 172, /* VARIABLES */ - YYSYMBOL_VARIABLE = 173, /* VARIABLE */ - YYSYMBOL_DELTA = 174, /* DELTA */ - YYSYMBOL_LOGS = 175, /* LOGS */ - YYSYMBOL_CATALOGS = 176, /* CATALOGS */ - YYSYMBOL_CATALOG = 177, /* CATALOG */ - YYSYMBOL_SEARCH = 178, /* SEARCH */ - YYSYMBOL_MATCH = 179, /* MATCH */ - YYSYMBOL_MAXSIM = 180, /* MAXSIM */ - YYSYMBOL_QUERY = 181, /* QUERY */ - YYSYMBOL_QUERIES = 182, /* QUERIES */ - YYSYMBOL_FUSION = 183, /* FUSION */ - YYSYMBOL_ROWLIMIT = 184, /* ROWLIMIT */ - YYSYMBOL_ADMIN = 185, /* ADMIN */ - YYSYMBOL_LEADER = 186, /* LEADER */ - YYSYMBOL_FOLLOWER = 187, /* FOLLOWER */ - YYSYMBOL_LEARNER = 188, /* LEARNER */ - YYSYMBOL_CONNECT = 189, /* CONNECT */ - YYSYMBOL_STANDALONE = 190, /* STANDALONE */ - YYSYMBOL_NODES = 191, /* NODES */ - YYSYMBOL_NODE = 192, /* NODE */ - YYSYMBOL_REMOVE = 193, /* REMOVE */ - YYSYMBOL_SNAPSHOT = 194, /* SNAPSHOT */ - YYSYMBOL_SNAPSHOTS = 195, /* SNAPSHOTS */ - YYSYMBOL_RECOVER = 196, /* RECOVER */ - YYSYMBOL_PERSISTENCE = 197, /* PERSISTENCE */ - YYSYMBOL_OBJECT = 198, /* OBJECT */ - YYSYMBOL_OBJECTS = 199, /* OBJECTS */ - YYSYMBOL_FILES = 200, /* FILES */ - YYSYMBOL_MEMORY = 201, /* MEMORY */ - YYSYMBOL_ALLOCATION = 202, /* ALLOCATION */ - YYSYMBOL_NUMBER = 203, /* NUMBER */ - YYSYMBOL_204_ = 204, /* '=' */ - YYSYMBOL_205_ = 205, /* '<' */ - YYSYMBOL_206_ = 206, /* '>' */ - YYSYMBOL_207_ = 207, /* '+' */ - YYSYMBOL_208_ = 208, /* '-' */ - YYSYMBOL_209_ = 209, /* '*' */ - YYSYMBOL_210_ = 210, /* '/' */ - YYSYMBOL_211_ = 211, /* '%' */ - YYSYMBOL_212_ = 212, /* '[' */ - YYSYMBOL_213_ = 213, /* ']' */ - YYSYMBOL_214_ = 214, /* '(' */ - YYSYMBOL_215_ = 215, /* ')' */ - YYSYMBOL_216_ = 216, /* '.' */ - YYSYMBOL_217_ = 217, /* ';' */ - YYSYMBOL_218_ = 218, /* ',' */ - YYSYMBOL_219_ = 219, /* ':' */ - YYSYMBOL_YYACCEPT = 220, /* $accept */ - YYSYMBOL_input_pattern = 221, /* input_pattern */ - YYSYMBOL_statement_list = 222, /* statement_list */ - YYSYMBOL_statement = 223, /* statement */ - YYSYMBOL_explainable_statement = 224, /* explainable_statement */ - YYSYMBOL_create_statement = 225, /* create_statement */ - YYSYMBOL_table_element_array = 226, /* table_element_array */ - YYSYMBOL_column_def_array = 227, /* column_def_array */ - YYSYMBOL_table_element = 228, /* table_element */ - YYSYMBOL_table_column = 229, /* table_column */ - YYSYMBOL_column_type = 230, /* column_type */ - YYSYMBOL_column_constraints = 231, /* column_constraints */ - YYSYMBOL_column_constraint = 232, /* column_constraint */ - YYSYMBOL_default_expr = 233, /* default_expr */ - YYSYMBOL_table_constraint = 234, /* table_constraint */ - YYSYMBOL_identifier_array = 235, /* identifier_array */ - YYSYMBOL_delete_statement = 236, /* delete_statement */ - YYSYMBOL_insert_statement = 237, /* insert_statement */ - YYSYMBOL_optional_identifier_array = 238, /* optional_identifier_array */ - YYSYMBOL_explain_statement = 239, /* explain_statement */ - YYSYMBOL_update_statement = 240, /* update_statement */ - YYSYMBOL_update_expr_array = 241, /* update_expr_array */ - YYSYMBOL_update_expr = 242, /* update_expr */ - YYSYMBOL_drop_statement = 243, /* drop_statement */ - YYSYMBOL_copy_statement = 244, /* copy_statement */ - YYSYMBOL_select_statement = 245, /* select_statement */ - YYSYMBOL_select_with_paren = 246, /* select_with_paren */ - YYSYMBOL_select_without_paren = 247, /* select_without_paren */ - YYSYMBOL_select_clause_with_modifier = 248, /* select_clause_with_modifier */ - YYSYMBOL_select_clause_without_modifier_paren = 249, /* select_clause_without_modifier_paren */ - YYSYMBOL_select_clause_without_modifier = 250, /* select_clause_without_modifier */ - YYSYMBOL_order_by_clause = 251, /* order_by_clause */ - YYSYMBOL_order_by_expr_list = 252, /* order_by_expr_list */ - YYSYMBOL_order_by_expr = 253, /* order_by_expr */ - YYSYMBOL_order_by_type = 254, /* order_by_type */ - YYSYMBOL_limit_expr = 255, /* limit_expr */ - YYSYMBOL_offset_expr = 256, /* offset_expr */ - YYSYMBOL_distinct = 257, /* distinct */ - YYSYMBOL_unnest_clause = 258, /* unnest_clause */ - YYSYMBOL_highlight_clause = 259, /* highlight_clause */ - YYSYMBOL_from_clause = 260, /* from_clause */ - YYSYMBOL_search_clause = 261, /* search_clause */ - YYSYMBOL_optional_search_filter_expr = 262, /* optional_search_filter_expr */ - YYSYMBOL_where_clause = 263, /* where_clause */ - YYSYMBOL_having_clause = 264, /* having_clause */ - YYSYMBOL_group_by_clause = 265, /* group_by_clause */ - YYSYMBOL_set_operator = 266, /* set_operator */ - YYSYMBOL_table_reference = 267, /* table_reference */ - YYSYMBOL_table_reference_unit = 268, /* table_reference_unit */ - YYSYMBOL_table_reference_name = 269, /* table_reference_name */ - YYSYMBOL_table_name = 270, /* table_name */ - YYSYMBOL_table_alias = 271, /* table_alias */ - YYSYMBOL_with_clause = 272, /* with_clause */ - YYSYMBOL_with_expr_list = 273, /* with_expr_list */ - YYSYMBOL_with_expr = 274, /* with_expr */ - YYSYMBOL_join_clause = 275, /* join_clause */ - YYSYMBOL_join_type = 276, /* join_type */ - YYSYMBOL_show_statement = 277, /* show_statement */ - YYSYMBOL_flush_statement = 278, /* flush_statement */ - YYSYMBOL_optimize_statement = 279, /* optimize_statement */ - YYSYMBOL_command_statement = 280, /* command_statement */ - YYSYMBOL_compact_statement = 281, /* compact_statement */ - YYSYMBOL_admin_statement = 282, /* admin_statement */ - YYSYMBOL_alter_statement = 283, /* alter_statement */ - YYSYMBOL_expr_array = 284, /* expr_array */ - YYSYMBOL_insert_row_list = 285, /* insert_row_list */ - YYSYMBOL_expr_alias = 286, /* expr_alias */ - YYSYMBOL_expr = 287, /* expr */ - YYSYMBOL_operand = 288, /* operand */ - YYSYMBOL_match_tensor_expr = 289, /* match_tensor_expr */ - YYSYMBOL_match_vector_expr = 290, /* match_vector_expr */ - YYSYMBOL_match_sparse_expr = 291, /* match_sparse_expr */ - YYSYMBOL_match_text_expr = 292, /* match_text_expr */ - YYSYMBOL_query_expr = 293, /* query_expr */ - YYSYMBOL_fusion_expr = 294, /* fusion_expr */ - YYSYMBOL_sub_search = 295, /* sub_search */ - YYSYMBOL_sub_search_array = 296, /* sub_search_array */ - YYSYMBOL_function_expr = 297, /* function_expr */ - YYSYMBOL_conjunction_expr = 298, /* conjunction_expr */ - YYSYMBOL_between_expr = 299, /* between_expr */ - YYSYMBOL_in_expr = 300, /* in_expr */ - YYSYMBOL_case_expr = 301, /* case_expr */ - YYSYMBOL_case_check_array = 302, /* case_check_array */ - YYSYMBOL_cast_expr = 303, /* cast_expr */ - YYSYMBOL_subquery_expr = 304, /* subquery_expr */ - YYSYMBOL_column_expr = 305, /* column_expr */ - YYSYMBOL_constant_expr = 306, /* constant_expr */ - YYSYMBOL_common_array_expr = 307, /* common_array_expr */ - YYSYMBOL_common_sparse_array_expr = 308, /* common_sparse_array_expr */ - YYSYMBOL_subarray_array_expr = 309, /* subarray_array_expr */ - YYSYMBOL_unclosed_subarray_array_expr = 310, /* unclosed_subarray_array_expr */ - YYSYMBOL_sparse_array_expr = 311, /* sparse_array_expr */ - YYSYMBOL_long_sparse_array_expr = 312, /* long_sparse_array_expr */ - YYSYMBOL_unclosed_long_sparse_array_expr = 313, /* unclosed_long_sparse_array_expr */ - YYSYMBOL_double_sparse_array_expr = 314, /* double_sparse_array_expr */ - YYSYMBOL_unclosed_double_sparse_array_expr = 315, /* unclosed_double_sparse_array_expr */ - YYSYMBOL_empty_array_expr = 316, /* empty_array_expr */ - YYSYMBOL_int_sparse_ele = 317, /* int_sparse_ele */ - YYSYMBOL_float_sparse_ele = 318, /* float_sparse_ele */ - YYSYMBOL_array_expr = 319, /* array_expr */ - YYSYMBOL_long_array_expr = 320, /* long_array_expr */ - YYSYMBOL_unclosed_long_array_expr = 321, /* unclosed_long_array_expr */ - YYSYMBOL_double_array_expr = 322, /* double_array_expr */ - YYSYMBOL_unclosed_double_array_expr = 323, /* unclosed_double_array_expr */ - YYSYMBOL_interval_expr = 324, /* interval_expr */ - YYSYMBOL_copy_option_list = 325, /* copy_option_list */ - YYSYMBOL_copy_option = 326, /* copy_option */ - YYSYMBOL_file_path = 327, /* file_path */ - YYSYMBOL_if_exists = 328, /* if_exists */ - YYSYMBOL_if_not_exists = 329, /* if_not_exists */ - YYSYMBOL_semicolon = 330, /* semicolon */ - YYSYMBOL_if_not_exists_info = 331, /* if_not_exists_info */ - YYSYMBOL_with_index_param_list = 332, /* with_index_param_list */ - YYSYMBOL_optional_table_properties_list = 333, /* optional_table_properties_list */ - YYSYMBOL_index_param_list = 334, /* index_param_list */ - YYSYMBOL_index_param = 335, /* index_param */ - YYSYMBOL_index_info = 336 /* index_info */ +enum yysymbol_kind_t +{ + YYSYMBOL_YYEMPTY = -2, + YYSYMBOL_YYEOF = 0, /* "end of file" */ + YYSYMBOL_YYerror = 1, /* error */ + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ + YYSYMBOL_IDENTIFIER = 3, /* IDENTIFIER */ + YYSYMBOL_STRING = 4, /* STRING */ + YYSYMBOL_DOUBLE_VALUE = 5, /* DOUBLE_VALUE */ + YYSYMBOL_LONG_VALUE = 6, /* LONG_VALUE */ + YYSYMBOL_CREATE = 7, /* CREATE */ + YYSYMBOL_SELECT = 8, /* SELECT */ + YYSYMBOL_INSERT = 9, /* INSERT */ + YYSYMBOL_DROP = 10, /* DROP */ + YYSYMBOL_UPDATE = 11, /* UPDATE */ + YYSYMBOL_DELETE = 12, /* DELETE */ + YYSYMBOL_COPY = 13, /* COPY */ + YYSYMBOL_SET = 14, /* SET */ + YYSYMBOL_EXPLAIN = 15, /* EXPLAIN */ + YYSYMBOL_SHOW = 16, /* SHOW */ + YYSYMBOL_ALTER = 17, /* ALTER */ + YYSYMBOL_EXECUTE = 18, /* EXECUTE */ + YYSYMBOL_PREPARE = 19, /* PREPARE */ + YYSYMBOL_UNION = 20, /* UNION */ + YYSYMBOL_ALL = 21, /* ALL */ + YYSYMBOL_INTERSECT = 22, /* INTERSECT */ + YYSYMBOL_COMPACT = 23, /* COMPACT */ + YYSYMBOL_LOCK = 24, /* LOCK */ + YYSYMBOL_UNLOCK = 25, /* UNLOCK */ + YYSYMBOL_ADD = 26, /* ADD */ + YYSYMBOL_RENAME = 27, /* RENAME */ + YYSYMBOL_EXCEPT = 28, /* EXCEPT */ + YYSYMBOL_FLUSH = 29, /* FLUSH */ + YYSYMBOL_USE = 30, /* USE */ + YYSYMBOL_OPTIMIZE = 31, /* OPTIMIZE */ + YYSYMBOL_PROPERTIES = 32, /* PROPERTIES */ + YYSYMBOL_DATABASE = 33, /* DATABASE */ + YYSYMBOL_TABLE = 34, /* TABLE */ + YYSYMBOL_COLLECTION = 35, /* COLLECTION */ + YYSYMBOL_TABLES = 36, /* TABLES */ + YYSYMBOL_INTO = 37, /* INTO */ + YYSYMBOL_VALUES = 38, /* VALUES */ + YYSYMBOL_VIEW = 39, /* VIEW */ + YYSYMBOL_INDEX = 40, /* INDEX */ + YYSYMBOL_VIEWS = 41, /* VIEWS */ + YYSYMBOL_DATABASES = 42, /* DATABASES */ + YYSYMBOL_SEGMENT = 43, /* SEGMENT */ + YYSYMBOL_SEGMENTS = 44, /* SEGMENTS */ + YYSYMBOL_BLOCK = 45, /* BLOCK */ + YYSYMBOL_BLOCKS = 46, /* BLOCKS */ + YYSYMBOL_COLUMN = 47, /* COLUMN */ + YYSYMBOL_COLUMNS = 48, /* COLUMNS */ + YYSYMBOL_INDEXES = 49, /* INDEXES */ + YYSYMBOL_CHUNK = 50, /* CHUNK */ + YYSYMBOL_SYSTEM = 51, /* SYSTEM */ + YYSYMBOL_GROUP = 52, /* GROUP */ + YYSYMBOL_BY = 53, /* BY */ + YYSYMBOL_HAVING = 54, /* HAVING */ + YYSYMBOL_AS = 55, /* AS */ + YYSYMBOL_NATURAL = 56, /* NATURAL */ + YYSYMBOL_JOIN = 57, /* JOIN */ + YYSYMBOL_LEFT = 58, /* LEFT */ + YYSYMBOL_RIGHT = 59, /* RIGHT */ + YYSYMBOL_OUTER = 60, /* OUTER */ + YYSYMBOL_FULL = 61, /* FULL */ + YYSYMBOL_ON = 62, /* ON */ + YYSYMBOL_INNER = 63, /* INNER */ + YYSYMBOL_CROSS = 64, /* CROSS */ + YYSYMBOL_DISTINCT = 65, /* DISTINCT */ + YYSYMBOL_WHERE = 66, /* WHERE */ + YYSYMBOL_ORDER = 67, /* ORDER */ + YYSYMBOL_LIMIT = 68, /* LIMIT */ + YYSYMBOL_OFFSET = 69, /* OFFSET */ + YYSYMBOL_ASC = 70, /* ASC */ + YYSYMBOL_DESC = 71, /* DESC */ + YYSYMBOL_IF = 72, /* IF */ + YYSYMBOL_NOT = 73, /* NOT */ + YYSYMBOL_EXISTS = 74, /* EXISTS */ + YYSYMBOL_IN = 75, /* IN */ + YYSYMBOL_FROM = 76, /* FROM */ + YYSYMBOL_TO = 77, /* TO */ + YYSYMBOL_WITH = 78, /* WITH */ + YYSYMBOL_DELIMITER = 79, /* DELIMITER */ + YYSYMBOL_FORMAT = 80, /* FORMAT */ + YYSYMBOL_HEADER = 81, /* HEADER */ + YYSYMBOL_HIGHLIGHT = 82, /* HIGHLIGHT */ + YYSYMBOL_CAST = 83, /* CAST */ + YYSYMBOL_END = 84, /* END */ + YYSYMBOL_CASE = 85, /* CASE */ + YYSYMBOL_ELSE = 86, /* ELSE */ + YYSYMBOL_THEN = 87, /* THEN */ + YYSYMBOL_WHEN = 88, /* WHEN */ + YYSYMBOL_UNNEST = 89, /* UNNEST */ + YYSYMBOL_BOOLEAN = 90, /* BOOLEAN */ + YYSYMBOL_INTEGER = 91, /* INTEGER */ + YYSYMBOL_INT = 92, /* INT */ + YYSYMBOL_TINYINT = 93, /* TINYINT */ + YYSYMBOL_SMALLINT = 94, /* SMALLINT */ + YYSYMBOL_BIGINT = 95, /* BIGINT */ + YYSYMBOL_HUGEINT = 96, /* HUGEINT */ + YYSYMBOL_VARCHAR = 97, /* VARCHAR */ + YYSYMBOL_FLOAT = 98, /* FLOAT */ + YYSYMBOL_DOUBLE = 99, /* DOUBLE */ + YYSYMBOL_REAL = 100, /* REAL */ + YYSYMBOL_DECIMAL = 101, /* DECIMAL */ + YYSYMBOL_DATE = 102, /* DATE */ + YYSYMBOL_TIME = 103, /* TIME */ + YYSYMBOL_DATETIME = 104, /* DATETIME */ + YYSYMBOL_FLOAT16 = 105, /* FLOAT16 */ + YYSYMBOL_BFLOAT16 = 106, /* BFLOAT16 */ + YYSYMBOL_UNSIGNED = 107, /* UNSIGNED */ + YYSYMBOL_TIMESTAMP = 108, /* TIMESTAMP */ + YYSYMBOL_UUID = 109, /* UUID */ + YYSYMBOL_POINT = 110, /* POINT */ + YYSYMBOL_LINE = 111, /* LINE */ + YYSYMBOL_LSEG = 112, /* LSEG */ + YYSYMBOL_BOX = 113, /* BOX */ + YYSYMBOL_PATH = 114, /* PATH */ + YYSYMBOL_POLYGON = 115, /* POLYGON */ + YYSYMBOL_CIRCLE = 116, /* CIRCLE */ + YYSYMBOL_BLOB = 117, /* BLOB */ + YYSYMBOL_BITMAP = 118, /* BITMAP */ + YYSYMBOL_EMBEDDING = 119, /* EMBEDDING */ + YYSYMBOL_VECTOR = 120, /* VECTOR */ + YYSYMBOL_BIT = 121, /* BIT */ + YYSYMBOL_TEXT = 122, /* TEXT */ + YYSYMBOL_MULTIVECTOR = 123, /* MULTIVECTOR */ + YYSYMBOL_TENSOR = 124, /* TENSOR */ + YYSYMBOL_SPARSE = 125, /* SPARSE */ + YYSYMBOL_TENSORARRAY = 126, /* TENSORARRAY */ + YYSYMBOL_IGNORE = 127, /* IGNORE */ + YYSYMBOL_PRIMARY = 128, /* PRIMARY */ + YYSYMBOL_KEY = 129, /* KEY */ + YYSYMBOL_UNIQUE = 130, /* UNIQUE */ + YYSYMBOL_NULLABLE = 131, /* NULLABLE */ + YYSYMBOL_IS = 132, /* IS */ + YYSYMBOL_DEFAULT = 133, /* DEFAULT */ + YYSYMBOL_COMMENT = 134, /* COMMENT */ + YYSYMBOL_TRUE = 135, /* TRUE */ + YYSYMBOL_FALSE = 136, /* FALSE */ + YYSYMBOL_INTERVAL = 137, /* INTERVAL */ + YYSYMBOL_SECOND = 138, /* SECOND */ + YYSYMBOL_SECONDS = 139, /* SECONDS */ + YYSYMBOL_MINUTE = 140, /* MINUTE */ + YYSYMBOL_MINUTES = 141, /* MINUTES */ + YYSYMBOL_HOUR = 142, /* HOUR */ + YYSYMBOL_HOURS = 143, /* HOURS */ + YYSYMBOL_DAY = 144, /* DAY */ + YYSYMBOL_DAYS = 145, /* DAYS */ + YYSYMBOL_MONTH = 146, /* MONTH */ + YYSYMBOL_MONTHS = 147, /* MONTHS */ + YYSYMBOL_YEAR = 148, /* YEAR */ + YYSYMBOL_YEARS = 149, /* YEARS */ + YYSYMBOL_EQUAL = 150, /* EQUAL */ + YYSYMBOL_NOT_EQ = 151, /* NOT_EQ */ + YYSYMBOL_LESS_EQ = 152, /* LESS_EQ */ + YYSYMBOL_GREATER_EQ = 153, /* GREATER_EQ */ + YYSYMBOL_BETWEEN = 154, /* BETWEEN */ + YYSYMBOL_AND = 155, /* AND */ + YYSYMBOL_OR = 156, /* OR */ + YYSYMBOL_EXTRACT = 157, /* EXTRACT */ + YYSYMBOL_LIKE = 158, /* LIKE */ + YYSYMBOL_DATA = 159, /* DATA */ + YYSYMBOL_LOG = 160, /* LOG */ + YYSYMBOL_BUFFER = 161, /* BUFFER */ + YYSYMBOL_TRANSACTIONS = 162, /* TRANSACTIONS */ + YYSYMBOL_TRANSACTION = 163, /* TRANSACTION */ + YYSYMBOL_MEMINDEX = 164, /* MEMINDEX */ + YYSYMBOL_USING = 165, /* USING */ + YYSYMBOL_SESSION = 166, /* SESSION */ + YYSYMBOL_GLOBAL = 167, /* GLOBAL */ + YYSYMBOL_OFF = 168, /* OFF */ + YYSYMBOL_EXPORT = 169, /* EXPORT */ + YYSYMBOL_CONFIGS = 170, /* CONFIGS */ + YYSYMBOL_CONFIG = 171, /* CONFIG */ + YYSYMBOL_PROFILES = 172, /* PROFILES */ + YYSYMBOL_VARIABLES = 173, /* VARIABLES */ + YYSYMBOL_VARIABLE = 174, /* VARIABLE */ + YYSYMBOL_DELTA = 175, /* DELTA */ + YYSYMBOL_LOGS = 176, /* LOGS */ + YYSYMBOL_CATALOGS = 177, /* CATALOGS */ + YYSYMBOL_CATALOG = 178, /* CATALOG */ + YYSYMBOL_SEARCH = 179, /* SEARCH */ + YYSYMBOL_MATCH = 180, /* MATCH */ + YYSYMBOL_MAXSIM = 181, /* MAXSIM */ + YYSYMBOL_QUERY = 182, /* QUERY */ + YYSYMBOL_QUERIES = 183, /* QUERIES */ + YYSYMBOL_FUSION = 184, /* FUSION */ + YYSYMBOL_ROWLIMIT = 185, /* ROWLIMIT */ + YYSYMBOL_ADMIN = 186, /* ADMIN */ + YYSYMBOL_LEADER = 187, /* LEADER */ + YYSYMBOL_FOLLOWER = 188, /* FOLLOWER */ + YYSYMBOL_LEARNER = 189, /* LEARNER */ + YYSYMBOL_CONNECT = 190, /* CONNECT */ + YYSYMBOL_STANDALONE = 191, /* STANDALONE */ + YYSYMBOL_NODES = 192, /* NODES */ + YYSYMBOL_NODE = 193, /* NODE */ + YYSYMBOL_REMOVE = 194, /* REMOVE */ + YYSYMBOL_SNAPSHOT = 195, /* SNAPSHOT */ + YYSYMBOL_SNAPSHOTS = 196, /* SNAPSHOTS */ + YYSYMBOL_RECOVER = 197, /* RECOVER */ + YYSYMBOL_RESTORE = 198, /* RESTORE */ + YYSYMBOL_PERSISTENCE = 199, /* PERSISTENCE */ + YYSYMBOL_OBJECT = 200, /* OBJECT */ + YYSYMBOL_OBJECTS = 201, /* OBJECTS */ + YYSYMBOL_FILES = 202, /* FILES */ + YYSYMBOL_MEMORY = 203, /* MEMORY */ + YYSYMBOL_ALLOCATION = 204, /* ALLOCATION */ + YYSYMBOL_NUMBER = 205, /* NUMBER */ + YYSYMBOL_206_ = 206, /* '=' */ + YYSYMBOL_207_ = 207, /* '<' */ + YYSYMBOL_208_ = 208, /* '>' */ + YYSYMBOL_209_ = 209, /* '+' */ + YYSYMBOL_210_ = 210, /* '-' */ + YYSYMBOL_211_ = 211, /* '*' */ + YYSYMBOL_212_ = 212, /* '/' */ + YYSYMBOL_213_ = 213, /* '%' */ + YYSYMBOL_214_ = 214, /* '[' */ + YYSYMBOL_215_ = 215, /* ']' */ + YYSYMBOL_216_ = 216, /* '(' */ + YYSYMBOL_217_ = 217, /* ')' */ + YYSYMBOL_218_ = 218, /* '.' */ + YYSYMBOL_219_ = 219, /* ';' */ + YYSYMBOL_220_ = 220, /* ',' */ + YYSYMBOL_221_ = 221, /* ':' */ + YYSYMBOL_YYACCEPT = 222, /* $accept */ + YYSYMBOL_input_pattern = 223, /* input_pattern */ + YYSYMBOL_statement_list = 224, /* statement_list */ + YYSYMBOL_statement = 225, /* statement */ + YYSYMBOL_explainable_statement = 226, /* explainable_statement */ + YYSYMBOL_create_statement = 227, /* create_statement */ + YYSYMBOL_table_element_array = 228, /* table_element_array */ + YYSYMBOL_column_def_array = 229, /* column_def_array */ + YYSYMBOL_table_element = 230, /* table_element */ + YYSYMBOL_table_column = 231, /* table_column */ + YYSYMBOL_column_type = 232, /* column_type */ + YYSYMBOL_column_constraints = 233, /* column_constraints */ + YYSYMBOL_column_constraint = 234, /* column_constraint */ + YYSYMBOL_default_expr = 235, /* default_expr */ + YYSYMBOL_table_constraint = 236, /* table_constraint */ + YYSYMBOL_identifier_array = 237, /* identifier_array */ + YYSYMBOL_delete_statement = 238, /* delete_statement */ + YYSYMBOL_insert_statement = 239, /* insert_statement */ + YYSYMBOL_optional_identifier_array = 240, /* optional_identifier_array */ + YYSYMBOL_explain_statement = 241, /* explain_statement */ + YYSYMBOL_update_statement = 242, /* update_statement */ + YYSYMBOL_update_expr_array = 243, /* update_expr_array */ + YYSYMBOL_update_expr = 244, /* update_expr */ + YYSYMBOL_drop_statement = 245, /* drop_statement */ + YYSYMBOL_copy_statement = 246, /* copy_statement */ + YYSYMBOL_select_statement = 247, /* select_statement */ + YYSYMBOL_select_with_paren = 248, /* select_with_paren */ + YYSYMBOL_select_without_paren = 249, /* select_without_paren */ + YYSYMBOL_select_clause_with_modifier = 250, /* select_clause_with_modifier */ + YYSYMBOL_select_clause_without_modifier_paren = 251, /* select_clause_without_modifier_paren */ + YYSYMBOL_select_clause_without_modifier = 252, /* select_clause_without_modifier */ + YYSYMBOL_order_by_clause = 253, /* order_by_clause */ + YYSYMBOL_order_by_expr_list = 254, /* order_by_expr_list */ + YYSYMBOL_order_by_expr = 255, /* order_by_expr */ + YYSYMBOL_order_by_type = 256, /* order_by_type */ + YYSYMBOL_limit_expr = 257, /* limit_expr */ + YYSYMBOL_offset_expr = 258, /* offset_expr */ + YYSYMBOL_distinct = 259, /* distinct */ + YYSYMBOL_unnest_clause = 260, /* unnest_clause */ + YYSYMBOL_highlight_clause = 261, /* highlight_clause */ + YYSYMBOL_from_clause = 262, /* from_clause */ + YYSYMBOL_search_clause = 263, /* search_clause */ + YYSYMBOL_optional_search_filter_expr = 264, /* optional_search_filter_expr */ + YYSYMBOL_where_clause = 265, /* where_clause */ + YYSYMBOL_having_clause = 266, /* having_clause */ + YYSYMBOL_group_by_clause = 267, /* group_by_clause */ + YYSYMBOL_set_operator = 268, /* set_operator */ + YYSYMBOL_table_reference = 269, /* table_reference */ + YYSYMBOL_table_reference_unit = 270, /* table_reference_unit */ + YYSYMBOL_table_reference_name = 271, /* table_reference_name */ + YYSYMBOL_table_name = 272, /* table_name */ + YYSYMBOL_table_alias = 273, /* table_alias */ + YYSYMBOL_with_clause = 274, /* with_clause */ + YYSYMBOL_with_expr_list = 275, /* with_expr_list */ + YYSYMBOL_with_expr = 276, /* with_expr */ + YYSYMBOL_join_clause = 277, /* join_clause */ + YYSYMBOL_join_type = 278, /* join_type */ + YYSYMBOL_show_statement = 279, /* show_statement */ + YYSYMBOL_flush_statement = 280, /* flush_statement */ + YYSYMBOL_optimize_statement = 281, /* optimize_statement */ + YYSYMBOL_command_statement = 282, /* command_statement */ + YYSYMBOL_compact_statement = 283, /* compact_statement */ + YYSYMBOL_admin_statement = 284, /* admin_statement */ + YYSYMBOL_alter_statement = 285, /* alter_statement */ + YYSYMBOL_expr_array = 286, /* expr_array */ + YYSYMBOL_insert_row_list = 287, /* insert_row_list */ + YYSYMBOL_expr_alias = 288, /* expr_alias */ + YYSYMBOL_expr = 289, /* expr */ + YYSYMBOL_operand = 290, /* operand */ + YYSYMBOL_match_tensor_expr = 291, /* match_tensor_expr */ + YYSYMBOL_match_vector_expr = 292, /* match_vector_expr */ + YYSYMBOL_match_sparse_expr = 293, /* match_sparse_expr */ + YYSYMBOL_match_text_expr = 294, /* match_text_expr */ + YYSYMBOL_query_expr = 295, /* query_expr */ + YYSYMBOL_fusion_expr = 296, /* fusion_expr */ + YYSYMBOL_sub_search = 297, /* sub_search */ + YYSYMBOL_sub_search_array = 298, /* sub_search_array */ + YYSYMBOL_function_expr = 299, /* function_expr */ + YYSYMBOL_conjunction_expr = 300, /* conjunction_expr */ + YYSYMBOL_between_expr = 301, /* between_expr */ + YYSYMBOL_in_expr = 302, /* in_expr */ + YYSYMBOL_case_expr = 303, /* case_expr */ + YYSYMBOL_case_check_array = 304, /* case_check_array */ + YYSYMBOL_cast_expr = 305, /* cast_expr */ + YYSYMBOL_subquery_expr = 306, /* subquery_expr */ + YYSYMBOL_column_expr = 307, /* column_expr */ + YYSYMBOL_constant_expr = 308, /* constant_expr */ + YYSYMBOL_common_array_expr = 309, /* common_array_expr */ + YYSYMBOL_common_sparse_array_expr = 310, /* common_sparse_array_expr */ + YYSYMBOL_subarray_array_expr = 311, /* subarray_array_expr */ + YYSYMBOL_unclosed_subarray_array_expr = 312, /* unclosed_subarray_array_expr */ + YYSYMBOL_sparse_array_expr = 313, /* sparse_array_expr */ + YYSYMBOL_long_sparse_array_expr = 314, /* long_sparse_array_expr */ + YYSYMBOL_unclosed_long_sparse_array_expr = 315, /* unclosed_long_sparse_array_expr */ + YYSYMBOL_double_sparse_array_expr = 316, /* double_sparse_array_expr */ + YYSYMBOL_unclosed_double_sparse_array_expr = 317, /* unclosed_double_sparse_array_expr */ + YYSYMBOL_empty_array_expr = 318, /* empty_array_expr */ + YYSYMBOL_int_sparse_ele = 319, /* int_sparse_ele */ + YYSYMBOL_float_sparse_ele = 320, /* float_sparse_ele */ + YYSYMBOL_array_expr = 321, /* array_expr */ + YYSYMBOL_long_array_expr = 322, /* long_array_expr */ + YYSYMBOL_unclosed_long_array_expr = 323, /* unclosed_long_array_expr */ + YYSYMBOL_double_array_expr = 324, /* double_array_expr */ + YYSYMBOL_unclosed_double_array_expr = 325, /* unclosed_double_array_expr */ + YYSYMBOL_interval_expr = 326, /* interval_expr */ + YYSYMBOL_copy_option_list = 327, /* copy_option_list */ + YYSYMBOL_copy_option = 328, /* copy_option */ + YYSYMBOL_file_path = 329, /* file_path */ + YYSYMBOL_if_exists = 330, /* if_exists */ + YYSYMBOL_if_not_exists = 331, /* if_not_exists */ + YYSYMBOL_semicolon = 332, /* semicolon */ + YYSYMBOL_if_not_exists_info = 333, /* if_not_exists_info */ + YYSYMBOL_with_index_param_list = 334, /* with_index_param_list */ + YYSYMBOL_optional_table_properties_list = 335, /* optional_table_properties_list */ + YYSYMBOL_index_param_list = 336, /* index_param_list */ + YYSYMBOL_index_param = 337, /* index_param */ + YYSYMBOL_index_info = 338 /* index_info */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; + + /* Unqualified %code blocks. */ #line 97 "parser.y" @@ -458,10 +463,10 @@ typedef enum yysymbol_kind_t yysymbol_kind_t; #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #endif -#line 465 "parser.cpp" +#line 467 "parser.cpp" #ifdef short -#undef short +# undef short #endif /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure @@ -469,11 +474,11 @@ typedef enum yysymbol_kind_t yysymbol_kind_t; so that the code can choose integer types of a good width. */ #ifndef __PTRDIFF_MAX__ -#include /* INFRINGES ON USER NAME SPACE */ -#if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ -#include /* INFRINGES ON USER NAME SPACE */ -#define YY_STDINT_H -#endif +# include /* INFRINGES ON USER NAME SPACE */ +# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_STDINT_H +# endif #endif /* Narrow types that promote to a signed type and that can represent a @@ -503,15 +508,16 @@ typedef short yytype_int16; (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of . */ #ifdef __hpux -#undef UINT_LEAST8_MAX -#undef UINT_LEAST16_MAX -#define UINT_LEAST8_MAX 255 -#define UINT_LEAST16_MAX 65535 +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 #endif #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; -#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H && UINT_LEAST8_MAX <= INT_MAX) +#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST8_MAX <= INT_MAX) typedef uint_least8_t yytype_uint8; #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX typedef unsigned char yytype_uint8; @@ -521,7 +527,8 @@ typedef short yytype_uint8; #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ typedef __UINT_LEAST16_TYPE__ yytype_uint16; -#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H && UINT_LEAST16_MAX <= INT_MAX) +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST16_MAX <= INT_MAX) typedef uint_least16_t yytype_uint16; #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX typedef unsigned short yytype_uint16; @@ -530,37 +537,42 @@ typedef int yytype_uint16; #endif #ifndef YYPTRDIFF_T -#if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ -#define YYPTRDIFF_T __PTRDIFF_TYPE__ -#define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ -#elif defined PTRDIFF_MAX -#ifndef ptrdiff_t -#include /* INFRINGES ON USER NAME SPACE */ -#endif -#define YYPTRDIFF_T ptrdiff_t -#define YYPTRDIFF_MAXIMUM PTRDIFF_MAX -#else -#define YYPTRDIFF_T long -#define YYPTRDIFF_MAXIMUM LONG_MAX -#endif +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ +# define YYPTRDIFF_T __PTRDIFF_TYPE__ +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ +# elif defined PTRDIFF_MAX +# ifndef ptrdiff_t +# include /* INFRINGES ON USER NAME SPACE */ +# endif +# define YYPTRDIFF_T ptrdiff_t +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX +# else +# define YYPTRDIFF_T long +# define YYPTRDIFF_MAXIMUM LONG_MAX +# endif #endif #ifndef YYSIZE_T -#ifdef __SIZE_TYPE__ -#define YYSIZE_T __SIZE_TYPE__ -#elif defined size_t -#define YYSIZE_T size_t -#elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ -#include /* INFRINGES ON USER NAME SPACE */ -#define YYSIZE_T size_t -#else -#define YYSIZE_T unsigned -#endif +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned +# endif #endif -#define YYSIZE_MAXIMUM YY_CAST(YYPTRDIFF_T, (YYPTRDIFF_MAXIMUM < YY_CAST(YYSIZE_T, -1) ? YYPTRDIFF_MAXIMUM : YY_CAST(YYSIZE_T, -1))) +#define YYSIZE_MAXIMUM \ + YY_CAST (YYPTRDIFF_T, \ + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ + ? YYPTRDIFF_MAXIMUM \ + : YY_CAST (YYSIZE_T, -1))) + +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) -#define YYSIZEOF(X) YY_CAST(YYPTRDIFF_T, sizeof(X)) /* Stored state numbers (used for stacks). */ typedef yytype_int16 yy_state_t; @@ -569,965 +581,1318 @@ typedef yytype_int16 yy_state_t; typedef int yy_state_fast_t; #ifndef YY_ -#if defined YYENABLE_NLS && YYENABLE_NLS -#if ENABLE_NLS -#include /* INFRINGES ON USER NAME SPACE */ -#define YY_(Msgid) dgettext("bison-runtime", Msgid) -#endif -#endif -#ifndef YY_ -#define YY_(Msgid) Msgid -#endif +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# endif +# endif +# ifndef YY_ +# define YY_(Msgid) Msgid +# endif #endif + #ifndef YY_ATTRIBUTE_PURE -#if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) -#define YY_ATTRIBUTE_PURE __attribute__((__pure__)) -#else -#define YY_ATTRIBUTE_PURE -#endif +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif #endif #ifndef YY_ATTRIBUTE_UNUSED -#if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) -#define YY_ATTRIBUTE_UNUSED __attribute__((__unused__)) -#else -#define YY_ATTRIBUTE_UNUSED -#endif +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif #endif /* Suppress unused-variable warnings by "using" E. */ -#if !defined lint || defined __GNUC__ -#define YY_USE(E) ((void)(E)) +#if ! defined lint || defined __GNUC__ +# define YY_USE(E) ((void) (E)) #else -#define YY_USE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -#if defined __GNUC__ && !defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ -#if __GNUC__ * 100 + __GNUC_MINOR__ < 407 -#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wuninitialized\"") -#else -#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wuninitialized\"") _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -#endif -#define YY_IGNORE_MAYBE_UNINITIALIZED_END _Pragma("GCC diagnostic pop") +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -#define YY_INITIAL_VALUE(Value) Value +# define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -#define YY_IGNORE_MAYBE_UNINITIALIZED_END +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE -#define YY_INITIAL_VALUE(Value) /* Nothing. */ +# define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif -#if defined __cplusplus && defined __GNUC__ && !defined __ICC && 6 <= __GNUC__ -#define YY_IGNORE_USELESS_CAST_BEGIN _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wuseless-cast\"") -#define YY_IGNORE_USELESS_CAST_END _Pragma("GCC diagnostic pop") +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") #endif #ifndef YY_IGNORE_USELESS_CAST_BEGIN -#define YY_IGNORE_USELESS_CAST_BEGIN -#define YY_IGNORE_USELESS_CAST_END +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END #endif -#define YY_ASSERT(E) ((void)(0 && (E))) + +#define YY_ASSERT(E) ((void) (0 && (E))) #if 1 /* The parser invokes alloca or malloc; define the necessary symbols. */ -#ifdef YYSTACK_USE_ALLOCA -#if YYSTACK_USE_ALLOCA -#ifdef __GNUC__ -#define YYSTACK_ALLOC __builtin_alloca -#elif defined __BUILTIN_VA_ARG_INCR -#include /* INFRINGES ON USER NAME SPACE */ -#elif defined _AIX -#define YYSTACK_ALLOC __alloca -#elif defined _MSC_VER -#include /* INFRINGES ON USER NAME SPACE */ -#define alloca _alloca -#else -#define YYSTACK_ALLOC alloca -#if !defined _ALLOCA_H && !defined EXIT_SUCCESS -#include /* INFRINGES ON USER NAME SPACE */ -/* Use EXIT_SUCCESS as a witness for stdlib.h. */ -#ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 -#endif -#endif -#endif -#endif -#endif - -#ifdef YYSTACK_ALLOC -/* Pacify GCC's 'empty if-body' warning. */ -#define YYSTACK_FREE(Ptr) \ - do { /* empty */ \ - ; \ - } while (0) -#ifndef YYSTACK_ALLOC_MAXIMUM -/* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -#define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -#endif -#else -#define YYSTACK_ALLOC YYMALLOC -#define YYSTACK_FREE YYFREE -#ifndef YYSTACK_ALLOC_MAXIMUM -#define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -#endif -#if (defined __cplusplus && !defined EXIT_SUCCESS && !((defined YYMALLOC || defined malloc) && (defined YYFREE || defined free))) -#include /* INFRINGES ON USER NAME SPACE */ -#ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 -#endif -#endif -#ifndef YYMALLOC -#define YYMALLOC malloc -#if !defined malloc && !defined EXIT_SUCCESS -void *malloc(YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -#endif -#endif -#ifndef YYFREE -#define YYFREE free -#if !defined free && !defined EXIT_SUCCESS -void free(void *); /* INFRINGES ON USER NAME SPACE */ -#endif -#endif -#endif +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +# include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif #endif /* 1 */ -#if (!defined yyoverflow && \ - (!defined __cplusplus || (defined SQLLTYPE_IS_TRIVIAL && SQLLTYPE_IS_TRIVIAL && defined SQLSTYPE_IS_TRIVIAL && SQLSTYPE_IS_TRIVIAL))) +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined SQLLTYPE_IS_TRIVIAL && SQLLTYPE_IS_TRIVIAL \ + && defined SQLSTYPE_IS_TRIVIAL && SQLSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ -union yyalloc { - yy_state_t yyss_alloc; - YYSTYPE yyvs_alloc; - YYLTYPE yyls_alloc; +union yyalloc +{ + yy_state_t yyss_alloc; + YYSTYPE yyvs_alloc; + YYLTYPE yyls_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ -#define YYSTACK_GAP_MAXIMUM (YYSIZEOF(union yyalloc) - 1) +# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ -#define YYSTACK_BYTES(N) ((N) * (YYSIZEOF(yy_state_t) + YYSIZEOF(YYSTYPE) + YYSIZEOF(YYLTYPE)) + 2 * YYSTACK_GAP_MAXIMUM) +# define YYSTACK_BYTES(N) \ + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \ + + YYSIZEOF (YYLTYPE)) \ + + 2 * YYSTACK_GAP_MAXIMUM) -#define YYCOPY_NEEDED 1 +# define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -#define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do { \ - YYPTRDIFF_T yynewbytes; \ - YYCOPY(&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * YYSIZEOF(*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / YYSIZEOF(*yyptr); \ - } while (0) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYPTRDIFF_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ + } \ + while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ -#ifndef YYCOPY -#if defined __GNUC__ && 1 < __GNUC__ -#define YYCOPY(Dst, Src, Count) __builtin_memcpy(Dst, Src, YY_CAST(YYSIZE_T, (Count)) * sizeof(*(Src))) -#else -#define YYCOPY(Dst, Src, Count) \ - do { \ - YYPTRDIFF_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } while (0) -#endif -#endif +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYPTRDIFF_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 120 +#define YYFINAL 127 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1432 +#define YYLAST 1465 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 220 +#define YYNTOKENS 222 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 117 +#define YYNNTS 117 /* YYNRULES -- Number of rules. */ -#define YYNRULES 526 +#define YYNRULES 534 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 1189 +#define YYNSTATES 1209 /* YYMAXUTOK -- Last valid token kind. */ -#define YYMAXUTOK 458 +#define YYMAXUTOK 460 + /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) (0 <= (YYX) && (YYX) <= YYMAXUTOK ? YY_CAST(yysymbol_kind_t, yytranslate[YYX]) : YYSYMBOL_YYUNDEF) +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ -static const yytype_uint8 yytranslate[] = { - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 211, 2, 2, 214, 215, 209, 207, 218, 208, 216, 210, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 219, 217, 205, 204, 206, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 212, 2, 213, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203}; +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 213, 2, 2, + 216, 217, 211, 209, 220, 210, 218, 212, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 221, 219, + 207, 206, 208, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 214, 2, 215, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205 +}; #if SQLDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_int16 yyrline[] = { - 0, 503, 503, 507, 513, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 536, 537, 538, 539, - 540, 541, 542, 543, 544, 545, 546, 547, 554, 571, 588, 604, 633, 648, 680, 698, 716, 744, 775, 779, 784, 788, 794, 797, - 804, 855, 892, 944, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, - 1004, 1007, 1009, 1010, 1011, 1012, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, - 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, - 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, - 1099, 1103, 1113, 1116, 1119, 1122, 1126, 1129, 1134, 1139, 1146, 1152, 1162, 1178, 1216, 1232, 1235, 1242, 1254, 1263, 1276, 1280, 1285, 1298, - 1311, 1326, 1341, 1356, 1379, 1432, 1487, 1538, 1541, 1544, 1553, 1563, 1566, 1570, 1575, 1602, 1605, 1610, 1628, 1631, 1635, 1639, 1644, 1650, - 1653, 1656, 1660, 1664, 1666, 1670, 1672, 1675, 1679, 1682, 1686, 1689, 1693, 1696, 1700, 1705, 1709, 1712, 1716, 1719, 1723, 1726, 1730, 1733, - 1737, 1740, 1743, 1746, 1754, 1757, 1772, 1772, 1774, 1788, 1797, 1802, 1811, 1816, 1821, 1827, 1834, 1837, 1841, 1844, 1849, 1861, 1868, 1882, - 1885, 1888, 1891, 1894, 1897, 1900, 1906, 1910, 1914, 1918, 1922, 1929, 1933, 1937, 1941, 1945, 1950, 1954, 1959, 1963, 1967, 1973, 1979, 1985, - 1996, 2007, 2018, 2030, 2042, 2055, 2069, 2080, 2094, 2110, 2127, 2131, 2135, 2139, 2143, 2147, 2153, 2157, 2161, 2165, 2175, 2179, 2183, 2191, - 2202, 2225, 2231, 2236, 2242, 2248, 2256, 2262, 2268, 2274, 2280, 2288, 2294, 2300, 2306, 2312, 2320, 2326, 2332, 2341, 2351, 2364, 2368, 2373, - 2379, 2386, 2394, 2403, 2413, 2423, 2434, 2445, 2457, 2469, 2479, 2490, 2502, 2515, 2519, 2524, 2529, 2535, 2539, 2543, 2549, 2553, 2557, 2563, - 2569, 2577, 2583, 2587, 2593, 2597, 2603, 2608, 2613, 2620, 2629, 2639, 2648, 2660, 2676, 2680, 2685, 2695, 2717, 2723, 2727, 2728, 2729, 2730, - 2731, 2733, 2736, 2742, 2745, 2746, 2747, 2748, 2749, 2750, 2751, 2752, 2753, 2754, 2758, 2774, 2791, 2809, 2855, 2894, 2937, 2984, 3008, 3031, - 3052, 3073, 3082, 3093, 3104, 3118, 3125, 3135, 3141, 3153, 3156, 3159, 3162, 3165, 3168, 3172, 3176, 3181, 3189, 3197, 3206, 3213, 3220, 3227, - 3234, 3241, 3249, 3257, 3265, 3273, 3281, 3289, 3297, 3305, 3313, 3321, 3329, 3337, 3367, 3375, 3384, 3392, 3401, 3409, 3415, 3422, 3428, 3435, - 3440, 3447, 3454, 3462, 3489, 3495, 3501, 3508, 3516, 3523, 3530, 3535, 3545, 3550, 3555, 3560, 3565, 3570, 3575, 3580, 3585, 3590, 3593, 3596, - 3600, 3603, 3606, 3609, 3613, 3616, 3619, 3623, 3627, 3632, 3637, 3640, 3644, 3648, 3655, 3662, 3666, 3673, 3680, 3684, 3688, 3692, 3695, 3699, - 3703, 3708, 3713, 3717, 3722, 3727, 3733, 3739, 3745, 3751, 3757, 3763, 3769, 3775, 3781, 3787, 3793, 3804, 3808, 3813, 3844, 3854, 3859, 3864, - 3869, 3875, 3879, 3880, 3882, 3883, 3885, 3886, 3898, 3906, 3910, 3913, 3917, 3920, 3924, 3928, 3933, 3939, 3949, 3959, 3967, 3978, 4009}; +static const yytype_int16 yyrline[] = +{ + 0, 503, 503, 507, 513, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 554, 571, 588, 604, 633, 648, 680, 698, + 716, 744, 775, 779, 784, 788, 794, 797, 804, 855, + 892, 944, 984, 985, 986, 987, 988, 989, 990, 991, + 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, + 1002, 1003, 1004, 1007, 1009, 1010, 1011, 1012, 1015, 1016, + 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, + 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, + 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, + 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, + 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, + 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, + 1077, 1078, 1079, 1080, 1099, 1103, 1113, 1116, 1119, 1122, + 1126, 1129, 1134, 1139, 1146, 1152, 1162, 1178, 1216, 1232, + 1235, 1242, 1254, 1263, 1276, 1280, 1285, 1298, 1311, 1326, + 1341, 1356, 1379, 1432, 1487, 1538, 1541, 1544, 1553, 1563, + 1566, 1570, 1575, 1602, 1605, 1610, 1628, 1631, 1635, 1639, + 1644, 1650, 1653, 1656, 1660, 1664, 1666, 1670, 1672, 1675, + 1679, 1682, 1686, 1689, 1693, 1696, 1700, 1705, 1709, 1712, + 1716, 1719, 1723, 1726, 1730, 1733, 1737, 1740, 1743, 1746, + 1754, 1757, 1772, 1772, 1774, 1788, 1797, 1802, 1811, 1816, + 1821, 1827, 1834, 1837, 1841, 1844, 1849, 1861, 1868, 1882, + 1885, 1888, 1891, 1894, 1897, 1900, 1906, 1910, 1914, 1918, + 1922, 1929, 1933, 1937, 1941, 1945, 1950, 1954, 1959, 1963, + 1967, 1973, 1979, 1985, 1996, 2007, 2018, 2030, 2042, 2055, + 2069, 2080, 2094, 2110, 2127, 2131, 2135, 2139, 2143, 2147, + 2153, 2157, 2161, 2165, 2171, 2175, 2185, 2189, 2193, 2201, + 2212, 2235, 2241, 2246, 2252, 2258, 2266, 2272, 2278, 2284, + 2290, 2298, 2304, 2310, 2316, 2322, 2330, 2336, 2342, 2351, + 2360, 2368, 2376, 2382, 2388, 2394, 2401, 2414, 2418, 2423, + 2429, 2436, 2444, 2453, 2463, 2473, 2484, 2495, 2507, 2519, + 2529, 2540, 2552, 2565, 2569, 2574, 2579, 2585, 2589, 2593, + 2599, 2603, 2607, 2613, 2619, 2627, 2633, 2637, 2643, 2647, + 2653, 2658, 2663, 2670, 2679, 2689, 2698, 2710, 2726, 2730, + 2735, 2745, 2767, 2773, 2777, 2778, 2779, 2780, 2781, 2783, + 2786, 2792, 2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, + 2803, 2804, 2808, 2824, 2841, 2859, 2905, 2944, 2987, 3034, + 3058, 3081, 3102, 3123, 3132, 3143, 3154, 3168, 3175, 3185, + 3191, 3203, 3206, 3209, 3212, 3215, 3218, 3222, 3226, 3231, + 3239, 3247, 3256, 3263, 3270, 3277, 3284, 3291, 3299, 3307, + 3315, 3323, 3331, 3339, 3347, 3355, 3363, 3371, 3379, 3387, + 3417, 3425, 3434, 3442, 3451, 3459, 3465, 3472, 3478, 3485, + 3490, 3497, 3504, 3512, 3539, 3545, 3551, 3558, 3566, 3573, + 3580, 3585, 3595, 3600, 3605, 3610, 3615, 3620, 3625, 3630, + 3635, 3640, 3643, 3646, 3650, 3653, 3656, 3659, 3663, 3666, + 3669, 3673, 3677, 3682, 3687, 3690, 3694, 3698, 3705, 3712, + 3716, 3723, 3730, 3734, 3738, 3742, 3745, 3749, 3753, 3758, + 3763, 3767, 3772, 3777, 3783, 3789, 3795, 3801, 3807, 3813, + 3819, 3825, 3831, 3837, 3843, 3854, 3858, 3863, 3894, 3904, + 3909, 3914, 3919, 3925, 3929, 3930, 3932, 3933, 3935, 3936, + 3948, 3956, 3960, 3963, 3967, 3970, 3974, 3978, 3983, 3989, + 3999, 4009, 4017, 4028, 4059 +}; #endif /** Accessing symbol of state STATE. */ -#define YY_ACCESSING_SYMBOL(State) YY_CAST(yysymbol_kind_t, yystos[State]) +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) #if 1 /* The user-facing name of the symbol whose (internal) number is YYSYMBOL. No bounds checking. */ -static const char *yysymbol_name(yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = {"\"end of file\"", - "error", - "\"invalid token\"", - "IDENTIFIER", - "STRING", - "DOUBLE_VALUE", - "LONG_VALUE", - "CREATE", - "SELECT", - "INSERT", - "DROP", - "UPDATE", - "DELETE", - "COPY", - "SET", - "EXPLAIN", - "SHOW", - "ALTER", - "EXECUTE", - "PREPARE", - "UNION", - "ALL", - "INTERSECT", - "COMPACT", - "LOCK", - "UNLOCK", - "ADD", - "RENAME", - "EXCEPT", - "FLUSH", - "USE", - "OPTIMIZE", - "PROPERTIES", - "DATABASE", - "TABLE", - "COLLECTION", - "TABLES", - "INTO", - "VALUES", - "VIEW", - "INDEX", - "VIEWS", - "DATABASES", - "SEGMENT", - "SEGMENTS", - "BLOCK", - "BLOCKS", - "COLUMN", - "COLUMNS", - "INDEXES", - "CHUNK", - "GROUP", - "BY", - "HAVING", - "AS", - "NATURAL", - "JOIN", - "LEFT", - "RIGHT", - "OUTER", - "FULL", - "ON", - "INNER", - "CROSS", - "DISTINCT", - "WHERE", - "ORDER", - "LIMIT", - "OFFSET", - "ASC", - "DESC", - "IF", - "NOT", - "EXISTS", - "IN", - "FROM", - "TO", - "WITH", - "DELIMITER", - "FORMAT", - "HEADER", - "HIGHLIGHT", - "CAST", - "END", - "CASE", - "ELSE", - "THEN", - "WHEN", - "UNNEST", - "BOOLEAN", - "INTEGER", - "INT", - "TINYINT", - "SMALLINT", - "BIGINT", - "HUGEINT", - "VARCHAR", - "FLOAT", - "DOUBLE", - "REAL", - "DECIMAL", - "DATE", - "TIME", - "DATETIME", - "FLOAT16", - "BFLOAT16", - "UNSIGNED", - "TIMESTAMP", - "UUID", - "POINT", - "LINE", - "LSEG", - "BOX", - "PATH", - "POLYGON", - "CIRCLE", - "BLOB", - "BITMAP", - "EMBEDDING", - "VECTOR", - "BIT", - "TEXT", - "MULTIVECTOR", - "TENSOR", - "SPARSE", - "TENSORARRAY", - "IGNORE", - "PRIMARY", - "KEY", - "UNIQUE", - "NULLABLE", - "IS", - "DEFAULT", - "COMMENT", - "TRUE", - "FALSE", - "INTERVAL", - "SECOND", - "SECONDS", - "MINUTE", - "MINUTES", - "HOUR", - "HOURS", - "DAY", - "DAYS", - "MONTH", - "MONTHS", - "YEAR", - "YEARS", - "EQUAL", - "NOT_EQ", - "LESS_EQ", - "GREATER_EQ", - "BETWEEN", - "AND", - "OR", - "EXTRACT", - "LIKE", - "DATA", - "LOG", - "BUFFER", - "TRANSACTIONS", - "TRANSACTION", - "MEMINDEX", - "USING", - "SESSION", - "GLOBAL", - "OFF", - "EXPORT", - "CONFIGS", - "CONFIG", - "PROFILES", - "VARIABLES", - "VARIABLE", - "DELTA", - "LOGS", - "CATALOGS", - "CATALOG", - "SEARCH", - "MATCH", - "MAXSIM", - "QUERY", - "QUERIES", - "FUSION", - "ROWLIMIT", - "ADMIN", - "LEADER", - "FOLLOWER", - "LEARNER", - "CONNECT", - "STANDALONE", - "NODES", - "NODE", - "REMOVE", - "SNAPSHOT", - "SNAPSHOTS", - "RECOVER", - "PERSISTENCE", - "OBJECT", - "OBJECTS", - "FILES", - "MEMORY", - "ALLOCATION", - "NUMBER", - "'='", - "'<'", - "'>'", - "'+'", - "'-'", - "'*'", - "'/'", - "'%'", - "'['", - "']'", - "'('", - "')'", - "'.'", - "';'", - "','", - "':'", - "$accept", - "input_pattern", - "statement_list", - "statement", - "explainable_statement", - "create_statement", - "table_element_array", - "column_def_array", - "table_element", - "table_column", - "column_type", - "column_constraints", - "column_constraint", - "default_expr", - "table_constraint", - "identifier_array", - "delete_statement", - "insert_statement", - "optional_identifier_array", - "explain_statement", - "update_statement", - "update_expr_array", - "update_expr", - "drop_statement", - "copy_statement", - "select_statement", - "select_with_paren", - "select_without_paren", - "select_clause_with_modifier", - "select_clause_without_modifier_paren", - "select_clause_without_modifier", - "order_by_clause", - "order_by_expr_list", - "order_by_expr", - "order_by_type", - "limit_expr", - "offset_expr", - "distinct", - "unnest_clause", - "highlight_clause", - "from_clause", - "search_clause", - "optional_search_filter_expr", - "where_clause", - "having_clause", - "group_by_clause", - "set_operator", - "table_reference", - "table_reference_unit", - "table_reference_name", - "table_name", - "table_alias", - "with_clause", - "with_expr_list", - "with_expr", - "join_clause", - "join_type", - "show_statement", - "flush_statement", - "optimize_statement", - "command_statement", - "compact_statement", - "admin_statement", - "alter_statement", - "expr_array", - "insert_row_list", - "expr_alias", - "expr", - "operand", - "match_tensor_expr", - "match_vector_expr", - "match_sparse_expr", - "match_text_expr", - "query_expr", - "fusion_expr", - "sub_search", - "sub_search_array", - "function_expr", - "conjunction_expr", - "between_expr", - "in_expr", - "case_expr", - "case_check_array", - "cast_expr", - "subquery_expr", - "column_expr", - "constant_expr", - "common_array_expr", - "common_sparse_array_expr", - "subarray_array_expr", - "unclosed_subarray_array_expr", - "sparse_array_expr", - "long_sparse_array_expr", - "unclosed_long_sparse_array_expr", - "double_sparse_array_expr", - "unclosed_double_sparse_array_expr", - "empty_array_expr", - "int_sparse_ele", - "float_sparse_ele", - "array_expr", - "long_array_expr", - "unclosed_long_array_expr", - "double_array_expr", - "unclosed_double_array_expr", - "interval_expr", - "copy_option_list", - "copy_option", - "file_path", - "if_exists", - "if_not_exists", - "semicolon", - "if_not_exists_info", - "with_index_param_list", - "optional_table_properties_list", - "index_param_list", - "index_param", - "index_info", - YY_NULLPTR}; - -static const char *yysymbol_name(yysymbol_kind_t yysymbol) { return yytname[yysymbol]; } +static const char *const yytname[] = +{ + "\"end of file\"", "error", "\"invalid token\"", "IDENTIFIER", "STRING", + "DOUBLE_VALUE", "LONG_VALUE", "CREATE", "SELECT", "INSERT", "DROP", + "UPDATE", "DELETE", "COPY", "SET", "EXPLAIN", "SHOW", "ALTER", "EXECUTE", + "PREPARE", "UNION", "ALL", "INTERSECT", "COMPACT", "LOCK", "UNLOCK", + "ADD", "RENAME", "EXCEPT", "FLUSH", "USE", "OPTIMIZE", "PROPERTIES", + "DATABASE", "TABLE", "COLLECTION", "TABLES", "INTO", "VALUES", "VIEW", + "INDEX", "VIEWS", "DATABASES", "SEGMENT", "SEGMENTS", "BLOCK", "BLOCKS", + "COLUMN", "COLUMNS", "INDEXES", "CHUNK", "SYSTEM", "GROUP", "BY", + "HAVING", "AS", "NATURAL", "JOIN", "LEFT", "RIGHT", "OUTER", "FULL", + "ON", "INNER", "CROSS", "DISTINCT", "WHERE", "ORDER", "LIMIT", "OFFSET", + "ASC", "DESC", "IF", "NOT", "EXISTS", "IN", "FROM", "TO", "WITH", + "DELIMITER", "FORMAT", "HEADER", "HIGHLIGHT", "CAST", "END", "CASE", + "ELSE", "THEN", "WHEN", "UNNEST", "BOOLEAN", "INTEGER", "INT", "TINYINT", + "SMALLINT", "BIGINT", "HUGEINT", "VARCHAR", "FLOAT", "DOUBLE", "REAL", + "DECIMAL", "DATE", "TIME", "DATETIME", "FLOAT16", "BFLOAT16", "UNSIGNED", + "TIMESTAMP", "UUID", "POINT", "LINE", "LSEG", "BOX", "PATH", "POLYGON", + "CIRCLE", "BLOB", "BITMAP", "EMBEDDING", "VECTOR", "BIT", "TEXT", + "MULTIVECTOR", "TENSOR", "SPARSE", "TENSORARRAY", "IGNORE", "PRIMARY", + "KEY", "UNIQUE", "NULLABLE", "IS", "DEFAULT", "COMMENT", "TRUE", "FALSE", + "INTERVAL", "SECOND", "SECONDS", "MINUTE", "MINUTES", "HOUR", "HOURS", + "DAY", "DAYS", "MONTH", "MONTHS", "YEAR", "YEARS", "EQUAL", "NOT_EQ", + "LESS_EQ", "GREATER_EQ", "BETWEEN", "AND", "OR", "EXTRACT", "LIKE", + "DATA", "LOG", "BUFFER", "TRANSACTIONS", "TRANSACTION", "MEMINDEX", + "USING", "SESSION", "GLOBAL", "OFF", "EXPORT", "CONFIGS", "CONFIG", + "PROFILES", "VARIABLES", "VARIABLE", "DELTA", "LOGS", "CATALOGS", + "CATALOG", "SEARCH", "MATCH", "MAXSIM", "QUERY", "QUERIES", "FUSION", + "ROWLIMIT", "ADMIN", "LEADER", "FOLLOWER", "LEARNER", "CONNECT", + "STANDALONE", "NODES", "NODE", "REMOVE", "SNAPSHOT", "SNAPSHOTS", + "RECOVER", "RESTORE", "PERSISTENCE", "OBJECT", "OBJECTS", "FILES", + "MEMORY", "ALLOCATION", "NUMBER", "'='", "'<'", "'>'", "'+'", "'-'", + "'*'", "'/'", "'%'", "'['", "']'", "'('", "')'", "'.'", "';'", "','", + "':'", "$accept", "input_pattern", "statement_list", "statement", + "explainable_statement", "create_statement", "table_element_array", + "column_def_array", "table_element", "table_column", "column_type", + "column_constraints", "column_constraint", "default_expr", + "table_constraint", "identifier_array", "delete_statement", + "insert_statement", "optional_identifier_array", "explain_statement", + "update_statement", "update_expr_array", "update_expr", "drop_statement", + "copy_statement", "select_statement", "select_with_paren", + "select_without_paren", "select_clause_with_modifier", + "select_clause_without_modifier_paren", "select_clause_without_modifier", + "order_by_clause", "order_by_expr_list", "order_by_expr", + "order_by_type", "limit_expr", "offset_expr", "distinct", + "unnest_clause", "highlight_clause", "from_clause", "search_clause", + "optional_search_filter_expr", "where_clause", "having_clause", + "group_by_clause", "set_operator", "table_reference", + "table_reference_unit", "table_reference_name", "table_name", + "table_alias", "with_clause", "with_expr_list", "with_expr", + "join_clause", "join_type", "show_statement", "flush_statement", + "optimize_statement", "command_statement", "compact_statement", + "admin_statement", "alter_statement", "expr_array", "insert_row_list", + "expr_alias", "expr", "operand", "match_tensor_expr", + "match_vector_expr", "match_sparse_expr", "match_text_expr", + "query_expr", "fusion_expr", "sub_search", "sub_search_array", + "function_expr", "conjunction_expr", "between_expr", "in_expr", + "case_expr", "case_check_array", "cast_expr", "subquery_expr", + "column_expr", "constant_expr", "common_array_expr", + "common_sparse_array_expr", "subarray_array_expr", + "unclosed_subarray_array_expr", "sparse_array_expr", + "long_sparse_array_expr", "unclosed_long_sparse_array_expr", + "double_sparse_array_expr", "unclosed_double_sparse_array_expr", + "empty_array_expr", "int_sparse_ele", "float_sparse_ele", "array_expr", + "long_array_expr", "unclosed_long_array_expr", "double_array_expr", + "unclosed_double_array_expr", "interval_expr", "copy_option_list", + "copy_option", "file_path", "if_exists", "if_not_exists", "semicolon", + "if_not_exists_info", "with_index_param_list", + "optional_table_properties_list", "index_param_list", "index_param", + "index_info", YY_NULLPTR +}; + +static const char * +yysymbol_name (yysymbol_kind_t yysymbol) +{ + return yytname[yysymbol]; +} #endif -#define YYPACT_NINF (-725) +#define YYPACT_NINF (-745) -#define yypact_value_is_default(Yyn) ((Yyn) == YYPACT_NINF) +#define yypact_value_is_default(Yyn) \ + ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF (-514) +#define YYTABLE_NINF (-522) -#define yytable_value_is_error(Yyn) ((Yyn) == YYTABLE_NINF) +#define yytable_value_is_error(Yyn) \ + ((Yyn) == YYTABLE_NINF) /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -static const yytype_int16 yypact[] = { - 652, 445, 35, 464, 99, 149, 99, -81, 83, 785, 124, 210, 253, 266, 278, 330, 340, 371, 235, 123, -55, 422, 241, -725, - -725, -725, -725, -725, -725, -725, -725, 389, -725, -725, 456, -725, -725, -725, -725, -725, -725, -725, 402, 402, 402, 402, 185, 99, - 417, 417, 417, 417, 417, 259, 494, 99, -45, 479, 493, 516, 694, -725, -725, -725, -725, -725, -725, -725, 389, -725, -725, -725, - -725, -725, 348, 539, 99, -725, -725, -725, -725, -725, 538, -725, 85, 257, -725, 561, -725, 408, -725, -725, 571, -725, 248, 87, - 99, 99, 99, 99, -725, -725, -725, -725, -8, -725, 543, 387, -725, 604, 424, 428, 271, 663, 430, 612, 450, 574, 442, 443, - -725, 51, -725, 632, -725, -725, 24, 610, -725, 613, 606, 677, 99, 99, 99, 681, 624, 472, 625, 699, 99, 99, 99, 708, - 713, 717, 656, 718, 718, 553, 40, 192, 200, -725, 511, -725, 384, -725, -725, 724, -725, 727, -725, -725, -725, 729, -725, -725, - -725, -725, 373, -725, -725, -725, 99, 521, 371, 718, -725, 733, -725, 577, -725, 732, -725, -725, 739, -725, -725, 737, -725, 740, - 741, -725, 742, 693, 744, 556, -725, -725, -725, -725, 24, -725, -725, -725, 553, 700, 686, 682, 621, -15, -725, 472, -725, 99, - 753, 45, -725, -725, -725, -725, -725, 696, -725, 554, 5, -725, 553, -725, -725, 687, 689, 549, -725, -725, 759, 667, 558, 559, - 399, 755, 771, 772, 773, -725, -725, 774, 564, 249, 565, 568, 709, 709, -725, 28, 438, 111, -725, -2, 821, -725, -725, -725, - -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, 567, -725, -725, -725, 42, -725, -725, 55, -725, 132, -725, -725, -725, 221, - -725, 227, -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, 781, 779, -725, -725, -725, - -725, -725, -725, 743, 747, 710, 712, 456, -725, -725, -725, 783, 252, -725, 789, -725, -725, 721, 127, -725, 792, 583, 584, -24, - 553, 553, 736, -725, 796, -55, 41, 752, 593, -725, 112, 594, -725, 99, 553, 717, -725, 358, 599, 600, 206, -725, -725, -725, - -725, -725, -725, -725, -725, -725, -725, -725, -725, 709, 601, 187, 748, 553, 553, 128, 380, -725, -725, -725, -725, 759, -725, 813, - 614, 616, 617, 619, 820, 830, 327, 327, -725, 622, -725, -725, -725, -725, 627, 95, 776, 553, 844, 553, 553, -26, 635, 163, - 709, 709, 709, 709, 709, 709, 709, 709, 709, 709, 709, 709, 709, 709, 38, -725, 641, -725, 850, -725, 853, -725, 854, -725, - 856, 824, 525, 649, 650, 865, 659, -725, 665, -725, 872, -725, 374, 878, 719, 722, -725, -725, -725, 553, 809, 669, -725, 144, - 358, 553, -725, -725, 129, 961, 757, 675, 208, -725, -725, -725, -55, 888, 761, -725, 906, 553, 695, -725, 358, -725, 37, 37, - 553, -725, 275, 748, 754, 697, 17, -30, 404, -725, 553, 553, 839, 553, 911, 39, 553, 701, 299, 463, -725, -725, 718, -725, - -725, -725, 766, 723, 709, 438, 802, -725, 171, 171, 343, 343, 838, 171, 171, 343, 343, 327, 327, -725, -725, -725, -725, -725, - -725, 703, -725, 714, -725, -725, -725, 928, 930, -725, 753, 935, -725, 936, -725, -725, 934, -725, -725, 937, 938, 725, 12, 861, - 553, -725, -725, -725, 358, 940, -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, 749, -725, -725, -725, -725, -725, -725, - -725, -725, -725, -725, -725, -725, 750, 751, 762, 763, 765, 767, 234, 769, 753, 921, 41, 389, 760, 953, -725, 303, 770, 952, - 956, 964, 977, -725, 979, 314, -725, 328, 345, -725, 778, -725, 961, 553, -725, 553, -10, 62, 709, -76, 780, -725, 142, 130, - 46, 782, -725, 987, -725, -725, 917, 438, 171, 784, 366, -725, 709, 990, 995, 951, 955, 394, 405, -725, 804, 421, -725, 1003, - -725, -725, -55, 794, 468, -725, 217, -725, 553, 835, -725, -725, 1008, 495, 913, 997, 1014, 1031, 1048, 885, 892, -725, -725, 224, - -725, 884, 753, 423, 807, 889, -725, 859, -725, -725, 553, -725, -725, -725, -725, -725, -725, 37, -725, -725, -725, 819, 358, 121, - -725, 553, 720, 812, 1032, 641, 823, 822, 553, -725, 826, 825, 852, 425, -725, -725, 187, 1068, 1069, -725, -725, 935, 563, -725, - 936, 376, 27, 12, 981, -725, -725, -725, -725, -725, -725, 982, -725, 1074, -725, 725, 326, 656, 433, 860, 863, 864, 874, 875, - 879, 880, 881, 882, 1004, 891, 895, 896, 897, 898, 908, 909, 912, 914, 915, 1018, 925, 926, 929, 931, 932, 939, 941, 942, - 943, 944, 1039, 945, 946, 947, 948, 949, 954, 957, 958, 959, 960, 1056, 962, 963, 965, 966, 967, 968, 969, 970, 971, 972, - 1063, 973, 974, 975, 976, 978, 980, 983, 984, 985, 986, 1064, 988, -725, -725, 31, -725, 1025, 1036, 475, -725, 936, 1166, 1168, - 476, -725, -725, -725, 358, -725, 570, 989, 991, 992, 15, 993, -725, -725, -725, 1108, 998, 358, -725, 37, -725, -725, -725, -725, - -725, -725, -725, -725, -725, -725, 1173, -725, 217, 468, 12, 12, 994, -725, -725, -725, -725, -725, -725, -725, 996, 1123, -725, 1176, - 1189, 1191, 1193, 1194, 1199, 1206, 1209, 1210, 1211, 1000, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1011, 1224, 1225, 1226, - 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1022, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1033, 1246, 1247, 1248, 1249, 1250, - 1251, 1252, 1253, 1254, 1255, 1044, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 1055, 1268, -725, 1271, 1272, -725, 477, -725, - 712, -725, -725, 1273, 96, 1065, 1274, 1275, -725, 481, 1276, -725, -725, 1223, 753, 326, 1234, 1245, 1066, 1070, 1072, 1073, 1075, 1076, - 1077, 1078, 1079, 1080, 1277, 1081, 1082, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1283, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, - 1100, 1101, 1311, 1103, 1104, 1105, 1106, 1107, 1109, 1110, 1111, 1112, 1113, 1317, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1124, - 1332, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1344, 1136, -725, -725, -725, -725, 1135, 822, 1188, 1137, 1138, -725, 411, - 553, 482, -725, 553, 553, -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, 1139, -725, -725, -725, -725, -725, -725, -725, - -725, -725, -725, 1142, -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, 1143, -725, -725, -725, -725, -725, -725, -725, -725, -725, - -725, 1144, -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, 1145, -725, -725, -725, -725, -725, -725, -725, -725, -725, -725, 1146, - -725, 1358, 1148, 1315, 1361, 212, 1151, 1362, 1363, -725, -725, -725, 358, -725, 725, 358, -725, -725, -725, -725, -725, -725, 1149, 1207, - 1156, 1154, 822, 712, 1367, 545, 216, 1159, 1326, 1372, 1373, 1163, -725, 552, 1374, -725, 822, 712, 1165, 1167, 822, 10, 1375, -725, - 1335, 1169, -725, 1381, -725, 1171, 1347, 1348, -725, -725, -725, 14, 1174, -38, -725, 1177, 1350, 1352, -725, -725, 1353, 1354, 1392, -725, - 1182, -725, 1183, 1184, 1395, 1397, 712, 1186, 1187, -725, 712, -725, -725}; +static const yytype_int16 yypact[] = +{ + 881, 71, 0, 92, 52, 20, 52, 212, 835, 754, + 69, 89, 101, 115, 229, 173, 181, 202, 48, 165, + 236, -31, 160, 28, -745, -745, -745, -745, -745, -745, + -745, -745, 347, -745, -745, 246, -745, -745, -745, -745, + -745, -745, -745, 258, 258, 258, 258, -10, 353, 52, + 273, 273, 273, 273, 273, 371, 179, 417, 52, -12, + 403, 446, 450, 293, -745, -745, -745, -745, -745, -745, + -745, 347, -745, -745, -745, -745, -745, 239, 457, 52, + -745, -745, -745, -745, -745, 467, -745, 207, 250, -745, + 474, -745, 311, -745, -745, 483, -745, 491, -745, 427, + -138, 52, 52, 52, 52, -745, -745, -745, -745, -18, + -745, 441, 278, -745, 496, 309, 325, 226, 534, 340, + 535, 358, 477, 366, 372, 357, 363, -745, 70, -745, + 567, -745, -745, 25, 529, -745, 531, 537, 612, 52, + 52, 52, 614, 557, 562, 420, 559, 639, 52, 52, + 52, 646, -745, 650, 656, 595, 658, 658, 552, 40, + 55, 66, -745, 448, -745, 386, -745, -745, 661, -745, + 668, -745, -745, -745, -745, 671, -745, -745, -745, -745, + 334, -745, -745, -745, 52, 456, 202, 658, -745, 679, + -745, 519, -745, 680, -745, -745, 682, -745, -745, 686, + -745, 689, 692, -745, 693, 643, 695, 506, 700, 702, + -745, -745, -745, -745, 25, -745, -745, -745, 552, 653, + 645, 640, 581, -13, -745, 420, -745, 52, 191, 713, + 12, -745, -745, -745, -745, -745, 655, -745, 512, -45, + -745, 552, -745, -745, 644, 657, 507, -745, -745, 729, + 617, 508, 515, 434, 724, 733, 734, 735, -745, -745, + 727, 524, 341, 525, 527, 673, 673, -745, 23, 397, + 122, -745, -1, 828, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, 530, -745, -745, + -745, 116, -745, -745, 143, -745, 150, -745, -745, -745, + 157, -745, 184, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + 739, 738, -745, -745, -745, -745, -745, -745, 698, 703, + 670, 677, 246, -745, -745, -745, 745, 49, -745, 753, + -745, -745, 674, 280, -745, 756, -745, -745, 547, 548, + -14, 552, 552, 701, -745, 763, -31, 130, 714, 555, + 769, 770, -745, -745, 188, 563, -745, 52, 552, 656, + -745, 449, 564, 566, 211, -745, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, 673, 568, 895, + 705, 552, 552, 134, 388, -745, -745, -745, -745, 729, + -745, 774, 569, 570, 573, 576, 787, 789, 419, 419, + -745, 577, -745, -745, -745, -745, 583, 108, 717, 552, + 799, 552, 552, -44, 587, 15, 673, 673, 673, 673, + 673, 673, 673, 673, 673, 673, 673, 673, 673, 673, + 32, -745, 590, -745, 800, -745, 801, -745, 805, -745, + 807, 762, 465, 598, 599, 813, 602, -745, 603, -745, + 815, -745, 259, 818, 654, 659, -745, -745, -745, 552, + 747, 605, -745, 94, 449, 552, -745, -745, 87, 1034, + 706, 613, 194, -745, -745, -745, -31, 829, 707, -745, + -745, -745, 831, 552, 616, -745, 449, -745, 82, 82, + 552, -745, 198, 705, 681, 623, 63, 54, 404, -745, + 552, 552, 767, 552, 846, 33, 552, 632, 286, 633, + -745, -745, 658, -745, -745, -745, 699, 663, 673, 397, + 725, -745, 910, 910, 234, 234, 812, 910, 910, 234, + 234, 419, 419, -745, -745, -745, -745, -745, -745, 641, + -745, 660, -745, -745, -745, 855, 874, -745, 713, 883, + -745, 896, -745, -745, 894, -745, -745, 898, 903, 688, + 24, 820, 552, -745, -745, -745, 449, 915, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, 711, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, 712, 716, 718, 719, 722, 723, 279, 730, + 713, 882, 130, 347, 728, 919, -745, 301, 731, 927, + 945, 948, 951, -745, 949, 323, -745, 324, 328, -745, + 741, -745, 1034, 552, -745, 552, -11, 125, 673, -81, + 736, -745, 73, 106, 231, 744, -745, 962, -745, -745, + 891, 397, 910, 755, 330, -745, 673, 965, 968, 924, + 928, 332, 342, -745, 771, 346, -745, 970, -745, -745, + -31, 764, 526, -745, 171, -745, 552, 804, -745, -745, + 979, 575, 978, 1070, 1087, 1104, 1121, 856, 859, -745, + -745, 210, -745, 857, 713, 348, 773, 858, -745, 826, + -745, -745, 552, -745, -745, -745, -745, -745, -745, 82, + -745, -745, -745, 776, 449, 123, -745, 552, 790, 780, + 991, 590, 791, 786, 552, -745, 792, 794, 795, 355, + -745, -745, 895, 1002, 1005, -745, -745, 883, 510, -745, + 896, 447, 29, 24, 956, -745, -745, -745, -745, -745, + -745, 957, -745, 1012, -745, 688, 313, 595, 356, 796, + 797, 806, 808, 809, 810, 811, 823, 824, 939, 832, + 834, 836, 837, 838, 839, 844, 845, 854, 860, 973, + 861, 862, 866, 867, 868, 869, 870, 871, 872, 873, + 982, 875, 876, 878, 880, 889, 890, 892, 893, 921, + 929, 985, 931, 932, 935, 936, 946, 947, 950, 952, + 953, 954, 1001, 963, 964, 967, 969, 980, 981, 984, + 986, 987, 997, 1018, 998, -745, -745, 34, -745, 1014, + 1037, 375, -745, 896, 1045, 1052, 376, -745, -745, -745, + 449, -745, 635, 1003, 1004, 1009, 14, 1010, -745, -745, + -745, 1048, 971, 449, -745, 82, -745, -745, -745, -745, + -745, -745, -745, -745, -745, -745, 1109, -745, 171, 526, + 24, 24, 974, -745, -745, -745, -745, -745, -745, -745, + 1011, 1153, -745, 1215, 1216, 1226, 1227, 1228, 1229, 1230, + 1231, 1232, 1233, 1020, 1235, 1237, 1238, 1239, 1240, 1241, + 1242, 1243, 1244, 1245, 1032, 1247, 1248, 1249, 1250, 1251, + 1252, 1253, 1254, 1255, 1256, 1043, 1258, 1259, 1260, 1261, + 1262, 1263, 1264, 1265, 1266, 1267, 1054, 1269, 1270, 1271, + 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1065, 1280, 1281, + 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1076, 1291, + -745, 1294, 1295, -745, 382, -745, 677, -745, -745, 1296, + 255, 1084, 1298, 1299, -745, 383, 1300, -745, -745, 1246, + 713, 313, 1257, 1268, 1088, 1090, 1092, 1094, 1095, 1096, + 1097, 1098, 1099, 1100, 1312, 1102, 1103, 1106, 1107, 1108, + 1110, 1111, 1112, 1113, 1114, 1315, 1115, 1116, 1117, 1118, + 1119, 1120, 1122, 1123, 1124, 1125, 1320, 1126, 1127, 1128, + 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1332, 1136, 1137, + 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1357, 1147, + 1148, 1149, 1150, 1151, 1152, 1154, 1155, 1156, 1157, 1364, + 1158, -745, -745, -745, -745, 1159, 786, 1211, 1160, 1161, + -745, 408, 552, 392, -745, 552, 552, -745, -745, -745, + -745, -745, -745, -745, -745, -745, -745, -745, 1165, -745, + -745, -745, -745, -745, -745, -745, -745, -745, -745, 1166, + -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, + 1167, -745, -745, -745, -745, -745, -745, -745, -745, -745, + -745, 1168, -745, -745, -745, -745, -745, -745, -745, -745, + -745, -745, 1169, -745, -745, -745, -745, -745, -745, -745, + -745, -745, -745, 1170, -745, 1373, 1171, 1329, 1385, 26, + 1173, 1386, 1387, -745, -745, -745, 449, -745, 688, 449, + -745, -745, -745, -745, -745, -745, 1174, 1234, 1175, 1176, + 786, 677, 1389, 601, 42, 1180, 1349, 1396, 1397, 1185, + -745, 608, 1398, -745, 786, 677, 1187, 1188, 786, 13, + 1400, -745, 1359, 1191, -745, 1405, -745, 1193, 1371, 1372, + -745, -745, -745, 46, 1196, -49, -745, 1198, 1375, 1376, + -745, -745, 1377, 1378, 1301, -745, 1203, -745, 1204, 1205, + 1418, 1420, 677, 1207, 1208, -745, 677, -745, -745 +}; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ -static const yytype_int16 yydefact[] = { - 233, 0, 0, 0, 0, 0, 0, 0, 233, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 233, 0, 511, 3, 5, 10, 12, 13, 11, - 6, 7, 9, 176, 175, 0, 8, 14, 15, 16, 17, 18, 19, 509, 509, 509, 509, 509, 0, 507, 507, 507, 507, 507, 226, 0, 0, 0, 0, - 0, 0, 233, 162, 20, 25, 27, 26, 21, 22, 24, 23, 28, 29, 30, 31, 0, 0, 0, 247, 248, 246, 252, 256, 0, 253, 0, 0, 249, - 0, 251, 0, 274, 276, 0, 254, 0, 280, 0, 0, 0, 0, 284, 285, 286, 289, 226, 287, 0, 232, 234, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 233, 2, 216, 218, 219, 0, 199, 181, 187, 0, 0, 0, 0, 0, 0, 0, 160, 0, 0, 0, 0, 0, 0, 0, - 0, 211, 0, 0, 0, 0, 0, 0, 161, 0, 262, 263, 257, 258, 0, 259, 0, 250, 275, 255, 0, 278, 277, 281, 282, 0, 308, 306, 307, - 0, 0, 0, 0, 332, 0, 342, 0, 343, 0, 329, 330, 0, 325, 309, 0, 338, 340, 0, 333, 0, 0, 0, 0, 180, 179, 4, 217, 0, - 177, 178, 198, 0, 0, 195, 0, 33, 0, 34, 160, 512, 0, 0, 233, 506, 167, 169, 168, 170, 0, 227, 0, 211, 164, 0, 156, 505, 0, - 0, 440, 444, 447, 448, 0, 0, 0, 0, 0, 0, 0, 0, 445, 446, 0, 0, 0, 0, 0, 0, 0, 442, 0, 233, 0, 350, 355, 356, - 370, 368, 371, 369, 372, 373, 365, 360, 359, 358, 366, 367, 357, 364, 363, 455, 457, 0, 458, 466, 0, 467, 0, 459, 456, 477, 0, 478, 0, - 454, 293, 295, 294, 291, 292, 298, 300, 299, 296, 297, 303, 305, 304, 301, 302, 283, 0, 0, 265, 264, 270, 260, 261, 279, 0, 0, 0, 515, - 0, 235, 290, 335, 0, 326, 331, 310, 339, 334, 0, 0, 341, 0, 0, 0, 203, 0, 0, 197, 508, 0, 233, 0, 0, 0, 154, 0, 0, - 158, 0, 0, 0, 163, 210, 0, 0, 0, 486, 485, 488, 487, 490, 489, 492, 491, 494, 493, 496, 495, 0, 0, 406, 233, 0, 0, 0, 0, - 449, 450, 451, 452, 0, 453, 0, 0, 0, 0, 0, 0, 0, 408, 407, 483, 480, 474, 464, 469, 472, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 463, 0, 468, 0, 471, 0, 479, 0, 482, 0, 271, 266, - 0, 0, 0, 0, 288, 0, 344, 0, 327, 0, 0, 0, 0, 337, 184, 183, 0, 205, 186, 188, 193, 194, 0, 182, 32, 36, 0, 0, 0, - 0, 42, 46, 47, 233, 0, 40, 159, 0, 0, 157, 171, 166, 165, 0, 0, 0, 401, 0, 233, 0, 0, 0, 0, 0, 431, 0, 0, 0, - 0, 0, 0, 0, 209, 0, 0, 362, 361, 0, 351, 354, 424, 425, 0, 0, 233, 0, 405, 415, 416, 419, 420, 0, 422, 414, 417, 418, 410, - 409, 411, 412, 413, 441, 443, 465, 0, 470, 0, 473, 481, 484, 0, 0, 267, 0, 0, 347, 0, 236, 328, 0, 311, 336, 0, 0, 202, 0, - 201, 0, 191, 192, 190, 196, 0, 52, 55, 56, 53, 54, 57, 58, 74, 59, 61, 60, 77, 64, 65, 66, 62, 63, 67, 68, 69, 70, 71, - 72, 73, 0, 0, 0, 0, 0, 0, 515, 0, 0, 517, 0, 39, 0, 0, 155, 0, 0, 0, 0, 0, 0, 501, 0, 0, 497, 0, 0, - 402, 0, 436, 0, 0, 429, 0, 0, 0, 0, 0, 0, 440, 0, 0, 0, 0, 391, 0, 476, 475, 0, 233, 423, 0, 0, 404, 0, 0, - 0, 272, 268, 0, 0, 44, 520, 0, 518, 312, 345, 346, 233, 204, 220, 222, 231, 223, 0, 207, 189, 38, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 147, 148, 151, 144, 151, 0, 0, 0, 35, 43, 526, 41, 352, 0, 503, 502, 500, 499, 504, 174, 0, 172, 403, 437, 0, 433, 0, - 432, 0, 0, 0, 0, 0, 0, 209, 0, 389, 0, 0, 0, 0, 438, 427, 426, 0, 0, 349, 348, 0, 0, 514, 0, 0, 0, 0, 0, - 240, 241, 242, 243, 239, 244, 0, 229, 0, 224, 200, 0, 211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 149, 146, 0, 145, 49, 48, 0, - 153, 0, 0, 0, 0, 498, 435, 430, 434, 421, 0, 0, 209, 0, 0, 0, 460, 462, 461, 0, 0, 208, 392, 0, 439, 428, 273, 269, 45, - 521, 522, 524, 523, 519, 0, 313, 231, 221, 0, 0, 228, 395, 393, 396, 394, 397, 398, 399, 206, 215, 76, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 150, 0, 0, 152, 0, 37, 515, 353, 480, 0, 0, 0, 0, 0, 390, 0, 314, 225, 237, 0, 0, 0, 0, 213, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 51, 50, 516, 525, 0, 209, 385, 0, 209, 173, 0, 0, 0, 400, 0, 0, 185, 75, 81, 82, 79, 80, 83, - 84, 85, 86, 87, 0, 78, 125, 126, 123, 124, 127, 128, 129, 130, 131, 0, 122, 92, 93, 90, 91, 94, 95, 96, 97, 98, 0, 89, 103, - 104, 101, 102, 105, 106, 107, 108, 109, 0, 100, 136, 137, 134, 135, 138, 139, 140, 141, 142, 0, 133, 114, 115, 112, 113, 116, 117, 118, 119, - 120, 0, 111, 0, 0, 0, 0, 0, 0, 0, 0, 316, 315, 321, 238, 230, 214, 212, 88, 132, 99, 110, 143, 121, 209, 386, 0, 0, 209, - 515, 322, 317, 0, 0, 0, 0, 0, 0, 384, 0, 0, 318, 209, 515, 0, 0, 209, 515, 0, 323, 319, 0, 380, 0, 387, 0, 0, 0, - 383, 324, 320, 515, 0, 374, 382, 0, 0, 0, 379, 388, 0, 0, 0, 378, 0, 376, 0, 0, 0, 0, 515, 0, 0, 381, 515, 375, 377}; +static const yytype_int16 yydefact[] = +{ + 233, 0, 0, 0, 0, 0, 0, 0, 233, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 233, 0, 519, 3, 5, 10, 12, 13, 11, + 6, 7, 9, 176, 175, 0, 8, 14, 15, 16, + 17, 18, 19, 517, 517, 517, 517, 517, 0, 0, + 515, 515, 515, 515, 515, 0, 226, 0, 0, 0, + 0, 0, 0, 233, 162, 20, 25, 27, 26, 21, + 22, 24, 23, 28, 29, 30, 31, 0, 0, 0, + 247, 248, 246, 252, 256, 0, 253, 0, 0, 249, + 0, 251, 0, 274, 276, 0, 254, 0, 284, 0, + 280, 0, 0, 0, 0, 286, 287, 288, 291, 226, + 289, 0, 232, 234, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, 233, 2, + 216, 218, 219, 0, 199, 181, 187, 0, 0, 0, + 0, 0, 0, 0, 0, 160, 0, 0, 0, 0, + 0, 0, 313, 0, 0, 211, 0, 0, 0, 0, + 0, 0, 161, 0, 262, 263, 257, 258, 0, 259, + 0, 250, 275, 255, 285, 0, 278, 277, 281, 282, + 0, 316, 308, 309, 0, 0, 0, 0, 340, 0, + 350, 0, 351, 0, 337, 338, 0, 333, 317, 0, + 346, 348, 0, 341, 0, 0, 0, 0, 0, 0, + 180, 179, 4, 217, 0, 177, 178, 198, 0, 0, + 195, 0, 33, 0, 34, 160, 520, 0, 0, 0, + 233, 514, 167, 169, 168, 170, 0, 227, 0, 211, + 164, 0, 156, 513, 0, 0, 448, 452, 455, 456, + 0, 0, 0, 0, 0, 0, 0, 0, 453, 454, + 0, 0, 0, 0, 0, 0, 0, 450, 0, 233, + 0, 358, 363, 364, 378, 376, 379, 377, 380, 381, + 373, 368, 367, 366, 374, 375, 365, 372, 371, 463, + 465, 0, 466, 474, 0, 475, 0, 467, 464, 485, + 0, 486, 0, 462, 295, 297, 296, 293, 294, 300, + 302, 301, 298, 299, 305, 307, 306, 303, 304, 283, + 0, 0, 265, 264, 270, 260, 261, 279, 0, 0, + 0, 523, 0, 235, 292, 343, 0, 334, 339, 318, + 347, 342, 0, 0, 349, 0, 314, 315, 0, 0, + 203, 0, 0, 197, 516, 0, 233, 0, 0, 0, + 0, 0, 312, 154, 0, 0, 158, 0, 0, 0, + 163, 210, 0, 0, 0, 494, 493, 496, 495, 498, + 497, 500, 499, 502, 501, 504, 503, 0, 0, 414, + 233, 0, 0, 0, 0, 457, 458, 459, 460, 0, + 461, 0, 0, 0, 0, 0, 0, 0, 416, 415, + 491, 488, 482, 472, 477, 480, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 471, 0, 476, 0, 479, 0, 487, 0, 490, + 0, 271, 266, 0, 0, 0, 0, 290, 0, 352, + 0, 335, 0, 0, 0, 0, 345, 184, 183, 0, + 205, 186, 188, 193, 194, 0, 182, 32, 36, 0, + 0, 0, 0, 42, 46, 47, 233, 0, 40, 311, + 310, 159, 0, 0, 157, 171, 166, 165, 0, 0, + 0, 409, 0, 233, 0, 0, 0, 0, 0, 439, + 0, 0, 0, 0, 0, 0, 0, 209, 0, 0, + 370, 369, 0, 359, 362, 432, 433, 0, 0, 233, + 0, 413, 423, 424, 427, 428, 0, 430, 422, 425, + 426, 418, 417, 419, 420, 421, 449, 451, 473, 0, + 478, 0, 481, 489, 492, 0, 0, 267, 0, 0, + 355, 0, 236, 336, 0, 319, 344, 0, 0, 202, + 0, 201, 0, 191, 192, 190, 196, 0, 52, 55, + 56, 53, 54, 57, 58, 74, 59, 61, 60, 77, + 64, 65, 66, 62, 63, 67, 68, 69, 70, 71, + 72, 73, 0, 0, 0, 0, 0, 0, 523, 0, + 0, 525, 0, 39, 0, 0, 155, 0, 0, 0, + 0, 0, 0, 509, 0, 0, 505, 0, 0, 410, + 0, 444, 0, 0, 437, 0, 0, 0, 0, 0, + 0, 448, 0, 0, 0, 0, 399, 0, 484, 483, + 0, 233, 431, 0, 0, 412, 0, 0, 0, 272, + 268, 0, 0, 44, 528, 0, 526, 320, 353, 354, + 233, 204, 220, 222, 231, 223, 0, 207, 189, 38, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 147, + 148, 151, 144, 151, 0, 0, 0, 35, 43, 534, + 41, 360, 0, 511, 510, 508, 507, 512, 174, 0, + 172, 411, 445, 0, 441, 0, 440, 0, 0, 0, + 0, 0, 0, 209, 0, 397, 0, 0, 0, 0, + 446, 435, 434, 0, 0, 357, 356, 0, 0, 522, + 0, 0, 0, 0, 0, 240, 241, 242, 243, 239, + 244, 0, 229, 0, 224, 200, 0, 211, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 149, 146, 0, 145, 49, + 48, 0, 153, 0, 0, 0, 0, 506, 443, 438, + 442, 429, 0, 0, 209, 0, 0, 0, 468, 470, + 469, 0, 0, 208, 400, 0, 447, 436, 273, 269, + 45, 529, 530, 532, 531, 527, 0, 321, 231, 221, + 0, 0, 228, 403, 401, 404, 402, 405, 406, 407, + 206, 215, 76, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 150, 0, 0, 152, 0, 37, 523, 361, 488, 0, + 0, 0, 0, 0, 398, 0, 322, 225, 237, 0, + 0, 0, 0, 213, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 51, 50, 524, 533, 0, 209, 393, 0, 209, + 173, 0, 0, 0, 408, 0, 0, 185, 75, 81, + 82, 79, 80, 83, 84, 85, 86, 87, 0, 78, + 125, 126, 123, 124, 127, 128, 129, 130, 131, 0, + 122, 92, 93, 90, 91, 94, 95, 96, 97, 98, + 0, 89, 103, 104, 101, 102, 105, 106, 107, 108, + 109, 0, 100, 136, 137, 134, 135, 138, 139, 140, + 141, 142, 0, 133, 114, 115, 112, 113, 116, 117, + 118, 119, 120, 0, 111, 0, 0, 0, 0, 0, + 0, 0, 0, 324, 323, 329, 238, 230, 214, 212, + 88, 132, 99, 110, 143, 121, 209, 394, 0, 0, + 209, 523, 330, 325, 0, 0, 0, 0, 0, 0, + 392, 0, 0, 326, 209, 523, 0, 0, 209, 523, + 0, 331, 327, 0, 388, 0, 395, 0, 0, 0, + 391, 332, 328, 523, 0, 382, 390, 0, 0, 0, + 387, 396, 0, 0, 0, 386, 0, 384, 0, 0, + 0, 0, 523, 0, 0, 389, 523, 383, 385 +}; /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = { - -725, -725, -725, 1282, 1345, 119, -725, -725, 814, -516, 795, -725, 738, 731, -725, -531, 165, 194, 1195, -725, 244, -725, 1059, 264, - 286, -6, 1391, -17, 1102, 1212, -99, -725, -725, 866, -725, -725, -725, -725, -725, -725, -725, -725, -695, -221, -725, -725, -725, -725, - 690, -247, 22, 569, -725, -725, 1256, -725, -725, 287, 297, 309, 324, 341, -725, -725, -206, -725, 1015, -227, -228, -724, -722, -720, - -719, -718, -717, 461, -725, -725, -725, -725, -725, -725, 1040, -725, -725, 924, 615, -249, -725, -725, -725, 726, -725, -725, -725, -725, - 728, 999, 1001, 29, -725, -725, -725, -725, 1179, -469, 734, -137, 578, 588, -725, -725, -584, -725, 607, 704, -725}; +static const yytype_int16 yypgoto[] = +{ + -745, -745, -745, 1302, 1363, 245, -745, -745, 816, -536, + 802, -745, 740, 742, -745, -551, 247, 249, 1202, -745, + 257, -745, 1060, 265, 287, -7, 1411, -17, 1101, 1222, + -80, -745, -745, 865, -745, -745, -745, -745, -745, -745, + -745, -745, -714, -234, -745, -745, -745, -745, 696, -213, + 18, 572, -745, -745, 1279, -745, -745, 290, 291, 319, + 321, 329, -745, -745, -218, -745, 1019, -239, -240, -744, + -743, -741, -740, -739, -738, 470, -745, -745, -745, -745, + -745, -745, 1049, -745, -745, 930, 619, -262, -745, -745, + -745, 721, -745, -745, -745, -745, 726, 1000, 1006, -255, + -745, -745, -745, -745, 1189, -491, 746, -146, 473, 484, + -745, -745, -605, -745, 618, 710, -745 +}; /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = {0, 21, 22, 23, 61, 24, 464, 642, 465, 466, 588, 671, 672, 809, 467, 346, 25, 26, 217, 27, - 28, 226, 227, 29, 30, 31, 32, 33, 128, 203, 129, 208, 453, 454, 555, 338, 458, 206, 657, 452, - 551, 737, 625, 229, 1037, 953, 126, 651, 652, 653, 654, 734, 34, 107, 108, 655, 731, 35, 36, 37, - 38, 39, 40, 41, 257, 474, 258, 259, 260, 261, 262, 263, 264, 265, 266, 859, 860, 267, 268, 269, - 270, 271, 376, 272, 273, 274, 275, 276, 827, 277, 278, 279, 280, 281, 282, 283, 284, 396, 397, 285, - 286, 287, 288, 289, 290, 605, 606, 231, 139, 131, 122, 136, 439, 677, 645, 646, 470}; +static const yytype_int16 yydefgoto[] = +{ + 0, 22, 23, 24, 64, 25, 482, 662, 483, 484, + 608, 691, 692, 829, 485, 364, 26, 27, 230, 28, + 29, 239, 240, 30, 31, 32, 33, 34, 135, 215, + 136, 220, 471, 472, 575, 353, 476, 218, 677, 470, + 571, 757, 645, 242, 1057, 973, 133, 671, 672, 673, + 674, 754, 35, 112, 113, 675, 751, 36, 37, 38, + 39, 40, 41, 42, 270, 494, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 879, 880, 280, 281, 282, + 283, 284, 394, 285, 286, 287, 288, 289, 847, 290, + 291, 292, 293, 294, 295, 296, 297, 414, 415, 298, + 299, 300, 301, 302, 303, 625, 626, 244, 147, 138, + 129, 143, 457, 697, 665, 666, 488 +}; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_int16 yytable[] = { - 335, 353, 68, 119, 673, 352, 395, 641, 832, 371, 607, 232, 853, 375, 854, 53, 855, 856, 857, 858, 392, 393, 17, 643, - 390, 391, 54, 204, 56, 399, 147, 148, 127, 392, 393, 234, 235, 236, 105, 341, 321, 526, 621, 291, 461, 292, 293, 123, - 507, 124, 703, -510, 402, 174, 68, 125, 613, 451, 1, 675, 2, 3, 4, 5, 6, 7, 8, 9, 10, 137, 228, 612, - 47, 696, 11, 12, 13, 146, 403, 404, 14, 15, 16, 347, 57, 58, 60, 438, 1172, 59, 1, 438, 2, 3, 4, 5, - 6, 7, 156, 9, 1026, 294, 53, 334, 599, 600, 11, 12, 13, 455, 456, 704, 14, 15, 16, 601, 602, 603, 170, 171, - 172, 173, 17, 476, 403, 404, 1173, 62, 17, 941, 110, 508, 241, 242, 243, 111, 1158, 112, 244, 113, 1168, 371, 699, 811, - 403, 404, 486, 487, 697, 123, 482, 124, 403, 404, 211, 212, 213, 125, 96, 20, 17, 704, 220, 221, 222, 245, 246, 247, - 462, 149, 463, 403, 404, 63, 1159, 528, 505, 506, 1169, 62, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 401, 296, 318, 297, 298, 342, 348, 840, 64, 301, 819, 302, 303, 295, 144, 233, 234, 235, 236, 553, 554, 374, - 403, 404, 1130, 18, 732, 604, 1144, 351, 55, 63, 650, 853, 394, 854, 556, 855, 856, 857, 858, 510, 19, 344, 202, 398, - 255, 394, 848, 255, 97, 549, -513, 527, 254, 403, 404, 18, 65, 299, 64, 423, 130, 158, 159, 484, 424, 304, 557, 616, - 617, 20, 619, 597, 425, 623, 480, 733, 66, 426, 608, 403, 404, 704, 237, 238, 632, 704, 403, 404, 403, 404, 168, 98, - 239, 169, 240, 114, 442, 511, 67, 69, 667, 20, 403, 404, 99, 443, 407, 634, 65, 70, 667, 241, 242, 243, 501, 438, - 115, 244, 446, 447, 116, 71, 407, 117, -514, -514, 410, 411, 66, 455, 400, 471, -514, 401, 472, 1106, 72, 103, 1110, 460, - 408, 409, 410, 411, 245, 246, 247, 104, 413, 427, 67, 69, 702, 73, 428, 668, 1024, 669, 670, 485, 807, 70, 422, 300, - 701, 668, 248, 669, 670, 630, 945, 305, 384, 71, 385, 475, 386, 387, 106, -514, 415, 416, 417, 418, 419, 420, 421, 315, - 72, 249, 694, 250, 695, 251, 698, 414, 415, 416, 417, 418, 419, 420, 421, 316, 317, 73, 233, 234, 235, 236, 109, 544, - 712, 123, 846, 124, 847, 252, 253, 254, 545, 125, 255, 1033, 256, 481, 120, 591, 307, 709, 592, 308, 309, 160, 161, 1135, - 310, 311, 429, 1139, 100, 101, 102, 430, 431, 233, 234, 235, 236, 432, 165, 166, 167, 1153, 735, 1111, 825, 1157, 1112, 1113, - 180, 181, 121, 1114, 1115, 182, 593, 489, 127, 490, 610, 491, 628, 629, 820, 237, 238, 130, 407, 144, 816, 833, 42, 43, - 44, 239, 150, 240, 45, 46, 374, 614, 138, 615, 609, 491, 633, 401, -514, -514, 151, 48, 49, 50, 241, 242, 243, 51, - 52, 249, 244, 250, 145, 251, 237, 238, 403, 404, 626, 17, 861, 627, 681, 152, 239, 401, 240, 724, -245, 725, 726, 727, - 728, 688, 729, 730, 689, 245, 246, 247, 419, 420, 421, 241, 242, 243, 155, 690, 157, 244, 689, 1140, -514, -514, 417, 418, - 419, 420, 421, 248, 233, 234, 235, 236, 691, 1154, 154, 401, 162, 1160, 841, 842, 843, 844, 536, 537, 245, 246, 247, 392, - 938, 164, 249, 1170, 250, 711, 251, 163, 401, 739, 740, 741, 742, 743, 1142, 1143, 744, 745, 248, 1150, 1151, 175, 1185, 746, - 747, 748, 1188, 948, 949, 176, 252, 253, 254, 715, 177, 255, 472, 256, 708, 749, 195, 249, 178, 250, 716, 251, 179, 717, - 194, 237, 238, 140, 141, 142, 143, 132, 133, 134, 135, 239, 719, 240, 812, 720, 837, 472, 196, 401, 722, 252, 253, 254, - 862, 197, 255, 863, 256, 201, 241, 242, 243, 198, 199, 1, 244, 2, 3, 4, 5, 6, 7, 8, 9, 10, 233, 234, - 235, 236, 205, 11, 12, 13, 209, 207, 210, 14, 15, 16, 214, 215, 216, 245, 246, 247, 933, 937, 1023, 472, 401, 720, - 1030, 1117, 218, 689, 472, 1, 219, 2, 3, 4, 5, 6, 7, 248, 9, 223, 233, 234, 235, 236, 224, 11, 12, 13, - 225, 228, 230, 14, 15, 16, 306, 312, 823, 17, 313, 830, 249, 314, 250, 319, 251, 322, 324, 369, 370, 323, 325, 326, - 327, 328, 329, 330, 331, 239, 332, 240, 336, 337, 340, 339, 345, 349, 350, 377, 252, 253, 254, 356, 354, 255, 355, 256, - 241, 242, 243, 17, 372, 373, 244, 378, 379, 380, 383, 388, 381, 369, 389, 422, 433, 434, 437, 441, 74, 438, 435, 239, - 484, 240, 436, 444, 448, 445, 449, 450, 459, 245, 246, 247, 457, 1116, 468, 469, 473, 1119, 241, 242, 243, 478, 479, 483, - 244, 492, 75, 76, 18, 77, 183, 248, 497, 17, 78, 79, 493, 1118, 494, 495, 184, 496, 498, 185, 186, 19, 187, 188, - 189, 499, 500, 245, 246, 247, 249, 504, 250, 509, 251, 407, 502, 255, 190, 191, 529, 192, 193, 531, 533, 534, 18, 538, - 539, 248, 20, 535, 540, 408, 409, 410, 411, 541, 252, 253, 254, 413, 543, 255, 542, 256, 546, 547, 550, 589, 548, 552, - 249, 590, 250, 594, 251, 405, 595, 406, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 20, 596, 484, 508, - 611, 598, 618, 620, 252, 253, 254, 624, 403, 255, 637, 256, 414, 415, 416, 417, 418, 419, 420, 421, 635, 638, 639, 821, - 640, 631, 461, 644, 647, 648, 649, 401, 659, 80, 81, 82, 83, 656, 84, 85, 407, 676, 86, 87, 88, 680, 683, 89, - 90, 91, 684, 660, 661, 662, 92, 93, 685, 407, 408, 409, 410, 411, 412, 679, 663, 664, 413, 665, 686, 666, 94, 674, - 682, 687, 95, 408, 409, 410, 411, 706, 636, 692, 707, 413, 629, 705, 700, 710, 628, 713, 714, 750, 751, 752, 753, 754, - 718, 721, 755, 756, 723, 736, 738, 805, 807, 757, 758, 759, 806, 813, 814, 815, 822, 414, 415, 416, 417, 418, 419, 420, - 421, 760, 818, 826, 824, 850, 851, 835, 831, 834, 414, 415, 416, 417, 418, 419, 420, 421, 558, 559, 560, 561, 562, 563, - 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 836, 575, 576, 577, 578, 579, 580, 838, 839, 581, 852, 864, 582, - 583, 865, 866, 584, 585, 586, 587, 761, 762, 763, 764, 765, 867, 868, 766, 767, 873, 869, 870, 871, 872, 768, 769, 770, - 772, 773, 774, 775, 776, 874, 884, 777, 778, 875, 876, 877, 878, 771, 779, 780, 781, 783, 784, 785, 786, 787, 879, 880, - 788, 789, 881, 895, 882, 883, 782, 790, 791, 792, 794, 795, 796, 797, 798, 885, 886, 799, 800, 887, 906, 888, 889, 793, - 801, 802, 803, 917, 928, 890, 931, 891, 892, 893, 894, 896, 897, 898, 899, 900, 804, 932, 935, 936, 901, 704, 952, 902, - 903, 904, 905, 946, 907, 908, 954, 909, 910, 911, 912, 913, 914, 915, 916, 918, 919, 920, 921, 955, 922, 956, 923, 957, - 958, 924, 925, 926, 927, 959, 929, 939, 950, 940, 942, 943, 960, 944, 951, 961, 962, 963, 964, 965, 966, 967, 968, 969, - 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, - 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, - 1018, 1019, 1020, 1021, 1022, 1025, 1028, 1029, 1027, 1038, 1031, 1048, 1032, 1039, 1035, 1040, 1041, 1059, 1042, 1043, 1044, 1045, 1046, 1047, - 1049, 1050, 1036, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, - 1073, 1074, 1075, 1081, 1076, 1077, 1078, 1079, 1080, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1092, 1091, 1093, 1094, 1095, 1096, - 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1107, 1105, 1120, 1108, 1109, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1131, 1134, - 1132, 1133, 1137, 1136, 1138, 1141, 1145, 1146, 1147, 1148, 1149, 1155, 1152, 1161, 1156, 1162, 1163, 1164, 1165, 1166, 1167, 1171, 1175, 1174, - 1176, 1177, 1178, 1179, 1180, 1181, 1183, 1182, 1184, 1186, 1187, 200, 810, 153, 678, 693, 343, 808, 477, 118, 1034, 849, 333, 488, - 503, 947, 658, 622, 934, 440, 930, 817, 845, 530, 382, 0, 828, 532, 829, 0, 320}; - -static const yytype_int16 yycheck[] = { - 206, 228, 8, 20, 588, 226, 255, 538, 703, 237, 479, 148, 736, 240, 736, 3, 736, 736, 736, 736, 5, 6, 77, 539, 252, 253, 4, - 126, 6, 256, 75, 76, 8, 5, 6, 4, 5, 6, 16, 54, 177, 3, 3, 3, 3, 5, 6, 20, 74, 22, 4, 0, 54, 61, - 60, 28, 86, 81, 7, 590, 9, 10, 11, 12, 13, 14, 15, 16, 17, 47, 65, 54, 37, 83, 23, 24, 25, 55, 154, 155, 29, - 30, 31, 38, 165, 166, 3, 77, 126, 170, 7, 77, 9, 10, 11, 12, 13, 14, 76, 16, 4, 61, 3, 202, 67, 68, 23, 24, - 25, 336, 337, 65, 29, 30, 31, 78, 79, 80, 96, 97, 98, 99, 77, 350, 154, 155, 164, 8, 77, 824, 7, 157, 101, 102, 103, - 12, 126, 14, 107, 16, 126, 369, 218, 674, 154, 155, 373, 374, 86, 20, 356, 22, 154, 155, 132, 133, 134, 28, 34, 214, 77, 65, - 140, 141, 142, 134, 135, 136, 127, 214, 129, 154, 155, 8, 164, 424, 403, 404, 164, 60, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 218, 3, 174, 5, 6, 214, 217, 717, 8, 3, 83, 5, 6, 167, 216, 3, 4, 5, 6, 69, 70, 87, - 154, 155, 6, 168, 3, 184, 6, 218, 75, 60, 214, 951, 213, 951, 457, 951, 951, 951, 951, 72, 185, 215, 214, 256, 212, 213, 215, - 212, 34, 451, 61, 209, 209, 154, 155, 168, 8, 61, 60, 213, 71, 172, 173, 72, 218, 61, 133, 490, 491, 214, 493, 473, 213, 496, - 64, 54, 8, 218, 480, 154, 155, 65, 72, 73, 508, 65, 154, 155, 154, 155, 199, 34, 82, 202, 84, 168, 40, 130, 8, 8, 72, - 214, 154, 155, 34, 49, 131, 509, 60, 8, 72, 101, 102, 103, 215, 77, 189, 107, 187, 188, 193, 8, 131, 196, 149, 150, 151, 152, - 60, 552, 215, 215, 157, 218, 218, 1026, 8, 3, 1029, 341, 149, 150, 151, 152, 134, 135, 136, 3, 157, 213, 60, 60, 218, 8, 218, - 127, 936, 129, 130, 372, 132, 60, 216, 167, 218, 127, 156, 129, 130, 502, 835, 167, 119, 60, 121, 349, 123, 124, 3, 204, 205, 206, - 207, 208, 209, 210, 211, 10, 60, 179, 613, 181, 615, 183, 618, 204, 205, 206, 207, 208, 209, 210, 211, 26, 27, 60, 3, 4, 5, - 6, 171, 33, 636, 20, 34, 22, 36, 207, 208, 209, 42, 28, 212, 950, 214, 215, 0, 215, 40, 631, 218, 43, 44, 172, 173, 1126, - 48, 49, 213, 1130, 158, 159, 160, 218, 213, 3, 4, 5, 6, 218, 198, 199, 200, 1144, 656, 40, 701, 1148, 43, 44, 185, 186, 217, - 48, 49, 190, 468, 83, 8, 85, 483, 87, 5, 6, 697, 72, 73, 71, 131, 216, 682, 704, 33, 34, 35, 82, 3, 84, 39, 40, - 87, 83, 71, 85, 215, 87, 509, 218, 151, 152, 3, 33, 34, 35, 101, 102, 103, 39, 40, 179, 107, 181, 14, 183, 72, 73, 154, - 155, 215, 77, 737, 218, 215, 3, 82, 218, 84, 55, 56, 57, 58, 59, 60, 215, 62, 63, 218, 134, 135, 136, 209, 210, 211, 101, - 102, 103, 3, 215, 6, 107, 218, 1131, 205, 206, 207, 208, 209, 210, 211, 156, 3, 4, 5, 6, 215, 1145, 214, 218, 3, 1149, 3, - 4, 5, 6, 45, 46, 134, 135, 136, 5, 6, 6, 179, 1163, 181, 215, 183, 175, 218, 90, 91, 92, 93, 94, 45, 46, 97, 98, - 156, 43, 44, 54, 1182, 104, 105, 106, 1186, 850, 851, 218, 207, 208, 209, 215, 6, 212, 218, 214, 631, 120, 4, 179, 194, 181, 215, - 183, 194, 218, 194, 72, 73, 49, 50, 51, 52, 43, 44, 45, 46, 82, 215, 84, 215, 218, 215, 218, 192, 218, 650, 207, 208, 209, - 215, 75, 212, 218, 214, 21, 101, 102, 103, 215, 215, 7, 107, 9, 10, 11, 12, 13, 14, 15, 16, 17, 3, 4, 5, 6, 64, - 23, 24, 25, 72, 66, 3, 29, 30, 31, 3, 61, 214, 134, 135, 136, 215, 215, 215, 218, 218, 218, 215, 215, 73, 218, 218, 7, - 3, 9, 10, 11, 12, 13, 14, 156, 16, 3, 3, 4, 5, 6, 3, 23, 24, 25, 3, 65, 4, 29, 30, 31, 215, 3, 699, - 77, 3, 702, 179, 4, 181, 214, 183, 4, 6, 72, 73, 164, 3, 6, 4, 4, 4, 54, 4, 82, 194, 84, 52, 67, 133, 73, - 3, 61, 204, 4, 207, 208, 209, 214, 77, 212, 77, 214, 101, 102, 103, 77, 214, 214, 107, 4, 4, 4, 214, 214, 6, 72, 214, - 216, 3, 6, 76, 4, 3, 77, 47, 82, 72, 84, 47, 6, 4, 76, 215, 215, 4, 134, 135, 136, 68, 1032, 54, 214, 214, 1036, - 101, 102, 103, 214, 214, 214, 107, 4, 33, 34, 168, 36, 159, 156, 4, 77, 41, 42, 214, 1035, 214, 214, 169, 214, 4, 172, 173, - 185, 175, 176, 177, 219, 215, 134, 135, 136, 179, 3, 181, 214, 183, 131, 76, 212, 191, 192, 6, 194, 195, 6, 6, 5, 168, 214, - 214, 156, 214, 43, 3, 149, 150, 151, 152, 214, 207, 208, 209, 157, 6, 212, 215, 214, 4, 164, 75, 128, 164, 218, 179, 214, 181, - 3, 183, 72, 133, 74, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 214, 3, 72, 157, 215, 218, 75, 4, 207, 208, - 209, 218, 154, 212, 219, 214, 204, 205, 206, 207, 208, 209, 210, 211, 130, 219, 6, 215, 6, 214, 3, 3, 6, 4, 4, 218, 4, - 160, 161, 162, 163, 88, 165, 166, 131, 32, 169, 170, 171, 4, 6, 174, 175, 176, 6, 214, 214, 214, 181, 182, 4, 131, 149, 150, - 151, 152, 153, 215, 214, 214, 157, 214, 3, 214, 197, 214, 214, 6, 201, 149, 150, 151, 152, 4, 154, 215, 77, 157, 6, 215, 218, - 215, 5, 50, 47, 90, 91, 92, 93, 94, 204, 6, 97, 98, 218, 178, 6, 130, 132, 104, 105, 106, 128, 214, 133, 164, 212, 204, - 205, 206, 207, 208, 209, 210, 211, 120, 215, 212, 4, 56, 56, 214, 218, 215, 204, 205, 206, 207, 208, 209, 210, 211, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 215, 107, 108, 109, 110, 111, 112, 6, 6, 115, 3, 218, 118, - 119, 218, 218, 122, 123, 124, 125, 90, 91, 92, 93, 94, 218, 218, 97, 98, 92, 218, 218, 218, 218, 104, 105, 106, 90, 91, 92, - 93, 94, 218, 92, 97, 98, 218, 218, 218, 218, 120, 104, 105, 106, 90, 91, 92, 93, 94, 218, 218, 97, 98, 218, 92, 218, 218, - 120, 104, 105, 106, 90, 91, 92, 93, 94, 218, 218, 97, 98, 218, 92, 218, 218, 120, 104, 105, 106, 92, 92, 218, 133, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 120, 133, 4, 3, 218, 65, 51, 218, 218, 218, 218, 6, 218, 218, 6, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 6, 218, 6, 218, 6, 6, 218, 218, 218, 218, 6, 218, 218, 214, 218, 218, 218, 6, 215, 218, - 6, 6, 6, 218, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 218, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 218, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 218, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 218, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 218, 6, 4, 4, 4, 4, 4, 215, 215, 6, 6, 61, 215, 52, 215, 215, 6, 215, 215, 215, 215, 215, 215, - 215, 215, 53, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 6, 215, 215, 215, 215, 215, - 6, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 6, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, - 6, 215, 164, 218, 215, 218, 218, 215, 215, 215, 215, 215, 4, 215, 49, 4, 215, 218, 6, 6, 214, 164, 218, 6, 215, 49, 4, - 4, 215, 214, 6, 6, 215, 48, 215, 4, 215, 40, 40, 215, 40, 214, 40, 40, 40, 3, 214, 214, 3, 215, 3, 215, 215, 121, - 673, 60, 592, 612, 213, 671, 351, 20, 951, 723, 202, 375, 401, 848, 552, 495, 813, 319, 807, 689, 720, 426, 247, -1, 702, 428, 702, - -1, 176}; +static const yytype_int16 yytable[] = +{ + 350, 71, 371, 693, 126, 370, 413, 661, 627, 852, + 389, 245, 873, 874, 393, 875, 876, 877, 878, 410, + 411, 241, 57, 663, 59, 408, 409, 56, 410, 411, + 417, 527, 1150, 134, 110, 546, 641, 49, 247, 248, + 249, 334, 356, 304, 184, 305, 306, 17, 1164, 130, + 365, 131, -521, 216, 420, 56, 71, 132, 309, 695, + 310, 311, 137, 178, 156, 157, 179, 145, 469, 314, + -518, 315, 316, 716, 421, 422, 155, 1, 1192, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 530, 460, + 17, 456, 724, 11, 12, 13, 58, 165, 461, 14, + 15, 16, 307, 101, 43, 44, 45, 130, 724, 131, + 46, 47, 473, 474, 528, 132, 1193, 312, 632, 180, + 181, 182, 183, 102, 456, 50, 51, 52, 317, 496, + 961, 53, 54, 479, 349, 103, 254, 255, 256, 719, + 1178, 633, 257, 831, 421, 422, 531, 389, 17, 104, + 619, 620, 506, 507, 421, 422, 502, 223, 224, 225, + 127, 621, 622, 623, 573, 574, 233, 234, 235, 258, + 259, 260, 115, 1188, 752, 369, 108, 116, 1179, 117, + 548, 118, 525, 526, 109, 21, 532, 533, 534, 535, + 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 153, 860, 331, 357, 158, 111, 419, 839, 308, 421, + 422, 1189, 717, 366, 246, 247, 248, 249, 421, 422, + 114, 577, 392, 313, 360, 361, 753, 873, 874, 412, + 875, 876, 877, 878, 318, 723, 576, 268, 412, 18, + 670, 214, 362, 547, 267, 359, 868, 128, 268, 421, + 422, 569, 416, 65, 134, 66, 19, 67, 480, 1046, + 481, 421, 422, 421, 422, 68, 48, 624, 20, 123, + 124, 636, 637, 69, 639, 617, 500, 643, 421, 422, + 421, 422, 628, 687, 250, 251, 21, 55, 652, 421, + 422, 440, 564, 721, 252, 70, 253, 724, 72, 73, + 1, 565, 2, 3, 4, 5, 6, 7, 65, 9, + 66, 654, 67, 254, 255, 256, 11, 12, 13, 257, + 68, 724, 14, 15, 16, 521, 722, 74, 69, 75, + 137, 441, 1126, 473, 119, 1130, 442, 76, 688, 418, + 689, 690, 419, 827, 328, 146, 258, 259, 260, 478, + 70, 1044, 687, 72, 73, 120, 144, 456, 443, 121, + 329, 330, 122, 444, 965, 445, 425, 130, 261, 131, + 446, 17, 447, 505, 152, 132, 650, 448, 60, 61, + 167, 168, 74, 62, 75, 495, -522, -522, 105, 106, + 107, 262, 76, 263, 714, 264, 715, 153, 718, 449, + 246, 247, 248, 249, 450, 491, 159, 688, 492, 689, + 690, 611, 190, 191, 612, 629, 732, 192, 419, 1053, + 265, 266, 267, 169, 170, 268, 320, 269, 501, 321, + 322, 154, 1155, 729, 323, 324, 1159, 246, 247, 248, + 249, -522, -522, 435, 436, 437, 438, 439, 1131, 160, + 1173, 1132, 1133, 161, 1177, 163, 1134, 1135, 755, 845, + 164, 402, 18, 403, 843, 404, 405, 850, 464, 465, + 250, 251, 509, 166, 510, 17, 511, 171, 840, 613, + 252, 866, 253, 867, 836, 853, 630, 172, 634, 173, + 635, 20, 511, 262, 174, 263, 185, 264, 186, 254, + 255, 256, 187, 646, 188, 257, 647, 250, 251, 21, + 556, 557, 653, 861, 862, 863, 864, 252, 701, 253, + 189, 419, 392, 881, 148, 149, 150, 151, 139, 140, + 141, 142, 258, 259, 260, 204, 254, 255, 256, 205, + 708, 710, 257, 709, 709, 711, 1160, 731, 419, 735, + 419, 206, 492, 207, 261, 246, 247, 248, 249, 736, + 1174, 208, 737, 739, 1180, 832, 740, 209, 492, 258, + 259, 260, 857, 882, 210, 419, 883, 262, 1190, 263, + 211, 264, 744, -245, 745, 746, 747, 748, 213, 749, + 750, 261, 953, 957, 217, 492, 419, 1205, 219, 1043, + 1050, 1208, 740, 709, 421, 422, 265, 266, 267, 1137, + 221, 268, 492, 269, 262, 222, 263, 226, 264, 227, + 246, 247, 248, 249, 228, 250, 251, 175, 176, 177, + 437, 438, 439, 231, 728, 252, 229, 253, 648, 649, + 410, 958, 232, 265, 266, 267, 1162, 1163, 268, 236, + 269, 1170, 1171, 237, 254, 255, 256, 968, 969, 238, + 257, 241, 243, 742, 325, 319, 759, 760, 761, 762, + 763, 326, 332, 764, 765, 327, 246, 247, 248, 249, + 766, 767, 768, 335, 336, 338, 337, 258, 259, 260, + 387, 388, 339, 340, 193, 341, 769, 342, 343, 344, + 252, 345, 253, 346, 194, 347, 351, 195, 196, 261, + 197, 198, 199, 352, 354, 355, 363, 367, 368, 254, + 255, 256, 372, 374, 390, 257, 200, 201, 395, 202, + 203, 391, 262, 399, 263, 373, 264, 396, 397, 398, + 401, 406, 451, 407, 452, 453, 387, 455, 440, 459, + 454, 463, 258, 259, 260, 456, 252, 77, 253, 462, + 466, 265, 266, 267, 467, 468, 268, 477, 269, 486, + 475, 487, 489, 490, 261, 254, 255, 256, 512, 493, + 498, 257, 499, 17, 503, 513, 514, 78, 79, 515, + 80, 517, 516, 518, 522, 81, 82, 262, 519, 263, + 520, 264, 524, 529, 268, 555, 549, 551, 258, 259, + 260, 553, 554, 1136, 558, 559, 560, 1139, 561, 567, + 562, 563, 566, 570, 568, 572, 265, 266, 267, 610, + 261, 268, 614, 269, 616, 609, 618, 1138, 63, 528, + 631, 615, 1, 638, 2, 3, 4, 5, 6, 7, + 640, 9, 644, 262, 421, 263, 655, 264, 11, 12, + 13, 659, 657, 504, 14, 15, 16, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 651, + 660, 658, 265, 266, 267, 504, 479, 268, 1, 269, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 664, + 667, 423, 668, 424, 11, 12, 13, 669, 419, 676, + 14, 15, 16, 17, 696, 83, 84, 85, 86, 679, + 87, 88, 425, 700, 89, 90, 91, 680, 681, 92, + 93, 94, 682, 703, 683, 684, 95, 96, 685, 686, + 426, 427, 428, 429, 425, 699, 694, 702, 431, 97, + 98, 704, 705, 99, 706, 707, 720, 100, 712, 17, + 425, 725, 426, 427, 428, 429, 726, 656, 504, 727, + 431, 649, 730, 648, 733, 734, 741, 738, 426, 427, + 428, 429, 430, 756, 743, 758, 431, 825, 826, 833, + 827, 835, 834, 838, 842, 844, 432, 433, 434, 435, + 436, 437, 438, 439, 18, 846, 851, 841, 858, 854, + 855, 859, 856, 870, 871, 872, 884, 885, 432, 433, + 434, 435, 436, 437, 438, 439, 886, 425, 887, 888, + 889, 890, 893, 20, 432, 433, 434, 435, 436, 437, + 438, 439, 425, 891, 892, 426, 427, 428, 429, 955, + 18, 21, 894, 431, 895, 956, 896, 897, 898, 899, + -522, -522, 428, 429, 900, 901, 904, 19, -522, 770, + 771, 772, 773, 774, 902, 915, 775, 776, 926, 20, + 903, 905, 906, 777, 778, 779, 907, 908, 909, 910, + 911, 912, 913, 914, 937, 916, 917, 21, 918, 780, + 919, 432, 433, 434, 435, 436, 437, 438, 439, 920, + 921, 948, 922, 923, 724, 966, -522, 433, 434, 435, + 436, 437, 438, 439, 578, 579, 580, 581, 582, 583, + 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, + 594, 924, 595, 596, 597, 598, 599, 600, 951, 925, + 601, 927, 928, 602, 603, 929, 930, 604, 605, 606, + 607, 781, 782, 783, 784, 785, 931, 932, 786, 787, + 933, 952, 934, 935, 936, 788, 789, 790, 792, 793, + 794, 795, 796, 938, 939, 797, 798, 940, 964, 941, + 970, 791, 799, 800, 801, 803, 804, 805, 806, 807, + 942, 943, 808, 809, 944, 972, 945, 946, 802, 810, + 811, 812, 814, 815, 816, 817, 818, 947, 949, 819, + 820, 974, 975, 959, 960, 813, 821, 822, 823, 962, + 963, 971, 976, 977, 978, 979, 980, 981, 982, 983, + 984, 985, 824, 986, 987, 988, 989, 990, 991, 992, + 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, + 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, + 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, + 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, + 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, + 1045, 1047, 1048, 1049, 1199, 1058, 1051, 1059, 1052, 1060, + 1055, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1079, 1056, 1071, 1072, 1073, 1090, 1074, 1075, 1076, + 1077, 1078, 1080, 1081, 1082, 1083, 1084, 1085, 1101, 1086, + 1087, 1088, 1089, 1091, 1092, 1093, 1094, 1095, 1096, 1097, + 1098, 1099, 1100, 1102, 1103, 1104, 1105, 1106, 1107, 1108, + 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, + 1123, 1119, 1120, 1121, 1122, 1124, 1127, 1146, 1148, 1125, + 1128, 1129, 1140, 1141, 1142, 1143, 1144, 1145, 1147, 1149, + 1151, 1157, 1152, 1153, 1154, 1161, 1158, 1165, 1166, 1156, + 1167, 1168, 1169, 1175, 1172, 1176, 1181, 1182, 1183, 1184, + 1185, 1186, 1187, 1191, 1194, 1195, 1196, 1197, 1198, 1200, + 1201, 1203, 1202, 1204, 1206, 1207, 162, 358, 698, 497, + 212, 828, 125, 458, 713, 830, 348, 678, 523, 869, + 967, 1054, 508, 848, 550, 642, 950, 0, 849, 400, + 865, 954, 552, 0, 0, 837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 333 +}; + +static const yytype_int16 yycheck[] = +{ + 218, 8, 241, 608, 21, 239, 268, 558, 499, 723, + 250, 157, 756, 756, 253, 756, 756, 756, 756, 5, + 6, 66, 4, 559, 6, 265, 266, 3, 5, 6, + 269, 75, 6, 8, 16, 3, 3, 37, 4, 5, + 6, 187, 55, 3, 62, 5, 6, 78, 6, 20, + 38, 22, 62, 133, 55, 3, 63, 28, 3, 610, + 5, 6, 72, 201, 76, 77, 204, 49, 82, 3, + 0, 5, 6, 84, 155, 156, 58, 7, 127, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 73, 40, + 78, 78, 66, 23, 24, 25, 76, 79, 49, 29, + 30, 31, 62, 34, 33, 34, 35, 20, 66, 22, + 39, 40, 351, 352, 158, 28, 165, 62, 55, 101, + 102, 103, 104, 34, 78, 33, 34, 35, 62, 368, + 844, 39, 40, 3, 214, 34, 102, 103, 104, 220, + 127, 87, 108, 694, 155, 156, 131, 387, 78, 34, + 68, 69, 391, 392, 155, 156, 374, 139, 140, 141, + 0, 79, 80, 81, 70, 71, 148, 149, 150, 135, + 136, 137, 7, 127, 3, 220, 3, 12, 165, 14, + 442, 16, 421, 422, 3, 216, 426, 427, 428, 429, + 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, + 218, 737, 184, 216, 216, 3, 220, 84, 168, 155, + 156, 165, 87, 230, 3, 4, 5, 6, 155, 156, + 172, 134, 88, 168, 33, 34, 55, 971, 971, 215, + 971, 971, 971, 971, 168, 4, 475, 214, 215, 169, + 216, 216, 51, 211, 211, 227, 217, 219, 214, 155, + 156, 469, 269, 8, 8, 8, 186, 8, 128, 4, + 130, 155, 156, 155, 156, 8, 195, 185, 198, 33, + 34, 510, 511, 8, 513, 493, 65, 516, 155, 156, + 155, 156, 500, 73, 73, 74, 216, 195, 528, 155, + 156, 218, 33, 220, 83, 8, 85, 66, 8, 8, + 7, 42, 9, 10, 11, 12, 13, 14, 63, 16, + 63, 529, 63, 102, 103, 104, 23, 24, 25, 108, + 63, 66, 29, 30, 31, 217, 220, 8, 63, 8, + 72, 215, 1046, 572, 169, 1049, 220, 8, 128, 217, + 130, 131, 220, 133, 10, 72, 135, 136, 137, 356, + 63, 956, 73, 63, 63, 190, 3, 78, 215, 194, + 26, 27, 197, 220, 855, 215, 132, 20, 157, 22, + 220, 78, 215, 390, 3, 28, 522, 220, 166, 167, + 173, 174, 63, 171, 63, 367, 152, 153, 159, 160, + 161, 180, 63, 182, 633, 184, 635, 218, 638, 215, + 3, 4, 5, 6, 220, 217, 3, 128, 220, 130, + 131, 217, 186, 187, 220, 217, 656, 191, 220, 970, + 209, 210, 211, 173, 174, 214, 40, 216, 217, 43, + 44, 14, 1146, 651, 48, 49, 1150, 3, 4, 5, + 6, 207, 208, 209, 210, 211, 212, 213, 40, 3, + 1164, 43, 44, 3, 1168, 216, 48, 49, 676, 721, + 3, 120, 169, 122, 719, 124, 125, 722, 188, 189, + 73, 74, 84, 6, 86, 78, 88, 3, 717, 486, + 83, 34, 85, 36, 702, 724, 503, 176, 84, 6, + 86, 198, 88, 180, 3, 182, 55, 184, 220, 102, + 103, 104, 6, 217, 195, 108, 220, 73, 74, 216, + 45, 46, 529, 3, 4, 5, 6, 83, 217, 85, + 195, 220, 88, 757, 51, 52, 53, 54, 44, 45, + 46, 47, 135, 136, 137, 195, 102, 103, 104, 4, + 217, 217, 108, 220, 220, 217, 1151, 217, 220, 217, + 220, 193, 220, 76, 157, 3, 4, 5, 6, 217, + 1165, 195, 220, 217, 1169, 217, 220, 195, 220, 135, + 136, 137, 217, 217, 217, 220, 220, 180, 1183, 182, + 217, 184, 56, 57, 58, 59, 60, 61, 21, 63, + 64, 157, 217, 217, 65, 220, 220, 1202, 67, 217, + 217, 1206, 220, 220, 155, 156, 209, 210, 211, 217, + 73, 214, 220, 216, 180, 3, 182, 3, 184, 62, + 3, 4, 5, 6, 62, 73, 74, 200, 201, 202, + 211, 212, 213, 74, 651, 83, 216, 85, 5, 6, + 5, 6, 3, 209, 210, 211, 45, 46, 214, 3, + 216, 43, 44, 3, 102, 103, 104, 870, 871, 3, + 108, 66, 4, 670, 3, 217, 91, 92, 93, 94, + 95, 3, 216, 98, 99, 4, 3, 4, 5, 6, + 105, 106, 107, 4, 165, 3, 6, 135, 136, 137, + 73, 74, 6, 4, 160, 3, 121, 4, 55, 4, + 83, 195, 85, 3, 170, 3, 53, 173, 174, 157, + 176, 177, 178, 68, 74, 134, 3, 62, 206, 102, + 103, 104, 78, 216, 216, 108, 192, 193, 4, 195, + 196, 216, 180, 6, 182, 78, 184, 4, 4, 4, + 216, 216, 3, 216, 6, 47, 73, 77, 218, 4, + 47, 77, 135, 136, 137, 78, 83, 3, 85, 6, + 4, 209, 210, 211, 217, 217, 214, 4, 216, 55, + 69, 216, 3, 3, 157, 102, 103, 104, 4, 216, + 216, 108, 216, 78, 216, 216, 216, 33, 34, 216, + 36, 4, 216, 4, 77, 41, 42, 180, 221, 182, + 217, 184, 3, 216, 214, 43, 6, 6, 135, 136, + 137, 6, 5, 1052, 216, 216, 3, 1056, 216, 165, + 217, 6, 4, 76, 165, 220, 209, 210, 211, 216, + 157, 214, 3, 216, 3, 129, 220, 1055, 3, 158, + 217, 134, 7, 76, 9, 10, 11, 12, 13, 14, + 4, 16, 220, 180, 155, 182, 131, 184, 23, 24, + 25, 6, 221, 73, 29, 30, 31, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 216, + 6, 221, 209, 210, 211, 73, 3, 214, 7, 216, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 3, + 6, 73, 4, 75, 23, 24, 25, 4, 220, 89, + 29, 30, 31, 78, 32, 161, 162, 163, 164, 4, + 166, 167, 132, 4, 170, 171, 172, 216, 216, 175, + 176, 177, 216, 6, 216, 216, 182, 183, 216, 216, + 150, 151, 152, 153, 132, 217, 216, 216, 158, 195, + 196, 6, 4, 199, 3, 6, 220, 203, 217, 78, + 132, 217, 150, 151, 152, 153, 4, 155, 73, 78, + 158, 6, 217, 5, 50, 47, 6, 206, 150, 151, + 152, 153, 154, 179, 220, 6, 158, 131, 129, 216, + 133, 165, 134, 217, 214, 4, 206, 207, 208, 209, + 210, 211, 212, 213, 169, 214, 220, 217, 6, 217, + 216, 6, 217, 57, 57, 3, 220, 220, 206, 207, + 208, 209, 210, 211, 212, 213, 220, 132, 220, 220, + 220, 220, 93, 198, 206, 207, 208, 209, 210, 211, + 212, 213, 132, 220, 220, 150, 151, 152, 153, 4, + 169, 216, 220, 158, 220, 3, 220, 220, 220, 220, + 150, 151, 152, 153, 220, 220, 93, 186, 158, 91, + 92, 93, 94, 95, 220, 93, 98, 99, 93, 198, + 220, 220, 220, 105, 106, 107, 220, 220, 220, 220, + 220, 220, 220, 220, 93, 220, 220, 216, 220, 121, + 220, 206, 207, 208, 209, 210, 211, 212, 213, 220, + 220, 93, 220, 220, 66, 6, 206, 207, 208, 209, + 210, 211, 212, 213, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 220, 108, 109, 110, 111, 112, 113, 134, 220, + 116, 220, 220, 119, 120, 220, 220, 123, 124, 125, + 126, 91, 92, 93, 94, 95, 220, 220, 98, 99, + 220, 134, 220, 220, 220, 105, 106, 107, 91, 92, + 93, 94, 95, 220, 220, 98, 99, 220, 217, 220, + 216, 121, 105, 106, 107, 91, 92, 93, 94, 95, + 220, 220, 98, 99, 220, 52, 220, 220, 121, 105, + 106, 107, 91, 92, 93, 94, 95, 220, 220, 98, + 99, 6, 6, 220, 220, 121, 105, 106, 107, 220, + 220, 220, 6, 6, 6, 6, 6, 6, 6, 6, + 220, 6, 121, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 220, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 220, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 220, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 220, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 220, 6, 4, 4, + 4, 217, 4, 4, 3, 217, 6, 217, 62, 217, + 53, 217, 217, 217, 217, 217, 217, 217, 6, 217, + 217, 6, 54, 217, 217, 217, 6, 217, 217, 217, + 217, 217, 217, 217, 217, 217, 217, 217, 6, 217, + 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, + 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, + 217, 217, 217, 6, 217, 217, 217, 217, 217, 217, + 6, 217, 217, 217, 217, 217, 165, 4, 49, 220, + 220, 220, 217, 217, 217, 217, 217, 217, 217, 4, + 217, 216, 6, 6, 220, 6, 220, 217, 49, 165, + 4, 4, 217, 216, 6, 217, 6, 48, 217, 4, + 217, 40, 40, 217, 216, 40, 40, 40, 40, 216, + 216, 3, 217, 3, 217, 217, 63, 225, 612, 369, + 128, 691, 21, 332, 632, 693, 214, 572, 419, 743, + 868, 971, 393, 722, 444, 515, 827, -1, 722, 260, + 740, 833, 446, -1, -1, 709, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 186 +}; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of state STATE-NUM. */ -static const yytype_int16 yystos[] = { - 0, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 23, 24, 25, 29, 30, 31, 77, 168, 185, 214, 221, 222, 223, 225, 236, 237, 239, 240, - 243, 244, 245, 246, 247, 272, 277, 278, 279, 280, 281, 282, 283, 33, 34, 35, 39, 40, 37, 33, 34, 35, 39, 40, 3, 270, 75, 270, 165, - 166, 170, 3, 224, 225, 236, 237, 240, 243, 244, 245, 277, 278, 279, 280, 281, 3, 33, 34, 36, 41, 42, 160, 161, 162, 163, 165, 166, 169, - 170, 171, 174, 175, 176, 181, 182, 197, 201, 34, 34, 34, 34, 158, 159, 160, 3, 3, 270, 3, 273, 274, 171, 7, 12, 14, 16, 168, 189, - 193, 196, 246, 247, 0, 217, 330, 20, 22, 28, 266, 8, 248, 250, 71, 329, 329, 329, 329, 329, 331, 270, 71, 328, 328, 328, 328, 328, 216, - 14, 270, 75, 76, 214, 3, 3, 3, 224, 214, 3, 270, 6, 172, 173, 172, 173, 3, 175, 6, 198, 199, 200, 199, 202, 270, 270, 270, 270, - 61, 54, 218, 6, 194, 194, 185, 186, 190, 159, 169, 172, 173, 175, 176, 177, 191, 192, 194, 195, 194, 4, 192, 75, 215, 215, 223, 21, 214, - 249, 250, 64, 257, 66, 251, 72, 3, 270, 270, 270, 3, 61, 214, 238, 73, 3, 270, 270, 270, 3, 3, 3, 241, 242, 65, 263, 4, 327, - 327, 3, 4, 5, 6, 72, 73, 82, 84, 101, 102, 103, 107, 134, 135, 136, 156, 179, 181, 183, 207, 208, 209, 212, 214, 284, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 297, 298, 299, 300, 301, 303, 304, 305, 306, 307, 309, 310, 311, 312, 313, 314, 315, 316, 319, 320, 321, 322, 323, - 324, 3, 5, 6, 61, 167, 3, 5, 6, 61, 167, 3, 5, 6, 61, 167, 215, 40, 43, 44, 48, 49, 3, 3, 4, 10, 26, 27, 270, - 214, 274, 327, 4, 164, 6, 3, 6, 4, 4, 4, 54, 4, 194, 249, 250, 284, 52, 67, 255, 73, 133, 54, 214, 238, 270, 3, 235, 38, - 247, 61, 204, 218, 263, 287, 77, 77, 214, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 72, 73, 288, 214, 214, 87, 287, 302, - 4, 4, 4, 4, 6, 324, 214, 119, 121, 123, 124, 214, 214, 288, 288, 5, 6, 213, 307, 317, 318, 247, 287, 215, 218, 54, 154, 155, 72, - 74, 131, 149, 150, 151, 152, 153, 157, 204, 205, 206, 207, 208, 209, 210, 211, 216, 213, 218, 213, 218, 213, 218, 213, 218, 213, 218, 3, 6, - 47, 47, 76, 77, 332, 248, 4, 40, 49, 6, 76, 187, 188, 4, 215, 215, 81, 259, 252, 253, 287, 287, 68, 256, 4, 245, 3, 127, 129, - 226, 228, 229, 234, 54, 214, 336, 215, 218, 214, 285, 270, 287, 242, 214, 214, 64, 215, 284, 214, 72, 247, 287, 287, 302, 83, 85, 87, 4, - 214, 214, 214, 214, 4, 4, 219, 215, 215, 76, 286, 3, 287, 287, 74, 157, 214, 72, 130, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, - 288, 288, 288, 288, 3, 209, 307, 6, 317, 6, 318, 6, 5, 43, 45, 46, 214, 214, 3, 214, 215, 6, 33, 42, 4, 164, 164, 284, 75, - 260, 218, 69, 70, 254, 287, 133, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 107, 108, 109, 110, 111, - 112, 115, 118, 119, 122, 123, 124, 125, 230, 128, 214, 215, 218, 245, 3, 133, 3, 284, 218, 67, 68, 78, 79, 80, 184, 325, 326, 325, 284, - 215, 247, 215, 54, 86, 83, 85, 287, 287, 75, 287, 4, 3, 305, 287, 218, 262, 215, 218, 5, 6, 327, 214, 288, 247, 284, 130, 154, 219, - 219, 6, 6, 235, 227, 229, 3, 334, 335, 6, 4, 4, 214, 267, 268, 269, 270, 275, 88, 258, 253, 4, 214, 214, 214, 214, 214, 214, 214, - 72, 127, 129, 130, 231, 232, 332, 214, 235, 32, 333, 228, 215, 4, 215, 214, 6, 6, 4, 3, 6, 215, 218, 215, 215, 215, 230, 287, 287, - 83, 86, 288, 218, 218, 218, 218, 4, 65, 215, 4, 77, 247, 284, 215, 215, 288, 50, 47, 215, 215, 218, 204, 215, 218, 6, 245, 218, 55, - 57, 58, 59, 60, 62, 63, 276, 3, 54, 271, 284, 178, 261, 6, 90, 91, 92, 93, 94, 97, 98, 104, 105, 106, 120, 90, 91, 92, 93, - 94, 97, 98, 104, 105, 106, 120, 90, 91, 92, 93, 94, 97, 98, 104, 105, 106, 120, 90, 91, 92, 93, 94, 97, 98, 104, 105, 106, 120, - 90, 91, 92, 93, 94, 97, 98, 104, 105, 106, 120, 90, 91, 92, 93, 94, 97, 98, 104, 105, 106, 120, 130, 128, 132, 232, 233, 233, 235, - 215, 214, 133, 164, 284, 326, 215, 83, 287, 215, 212, 319, 4, 307, 212, 308, 311, 316, 319, 218, 262, 287, 215, 214, 215, 215, 6, 6, 229, - 3, 4, 5, 6, 335, 34, 36, 215, 268, 56, 56, 3, 289, 290, 291, 292, 293, 294, 295, 296, 263, 215, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 92, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 92, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 92, 218, 218, 218, - 218, 218, 218, 218, 218, 218, 218, 92, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 92, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, - 92, 218, 306, 133, 133, 215, 334, 4, 3, 215, 6, 218, 218, 262, 218, 218, 215, 325, 6, 271, 269, 269, 214, 218, 51, 265, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 218, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 218, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 218, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 218, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 218, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 218, 6, 4, 4, 215, 332, 4, 4, 215, 4, 4, 215, 6, 61, 235, 295, 52, 53, 264, 215, 215, 215, 215, 215, 215, - 215, 215, 215, 215, 6, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 6, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 6, 215, 215, - 215, 215, 215, 215, 215, 215, 215, 215, 6, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 6, 215, 215, 215, 215, 215, 215, 215, 215, 215, - 215, 6, 215, 218, 262, 164, 218, 218, 262, 40, 43, 44, 48, 49, 287, 215, 284, 287, 215, 215, 215, 215, 215, 215, 4, 215, 49, 4, 6, - 215, 6, 6, 218, 262, 164, 214, 218, 262, 332, 6, 45, 46, 6, 215, 49, 4, 4, 215, 43, 44, 6, 262, 332, 214, 215, 262, 126, 164, - 332, 6, 48, 215, 4, 215, 40, 40, 126, 164, 332, 215, 126, 164, 214, 40, 40, 40, 40, 3, 214, 214, 215, 3, 3, 332, 215, 215, 332}; +static const yytype_int16 yystos[] = +{ + 0, 7, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 23, 24, 25, 29, 30, 31, 78, 169, 186, + 198, 216, 223, 224, 225, 227, 238, 239, 241, 242, + 245, 246, 247, 248, 249, 274, 279, 280, 281, 282, + 283, 284, 285, 33, 34, 35, 39, 40, 195, 37, + 33, 34, 35, 39, 40, 195, 3, 272, 76, 272, + 166, 167, 171, 3, 226, 227, 238, 239, 242, 245, + 246, 247, 279, 280, 281, 282, 283, 3, 33, 34, + 36, 41, 42, 161, 162, 163, 164, 166, 167, 170, + 171, 172, 175, 176, 177, 182, 183, 195, 196, 199, + 203, 34, 34, 34, 34, 159, 160, 161, 3, 3, + 272, 3, 275, 276, 172, 7, 12, 14, 16, 169, + 190, 194, 197, 33, 34, 248, 249, 0, 219, 332, + 20, 22, 28, 268, 8, 250, 252, 72, 331, 331, + 331, 331, 331, 333, 3, 272, 72, 330, 330, 330, + 330, 330, 3, 218, 14, 272, 76, 77, 216, 3, + 3, 3, 226, 216, 3, 272, 6, 173, 174, 173, + 174, 3, 176, 6, 3, 200, 201, 202, 201, 204, + 272, 272, 272, 272, 62, 55, 220, 6, 195, 195, + 186, 187, 191, 160, 170, 173, 174, 176, 177, 178, + 192, 193, 195, 196, 195, 4, 193, 76, 195, 195, + 217, 217, 225, 21, 216, 251, 252, 65, 259, 67, + 253, 73, 3, 272, 272, 272, 3, 62, 62, 216, + 240, 74, 3, 272, 272, 272, 3, 3, 3, 243, + 244, 66, 265, 4, 329, 329, 3, 4, 5, 6, + 73, 74, 83, 85, 102, 103, 104, 108, 135, 136, + 137, 157, 180, 182, 184, 209, 210, 211, 214, 216, + 286, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 299, 300, 301, 302, 303, 305, 306, 307, 308, 309, + 311, 312, 313, 314, 315, 316, 317, 318, 321, 322, + 323, 324, 325, 326, 3, 5, 6, 62, 168, 3, + 5, 6, 62, 168, 3, 5, 6, 62, 168, 217, + 40, 43, 44, 48, 49, 3, 3, 4, 10, 26, + 27, 272, 216, 276, 329, 4, 165, 6, 3, 6, + 4, 3, 4, 55, 4, 195, 3, 3, 251, 252, + 286, 53, 68, 257, 74, 134, 55, 216, 240, 272, + 33, 34, 51, 3, 237, 38, 249, 62, 206, 220, + 265, 289, 78, 78, 216, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 73, 74, 290, + 216, 216, 88, 289, 304, 4, 4, 4, 4, 6, + 326, 216, 120, 122, 124, 125, 216, 216, 290, 290, + 5, 6, 215, 309, 319, 320, 249, 289, 217, 220, + 55, 155, 156, 73, 75, 132, 150, 151, 152, 153, + 154, 158, 206, 207, 208, 209, 210, 211, 212, 213, + 218, 215, 220, 215, 220, 215, 220, 215, 220, 215, + 220, 3, 6, 47, 47, 77, 78, 334, 250, 4, + 40, 49, 6, 77, 188, 189, 4, 217, 217, 82, + 261, 254, 255, 289, 289, 69, 258, 4, 247, 3, + 128, 130, 228, 230, 231, 236, 55, 216, 338, 3, + 3, 217, 220, 216, 287, 272, 289, 244, 216, 216, + 65, 217, 286, 216, 73, 249, 289, 289, 304, 84, + 86, 88, 4, 216, 216, 216, 216, 4, 4, 221, + 217, 217, 77, 288, 3, 289, 289, 75, 158, 216, + 73, 131, 290, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 290, 290, 290, 290, 3, 211, 309, 6, + 319, 6, 320, 6, 5, 43, 45, 46, 216, 216, + 3, 216, 217, 6, 33, 42, 4, 165, 165, 286, + 76, 262, 220, 70, 71, 256, 289, 134, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 108, 109, 110, 111, 112, + 113, 116, 119, 120, 123, 124, 125, 126, 232, 129, + 216, 217, 220, 247, 3, 134, 3, 286, 220, 68, + 69, 79, 80, 81, 185, 327, 328, 327, 286, 217, + 249, 217, 55, 87, 84, 86, 289, 289, 76, 289, + 4, 3, 307, 289, 220, 264, 217, 220, 5, 6, + 329, 216, 290, 249, 286, 131, 155, 221, 221, 6, + 6, 237, 229, 231, 3, 336, 337, 6, 4, 4, + 216, 269, 270, 271, 272, 277, 89, 260, 255, 4, + 216, 216, 216, 216, 216, 216, 216, 73, 128, 130, + 131, 233, 234, 334, 216, 237, 32, 335, 230, 217, + 4, 217, 216, 6, 6, 4, 3, 6, 217, 220, + 217, 217, 217, 232, 289, 289, 84, 87, 290, 220, + 220, 220, 220, 4, 66, 217, 4, 78, 249, 286, + 217, 217, 290, 50, 47, 217, 217, 220, 206, 217, + 220, 6, 247, 220, 56, 58, 59, 60, 61, 63, + 64, 278, 3, 55, 273, 286, 179, 263, 6, 91, + 92, 93, 94, 95, 98, 99, 105, 106, 107, 121, + 91, 92, 93, 94, 95, 98, 99, 105, 106, 107, + 121, 91, 92, 93, 94, 95, 98, 99, 105, 106, + 107, 121, 91, 92, 93, 94, 95, 98, 99, 105, + 106, 107, 121, 91, 92, 93, 94, 95, 98, 99, + 105, 106, 107, 121, 91, 92, 93, 94, 95, 98, + 99, 105, 106, 107, 121, 131, 129, 133, 234, 235, + 235, 237, 217, 216, 134, 165, 286, 328, 217, 84, + 289, 217, 214, 321, 4, 309, 214, 310, 313, 318, + 321, 220, 264, 289, 217, 216, 217, 217, 6, 6, + 231, 3, 4, 5, 6, 337, 34, 36, 217, 270, + 57, 57, 3, 291, 292, 293, 294, 295, 296, 297, + 298, 265, 217, 220, 220, 220, 220, 220, 220, 220, + 220, 220, 220, 93, 220, 220, 220, 220, 220, 220, + 220, 220, 220, 220, 93, 220, 220, 220, 220, 220, + 220, 220, 220, 220, 220, 93, 220, 220, 220, 220, + 220, 220, 220, 220, 220, 220, 93, 220, 220, 220, + 220, 220, 220, 220, 220, 220, 220, 93, 220, 220, + 220, 220, 220, 220, 220, 220, 220, 220, 93, 220, + 308, 134, 134, 217, 336, 4, 3, 217, 6, 220, + 220, 264, 220, 220, 217, 327, 6, 273, 271, 271, + 216, 220, 52, 267, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 220, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 220, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 220, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 220, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 220, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 220, + 6, 4, 4, 217, 334, 4, 4, 217, 4, 4, + 217, 6, 62, 237, 297, 53, 54, 266, 217, 217, + 217, 217, 217, 217, 217, 217, 217, 217, 6, 217, + 217, 217, 217, 217, 217, 217, 217, 217, 217, 6, + 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, + 6, 217, 217, 217, 217, 217, 217, 217, 217, 217, + 217, 6, 217, 217, 217, 217, 217, 217, 217, 217, + 217, 217, 6, 217, 217, 217, 217, 217, 217, 217, + 217, 217, 217, 6, 217, 220, 264, 165, 220, 220, + 264, 40, 43, 44, 48, 49, 289, 217, 286, 289, + 217, 217, 217, 217, 217, 217, 4, 217, 49, 4, + 6, 217, 6, 6, 220, 264, 165, 216, 220, 264, + 334, 6, 45, 46, 6, 217, 49, 4, 4, 217, + 43, 44, 6, 264, 334, 216, 217, 264, 127, 165, + 334, 6, 48, 217, 4, 217, 40, 40, 127, 165, + 334, 217, 127, 165, 216, 40, 40, 40, 40, 3, + 216, 216, 217, 3, 3, 334, 217, 217, 334 +}; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ -static const yytype_int16 yyr1[] = { - 0, 220, 221, 222, 222, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 226, 226, 227, 227, 228, 228, 229, 229, 229, 229, 230, 230, 230, 230, - 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, - 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, - 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, - 230, 230, 230, 230, 231, 231, 232, 232, 232, 232, 233, 233, 234, 234, 235, 235, 236, 237, 237, 238, 238, 239, 239, 240, 241, 241, 242, 243, - 243, 243, 243, 243, 244, 244, 244, 245, 245, 245, 245, 246, 246, 247, 248, 249, 249, 250, 251, 251, 252, 252, 253, 254, 254, 254, 255, 255, - 256, 256, 257, 257, 258, 258, 259, 259, 260, 260, 261, 261, 262, 262, 263, 263, 264, 264, 265, 265, 266, 266, 266, 266, 267, 267, 268, 268, - 269, 269, 270, 270, 271, 271, 271, 271, 272, 272, 273, 273, 274, 275, 275, 276, 276, 276, 276, 276, 276, 276, 277, 277, 277, 277, 277, 277, - 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, - 277, 277, 277, 277, 278, 278, 278, 279, 279, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, - 281, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, - 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 283, 283, 283, 284, 284, 285, 285, 286, 286, 287, 287, 287, 287, 287, 288, 288, 288, - 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 289, 289, 289, 290, 290, 290, 290, 291, 291, 291, 291, 292, 292, 292, 292, 293, 293, 294, - 294, 295, 295, 295, 295, 295, 295, 296, 296, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, - 297, 297, 297, 297, 298, 298, 299, 300, 300, 301, 301, 301, 301, 302, 302, 303, 304, 304, 304, 304, 305, 305, 305, 305, 306, 306, 306, 306, - 306, 306, 306, 306, 306, 306, 306, 306, 307, 307, 307, 307, 308, 308, 308, 309, 310, 310, 311, 311, 312, 313, 313, 314, 315, 315, 316, 317, - 318, 319, 319, 320, 321, 321, 322, 323, 323, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 325, 325, 326, 326, 326, 326, 326, - 326, 327, 328, 328, 329, 329, 330, 330, 331, 331, 332, 332, 333, 333, 334, 334, 335, 335, 335, 335, 335, 336, 336}; +static const yytype_int16 yyr1[] = +{ + 0, 222, 223, 224, 224, 225, 225, 225, 225, 225, + 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, + 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, + 226, 226, 227, 227, 227, 227, 227, 227, 227, 227, + 227, 227, 228, 228, 229, 229, 230, 230, 231, 231, + 231, 231, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, + 232, 232, 232, 232, 233, 233, 234, 234, 234, 234, + 235, 235, 236, 236, 237, 237, 238, 239, 239, 240, + 240, 241, 241, 242, 243, 243, 244, 245, 245, 245, + 245, 245, 246, 246, 246, 247, 247, 247, 247, 248, + 248, 249, 250, 251, 251, 252, 253, 253, 254, 254, + 255, 256, 256, 256, 257, 257, 258, 258, 259, 259, + 260, 260, 261, 261, 262, 262, 263, 263, 264, 264, + 265, 265, 266, 266, 267, 267, 268, 268, 268, 268, + 269, 269, 270, 270, 271, 271, 272, 272, 273, 273, + 273, 273, 274, 274, 275, 275, 276, 277, 277, 278, + 278, 278, 278, 278, 278, 278, 279, 279, 279, 279, + 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, + 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, + 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, + 279, 279, 279, 279, 279, 279, 280, 280, 280, 281, + 281, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 283, 284, 284, 284, + 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, + 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, + 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, + 284, 284, 284, 284, 284, 285, 285, 285, 286, 286, + 287, 287, 288, 288, 289, 289, 289, 289, 289, 290, + 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, + 290, 290, 291, 291, 291, 292, 292, 292, 292, 293, + 293, 293, 293, 294, 294, 294, 294, 295, 295, 296, + 296, 297, 297, 297, 297, 297, 297, 298, 298, 299, + 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, + 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, + 299, 299, 300, 300, 301, 302, 302, 303, 303, 303, + 303, 304, 304, 305, 306, 306, 306, 306, 307, 307, + 307, 307, 308, 308, 308, 308, 308, 308, 308, 308, + 308, 308, 308, 308, 309, 309, 309, 309, 310, 310, + 310, 311, 312, 312, 313, 313, 314, 315, 315, 316, + 317, 317, 318, 319, 320, 321, 321, 322, 323, 323, + 324, 325, 325, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 327, 327, 328, 328, 328, + 328, 328, 328, 329, 330, 330, 331, 331, 332, 332, + 333, 333, 334, 334, 335, 335, 336, 336, 337, 337, + 337, 337, 337, 338, 338 +}; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ -static const yytype_int8 yyr2[] = { - 0, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 4, 4, 8, 6, 10, - 8, 7, 6, 8, 1, 3, 1, 3, 1, 1, 4, 4, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, - 4, 1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 1, 2, 2, 1, 1, 2, 2, 0, - 5, 4, 1, 3, 4, 6, 5, 3, 0, 3, 2, 5, 1, 3, 3, 4, 4, 4, 4, 6, 8, 11, 8, 1, 1, 3, 3, 3, 3, 2, 4, 3, 3, 10, 3, 0, 1, 3, - 2, 1, 1, 0, 2, 0, 2, 0, 1, 0, 2, 0, 2, 0, 2, 0, 2, 0, 3, 0, 2, 0, 2, 0, 3, 0, 1, 2, 1, 1, 1, 3, 1, 1, 2, 4, 1, 3, - 2, 1, 5, 0, 2, 0, 1, 3, 5, 4, 6, 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 2, 3, 2, 2, 2, 2, 3, 2, 3, 3, 3, 4, 4, 3, 3, 4, 4, - 5, 6, 7, 9, 4, 5, 7, 9, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 2, 2, 2, 2, 5, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 3, 3, 3, 3, 4, 6, 7, 9, 10, 12, 12, 13, 14, 15, 16, 12, 13, 15, 16, 3, 4, 5, 6, 3, 3, 4, 3, 3, 4, 4, 6, 5, 3, 4, 3, 4, - 3, 3, 5, 7, 7, 6, 8, 8, 1, 3, 3, 5, 3, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 14, 19, 16, 20, 16, 15, - 13, 18, 14, 13, 11, 8, 10, 13, 15, 5, 7, 4, 6, 1, 1, 1, 1, 1, 1, 1, 3, 3, 4, 5, 4, 3, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 6, 3, 4, 3, 3, 5, 5, 6, 4, 6, 3, 5, 4, 5, 6, 4, 5, 5, 6, 1, 3, 1, 3, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 1, 1, 2, 2, 3, 2, 2, 3, 2, 3, 3, 1, 1, 2, 2, 3, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 1, 3, 2, 2, 1, 2, 2, 2, 1, 2, 0, 3, 0, 1, 0, 2, 0, 4, 0, 4, 0, 1, 3, 1, 3, 3, 3, 3, 6, 3}; +static const yytype_int8 yyr2[] = +{ + 0, 2, 2, 1, 3, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 6, 4, 4, 8, 6, 10, 8, 7, + 6, 8, 1, 3, 1, 3, 1, 1, 4, 4, + 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 6, 4, 1, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 7, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 7, 1, 2, 2, 1, 1, 2, + 2, 0, 5, 4, 1, 3, 4, 6, 5, 3, + 0, 3, 2, 5, 1, 3, 3, 4, 4, 4, + 4, 6, 8, 11, 8, 1, 1, 3, 3, 3, + 3, 2, 4, 3, 3, 10, 3, 0, 1, 3, + 2, 1, 1, 0, 2, 0, 2, 0, 1, 0, + 2, 0, 2, 0, 2, 0, 2, 0, 3, 0, + 2, 0, 2, 0, 3, 0, 1, 2, 1, 1, + 1, 3, 1, 1, 2, 4, 1, 3, 2, 1, + 5, 0, 2, 0, 1, 3, 5, 4, 6, 1, + 1, 1, 1, 1, 1, 0, 2, 2, 2, 2, + 3, 2, 2, 2, 2, 3, 2, 3, 3, 3, + 4, 4, 3, 3, 4, 4, 5, 6, 7, 9, + 4, 5, 7, 9, 2, 3, 2, 3, 3, 4, + 2, 3, 3, 4, 2, 3, 2, 2, 2, 2, + 5, 2, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, + 6, 6, 5, 3, 4, 4, 3, 3, 4, 6, + 7, 9, 10, 12, 12, 13, 14, 15, 16, 12, + 13, 15, 16, 3, 4, 5, 6, 3, 3, 4, + 3, 3, 4, 4, 6, 5, 3, 4, 3, 4, + 3, 3, 5, 7, 7, 6, 8, 8, 1, 3, + 3, 5, 3, 1, 1, 1, 1, 1, 1, 3, + 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 14, 19, 16, 20, 16, 15, 13, 18, + 14, 13, 11, 8, 10, 13, 15, 5, 7, 4, + 6, 1, 1, 1, 1, 1, 1, 1, 3, 3, + 4, 5, 4, 3, 2, 2, 2, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 6, + 3, 4, 3, 3, 5, 5, 6, 4, 6, 3, + 5, 4, 5, 6, 4, 5, 5, 6, 1, 3, + 1, 3, 1, 1, 1, 1, 1, 2, 2, 2, + 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 2, 3, 1, 1, 2, 2, 3, 2, + 2, 3, 2, 3, 3, 1, 1, 2, 2, 3, + 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 3, 2, 2, 1, + 2, 2, 2, 1, 2, 0, 3, 0, 1, 0, + 2, 0, 4, 0, 4, 0, 1, 3, 1, 3, + 3, 3, 3, 6, 3 +}; + enum { YYENOMEM = -2 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = SQLEMPTY) - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab -#define YYNOMEM goto yyexhaustedlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ - do \ - if (yychar == SQLEMPTY) { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK(yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } else { \ - yyerror(&yylloc, scanner, result, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ - while (0) +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = SQLEMPTY) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab + + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == SQLEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (&yylloc, scanner, result, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) /* Backward compatibility with an undocumented macro. Use SQLerror or SQLUNDEF. */ @@ -1538,135 +1903,150 @@ enum { YYENOMEM = -2 }; the previous symbol: RHS[0] (always defined). */ #ifndef YYLLOC_DEFAULT -#define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) { \ - (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC(Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC(Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC(Rhs, N).last_column; \ - } else { \ - (Current).first_line = (Current).last_line = YYRHSLOC(Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = YYRHSLOC(Rhs, 0).last_column; \ - } \ +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ while (0) #endif #define YYRHSLOC(Rhs, K) ((Rhs)[K]) + /* Enable debugging if requested. */ #if SQLDEBUG -#ifndef YYFPRINTF -#include /* INFRINGES ON USER NAME SPACE */ -#define YYFPRINTF fprintf -#endif +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) -#define YYDPRINTF(Args) \ - do { \ - if (yydebug) \ - YYFPRINTF Args; \ - } while (0) /* YYLOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ -#ifndef YYLOCATION_PRINT +# ifndef YYLOCATION_PRINT -#if defined YY_LOCATION_PRINT +# if defined YY_LOCATION_PRINT -/* Temporary convenience wrapper in case some people defined the - undocumented and private YY_LOCATION_PRINT macros. */ -#define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc)) + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc)) -#elif defined SQLLTYPE_IS_TRIVIAL && SQLLTYPE_IS_TRIVIAL +# elif defined SQLLTYPE_IS_TRIVIAL && SQLLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. Private, do not rely on its existence. */ YY_ATTRIBUTE_UNUSED -static int yy_location_print_(FILE *yyo, YYLTYPE const *const yylocp) { - int res = 0; - int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; - if (0 <= yylocp->first_line) { - res += YYFPRINTF(yyo, "%d", yylocp->first_line); - if (0 <= yylocp->first_column) - res += YYFPRINTF(yyo, ".%d", yylocp->first_column); +static int +yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) +{ + int res = 0; + int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; + if (0 <= yylocp->first_line) + { + res += YYFPRINTF (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += YYFPRINTF (yyo, ".%d", yylocp->first_column); } - if (0 <= yylocp->last_line) { - if (yylocp->first_line < yylocp->last_line) { - res += YYFPRINTF(yyo, "-%d", yylocp->last_line); - if (0 <= end_col) - res += YYFPRINTF(yyo, ".%d", end_col); - } else if (0 <= end_col && yylocp->first_column < end_col) - res += YYFPRINTF(yyo, "-%d", end_col); + if (0 <= yylocp->last_line) + { + if (yylocp->first_line < yylocp->last_line) + { + res += YYFPRINTF (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += YYFPRINTF (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += YYFPRINTF (yyo, "-%d", end_col); } - return res; + return res; } -#define YYLOCATION_PRINT yy_location_print_ +# define YYLOCATION_PRINT yy_location_print_ -/* Temporary convenience wrapper in case some people defined the - undocumented and private YY_LOCATION_PRINT macros. */ -#define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc)) + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc)) -#else +# else -#define YYLOCATION_PRINT(File, Loc) ((void)0) -/* Temporary convenience wrapper in case some people defined the - undocumented and private YY_LOCATION_PRINT macros. */ -#define YY_LOCATION_PRINT YYLOCATION_PRINT +# define YYLOCATION_PRINT(File, Loc) ((void) 0) + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YY_LOCATION_PRINT YYLOCATION_PRINT + +# endif +# endif /* !defined YYLOCATION_PRINT */ -#endif -#endif /* !defined YYLOCATION_PRINT */ -#define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ - do { \ - if (yydebug) { \ - YYFPRINTF(stderr, "%s ", Title); \ - yy_symbol_print(stderr, Kind, Value, Location, scanner, result); \ - YYFPRINTF(stderr, "\n"); \ - } \ - } while (0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Kind, Value, Location, scanner, result); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + /*-----------------------------------. | Print this symbol's value on YYO. | `-----------------------------------*/ -static void yy_symbol_value_print(FILE *yyo, - yysymbol_kind_t yykind, - YYSTYPE const *const yyvaluep, - YYLTYPE const *const yylocationp, - void *scanner, - infinity::ParserResult *result) { - FILE *yyoutput = yyo; - YY_USE(yyoutput); - YY_USE(yylocationp); - YY_USE(scanner); - YY_USE(result); - if (!yyvaluep) - return; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YY_USE(yykind); - YY_IGNORE_MAYBE_UNINITIALIZED_END +static void +yy_symbol_value_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner, infinity::ParserResult* result) +{ + FILE *yyoutput = yyo; + YY_USE (yyoutput); + YY_USE (yylocationp); + YY_USE (scanner); + YY_USE (result); + if (!yyvaluep) + return; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END } + /*---------------------------. | Print this symbol on YYO. | `---------------------------*/ -static void yy_symbol_print(FILE *yyo, - yysymbol_kind_t yykind, - YYSTYPE const *const yyvaluep, - YYLTYPE const *const yylocationp, - void *scanner, - infinity::ParserResult *result) { - YYFPRINTF(yyo, "%s %s (", yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name(yykind)); - - YYLOCATION_PRINT(yyo, yylocationp); - YYFPRINTF(yyo, ": "); - yy_symbol_value_print(yyo, yykind, yyvaluep, yylocationp, scanner, result); - YYFPRINTF(yyo, ")"); +static void +yy_symbol_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *scanner, infinity::ParserResult* result) +{ + YYFPRINTF (yyo, "%s %s (", + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); + + YYLOCATION_PRINT (yyo, yylocationp); + YYFPRINTF (yyo, ": "); + yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, scanner, result); + YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. @@ -1674,62 +2054,70 @@ static void yy_symbol_print(FILE *yyo, | TOP (included). | `------------------------------------------------------------------*/ -static void yy_stack_print(yy_state_t *yybottom, yy_state_t *yytop) { - YYFPRINTF(stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) { - int yybot = *yybottom; - YYFPRINTF(stderr, " %d", yybot); +static void +yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); } - YYFPRINTF(stderr, "\n"); + YYFPRINTF (stderr, "\n"); } -#define YY_STACK_PRINT(Bottom, Top) \ - do { \ - if (yydebug) \ - yy_stack_print((Bottom), (Top)); \ - } while (0) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -static void yy_reduce_print(yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, void *scanner, infinity::ParserResult *result) { - int yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF(stderr, "Reducing stack by rule %d (line %d):\n", yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) { - YYFPRINTF(stderr, " $%d = ", yyi + 1); - yy_symbol_print(stderr, - YY_ACCESSING_SYMBOL(+yyssp[yyi + 1 - yynrhs]), - &yyvsp[(yyi + 1) - (yynrhs)], - &(yylsp[(yyi + 1) - (yynrhs)]), - scanner, - result); - YYFPRINTF(stderr, "\n"); - } -} - -#define YY_REDUCE_PRINT(Rule) \ - do { \ - if (yydebug) \ - yy_reduce_print(yyssp, yyvsp, yylsp, Rule, scanner, result); \ - } while (0) +static void +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, + int yyrule, void *scanner, infinity::ParserResult* result) +{ + int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), + &yyvsp[(yyi + 1) - (yynrhs)], + &(yylsp[(yyi + 1) - (yynrhs)]), scanner, result); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, yylsp, Rule, scanner, result); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !SQLDEBUG */ -#define YYDPRINTF(Args) ((void)0) -#define YY_SYMBOL_PRINT(Title, Kind, Value, Location) -#define YY_STACK_PRINT(Bottom, Top) -#define YY_REDUCE_PRINT(Rule) +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) #endif /* !SQLDEBUG */ + /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH -#define YYINITDEPTH 200 +# define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only @@ -1740,14 +2128,16 @@ int yydebug; evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 +# define YYMAXDEPTH 10000 #endif + /* Context of a parse error. */ -typedef struct { - yy_state_t *yyssp; - yysymbol_kind_t yytoken; - YYLTYPE *yylloc; +typedef struct +{ + yy_state_t *yyssp; + yysymbol_kind_t yytoken; + YYLTYPE *yylloc; } yypcontext_t; /* Put in YYARG at most YYARGN of the expected tokens given the @@ -1756,64 +2146,77 @@ typedef struct { be less than YYNTOKENS). Return YYENOMEM on memory exhaustion. Return 0 if there are more than YYARGN expected tokens, yet fill YYARG up to YYARGN. */ -static int yypcontext_expected_tokens(const yypcontext_t *yyctx, yysymbol_kind_t yyarg[], int yyargn) { - /* Actual size of YYARG. */ - int yycount = 0; - int yyn = yypact[+*yyctx->yyssp]; - if (!yypact_value_is_default(yyn)) { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror && !yytable_value_is_error(yytable[yyx + yyn])) { - if (!yyarg) - ++yycount; - else if (yycount == yyargn) - return 0; - else - yyarg[yycount++] = YY_CAST(yysymbol_kind_t, yyx); - } +static int +yypcontext_expected_tokens (const yypcontext_t *yyctx, + yysymbol_kind_t yyarg[], int yyargn) +{ + /* Actual size of YYARG. */ + int yycount = 0; + int yyn = yypact[+*yyctx->yyssp]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (!yyarg) + ++yycount; + else if (yycount == yyargn) + return 0; + else + yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx); + } } - if (yyarg && yycount == 0 && 0 < yyargn) - yyarg[0] = YYSYMBOL_YYEMPTY; - return yycount; + if (yyarg && yycount == 0 && 0 < yyargn) + yyarg[0] = YYSYMBOL_YYEMPTY; + return yycount; } + + + #ifndef yystrlen -#if defined __GLIBC__ && defined _STRING_H -#define yystrlen(S) (YY_CAST(YYPTRDIFF_T, strlen(S))) -#else +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) +# else /* Return the length of YYSTR. */ -static YYPTRDIFF_T yystrlen(const char *yystr) { - YYPTRDIFF_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; +static YYPTRDIFF_T +yystrlen (const char *yystr) +{ + YYPTRDIFF_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; } -#endif +# endif #endif #ifndef yystpcpy -#if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -#define yystpcpy stpcpy -#else +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -static char *yystpcpy(char *yydest, const char *yysrc) { - char *yyd = yydest; - const char *yys = yysrc; +static char * +yystpcpy (char *yydest, const char *yysrc) +{ + char *yyd = yydest; + const char *yys = yysrc; - while ((*yyd++ = *yys++) != '\0') - continue; + while ((*yyd++ = *yys++) != '\0') + continue; - return yyd - 1; + return yyd - 1; } -#endif +# endif #endif #ifndef yytnamerr @@ -1824,82 +2227,92 @@ static char *yystpcpy(char *yydest, const char *yysrc) { backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ -static YYPTRDIFF_T yytnamerr(char *yyres, const char *yystr) { - if (*yystr == '"') { - YYPTRDIFF_T yyn = 0; - char const *yyp = yystr; - for (;;) - switch (*++yyp) { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes:; +static YYPTRDIFF_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYPTRDIFF_T yyn = 0; + char const *yyp = yystr; + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + else + goto append; + + append: + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; } - if (yyres) - return yystpcpy(yyres, yystr) - yyres; - else - return yystrlen(yystr); + if (yyres) + return yystpcpy (yyres, yystr) - yyres; + else + return yystrlen (yystr); } #endif -static int yy_syntax_error_arguments(const yypcontext_t *yyctx, yysymbol_kind_t yyarg[], int yyargn) { - /* Actual size of YYARG. */ - int yycount = 0; - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yyctx->yytoken != YYSYMBOL_YYEMPTY) { - int yyn; - if (yyarg) - yyarg[yycount] = yyctx->yytoken; - ++yycount; - yyn = yypcontext_expected_tokens(yyctx, yyarg ? yyarg + 1 : yyarg, yyargn - 1); - if (yyn == YYENOMEM) - return YYENOMEM; - else - yycount += yyn; + +static int +yy_syntax_error_arguments (const yypcontext_t *yyctx, + yysymbol_kind_t yyarg[], int yyargn) +{ + /* Actual size of YYARG. */ + int yycount = 0; + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yyctx->yytoken != YYSYMBOL_YYEMPTY) + { + int yyn; + if (yyarg) + yyarg[yycount] = yyctx->yytoken; + ++yycount; + yyn = yypcontext_expected_tokens (yyctx, + yyarg ? yyarg + 1 : yyarg, yyargn - 1); + if (yyn == YYENOMEM) + return YYENOMEM; + else + yycount += yyn; } - return yycount; + return yycount; } /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message @@ -1910,940 +2323,963 @@ static int yy_syntax_error_arguments(const yypcontext_t *yyctx, yysymbol_kind_t not large enough to hold the message. In that case, also set *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the required number of bytes is too large to store. */ -static int yysyntax_error(YYPTRDIFF_T *yymsg_alloc, char **yymsg, const yypcontext_t *yyctx) { - enum { YYARGS_MAX = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat: reported tokens (one for the "unexpected", - one per "expected"). */ - yysymbol_kind_t yyarg[YYARGS_MAX]; - /* Cumulated lengths of YYARG. */ - YYPTRDIFF_T yysize = 0; - - /* Actual size of YYARG. */ - int yycount = yy_syntax_error_arguments(yyctx, yyarg, YYARGS_MAX); - if (yycount == YYENOMEM) - return YYENOMEM; - - switch (yycount) { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ +static int +yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, + const yypcontext_t *yyctx) +{ + enum { YYARGS_MAX = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat: reported tokens (one for the "unexpected", + one per "expected"). */ + yysymbol_kind_t yyarg[YYARGS_MAX]; + /* Cumulated lengths of YYARG. */ + YYPTRDIFF_T yysize = 0; + + /* Actual size of YYARG. */ + int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX); + if (yycount == YYENOMEM) + return YYENOMEM; + + switch (yycount) + { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ break - default: /* Avoid compiler warnings. */ - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); + default: /* Avoid compiler warnings. */ + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); #undef YYCASE_ } - /* Compute error message size. Don't count the "%s"s, but reserve - room for the terminator. */ - yysize = yystrlen(yyformat) - 2 * yycount + 1; - { - int yyi; - for (yyi = 0; yyi < yycount; ++yyi) { - YYPTRDIFF_T yysize1 = yysize + yytnamerr(YY_NULLPTR, yytname[yyarg[yyi]]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return YYENOMEM; - } - } - - if (*yymsg_alloc < yysize) { - *yymsg_alloc = 2 * yysize; - if (!(yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return -1; - } + /* Compute error message size. Don't count the "%s"s, but reserve + room for the terminator. */ + yysize = yystrlen (yyformat) - 2 * yycount + 1; + { + int yyi; + for (yyi = 0; yyi < yycount; ++yyi) + { + YYPTRDIFF_T yysize1 + = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]); + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else + return YYENOMEM; + } + } - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ + if (*yymsg_alloc < yysize) { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { - yyp += yytnamerr(yyp, yytname[yyarg[yyi++]]); - yyformat += 2; - } else { - ++yyp; - ++yyformat; - } + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return -1; } - return 0; + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]); + yyformat += 2; + } + else + { + ++yyp; + ++yyformat; + } + } + return 0; } + /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void -yydestruct(const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, void *scanner, infinity::ParserResult *result) { - YY_USE(yyvaluep); - YY_USE(yylocationp); - YY_USE(scanner); - YY_USE(result); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT(yymsg, yykind, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - switch (yykind) { - case YYSYMBOL_IDENTIFIER: /* IDENTIFIER */ +yydestruct (const char *yymsg, + yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, void *scanner, infinity::ParserResult* result) +{ + YY_USE (yyvaluep); + YY_USE (yylocationp); + YY_USE (scanner); + YY_USE (result); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + switch (yykind) + { + case YYSYMBOL_IDENTIFIER: /* IDENTIFIER */ #line 317 "parser.y" - { - free(((*yyvaluep).str_value)); - } -#line 2413 "parser.cpp" + { + free(((*yyvaluep).str_value)); +} +#line 2432 "parser.cpp" break; - case YYSYMBOL_STRING: /* STRING */ + case YYSYMBOL_STRING: /* STRING */ #line 317 "parser.y" - { - free(((*yyvaluep).str_value)); - } -#line 2421 "parser.cpp" + { + free(((*yyvaluep).str_value)); +} +#line 2440 "parser.cpp" break; - case YYSYMBOL_statement_list: /* statement_list */ + case YYSYMBOL_statement_list: /* statement_list */ #line 234 "parser.y" - { - fprintf(stderr, "destroy statement array\n"); - if ((((*yyvaluep).stmt_array)) != nullptr) { - for (auto ptr : *(((*yyvaluep).stmt_array))) { - delete ptr; - } - delete (((*yyvaluep).stmt_array)); - } + { + fprintf(stderr, "destroy statement array\n"); + if ((((*yyvaluep).stmt_array)) != nullptr) { + for (auto ptr : *(((*yyvaluep).stmt_array))) { + delete ptr; } -#line 2435 "parser.cpp" + delete (((*yyvaluep).stmt_array)); + } +} +#line 2454 "parser.cpp" break; - case YYSYMBOL_table_element_array: /* table_element_array */ + case YYSYMBOL_table_element_array: /* table_element_array */ #line 214 "parser.y" - { - fprintf(stderr, "destroy table element array\n"); - if ((((*yyvaluep).table_element_array_t)) != nullptr) { - for (auto ptr : *(((*yyvaluep).table_element_array_t))) { - delete ptr; - } - delete (((*yyvaluep).table_element_array_t)); - } + { + fprintf(stderr, "destroy table element array\n"); + if ((((*yyvaluep).table_element_array_t)) != nullptr) { + for (auto ptr : *(((*yyvaluep).table_element_array_t))) { + delete ptr; } -#line 2449 "parser.cpp" + delete (((*yyvaluep).table_element_array_t)); + } +} +#line 2468 "parser.cpp" break; - case YYSYMBOL_column_def_array: /* column_def_array */ + case YYSYMBOL_column_def_array: /* column_def_array */ #line 224 "parser.y" - { - fprintf(stderr, "destroy column def array\n"); - if ((((*yyvaluep).column_def_array_t)) != nullptr) { - for (auto ptr : *(((*yyvaluep).column_def_array_t))) { - delete ptr; - } - delete (((*yyvaluep).column_def_array_t)); - } + { + fprintf(stderr, "destroy column def array\n"); + if ((((*yyvaluep).column_def_array_t)) != nullptr) { + for (auto ptr : *(((*yyvaluep).column_def_array_t))) { + delete ptr; } -#line 2463 "parser.cpp" + delete (((*yyvaluep).column_def_array_t)); + } +} +#line 2482 "parser.cpp" break; - case YYSYMBOL_column_constraints: /* column_constraints */ + case YYSYMBOL_column_constraints: /* column_constraints */ #line 310 "parser.y" - { - fprintf(stderr, "destroy constraints\n"); - if ((((*yyvaluep).column_constraints_t)) != nullptr) { - delete (((*yyvaluep).column_constraints_t)); - } - } -#line 2474 "parser.cpp" + { + fprintf(stderr, "destroy constraints\n"); + if ((((*yyvaluep).column_constraints_t)) != nullptr) { + delete (((*yyvaluep).column_constraints_t)); + } +} +#line 2493 "parser.cpp" break; - case YYSYMBOL_default_expr: /* default_expr */ + case YYSYMBOL_default_expr: /* default_expr */ #line 330 "parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } -#line 2482 "parser.cpp" + { + delete (((*yyvaluep).const_expr_t)); +} +#line 2501 "parser.cpp" break; - case YYSYMBOL_identifier_array: /* identifier_array */ + case YYSYMBOL_identifier_array: /* identifier_array */ #line 321 "parser.y" - { - fprintf(stderr, "destroy identifier array\n"); - delete (((*yyvaluep).identifier_array_t)); - } -#line 2491 "parser.cpp" + { + fprintf(stderr, "destroy identifier array\n"); + delete (((*yyvaluep).identifier_array_t)); +} +#line 2510 "parser.cpp" break; - case YYSYMBOL_optional_identifier_array: /* optional_identifier_array */ + case YYSYMBOL_optional_identifier_array: /* optional_identifier_array */ #line 321 "parser.y" - { - fprintf(stderr, "destroy identifier array\n"); - delete (((*yyvaluep).identifier_array_t)); - } -#line 2500 "parser.cpp" + { + fprintf(stderr, "destroy identifier array\n"); + delete (((*yyvaluep).identifier_array_t)); +} +#line 2519 "parser.cpp" break; - case YYSYMBOL_update_expr_array: /* update_expr_array */ + case YYSYMBOL_update_expr_array: /* update_expr_array */ #line 281 "parser.y" - { - fprintf(stderr, "destroy update expr array\n"); - if ((((*yyvaluep).update_expr_array_t)) != nullptr) { - for (auto ptr : *(((*yyvaluep).update_expr_array_t))) { - delete ptr; - } - delete (((*yyvaluep).update_expr_array_t)); - } + { + fprintf(stderr, "destroy update expr array\n"); + if ((((*yyvaluep).update_expr_array_t)) != nullptr) { + for (auto ptr : *(((*yyvaluep).update_expr_array_t))) { + delete ptr; } -#line 2514 "parser.cpp" + delete (((*yyvaluep).update_expr_array_t)); + } +} +#line 2533 "parser.cpp" break; - case YYSYMBOL_update_expr: /* update_expr */ + case YYSYMBOL_update_expr: /* update_expr */ #line 274 "parser.y" - { - fprintf(stderr, "destroy update expr\n"); - if (((*yyvaluep).update_expr_t) != nullptr) { - delete ((*yyvaluep).update_expr_t); - } - } -#line 2525 "parser.cpp" + { + fprintf(stderr, "destroy update expr\n"); + if(((*yyvaluep).update_expr_t) != nullptr) { + delete ((*yyvaluep).update_expr_t); + } +} +#line 2544 "parser.cpp" break; - case YYSYMBOL_select_statement: /* select_statement */ + case YYSYMBOL_select_statement: /* select_statement */ #line 356 "parser.y" - { - if (((*yyvaluep).select_stmt) != nullptr) { - delete ((*yyvaluep).select_stmt); - } - } -#line 2535 "parser.cpp" + { + if(((*yyvaluep).select_stmt) != nullptr) { + delete ((*yyvaluep).select_stmt); + } +} +#line 2554 "parser.cpp" break; - case YYSYMBOL_select_with_paren: /* select_with_paren */ + case YYSYMBOL_select_with_paren: /* select_with_paren */ #line 356 "parser.y" - { - if (((*yyvaluep).select_stmt) != nullptr) { - delete ((*yyvaluep).select_stmt); - } - } -#line 2545 "parser.cpp" + { + if(((*yyvaluep).select_stmt) != nullptr) { + delete ((*yyvaluep).select_stmt); + } +} +#line 2564 "parser.cpp" break; - case YYSYMBOL_select_without_paren: /* select_without_paren */ + case YYSYMBOL_select_without_paren: /* select_without_paren */ #line 356 "parser.y" - { - if (((*yyvaluep).select_stmt) != nullptr) { - delete ((*yyvaluep).select_stmt); - } - } -#line 2555 "parser.cpp" + { + if(((*yyvaluep).select_stmt) != nullptr) { + delete ((*yyvaluep).select_stmt); + } +} +#line 2574 "parser.cpp" break; - case YYSYMBOL_select_clause_with_modifier: /* select_clause_with_modifier */ + case YYSYMBOL_select_clause_with_modifier: /* select_clause_with_modifier */ #line 356 "parser.y" - { - if (((*yyvaluep).select_stmt) != nullptr) { - delete ((*yyvaluep).select_stmt); - } - } -#line 2565 "parser.cpp" + { + if(((*yyvaluep).select_stmt) != nullptr) { + delete ((*yyvaluep).select_stmt); + } +} +#line 2584 "parser.cpp" break; - case YYSYMBOL_select_clause_without_modifier_paren: /* select_clause_without_modifier_paren */ + case YYSYMBOL_select_clause_without_modifier_paren: /* select_clause_without_modifier_paren */ #line 356 "parser.y" - { - if (((*yyvaluep).select_stmt) != nullptr) { - delete ((*yyvaluep).select_stmt); - } - } -#line 2575 "parser.cpp" + { + if(((*yyvaluep).select_stmt) != nullptr) { + delete ((*yyvaluep).select_stmt); + } +} +#line 2594 "parser.cpp" break; - case YYSYMBOL_select_clause_without_modifier: /* select_clause_without_modifier */ + case YYSYMBOL_select_clause_without_modifier: /* select_clause_without_modifier */ #line 356 "parser.y" - { - if (((*yyvaluep).select_stmt) != nullptr) { - delete ((*yyvaluep).select_stmt); - } - } -#line 2585 "parser.cpp" + { + if(((*yyvaluep).select_stmt) != nullptr) { + delete ((*yyvaluep).select_stmt); + } +} +#line 2604 "parser.cpp" break; - case YYSYMBOL_order_by_clause: /* order_by_clause */ + case YYSYMBOL_order_by_clause: /* order_by_clause */ #line 264 "parser.y" - { - fprintf(stderr, "destroy order by expr list\n"); - if ((((*yyvaluep).order_by_expr_list_t)) != nullptr) { - for (auto ptr : *(((*yyvaluep).order_by_expr_list_t))) { - delete ptr; - } - delete (((*yyvaluep).order_by_expr_list_t)); - } + { + fprintf(stderr, "destroy order by expr list\n"); + if ((((*yyvaluep).order_by_expr_list_t)) != nullptr) { + for (auto ptr : *(((*yyvaluep).order_by_expr_list_t))) { + delete ptr; } -#line 2599 "parser.cpp" + delete (((*yyvaluep).order_by_expr_list_t)); + } +} +#line 2618 "parser.cpp" break; - case YYSYMBOL_order_by_expr_list: /* order_by_expr_list */ + case YYSYMBOL_order_by_expr_list: /* order_by_expr_list */ #line 264 "parser.y" - { - fprintf(stderr, "destroy order by expr list\n"); - if ((((*yyvaluep).order_by_expr_list_t)) != nullptr) { - for (auto ptr : *(((*yyvaluep).order_by_expr_list_t))) { - delete ptr; - } - delete (((*yyvaluep).order_by_expr_list_t)); - } + { + fprintf(stderr, "destroy order by expr list\n"); + if ((((*yyvaluep).order_by_expr_list_t)) != nullptr) { + for (auto ptr : *(((*yyvaluep).order_by_expr_list_t))) { + delete ptr; } -#line 2613 "parser.cpp" + delete (((*yyvaluep).order_by_expr_list_t)); + } +} +#line 2632 "parser.cpp" break; - case YYSYMBOL_order_by_expr: /* order_by_expr */ + case YYSYMBOL_order_by_expr: /* order_by_expr */ #line 344 "parser.y" - { - fprintf(stderr, "destroy order by expr\n"); - delete ((*yyvaluep).order_by_expr_t)->expr_; - delete ((*yyvaluep).order_by_expr_t); - } -#line 2623 "parser.cpp" + { + fprintf(stderr, "destroy order by expr\n"); + delete ((*yyvaluep).order_by_expr_t)->expr_; + delete ((*yyvaluep).order_by_expr_t); +} +#line 2642 "parser.cpp" break; - case YYSYMBOL_limit_expr: /* limit_expr */ + case YYSYMBOL_limit_expr: /* limit_expr */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2631 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2650 "parser.cpp" break; - case YYSYMBOL_offset_expr: /* offset_expr */ + case YYSYMBOL_offset_expr: /* offset_expr */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2639 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2658 "parser.cpp" break; - case YYSYMBOL_unnest_clause: /* unnest_clause */ + case YYSYMBOL_unnest_clause: /* unnest_clause */ #line 244 "parser.y" - { - fprintf(stderr, "destroy expression array\n"); - if ((((*yyvaluep).expr_array_t)) != nullptr) { - for (auto ptr : *(((*yyvaluep).expr_array_t))) { - delete ptr; - } - delete (((*yyvaluep).expr_array_t)); - } + { + fprintf(stderr, "destroy expression array\n"); + if ((((*yyvaluep).expr_array_t)) != nullptr) { + for (auto ptr : *(((*yyvaluep).expr_array_t))) { + delete ptr; } -#line 2653 "parser.cpp" + delete (((*yyvaluep).expr_array_t)); + } +} +#line 2672 "parser.cpp" break; - case YYSYMBOL_highlight_clause: /* highlight_clause */ + case YYSYMBOL_highlight_clause: /* highlight_clause */ #line 244 "parser.y" - { - fprintf(stderr, "destroy expression array\n"); - if ((((*yyvaluep).expr_array_t)) != nullptr) { - for (auto ptr : *(((*yyvaluep).expr_array_t))) { - delete ptr; - } - delete (((*yyvaluep).expr_array_t)); - } + { + fprintf(stderr, "destroy expression array\n"); + if ((((*yyvaluep).expr_array_t)) != nullptr) { + for (auto ptr : *(((*yyvaluep).expr_array_t))) { + delete ptr; } -#line 2667 "parser.cpp" + delete (((*yyvaluep).expr_array_t)); + } +} +#line 2686 "parser.cpp" break; - case YYSYMBOL_from_clause: /* from_clause */ + case YYSYMBOL_from_clause: /* from_clause */ #line 339 "parser.y" - { - fprintf(stderr, "destroy table reference\n"); - delete (((*yyvaluep).table_reference_t)); - } -#line 2676 "parser.cpp" + { + fprintf(stderr, "destroy table reference\n"); + delete (((*yyvaluep).table_reference_t)); +} +#line 2695 "parser.cpp" break; - case YYSYMBOL_search_clause: /* search_clause */ + case YYSYMBOL_search_clause: /* search_clause */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2684 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2703 "parser.cpp" break; - case YYSYMBOL_optional_search_filter_expr: /* optional_search_filter_expr */ + case YYSYMBOL_optional_search_filter_expr: /* optional_search_filter_expr */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2692 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2711 "parser.cpp" break; - case YYSYMBOL_where_clause: /* where_clause */ + case YYSYMBOL_where_clause: /* where_clause */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2700 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2719 "parser.cpp" break; - case YYSYMBOL_having_clause: /* having_clause */ + case YYSYMBOL_having_clause: /* having_clause */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2708 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2727 "parser.cpp" break; - case YYSYMBOL_group_by_clause: /* group_by_clause */ + case YYSYMBOL_group_by_clause: /* group_by_clause */ #line 244 "parser.y" - { - fprintf(stderr, "destroy expression array\n"); - if ((((*yyvaluep).expr_array_t)) != nullptr) { - for (auto ptr : *(((*yyvaluep).expr_array_t))) { - delete ptr; - } - delete (((*yyvaluep).expr_array_t)); - } + { + fprintf(stderr, "destroy expression array\n"); + if ((((*yyvaluep).expr_array_t)) != nullptr) { + for (auto ptr : *(((*yyvaluep).expr_array_t))) { + delete ptr; } -#line 2722 "parser.cpp" + delete (((*yyvaluep).expr_array_t)); + } +} +#line 2741 "parser.cpp" break; - case YYSYMBOL_table_reference: /* table_reference */ + case YYSYMBOL_table_reference: /* table_reference */ #line 339 "parser.y" - { - fprintf(stderr, "destroy table reference\n"); - delete (((*yyvaluep).table_reference_t)); - } -#line 2731 "parser.cpp" + { + fprintf(stderr, "destroy table reference\n"); + delete (((*yyvaluep).table_reference_t)); +} +#line 2750 "parser.cpp" break; - case YYSYMBOL_table_reference_unit: /* table_reference_unit */ + case YYSYMBOL_table_reference_unit: /* table_reference_unit */ #line 339 "parser.y" - { - fprintf(stderr, "destroy table reference\n"); - delete (((*yyvaluep).table_reference_t)); - } -#line 2740 "parser.cpp" + { + fprintf(stderr, "destroy table reference\n"); + delete (((*yyvaluep).table_reference_t)); +} +#line 2759 "parser.cpp" break; - case YYSYMBOL_table_reference_name: /* table_reference_name */ + case YYSYMBOL_table_reference_name: /* table_reference_name */ #line 339 "parser.y" - { - fprintf(stderr, "destroy table reference\n"); - delete (((*yyvaluep).table_reference_t)); - } -#line 2749 "parser.cpp" + { + fprintf(stderr, "destroy table reference\n"); + delete (((*yyvaluep).table_reference_t)); +} +#line 2768 "parser.cpp" break; - case YYSYMBOL_table_name: /* table_name */ + case YYSYMBOL_table_name: /* table_name */ #line 301 "parser.y" - { - fprintf(stderr, "destroy table table_name\n"); - if ((((*yyvaluep).table_name_t)) != nullptr) { - free(((*yyvaluep).table_name_t)->schema_name_ptr_); - free(((*yyvaluep).table_name_t)->table_name_ptr_); - delete (((*yyvaluep).table_name_t)); - } - } -#line 2762 "parser.cpp" + { + fprintf(stderr, "destroy table table_name\n"); + if ((((*yyvaluep).table_name_t)) != nullptr) { + free(((*yyvaluep).table_name_t)->schema_name_ptr_); + free(((*yyvaluep).table_name_t)->table_name_ptr_); + delete (((*yyvaluep).table_name_t)); + } +} +#line 2781 "parser.cpp" break; - case YYSYMBOL_table_alias: /* table_alias */ + case YYSYMBOL_table_alias: /* table_alias */ #line 334 "parser.y" - { - fprintf(stderr, "destroy table alias\n"); - delete (((*yyvaluep).table_alias_t)); - } -#line 2771 "parser.cpp" + { + fprintf(stderr, "destroy table alias\n"); + delete (((*yyvaluep).table_alias_t)); +} +#line 2790 "parser.cpp" break; - case YYSYMBOL_with_clause: /* with_clause */ + case YYSYMBOL_with_clause: /* with_clause */ #line 291 "parser.y" - { - fprintf(stderr, "destroy with expr list\n"); - if ((((*yyvaluep).with_expr_list_t)) != nullptr) { - for (auto ptr : *(((*yyvaluep).with_expr_list_t))) { - delete ptr; - } - delete (((*yyvaluep).with_expr_list_t)); - } + { + fprintf(stderr, "destroy with expr list\n"); + if ((((*yyvaluep).with_expr_list_t)) != nullptr) { + for (auto ptr : *(((*yyvaluep).with_expr_list_t))) { + delete ptr; } -#line 2785 "parser.cpp" + delete (((*yyvaluep).with_expr_list_t)); + } +} +#line 2804 "parser.cpp" break; - case YYSYMBOL_with_expr_list: /* with_expr_list */ + case YYSYMBOL_with_expr_list: /* with_expr_list */ #line 291 "parser.y" - { - fprintf(stderr, "destroy with expr list\n"); - if ((((*yyvaluep).with_expr_list_t)) != nullptr) { - for (auto ptr : *(((*yyvaluep).with_expr_list_t))) { - delete ptr; - } - delete (((*yyvaluep).with_expr_list_t)); - } + { + fprintf(stderr, "destroy with expr list\n"); + if ((((*yyvaluep).with_expr_list_t)) != nullptr) { + for (auto ptr : *(((*yyvaluep).with_expr_list_t))) { + delete ptr; } -#line 2799 "parser.cpp" + delete (((*yyvaluep).with_expr_list_t)); + } +} +#line 2818 "parser.cpp" break; - case YYSYMBOL_with_expr: /* with_expr */ + case YYSYMBOL_with_expr: /* with_expr */ #line 350 "parser.y" - { - fprintf(stderr, "destroy with expr\n"); - delete ((*yyvaluep).with_expr_t)->select_; - delete ((*yyvaluep).with_expr_t); - } -#line 2809 "parser.cpp" + { + fprintf(stderr, "destroy with expr\n"); + delete ((*yyvaluep).with_expr_t)->select_; + delete ((*yyvaluep).with_expr_t); +} +#line 2828 "parser.cpp" break; - case YYSYMBOL_join_clause: /* join_clause */ + case YYSYMBOL_join_clause: /* join_clause */ #line 339 "parser.y" - { - fprintf(stderr, "destroy table reference\n"); - delete (((*yyvaluep).table_reference_t)); - } -#line 2818 "parser.cpp" + { + fprintf(stderr, "destroy table reference\n"); + delete (((*yyvaluep).table_reference_t)); +} +#line 2837 "parser.cpp" break; - case YYSYMBOL_expr_array: /* expr_array */ + case YYSYMBOL_expr_array: /* expr_array */ #line 244 "parser.y" - { - fprintf(stderr, "destroy expression array\n"); - if ((((*yyvaluep).expr_array_t)) != nullptr) { - for (auto ptr : *(((*yyvaluep).expr_array_t))) { - delete ptr; - } - delete (((*yyvaluep).expr_array_t)); - } + { + fprintf(stderr, "destroy expression array\n"); + if ((((*yyvaluep).expr_array_t)) != nullptr) { + for (auto ptr : *(((*yyvaluep).expr_array_t))) { + delete ptr; } -#line 2832 "parser.cpp" + delete (((*yyvaluep).expr_array_t)); + } +} +#line 2851 "parser.cpp" break; - case YYSYMBOL_insert_row_list: /* insert_row_list */ + case YYSYMBOL_insert_row_list: /* insert_row_list */ #line 254 "parser.y" - { - fprintf(stderr, "destroy insert row list\n"); - if ((((*yyvaluep).insert_row_list_t)) != nullptr) { - for (auto ptr : *(((*yyvaluep).insert_row_list_t))) { - delete ptr; - } - delete (((*yyvaluep).insert_row_list_t)); - } + { + fprintf(stderr, "destroy insert row list\n"); + if ((((*yyvaluep).insert_row_list_t)) != nullptr) { + for (auto ptr : *(((*yyvaluep).insert_row_list_t))) { + delete ptr; } -#line 2846 "parser.cpp" + delete (((*yyvaluep).insert_row_list_t)); + } +} +#line 2865 "parser.cpp" break; - case YYSYMBOL_expr_alias: /* expr_alias */ + case YYSYMBOL_expr_alias: /* expr_alias */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2854 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2873 "parser.cpp" break; - case YYSYMBOL_expr: /* expr */ + case YYSYMBOL_expr: /* expr */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2862 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2881 "parser.cpp" break; - case YYSYMBOL_operand: /* operand */ + case YYSYMBOL_operand: /* operand */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2870 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2889 "parser.cpp" break; - case YYSYMBOL_match_tensor_expr: /* match_tensor_expr */ + case YYSYMBOL_match_tensor_expr: /* match_tensor_expr */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2878 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2897 "parser.cpp" break; - case YYSYMBOL_match_vector_expr: /* match_vector_expr */ + case YYSYMBOL_match_vector_expr: /* match_vector_expr */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2886 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2905 "parser.cpp" break; - case YYSYMBOL_match_sparse_expr: /* match_sparse_expr */ + case YYSYMBOL_match_sparse_expr: /* match_sparse_expr */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2894 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2913 "parser.cpp" break; - case YYSYMBOL_match_text_expr: /* match_text_expr */ + case YYSYMBOL_match_text_expr: /* match_text_expr */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2902 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2921 "parser.cpp" break; - case YYSYMBOL_query_expr: /* query_expr */ + case YYSYMBOL_query_expr: /* query_expr */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2910 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2929 "parser.cpp" break; - case YYSYMBOL_fusion_expr: /* fusion_expr */ + case YYSYMBOL_fusion_expr: /* fusion_expr */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2918 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2937 "parser.cpp" break; - case YYSYMBOL_sub_search: /* sub_search */ + case YYSYMBOL_sub_search: /* sub_search */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2926 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2945 "parser.cpp" break; - case YYSYMBOL_sub_search_array: /* sub_search_array */ + case YYSYMBOL_sub_search_array: /* sub_search_array */ #line 244 "parser.y" - { - fprintf(stderr, "destroy expression array\n"); - if ((((*yyvaluep).expr_array_t)) != nullptr) { - for (auto ptr : *(((*yyvaluep).expr_array_t))) { - delete ptr; - } - delete (((*yyvaluep).expr_array_t)); - } + { + fprintf(stderr, "destroy expression array\n"); + if ((((*yyvaluep).expr_array_t)) != nullptr) { + for (auto ptr : *(((*yyvaluep).expr_array_t))) { + delete ptr; } -#line 2940 "parser.cpp" + delete (((*yyvaluep).expr_array_t)); + } +} +#line 2959 "parser.cpp" break; - case YYSYMBOL_function_expr: /* function_expr */ + case YYSYMBOL_function_expr: /* function_expr */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2948 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2967 "parser.cpp" break; - case YYSYMBOL_conjunction_expr: /* conjunction_expr */ + case YYSYMBOL_conjunction_expr: /* conjunction_expr */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2956 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2975 "parser.cpp" break; - case YYSYMBOL_between_expr: /* between_expr */ + case YYSYMBOL_between_expr: /* between_expr */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2964 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2983 "parser.cpp" break; - case YYSYMBOL_in_expr: /* in_expr */ + case YYSYMBOL_in_expr: /* in_expr */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2972 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2991 "parser.cpp" break; - case YYSYMBOL_case_expr: /* case_expr */ + case YYSYMBOL_case_expr: /* case_expr */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 2980 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 2999 "parser.cpp" break; - case YYSYMBOL_case_check_array: /* case_check_array */ + case YYSYMBOL_case_check_array: /* case_check_array */ #line 362 "parser.y" - { - fprintf(stderr, "destroy case check array\n"); - if (((*yyvaluep).case_check_array_t) != nullptr) { - for (auto ptr : *(((*yyvaluep).case_check_array_t))) { - delete ptr; - } - } + { + fprintf(stderr, "destroy case check array\n"); + if(((*yyvaluep).case_check_array_t) != nullptr) { + for(auto ptr: *(((*yyvaluep).case_check_array_t))) { + delete ptr; } -#line 2993 "parser.cpp" + } +} +#line 3012 "parser.cpp" break; - case YYSYMBOL_cast_expr: /* cast_expr */ + case YYSYMBOL_cast_expr: /* cast_expr */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 3001 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 3020 "parser.cpp" break; - case YYSYMBOL_subquery_expr: /* subquery_expr */ + case YYSYMBOL_subquery_expr: /* subquery_expr */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 3009 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 3028 "parser.cpp" break; - case YYSYMBOL_column_expr: /* column_expr */ + case YYSYMBOL_column_expr: /* column_expr */ #line 326 "parser.y" - { - delete (((*yyvaluep).expr_t)); - } -#line 3017 "parser.cpp" + { + delete (((*yyvaluep).expr_t)); +} +#line 3036 "parser.cpp" break; - case YYSYMBOL_constant_expr: /* constant_expr */ + case YYSYMBOL_constant_expr: /* constant_expr */ #line 330 "parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } -#line 3025 "parser.cpp" + { + delete (((*yyvaluep).const_expr_t)); +} +#line 3044 "parser.cpp" break; - case YYSYMBOL_common_array_expr: /* common_array_expr */ + case YYSYMBOL_common_array_expr: /* common_array_expr */ #line 330 "parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } -#line 3033 "parser.cpp" + { + delete (((*yyvaluep).const_expr_t)); +} +#line 3052 "parser.cpp" break; - case YYSYMBOL_common_sparse_array_expr: /* common_sparse_array_expr */ + case YYSYMBOL_common_sparse_array_expr: /* common_sparse_array_expr */ #line 330 "parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } -#line 3041 "parser.cpp" + { + delete (((*yyvaluep).const_expr_t)); +} +#line 3060 "parser.cpp" break; - case YYSYMBOL_subarray_array_expr: /* subarray_array_expr */ + case YYSYMBOL_subarray_array_expr: /* subarray_array_expr */ #line 330 "parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } -#line 3049 "parser.cpp" + { + delete (((*yyvaluep).const_expr_t)); +} +#line 3068 "parser.cpp" break; - case YYSYMBOL_unclosed_subarray_array_expr: /* unclosed_subarray_array_expr */ + case YYSYMBOL_unclosed_subarray_array_expr: /* unclosed_subarray_array_expr */ #line 330 "parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } -#line 3057 "parser.cpp" + { + delete (((*yyvaluep).const_expr_t)); +} +#line 3076 "parser.cpp" break; - case YYSYMBOL_sparse_array_expr: /* sparse_array_expr */ + case YYSYMBOL_sparse_array_expr: /* sparse_array_expr */ #line 330 "parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } -#line 3065 "parser.cpp" + { + delete (((*yyvaluep).const_expr_t)); +} +#line 3084 "parser.cpp" break; - case YYSYMBOL_long_sparse_array_expr: /* long_sparse_array_expr */ + case YYSYMBOL_long_sparse_array_expr: /* long_sparse_array_expr */ #line 330 "parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } -#line 3073 "parser.cpp" + { + delete (((*yyvaluep).const_expr_t)); +} +#line 3092 "parser.cpp" break; - case YYSYMBOL_unclosed_long_sparse_array_expr: /* unclosed_long_sparse_array_expr */ + case YYSYMBOL_unclosed_long_sparse_array_expr: /* unclosed_long_sparse_array_expr */ #line 330 "parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } -#line 3081 "parser.cpp" + { + delete (((*yyvaluep).const_expr_t)); +} +#line 3100 "parser.cpp" break; - case YYSYMBOL_double_sparse_array_expr: /* double_sparse_array_expr */ + case YYSYMBOL_double_sparse_array_expr: /* double_sparse_array_expr */ #line 330 "parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } -#line 3089 "parser.cpp" + { + delete (((*yyvaluep).const_expr_t)); +} +#line 3108 "parser.cpp" break; - case YYSYMBOL_unclosed_double_sparse_array_expr: /* unclosed_double_sparse_array_expr */ + case YYSYMBOL_unclosed_double_sparse_array_expr: /* unclosed_double_sparse_array_expr */ #line 330 "parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } -#line 3097 "parser.cpp" + { + delete (((*yyvaluep).const_expr_t)); +} +#line 3116 "parser.cpp" break; - case YYSYMBOL_empty_array_expr: /* empty_array_expr */ + case YYSYMBOL_empty_array_expr: /* empty_array_expr */ #line 330 "parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } -#line 3105 "parser.cpp" + { + delete (((*yyvaluep).const_expr_t)); +} +#line 3124 "parser.cpp" break; - case YYSYMBOL_int_sparse_ele: /* int_sparse_ele */ + case YYSYMBOL_int_sparse_ele: /* int_sparse_ele */ #line 371 "parser.y" - { - delete (((*yyvaluep).int_sparse_ele_t)); - } -#line 3113 "parser.cpp" + { + delete (((*yyvaluep).int_sparse_ele_t)); +} +#line 3132 "parser.cpp" break; - case YYSYMBOL_float_sparse_ele: /* float_sparse_ele */ + case YYSYMBOL_float_sparse_ele: /* float_sparse_ele */ #line 375 "parser.y" - { - delete (((*yyvaluep).float_sparse_ele_t)); - } -#line 3121 "parser.cpp" + { + delete (((*yyvaluep).float_sparse_ele_t)); +} +#line 3140 "parser.cpp" break; - case YYSYMBOL_array_expr: /* array_expr */ + case YYSYMBOL_array_expr: /* array_expr */ #line 330 "parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } -#line 3129 "parser.cpp" + { + delete (((*yyvaluep).const_expr_t)); +} +#line 3148 "parser.cpp" break; - case YYSYMBOL_long_array_expr: /* long_array_expr */ + case YYSYMBOL_long_array_expr: /* long_array_expr */ #line 330 "parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } -#line 3137 "parser.cpp" + { + delete (((*yyvaluep).const_expr_t)); +} +#line 3156 "parser.cpp" break; - case YYSYMBOL_unclosed_long_array_expr: /* unclosed_long_array_expr */ + case YYSYMBOL_unclosed_long_array_expr: /* unclosed_long_array_expr */ #line 330 "parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } -#line 3145 "parser.cpp" + { + delete (((*yyvaluep).const_expr_t)); +} +#line 3164 "parser.cpp" break; - case YYSYMBOL_double_array_expr: /* double_array_expr */ + case YYSYMBOL_double_array_expr: /* double_array_expr */ #line 330 "parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } -#line 3153 "parser.cpp" + { + delete (((*yyvaluep).const_expr_t)); +} +#line 3172 "parser.cpp" break; - case YYSYMBOL_unclosed_double_array_expr: /* unclosed_double_array_expr */ + case YYSYMBOL_unclosed_double_array_expr: /* unclosed_double_array_expr */ #line 330 "parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } -#line 3161 "parser.cpp" + { + delete (((*yyvaluep).const_expr_t)); +} +#line 3180 "parser.cpp" break; - case YYSYMBOL_interval_expr: /* interval_expr */ + case YYSYMBOL_interval_expr: /* interval_expr */ #line 330 "parser.y" - { - delete (((*yyvaluep).const_expr_t)); - } -#line 3169 "parser.cpp" + { + delete (((*yyvaluep).const_expr_t)); +} +#line 3188 "parser.cpp" break; - case YYSYMBOL_file_path: /* file_path */ + case YYSYMBOL_file_path: /* file_path */ #line 317 "parser.y" - { - free(((*yyvaluep).str_value)); - } -#line 3177 "parser.cpp" + { + free(((*yyvaluep).str_value)); +} +#line 3196 "parser.cpp" break; - case YYSYMBOL_if_not_exists_info: /* if_not_exists_info */ + case YYSYMBOL_if_not_exists_info: /* if_not_exists_info */ #line 207 "parser.y" - { - fprintf(stderr, "destroy if not exists info\n"); - if ((((*yyvaluep).if_not_exists_info_t)) != nullptr) { - delete (((*yyvaluep).if_not_exists_info_t)); - } - } -#line 3188 "parser.cpp" + { + fprintf(stderr, "destroy if not exists info\n"); + if ((((*yyvaluep).if_not_exists_info_t)) != nullptr) { + delete (((*yyvaluep).if_not_exists_info_t)); + } +} +#line 3207 "parser.cpp" break; - case YYSYMBOL_with_index_param_list: /* with_index_param_list */ + case YYSYMBOL_with_index_param_list: /* with_index_param_list */ #line 190 "parser.y" - { - fprintf(stderr, "destroy create index param list\n"); - if ((((*yyvaluep).with_index_param_list_t)) != nullptr) { - for (auto ptr : *(((*yyvaluep).with_index_param_list_t))) { - delete ptr; - } - delete (((*yyvaluep).with_index_param_list_t)); - } + { + fprintf(stderr, "destroy create index param list\n"); + if ((((*yyvaluep).with_index_param_list_t)) != nullptr) { + for (auto ptr : *(((*yyvaluep).with_index_param_list_t))) { + delete ptr; } -#line 3202 "parser.cpp" + delete (((*yyvaluep).with_index_param_list_t)); + } +} +#line 3221 "parser.cpp" break; - case YYSYMBOL_optional_table_properties_list: /* optional_table_properties_list */ + case YYSYMBOL_optional_table_properties_list: /* optional_table_properties_list */ #line 190 "parser.y" - { - fprintf(stderr, "destroy create index param list\n"); - if ((((*yyvaluep).with_index_param_list_t)) != nullptr) { - for (auto ptr : *(((*yyvaluep).with_index_param_list_t))) { - delete ptr; - } - delete (((*yyvaluep).with_index_param_list_t)); - } + { + fprintf(stderr, "destroy create index param list\n"); + if ((((*yyvaluep).with_index_param_list_t)) != nullptr) { + for (auto ptr : *(((*yyvaluep).with_index_param_list_t))) { + delete ptr; } -#line 3216 "parser.cpp" + delete (((*yyvaluep).with_index_param_list_t)); + } +} +#line 3235 "parser.cpp" break; - case YYSYMBOL_index_info: /* index_info */ + case YYSYMBOL_index_info: /* index_info */ #line 183 "parser.y" - { - fprintf(stderr, "destroy index info\n"); - if ((((*yyvaluep).index_info_t)) != nullptr) { - delete (((*yyvaluep).index_info_t)); - } - } -#line 3227 "parser.cpp" + { + fprintf(stderr, "destroy index info\n"); + if ((((*yyvaluep).index_info_t)) != nullptr) { + delete (((*yyvaluep).index_info_t)); + } +} +#line 3246 "parser.cpp" break; - default: - break; + default: + break; } - YY_IGNORE_MAYBE_UNINITIALIZED_END + YY_IGNORE_MAYBE_UNINITIALIZED_END } + + + + + /*----------. | yyparse. | `----------*/ -int yyparse(void *scanner, infinity::ParserResult *result) { - /* Lookahead token kind. */ - int yychar; +int +yyparse (void *scanner, infinity::ParserResult* result) +{ +/* Lookahead token kind. */ +int yychar; - /* The semantic value of the lookahead symbol. */ - /* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ - YY_INITIAL_VALUE(static YYSTYPE yyval_default;) - YYSTYPE yylval YY_INITIAL_VALUE(= yyval_default); - /* Location data for the lookahead symbol. */ - static YYLTYPE yyloc_default -#if defined SQLLTYPE_IS_TRIVIAL && SQLLTYPE_IS_TRIVIAL - = {1, 1, 1, 1} -#endif - ; - YYLTYPE yylloc = yyloc_default; +/* The semantic value of the lookahead symbol. */ +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); + +/* Location data for the lookahead symbol. */ +static YYLTYPE yyloc_default +# if defined SQLLTYPE_IS_TRIVIAL && SQLLTYPE_IS_TRIVIAL + = { 1, 1, 1, 1 } +# endif +; +YYLTYPE yylloc = yyloc_default; /* Number of syntax errors so far. */ int yynerrs = 0; @@ -2873,6596 +3309,6337 @@ int yyparse(void *scanner, infinity::ParserResult *result) { YYLTYPE *yyls = yylsa; YYLTYPE *yylsp = yyls; - int yyn; - /* The return value of yyparse. */ - int yyresult; - /* Lookahead symbol kind. */ - yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - YYLTYPE yyloc; + int yyn; + /* The return value of yyparse. */ + int yyresult; + /* Lookahead symbol kind. */ + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + YYLTYPE yyloc; - /* The locations where the error started and ended. */ - YYLTYPE yyerror_range[3]; + /* The locations where the error started and ended. */ + YYLTYPE yyerror_range[3]; - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; - YYDPRINTF((stderr, "Starting parse\n")); + YYDPRINTF ((stderr, "Starting parse\n")); + + yychar = SQLEMPTY; /* Cause a token to be read. */ - yychar = SQLEMPTY; /* Cause a token to be read. */ /* User initialization code. */ #line 87 "parser.y" - { - // Initialize - yylloc.first_column = 0; - yylloc.last_column = 0; - yylloc.first_line = 0; - yylloc.last_line = 0; - yylloc.total_column = 0; - yylloc.string_length = 0; - } +{ + // Initialize + yylloc.first_column = 0; + yylloc.last_column = 0; + yylloc.first_line = 0; + yylloc.last_line = 0; + yylloc.total_column = 0; + yylloc.string_length = 0; +} -#line 3335 "parser.cpp" +#line 3354 "parser.cpp" + + yylsp[0] = yylloc; + goto yysetstate; - yylsp[0] = yylloc; - goto yysetstate; /*------------------------------------------------------------. | yynewstate -- push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + /*--------------------------------------------------------------------. | yysetstate -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: - YYDPRINTF((stderr, "Entering state %d\n", yystate)); - YY_ASSERT(0 <= yystate && yystate < YYNSTATES); - YY_IGNORE_USELESS_CAST_BEGIN - *yyssp = YY_CAST(yy_state_t, yystate); - YY_IGNORE_USELESS_CAST_END - YY_STACK_PRINT(yyss, yyssp); - - if (yyss + yystacksize - 1 <= yyssp) + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + YY_IGNORE_USELESS_CAST_BEGIN + *yyssp = YY_CAST (yy_state_t, yystate); + YY_IGNORE_USELESS_CAST_END + YY_STACK_PRINT (yyss, yyssp); + + if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE - YYNOMEM; + YYNOMEM; #else { - /* Get the current used size of the three stacks, in elements. */ - YYPTRDIFF_T yysize = yyssp - yyss + 1; - -#if defined yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - yy_state_t *yyss1 = yyss; - YYSTYPE *yyvs1 = yyvs; - YYLTYPE *yyls1 = yyls; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow(YY_("memory exhausted"), - &yyss1, - yysize * YYSIZEOF(*yyssp), - &yyvs1, - yysize * YYSIZEOF(*yyvsp), - &yyls1, - yysize * YYSIZEOF(*yylsp), - &yystacksize); - yyss = yyss1; - yyvs = yyvs1; - yyls = yyls1; - } -#else /* defined YYSTACK_RELOCATE */ - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - YYNOMEM; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yy_state_t *yyss1 = yyss; - union yyalloc *yyptr = YY_CAST(union yyalloc *, YYSTACK_ALLOC(YY_CAST(YYSIZE_T, YYSTACK_BYTES(yystacksize)))); - if (!yyptr) - YYNOMEM; - YYSTACK_RELOCATE(yyss_alloc, yyss); - YYSTACK_RELOCATE(yyvs_alloc, yyvs); - YYSTACK_RELOCATE(yyls_alloc, yyls); -#undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE(yyss1); - } -#endif - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - yylsp = yyls + yysize - 1; - - YY_IGNORE_USELESS_CAST_BEGIN - YYDPRINTF((stderr, "Stack size increased to %ld\n", YY_CAST(long, yystacksize))); - YY_IGNORE_USELESS_CAST_END - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + /* Get the current used size of the three stacks, in elements. */ + YYPTRDIFF_T yysize = yyssp - yyss + 1; + +# if defined yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + yy_state_t *yyss1 = yyss; + YYSTYPE *yyvs1 = yyvs; + YYLTYPE *yyls1 = yyls; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * YYSIZEOF (*yyssp), + &yyvs1, yysize * YYSIZEOF (*yyvsp), + &yyls1, yysize * YYSIZEOF (*yylsp), + &yystacksize); + yyss = yyss1; + yyvs = yyvs1; + yyls = yyls1; + } +# else /* defined YYSTACK_RELOCATE */ + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + YYNOMEM; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yy_state_t *yyss1 = yyss; + union yyalloc *yyptr = + YY_CAST (union yyalloc *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); + if (! yyptr) + YYNOMEM; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyls_alloc, yyls); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + yylsp = yyls + yysize - 1; + + YY_IGNORE_USELESS_CAST_BEGIN + YYDPRINTF ((stderr, "Stack size increased to %ld\n", + YY_CAST (long, yystacksize))); + YY_IGNORE_USELESS_CAST_END + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - if (yystate == YYFINAL) - YYACCEPT; - goto yybackup; + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + /*-----------. | yybackup. | `-----------*/ yybackup: - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default(yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ - if (yychar == SQLEMPTY) { - YYDPRINTF((stderr, "Reading a token\n")); - yychar = yylex(&yylval, &yylloc, scanner); - } - - if (yychar <= SQLEOF) { - yychar = SQLEOF; - yytoken = YYSYMBOL_YYEOF; - YYDPRINTF((stderr, "Now at end of input.\n")); - } else if (yychar == SQLerror) { - /* The scanner already issued an error message, process directly - to error recovery. But do not keep the error token as - lookahead, it is too special and may lead us to an endless - loop in error recovery. */ - yychar = SQLUNDEF; - yytoken = YYSYMBOL_YYerror; - yyerror_range[1] = yylloc; - goto yyerrlab1; - } else { - yytoken = YYTRANSLATE(yychar); - YY_SYMBOL_PRINT("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) { - if (yytable_value_is_error(yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT("Shifting", yytoken, &yylval, &yylloc); - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - *++yylsp = yylloc; - - /* Discard the shifted token. */ - yychar = SQLEMPTY; - goto yynewstate; + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ + if (yychar == SQLEMPTY) + { + YYDPRINTF ((stderr, "Reading a token\n")); + yychar = yylex (&yylval, &yylloc, scanner); + } + + if (yychar <= SQLEOF) + { + yychar = SQLEOF; + yytoken = YYSYMBOL_YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else if (yychar == SQLerror) + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + yychar = SQLUNDEF; + yytoken = YYSYMBOL_YYerror; + yyerror_range[1] = yylloc; + goto yyerrlab1; + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yytable_value_is_error (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + *++yylsp = yylloc; + + /* Discard the shifted token. */ + yychar = SQLEMPTY; + goto yynewstate; + /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + /*-----------------------------. | yyreduce -- do a reduction. | `-----------------------------*/ yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1 - yylen]; - - /* Default location. */ - YYLLOC_DEFAULT(yyloc, (yylsp - yylen), yylen); - yyerror_range[1] = yyloc; - YY_REDUCE_PRINT(yyn); - switch (yyn) { - case 2: /* input_pattern: statement_list semicolon */ + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + /* Default location. */ + YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); + yyerror_range[1] = yyloc; + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: /* input_pattern: statement_list semicolon */ #line 503 "parser.y" - { - result->statements_ptr_ = (yyvsp[-1].stmt_array); - } -#line 3550 "parser.cpp" - break; + { + result->statements_ptr_ = (yyvsp[-1].stmt_array); +} +#line 3569 "parser.cpp" + break; - case 3: /* statement_list: statement */ + case 3: /* statement_list: statement */ #line 507 "parser.y" - { - (yyvsp[0].base_stmt)->stmt_length_ = yylloc.string_length; - yylloc.string_length = 0; - (yyval.stmt_array) = new std::vector(); - (yyval.stmt_array)->push_back((yyvsp[0].base_stmt)); - } -#line 3561 "parser.cpp" - break; + { + (yyvsp[0].base_stmt)->stmt_length_ = yylloc.string_length; + yylloc.string_length = 0; + (yyval.stmt_array) = new std::vector(); + (yyval.stmt_array)->push_back((yyvsp[0].base_stmt)); +} +#line 3580 "parser.cpp" + break; - case 4: /* statement_list: statement_list ';' statement */ + case 4: /* statement_list: statement_list ';' statement */ #line 513 "parser.y" - { - (yyvsp[0].base_stmt)->stmt_length_ = yylloc.string_length; - yylloc.string_length = 0; - (yyvsp[-2].stmt_array)->push_back((yyvsp[0].base_stmt)); - (yyval.stmt_array) = (yyvsp[-2].stmt_array); - } -#line 3572 "parser.cpp" - break; + { + (yyvsp[0].base_stmt)->stmt_length_ = yylloc.string_length; + yylloc.string_length = 0; + (yyvsp[-2].stmt_array)->push_back((yyvsp[0].base_stmt)); + (yyval.stmt_array) = (yyvsp[-2].stmt_array); +} +#line 3591 "parser.cpp" + break; - case 5: /* statement: create_statement */ + case 5: /* statement: create_statement */ #line 520 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].create_stmt); - } -#line 3578 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].create_stmt); } +#line 3597 "parser.cpp" + break; - case 6: /* statement: drop_statement */ + case 6: /* statement: drop_statement */ #line 521 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].drop_stmt); - } -#line 3584 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].drop_stmt); } +#line 3603 "parser.cpp" + break; - case 7: /* statement: copy_statement */ + case 7: /* statement: copy_statement */ #line 522 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].copy_stmt); - } -#line 3590 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].copy_stmt); } +#line 3609 "parser.cpp" + break; - case 8: /* statement: show_statement */ + case 8: /* statement: show_statement */ #line 523 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].show_stmt); - } -#line 3596 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].show_stmt); } +#line 3615 "parser.cpp" + break; - case 9: /* statement: select_statement */ + case 9: /* statement: select_statement */ #line 524 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].select_stmt); - } -#line 3602 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].select_stmt); } +#line 3621 "parser.cpp" + break; - case 10: /* statement: delete_statement */ + case 10: /* statement: delete_statement */ #line 525 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].delete_stmt); - } -#line 3608 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].delete_stmt); } +#line 3627 "parser.cpp" + break; - case 11: /* statement: update_statement */ + case 11: /* statement: update_statement */ #line 526 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].update_stmt); - } -#line 3614 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].update_stmt); } +#line 3633 "parser.cpp" + break; - case 12: /* statement: insert_statement */ + case 12: /* statement: insert_statement */ #line 527 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].insert_stmt); - } -#line 3620 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].insert_stmt); } +#line 3639 "parser.cpp" + break; - case 13: /* statement: explain_statement */ + case 13: /* statement: explain_statement */ #line 528 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].explain_stmt); - } -#line 3626 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].explain_stmt); } +#line 3645 "parser.cpp" + break; - case 14: /* statement: flush_statement */ + case 14: /* statement: flush_statement */ #line 529 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].flush_stmt); - } -#line 3632 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].flush_stmt); } +#line 3651 "parser.cpp" + break; - case 15: /* statement: optimize_statement */ + case 15: /* statement: optimize_statement */ #line 530 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].optimize_stmt); - } -#line 3638 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].optimize_stmt); } +#line 3657 "parser.cpp" + break; - case 16: /* statement: command_statement */ + case 16: /* statement: command_statement */ #line 531 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].command_stmt); - } -#line 3644 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].command_stmt); } +#line 3663 "parser.cpp" + break; - case 17: /* statement: compact_statement */ + case 17: /* statement: compact_statement */ #line 532 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].compact_stmt); - } -#line 3650 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].compact_stmt); } +#line 3669 "parser.cpp" + break; - case 18: /* statement: admin_statement */ + case 18: /* statement: admin_statement */ #line 533 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].admin_stmt); - } -#line 3656 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].admin_stmt); } +#line 3675 "parser.cpp" + break; - case 19: /* statement: alter_statement */ + case 19: /* statement: alter_statement */ #line 534 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].alter_stmt); - } -#line 3662 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].alter_stmt); } +#line 3681 "parser.cpp" + break; - case 20: /* explainable_statement: create_statement */ + case 20: /* explainable_statement: create_statement */ #line 536 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].create_stmt); - } -#line 3668 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].create_stmt); } +#line 3687 "parser.cpp" + break; - case 21: /* explainable_statement: drop_statement */ + case 21: /* explainable_statement: drop_statement */ #line 537 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].drop_stmt); - } -#line 3674 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].drop_stmt); } +#line 3693 "parser.cpp" + break; - case 22: /* explainable_statement: copy_statement */ + case 22: /* explainable_statement: copy_statement */ #line 538 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].copy_stmt); - } -#line 3680 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].copy_stmt); } +#line 3699 "parser.cpp" + break; - case 23: /* explainable_statement: show_statement */ + case 23: /* explainable_statement: show_statement */ #line 539 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].show_stmt); - } -#line 3686 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].show_stmt); } +#line 3705 "parser.cpp" + break; - case 24: /* explainable_statement: select_statement */ + case 24: /* explainable_statement: select_statement */ #line 540 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].select_stmt); - } -#line 3692 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].select_stmt); } +#line 3711 "parser.cpp" + break; - case 25: /* explainable_statement: delete_statement */ + case 25: /* explainable_statement: delete_statement */ #line 541 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].delete_stmt); - } -#line 3698 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].delete_stmt); } +#line 3717 "parser.cpp" + break; - case 26: /* explainable_statement: update_statement */ + case 26: /* explainable_statement: update_statement */ #line 542 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].update_stmt); - } -#line 3704 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].update_stmt); } +#line 3723 "parser.cpp" + break; - case 27: /* explainable_statement: insert_statement */ + case 27: /* explainable_statement: insert_statement */ #line 543 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].insert_stmt); - } -#line 3710 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].insert_stmt); } +#line 3729 "parser.cpp" + break; - case 28: /* explainable_statement: flush_statement */ + case 28: /* explainable_statement: flush_statement */ #line 544 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].flush_stmt); - } -#line 3716 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].flush_stmt); } +#line 3735 "parser.cpp" + break; - case 29: /* explainable_statement: optimize_statement */ + case 29: /* explainable_statement: optimize_statement */ #line 545 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].optimize_stmt); - } -#line 3722 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].optimize_stmt); } +#line 3741 "parser.cpp" + break; - case 30: /* explainable_statement: command_statement */ + case 30: /* explainable_statement: command_statement */ #line 546 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].command_stmt); - } -#line 3728 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].command_stmt); } +#line 3747 "parser.cpp" + break; - case 31: /* explainable_statement: compact_statement */ + case 31: /* explainable_statement: compact_statement */ #line 547 "parser.y" - { - (yyval.base_stmt) = (yyvsp[0].compact_stmt); - } -#line 3734 "parser.cpp" - break; + { (yyval.base_stmt) = (yyvsp[0].compact_stmt); } +#line 3753 "parser.cpp" + break; - case 32: /* create_statement: CREATE DATABASE if_not_exists IDENTIFIER COMMENT STRING */ + case 32: /* create_statement: CREATE DATABASE if_not_exists IDENTIFIER COMMENT STRING */ #line 554 "parser.y" - { - (yyval.create_stmt) = new infinity::CreateStatement(); - std::shared_ptr create_schema_info = std::make_shared(); - - ParserHelper::ToLower((yyvsp[-2].str_value)); - create_schema_info->schema_name_ = (yyvsp[-2].str_value); - free((yyvsp[-2].str_value)); - if (create_schema_info->schema_name_.empty()) { - yyerror(&yyloc, scanner, result, "Empty database name is given."); - YYERROR; - } + { + (yyval.create_stmt) = new infinity::CreateStatement(); + std::shared_ptr create_schema_info = std::make_shared(); + + ParserHelper::ToLower((yyvsp[-2].str_value)); + create_schema_info->schema_name_ = (yyvsp[-2].str_value); + free((yyvsp[-2].str_value)); + if(create_schema_info->schema_name_.empty()) { + yyerror(&yyloc, scanner, result, "Empty database name is given."); + YYERROR; + } - (yyval.create_stmt)->create_info_ = create_schema_info; - (yyval.create_stmt)->create_info_->conflict_type_ = - (yyvsp[-3].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; - (yyval.create_stmt)->create_info_->comment_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - } -#line 3756 "parser.cpp" - break; + (yyval.create_stmt)->create_info_ = create_schema_info; + (yyval.create_stmt)->create_info_->conflict_type_ = (yyvsp[-3].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; + (yyval.create_stmt)->create_info_->comment_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); +} +#line 3775 "parser.cpp" + break; - case 33: /* create_statement: CREATE DATABASE if_not_exists IDENTIFIER */ + case 33: /* create_statement: CREATE DATABASE if_not_exists IDENTIFIER */ #line 571 "parser.y" - { - (yyval.create_stmt) = new infinity::CreateStatement(); - std::shared_ptr create_schema_info = std::make_shared(); - - ParserHelper::ToLower((yyvsp[0].str_value)); - create_schema_info->schema_name_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - if (create_schema_info->schema_name_.empty()) { - yyerror(&yyloc, scanner, result, "Empty database name is given."); - YYERROR; - } + { + (yyval.create_stmt) = new infinity::CreateStatement(); + std::shared_ptr create_schema_info = std::make_shared(); + + ParserHelper::ToLower((yyvsp[0].str_value)); + create_schema_info->schema_name_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); + if(create_schema_info->schema_name_.empty()) { + yyerror(&yyloc, scanner, result, "Empty database name is given."); + YYERROR; + } - (yyval.create_stmt)->create_info_ = create_schema_info; - (yyval.create_stmt)->create_info_->conflict_type_ = - (yyvsp[-1].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; - } -#line 3776 "parser.cpp" - break; + (yyval.create_stmt)->create_info_ = create_schema_info; + (yyval.create_stmt)->create_info_->conflict_type_ = (yyvsp[-1].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; +} +#line 3795 "parser.cpp" + break; - case 34: /* create_statement: CREATE COLLECTION if_not_exists table_name */ + case 34: /* create_statement: CREATE COLLECTION if_not_exists table_name */ #line 588 "parser.y" - { - (yyval.create_stmt) = new infinity::CreateStatement(); - std::shared_ptr create_collection_info = std::make_shared(); - if ((yyvsp[0].table_name_t)->schema_name_ptr_ != nullptr) { - create_collection_info->schema_name_ = (yyvsp[0].table_name_t)->schema_name_ptr_; - free((yyvsp[0].table_name_t)->schema_name_ptr_); - } - create_collection_info->collection_name_ = (yyvsp[0].table_name_t)->table_name_ptr_; - free((yyvsp[0].table_name_t)->table_name_ptr_); - (yyval.create_stmt)->create_info_ = create_collection_info; - (yyval.create_stmt)->create_info_->conflict_type_ = - (yyvsp[-1].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; - delete (yyvsp[0].table_name_t); - } -#line 3794 "parser.cpp" - break; + { + (yyval.create_stmt) = new infinity::CreateStatement(); + std::shared_ptr create_collection_info = std::make_shared(); + if((yyvsp[0].table_name_t)->schema_name_ptr_ != nullptr) { + create_collection_info->schema_name_ = (yyvsp[0].table_name_t)->schema_name_ptr_; + free((yyvsp[0].table_name_t)->schema_name_ptr_); + } + create_collection_info->collection_name_ = (yyvsp[0].table_name_t)->table_name_ptr_; + free((yyvsp[0].table_name_t)->table_name_ptr_); + (yyval.create_stmt)->create_info_ = create_collection_info; + (yyval.create_stmt)->create_info_->conflict_type_ = (yyvsp[-1].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; + delete (yyvsp[0].table_name_t); +} +#line 3813 "parser.cpp" + break; - case 35: /* create_statement: CREATE TABLE if_not_exists table_name '(' table_element_array ')' optional_table_properties_list */ + case 35: /* create_statement: CREATE TABLE if_not_exists table_name '(' table_element_array ')' optional_table_properties_list */ #line 604 "parser.y" - { - (yyval.create_stmt) = new infinity::CreateStatement(); - std::shared_ptr create_table_info = std::make_shared(); - if ((yyvsp[-4].table_name_t)->schema_name_ptr_ != nullptr) { - create_table_info->schema_name_ = (yyvsp[-4].table_name_t)->schema_name_ptr_; - free((yyvsp[-4].table_name_t)->schema_name_ptr_); - } - create_table_info->table_name_ = (yyvsp[-4].table_name_t)->table_name_ptr_; - free((yyvsp[-4].table_name_t)->table_name_ptr_); - delete (yyvsp[-4].table_name_t); - - for (infinity::TableElement *&element : *(yyvsp[-2].table_element_array_t)) { - if (element->type_ == infinity::TableElementType::kColumn) { - create_table_info->column_defs_.emplace_back((infinity::ColumnDef *)element); - } else { - create_table_info->constraints_.emplace_back((infinity::TableConstraint *)element); - } - } - delete (yyvsp[-2].table_element_array_t); - - if ((yyvsp[0].with_index_param_list_t) != nullptr) { - create_table_info->properties_ = std::move(*(yyvsp[0].with_index_param_list_t)); - delete (yyvsp[0].with_index_param_list_t); - } + { + (yyval.create_stmt) = new infinity::CreateStatement(); + std::shared_ptr create_table_info = std::make_shared(); + if((yyvsp[-4].table_name_t)->schema_name_ptr_ != nullptr) { + create_table_info->schema_name_ = (yyvsp[-4].table_name_t)->schema_name_ptr_; + free((yyvsp[-4].table_name_t)->schema_name_ptr_); + } + create_table_info->table_name_ = (yyvsp[-4].table_name_t)->table_name_ptr_; + free((yyvsp[-4].table_name_t)->table_name_ptr_); + delete (yyvsp[-4].table_name_t); - (yyval.create_stmt)->create_info_ = create_table_info; - (yyval.create_stmt)->create_info_->conflict_type_ = - (yyvsp[-5].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; + for (infinity::TableElement*& element : *(yyvsp[-2].table_element_array_t)) { + if(element->type_ == infinity::TableElementType::kColumn) { + create_table_info->column_defs_.emplace_back((infinity::ColumnDef*)element); + } else { + create_table_info->constraints_.emplace_back((infinity::TableConstraint*)element); } -#line 3827 "parser.cpp" - break; + } + delete (yyvsp[-2].table_element_array_t); + + if ((yyvsp[0].with_index_param_list_t) != nullptr) { + create_table_info->properties_ = std::move(*(yyvsp[0].with_index_param_list_t)); + delete (yyvsp[0].with_index_param_list_t); + } + + (yyval.create_stmt)->create_info_ = create_table_info; + (yyval.create_stmt)->create_info_->conflict_type_ = (yyvsp[-5].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; +} +#line 3846 "parser.cpp" + break; - case 36: /* create_statement: CREATE TABLE if_not_exists table_name AS select_statement */ + case 36: /* create_statement: CREATE TABLE if_not_exists table_name AS select_statement */ #line 633 "parser.y" - { - (yyval.create_stmt) = new infinity::CreateStatement(); - std::shared_ptr create_table_info = std::make_shared(); - if ((yyvsp[-2].table_name_t)->schema_name_ptr_ != nullptr) { - create_table_info->schema_name_ = (yyvsp[-2].table_name_t)->schema_name_ptr_; - free((yyvsp[-2].table_name_t)->schema_name_ptr_); - } - create_table_info->table_name_ = (yyvsp[-2].table_name_t)->table_name_ptr_; - free((yyvsp[-2].table_name_t)->table_name_ptr_); - delete (yyvsp[-2].table_name_t); + { + (yyval.create_stmt) = new infinity::CreateStatement(); + std::shared_ptr create_table_info = std::make_shared(); + if((yyvsp[-2].table_name_t)->schema_name_ptr_ != nullptr) { + create_table_info->schema_name_ = (yyvsp[-2].table_name_t)->schema_name_ptr_; + free((yyvsp[-2].table_name_t)->schema_name_ptr_); + } + create_table_info->table_name_ = (yyvsp[-2].table_name_t)->table_name_ptr_; + free((yyvsp[-2].table_name_t)->table_name_ptr_); + delete (yyvsp[-2].table_name_t); - create_table_info->conflict_type_ = (yyvsp[-3].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; - create_table_info->select_ = (yyvsp[0].select_stmt); - (yyval.create_stmt)->create_info_ = create_table_info; - } -#line 3847 "parser.cpp" - break; + create_table_info->conflict_type_ = (yyvsp[-3].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; + create_table_info->select_ = (yyvsp[0].select_stmt); + (yyval.create_stmt)->create_info_ = create_table_info; +} +#line 3866 "parser.cpp" + break; - case 37: /* create_statement: CREATE TABLE if_not_exists table_name '(' table_element_array ')' optional_table_properties_list COMMENT STRING - */ + case 37: /* create_statement: CREATE TABLE if_not_exists table_name '(' table_element_array ')' optional_table_properties_list COMMENT STRING */ #line 648 "parser.y" - { - (yyval.create_stmt) = new infinity::CreateStatement(); - std::shared_ptr create_table_info = std::make_shared(); - if ((yyvsp[-6].table_name_t)->schema_name_ptr_ != nullptr) { - create_table_info->schema_name_ = (yyvsp[-6].table_name_t)->schema_name_ptr_; - free((yyvsp[-6].table_name_t)->schema_name_ptr_); - } - create_table_info->table_name_ = (yyvsp[-6].table_name_t)->table_name_ptr_; - free((yyvsp[-6].table_name_t)->table_name_ptr_); - delete (yyvsp[-6].table_name_t); - - for (infinity::TableElement *&element : *(yyvsp[-4].table_element_array_t)) { - if (element->type_ == infinity::TableElementType::kColumn) { - create_table_info->column_defs_.emplace_back((infinity::ColumnDef *)element); - } else { - create_table_info->constraints_.emplace_back((infinity::TableConstraint *)element); - } - } - delete (yyvsp[-4].table_element_array_t); + { + (yyval.create_stmt) = new infinity::CreateStatement(); + std::shared_ptr create_table_info = std::make_shared(); + if((yyvsp[-6].table_name_t)->schema_name_ptr_ != nullptr) { + create_table_info->schema_name_ = (yyvsp[-6].table_name_t)->schema_name_ptr_; + free((yyvsp[-6].table_name_t)->schema_name_ptr_); + } + create_table_info->table_name_ = (yyvsp[-6].table_name_t)->table_name_ptr_; + free((yyvsp[-6].table_name_t)->table_name_ptr_); + delete (yyvsp[-6].table_name_t); - if ((yyvsp[-2].with_index_param_list_t) != nullptr) { - create_table_info->properties_ = std::move(*(yyvsp[-2].with_index_param_list_t)); - delete (yyvsp[-2].with_index_param_list_t); - } + for (infinity::TableElement*& element : *(yyvsp[-4].table_element_array_t)) { + if(element->type_ == infinity::TableElementType::kColumn) { + create_table_info->column_defs_.emplace_back((infinity::ColumnDef*)element); + } else { + create_table_info->constraints_.emplace_back((infinity::TableConstraint*)element); + } + } + delete (yyvsp[-4].table_element_array_t); + + if ((yyvsp[-2].with_index_param_list_t) != nullptr) { + create_table_info->properties_ = std::move(*(yyvsp[-2].with_index_param_list_t)); + delete (yyvsp[-2].with_index_param_list_t); + } - create_table_info->comment_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); + create_table_info->comment_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); - (yyval.create_stmt)->create_info_ = create_table_info; - (yyval.create_stmt)->create_info_->conflict_type_ = - (yyvsp[-7].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; - } -#line 3883 "parser.cpp" - break; + (yyval.create_stmt)->create_info_ = create_table_info; + (yyval.create_stmt)->create_info_->conflict_type_ = (yyvsp[-7].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; +} +#line 3902 "parser.cpp" + break; - case 38: /* create_statement: CREATE TABLE if_not_exists table_name AS select_statement COMMENT STRING */ + case 38: /* create_statement: CREATE TABLE if_not_exists table_name AS select_statement COMMENT STRING */ #line 680 "parser.y" - { - (yyval.create_stmt) = new infinity::CreateStatement(); - std::shared_ptr create_table_info = std::make_shared(); - if ((yyvsp[-4].table_name_t)->schema_name_ptr_ != nullptr) { - create_table_info->schema_name_ = (yyvsp[-4].table_name_t)->schema_name_ptr_; - free((yyvsp[-4].table_name_t)->schema_name_ptr_); - } - create_table_info->table_name_ = (yyvsp[-4].table_name_t)->table_name_ptr_; - free((yyvsp[-4].table_name_t)->table_name_ptr_); - delete (yyvsp[-4].table_name_t); - - create_table_info->conflict_type_ = (yyvsp[-5].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; - create_table_info->select_ = (yyvsp[-2].select_stmt); - create_table_info->comment_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - (yyval.create_stmt)->create_info_ = create_table_info; - } -#line 3905 "parser.cpp" - break; + { + (yyval.create_stmt) = new infinity::CreateStatement(); + std::shared_ptr create_table_info = std::make_shared(); + if((yyvsp[-4].table_name_t)->schema_name_ptr_ != nullptr) { + create_table_info->schema_name_ = (yyvsp[-4].table_name_t)->schema_name_ptr_; + free((yyvsp[-4].table_name_t)->schema_name_ptr_); + } + create_table_info->table_name_ = (yyvsp[-4].table_name_t)->table_name_ptr_; + free((yyvsp[-4].table_name_t)->table_name_ptr_); + delete (yyvsp[-4].table_name_t); + + create_table_info->conflict_type_ = (yyvsp[-5].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; + create_table_info->select_ = (yyvsp[-2].select_stmt); + create_table_info->comment_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); + (yyval.create_stmt)->create_info_ = create_table_info; +} +#line 3924 "parser.cpp" + break; - case 39: /* create_statement: CREATE VIEW if_not_exists table_name optional_identifier_array AS select_statement */ + case 39: /* create_statement: CREATE VIEW if_not_exists table_name optional_identifier_array AS select_statement */ #line 698 "parser.y" - { - (yyval.create_stmt) = new infinity::CreateStatement(); - std::shared_ptr create_view_info = std::make_shared(); - if ((yyvsp[-3].table_name_t)->schema_name_ptr_ != nullptr) { - create_view_info->schema_name_ = (yyvsp[-3].table_name_t)->schema_name_ptr_; - free((yyvsp[-3].table_name_t)->schema_name_ptr_); - } - create_view_info->view_name_ = (yyvsp[-3].table_name_t)->table_name_ptr_; - free((yyvsp[-3].table_name_t)->table_name_ptr_); - delete (yyvsp[-3].table_name_t); - - create_view_info->view_columns_ = (yyvsp[-2].identifier_array_t); - create_view_info->select_ = (yyvsp[0].select_stmt); - create_view_info->conflict_type_ = (yyvsp[-4].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; - (yyval.create_stmt)->create_info_ = create_view_info; - } -#line 3926 "parser.cpp" - break; + { + (yyval.create_stmt) = new infinity::CreateStatement(); + std::shared_ptr create_view_info = std::make_shared(); + if((yyvsp[-3].table_name_t)->schema_name_ptr_ != nullptr) { + create_view_info->schema_name_ = (yyvsp[-3].table_name_t)->schema_name_ptr_; + free((yyvsp[-3].table_name_t)->schema_name_ptr_); + } + create_view_info->view_name_ = (yyvsp[-3].table_name_t)->table_name_ptr_; + free((yyvsp[-3].table_name_t)->table_name_ptr_); + delete (yyvsp[-3].table_name_t); + + create_view_info->view_columns_ = (yyvsp[-2].identifier_array_t); + create_view_info->select_ = (yyvsp[0].select_stmt); + create_view_info->conflict_type_ = (yyvsp[-4].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; + (yyval.create_stmt)->create_info_ = create_view_info; +} +#line 3945 "parser.cpp" + break; - case 40: /* create_statement: CREATE INDEX if_not_exists_info ON table_name index_info */ + case 40: /* create_statement: CREATE INDEX if_not_exists_info ON table_name index_info */ #line 716 "parser.y" - { - std::shared_ptr create_index_info = std::make_shared(); - if ((yyvsp[-1].table_name_t)->schema_name_ptr_ != nullptr) { - create_index_info->schema_name_ = (yyvsp[-1].table_name_t)->schema_name_ptr_; - free((yyvsp[-1].table_name_t)->schema_name_ptr_); - } - create_index_info->table_name_ = (yyvsp[-1].table_name_t)->table_name_ptr_; - free((yyvsp[-1].table_name_t)->table_name_ptr_); - delete (yyvsp[-1].table_name_t); - - create_index_info->index_name_ = (yyvsp[-3].if_not_exists_info_t)->info_; - if ((yyvsp[-3].if_not_exists_info_t)->exists_) { - create_index_info->conflict_type_ = - (yyvsp[-3].if_not_exists_info_t)->if_not_exists_ ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; - } else { - create_index_info->conflict_type_ = infinity::ConflictType::kIgnore; - } - delete (yyvsp[-3].if_not_exists_info_t); + { + std::shared_ptr create_index_info = std::make_shared(); + if((yyvsp[-1].table_name_t)->schema_name_ptr_ != nullptr) { + create_index_info->schema_name_ = (yyvsp[-1].table_name_t)->schema_name_ptr_; + free((yyvsp[-1].table_name_t)->schema_name_ptr_); + } + create_index_info->table_name_ = (yyvsp[-1].table_name_t)->table_name_ptr_; + free((yyvsp[-1].table_name_t)->table_name_ptr_); + delete (yyvsp[-1].table_name_t); - create_index_info->index_info_ = (yyvsp[0].index_info_t); + create_index_info->index_name_ = (yyvsp[-3].if_not_exists_info_t)->info_; + if ((yyvsp[-3].if_not_exists_info_t)->exists_) { + create_index_info->conflict_type_ = (yyvsp[-3].if_not_exists_info_t)->if_not_exists_ ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; + } else { + create_index_info->conflict_type_ = infinity::ConflictType::kIgnore; + } + delete (yyvsp[-3].if_not_exists_info_t); - if (create_index_info->index_name_.empty()) { - yyerror(&yyloc, scanner, result, "No index name"); - YYERROR; - } + create_index_info->index_info_ = (yyvsp[0].index_info_t); - (yyval.create_stmt) = new infinity::CreateStatement(); - (yyval.create_stmt)->create_info_ = create_index_info; - } -#line 3959 "parser.cpp" - break; + if(create_index_info->index_name_.empty()) { + yyerror(&yyloc, scanner, result, "No index name"); + YYERROR; + } - case 41: /* create_statement: CREATE INDEX if_not_exists_info ON table_name index_info COMMENT STRING */ + (yyval.create_stmt) = new infinity::CreateStatement(); + (yyval.create_stmt)->create_info_ = create_index_info; +} +#line 3978 "parser.cpp" + break; + + case 41: /* create_statement: CREATE INDEX if_not_exists_info ON table_name index_info COMMENT STRING */ #line 744 "parser.y" - { - std::shared_ptr create_index_info = std::make_shared(); - if ((yyvsp[-3].table_name_t)->schema_name_ptr_ != nullptr) { - create_index_info->schema_name_ = (yyvsp[-3].table_name_t)->schema_name_ptr_; - free((yyvsp[-3].table_name_t)->schema_name_ptr_); - } - create_index_info->table_name_ = (yyvsp[-3].table_name_t)->table_name_ptr_; - free((yyvsp[-3].table_name_t)->table_name_ptr_); - delete (yyvsp[-3].table_name_t); - - create_index_info->index_name_ = (yyvsp[-5].if_not_exists_info_t)->info_; - if ((yyvsp[-5].if_not_exists_info_t)->exists_) { - create_index_info->conflict_type_ = - (yyvsp[-5].if_not_exists_info_t)->if_not_exists_ ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; - } else { - create_index_info->conflict_type_ = infinity::ConflictType::kIgnore; - } - delete (yyvsp[-5].if_not_exists_info_t); + { + std::shared_ptr create_index_info = std::make_shared(); + if((yyvsp[-3].table_name_t)->schema_name_ptr_ != nullptr) { + create_index_info->schema_name_ = (yyvsp[-3].table_name_t)->schema_name_ptr_; + free((yyvsp[-3].table_name_t)->schema_name_ptr_); + } + create_index_info->table_name_ = (yyvsp[-3].table_name_t)->table_name_ptr_; + free((yyvsp[-3].table_name_t)->table_name_ptr_); + delete (yyvsp[-3].table_name_t); + + create_index_info->index_name_ = (yyvsp[-5].if_not_exists_info_t)->info_; + if ((yyvsp[-5].if_not_exists_info_t)->exists_) { + create_index_info->conflict_type_ = (yyvsp[-5].if_not_exists_info_t)->if_not_exists_ ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; + } else { + create_index_info->conflict_type_ = infinity::ConflictType::kIgnore; + } + delete (yyvsp[-5].if_not_exists_info_t); - create_index_info->index_info_ = (yyvsp[-2].index_info_t); - create_index_info->comment_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); + create_index_info->index_info_ = (yyvsp[-2].index_info_t); + create_index_info->comment_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); - if (create_index_info->index_name_.empty()) { - yyerror(&yyloc, scanner, result, "No index name"); - YYERROR; - } + if(create_index_info->index_name_.empty()) { + yyerror(&yyloc, scanner, result, "No index name"); + YYERROR; + } - (yyval.create_stmt) = new infinity::CreateStatement(); - (yyval.create_stmt)->create_info_ = create_index_info; - } -#line 3994 "parser.cpp" - break; + (yyval.create_stmt) = new infinity::CreateStatement(); + (yyval.create_stmt)->create_info_ = create_index_info; +} +#line 4013 "parser.cpp" + break; - case 42: /* table_element_array: table_element */ + case 42: /* table_element_array: table_element */ #line 775 "parser.y" - { - (yyval.table_element_array_t) = new std::vector(); - (yyval.table_element_array_t)->push_back((yyvsp[0].table_element_t)); - } -#line 4003 "parser.cpp" - break; + { + (yyval.table_element_array_t) = new std::vector(); + (yyval.table_element_array_t)->push_back((yyvsp[0].table_element_t)); +} +#line 4022 "parser.cpp" + break; - case 43: /* table_element_array: table_element_array ',' table_element */ + case 43: /* table_element_array: table_element_array ',' table_element */ #line 779 "parser.y" - { - (yyvsp[-2].table_element_array_t)->push_back((yyvsp[0].table_element_t)); - (yyval.table_element_array_t) = (yyvsp[-2].table_element_array_t); - } -#line 4012 "parser.cpp" - break; + { + (yyvsp[-2].table_element_array_t)->push_back((yyvsp[0].table_element_t)); + (yyval.table_element_array_t) = (yyvsp[-2].table_element_array_t); +} +#line 4031 "parser.cpp" + break; - case 44: /* column_def_array: table_column */ + case 44: /* column_def_array: table_column */ #line 784 "parser.y" - { - (yyval.column_def_array_t) = new std::vector(); - (yyval.column_def_array_t)->push_back((yyvsp[0].table_column_t)); - } -#line 4021 "parser.cpp" - break; + { + (yyval.column_def_array_t) = new std::vector(); + (yyval.column_def_array_t)->push_back((yyvsp[0].table_column_t)); +} +#line 4040 "parser.cpp" + break; - case 45: /* column_def_array: column_def_array ',' table_column */ + case 45: /* column_def_array: column_def_array ',' table_column */ #line 788 "parser.y" - { - (yyvsp[-2].column_def_array_t)->push_back((yyvsp[0].table_column_t)); - (yyval.column_def_array_t) = (yyvsp[-2].column_def_array_t); - } -#line 4030 "parser.cpp" - break; + { + (yyvsp[-2].column_def_array_t)->push_back((yyvsp[0].table_column_t)); + (yyval.column_def_array_t) = (yyvsp[-2].column_def_array_t); +} +#line 4049 "parser.cpp" + break; - case 46: /* table_element: table_column */ + case 46: /* table_element: table_column */ #line 794 "parser.y" - { - (yyval.table_element_t) = (yyvsp[0].table_column_t); - } -#line 4038 "parser.cpp" - break; + { + (yyval.table_element_t) = (yyvsp[0].table_column_t); +} +#line 4057 "parser.cpp" + break; - case 47: /* table_element: table_constraint */ + case 47: /* table_element: table_constraint */ #line 797 "parser.y" - { - (yyval.table_element_t) = (yyvsp[0].table_constraint_t); - } -#line 4046 "parser.cpp" - break; + { + (yyval.table_element_t) = (yyvsp[0].table_constraint_t); +} +#line 4065 "parser.cpp" + break; - case 48: /* table_column: IDENTIFIER column_type with_index_param_list default_expr */ + case 48: /* table_column: IDENTIFIER column_type with_index_param_list default_expr */ #line 804 "parser.y" - { - std::shared_ptr type_info_ptr{nullptr}; - std::vector> index_param_list = - infinity::InitParameter::MakeInitParameterList((yyvsp[-1].with_index_param_list_t)); - switch ((yyvsp[-2].column_type_t).logical_type_) { - case infinity::LogicalType::kDecimal: { - type_info_ptr = infinity::DecimalInfo::Make((yyvsp[-2].column_type_t).precision, (yyvsp[-2].column_type_t).scale); - if (type_info_ptr == nullptr) { - yyerror(&yyloc, scanner, result, "Fail to create decimal info."); - free((yyvsp[-3].str_value)); - YYERROR; - } - break; - } - // case infinity::LogicalType::kBitmap: { - // type_info_ptr = infinity::BitmapInfo::Make($2.width); - // break; - // } - case infinity::LogicalType::kEmbedding: - case infinity::LogicalType::kMultiVector: - case infinity::LogicalType::kTensor: - case infinity::LogicalType::kTensorArray: { - type_info_ptr = infinity::EmbeddingInfo::Make((yyvsp[-2].column_type_t).embedding_type_, (yyvsp[-2].column_type_t).width); - break; - } - case infinity::LogicalType::kSparse: { - auto store_type = infinity::SparseInfo::ParseStoreType(index_param_list); - type_info_ptr = - infinity::SparseInfo::Make((yyvsp[-2].column_type_t).embedding_type_, (yyvsp[-2].column_type_t).width, store_type); - if (type_info_ptr == nullptr) { - yyerror(&yyloc, scanner, result, "Fail to create sparse info."); - free((yyvsp[-3].str_value)); - YYERROR; - } - break; - } - default: { - break; - } - } - - std::shared_ptr default_expr((yyvsp[0].const_expr_t)); - (yyval.table_column_t) = new infinity::ColumnDef((yyvsp[-2].column_type_t).logical_type_, type_info_ptr, "", std::move(default_expr)); - - ParserHelper::ToLower((yyvsp[-3].str_value)); - (yyval.table_column_t)->name_ = (yyvsp[-3].str_value); - free((yyvsp[-3].str_value)); - /* - if (!$$->trySetNullableExplicit()) { - yyerror(&yyloc, result, scanner, ("Conflicting nullability constraints for " + std::string{$1}).c_str()); + { + std::shared_ptr type_info_ptr{nullptr}; + std::vector> index_param_list = infinity::InitParameter::MakeInitParameterList((yyvsp[-1].with_index_param_list_t)); + switch((yyvsp[-2].column_type_t).logical_type_) { + case infinity::LogicalType::kDecimal: { + type_info_ptr = infinity::DecimalInfo::Make((yyvsp[-2].column_type_t).precision, (yyvsp[-2].column_type_t).scale); + if(type_info_ptr == nullptr) { + yyerror(&yyloc, scanner, result, "Fail to create decimal info."); + free((yyvsp[-3].str_value)); + YYERROR; } - */ + break; } -#line 4102 "parser.cpp" - break; - - case 49: /* table_column: IDENTIFIER column_type column_constraints default_expr */ -#line 855 "parser.y" - { - std::shared_ptr type_info_ptr{nullptr}; - switch ((yyvsp[-2].column_type_t).logical_type_) { - case infinity::LogicalType::kDecimal: { - type_info_ptr = infinity::DecimalInfo::Make((yyvsp[-2].column_type_t).precision, (yyvsp[-2].column_type_t).scale); - break; - } - // case infinity::LogicalType::kBitmap: { - // type_info_ptr = infinity::BitmapInfo::Make($2.width); - // break; - // } - case infinity::LogicalType::kEmbedding: - case infinity::LogicalType::kMultiVector: - case infinity::LogicalType::kTensor: - case infinity::LogicalType::kTensorArray: { - type_info_ptr = infinity::EmbeddingInfo::Make((yyvsp[-2].column_type_t).embedding_type_, (yyvsp[-2].column_type_t).width); - break; - } - default: { - break; - } - } - - std::shared_ptr default_expr((yyvsp[0].const_expr_t)); - (yyval.table_column_t) = new infinity::ColumnDef((yyvsp[-2].column_type_t).logical_type_, type_info_ptr, "", default_expr); - - ParserHelper::ToLower((yyvsp[-3].str_value)); - (yyval.table_column_t)->name_ = (yyvsp[-3].str_value); - (yyval.table_column_t)->constraints_ = *(yyvsp[-1].column_constraints_t); - delete (yyvsp[-1].column_constraints_t); - free((yyvsp[-3].str_value)); - /* - if (!$$->trySetNullableExplicit()) { - yyerror(&yyloc, result, scanner, ("Conflicting nullability constraints for " + std::string{$1}).c_str()); +// case infinity::LogicalType::kBitmap: { +// type_info_ptr = infinity::BitmapInfo::Make($2.width); +// break; +// } + case infinity::LogicalType::kEmbedding: + case infinity::LogicalType::kMultiVector: + case infinity::LogicalType::kTensor: + case infinity::LogicalType::kTensorArray: { + type_info_ptr = infinity::EmbeddingInfo::Make((yyvsp[-2].column_type_t).embedding_type_, (yyvsp[-2].column_type_t).width); + break; + } + case infinity::LogicalType::kSparse: { + auto store_type = infinity::SparseInfo::ParseStoreType(index_param_list); + type_info_ptr = infinity::SparseInfo::Make((yyvsp[-2].column_type_t).embedding_type_, (yyvsp[-2].column_type_t).width, store_type); + if (type_info_ptr == nullptr) { + yyerror(&yyloc, scanner, result, "Fail to create sparse info."); + free((yyvsp[-3].str_value)); + YYERROR; } - */ + break; } -#line 4144 "parser.cpp" - break; + default: { + break; + } + } - case 50: /* table_column: IDENTIFIER column_type with_index_param_list default_expr COMMENT STRING */ -#line 892 "parser.y" - { - std::shared_ptr type_info_ptr{nullptr}; - std::vector> index_param_list = - infinity::InitParameter::MakeInitParameterList((yyvsp[-3].with_index_param_list_t)); - switch ((yyvsp[-4].column_type_t).logical_type_) { - case infinity::LogicalType::kDecimal: { - type_info_ptr = infinity::DecimalInfo::Make((yyvsp[-4].column_type_t).precision, (yyvsp[-4].column_type_t).scale); - if (type_info_ptr == nullptr) { - yyerror(&yyloc, scanner, result, "Fail to create decimal info."); - free((yyvsp[-5].str_value)); - YYERROR; - } - break; - } - // case infinity::LogicalType::kBitmap: { - // type_info_ptr = infinity::BitmapInfo::Make($2.width); - // break; - // } - case infinity::LogicalType::kEmbedding: - case infinity::LogicalType::kMultiVector: - case infinity::LogicalType::kTensor: - case infinity::LogicalType::kTensorArray: { - type_info_ptr = infinity::EmbeddingInfo::Make((yyvsp[-4].column_type_t).embedding_type_, (yyvsp[-4].column_type_t).width); - break; - } - case infinity::LogicalType::kSparse: { - auto store_type = infinity::SparseInfo::ParseStoreType(index_param_list); - type_info_ptr = - infinity::SparseInfo::Make((yyvsp[-4].column_type_t).embedding_type_, (yyvsp[-4].column_type_t).width, store_type); - if (type_info_ptr == nullptr) { - yyerror(&yyloc, scanner, result, "Fail to create sparse info."); - free((yyvsp[-5].str_value)); - YYERROR; - } - break; - } - default: { - break; - } - } + std::shared_ptr default_expr((yyvsp[0].const_expr_t)); + (yyval.table_column_t) = new infinity::ColumnDef((yyvsp[-2].column_type_t).logical_type_, type_info_ptr, "", std::move(default_expr)); - std::shared_ptr default_expr((yyvsp[-2].const_expr_t)); - (yyval.table_column_t) = - new infinity::ColumnDef((yyvsp[-4].column_type_t).logical_type_, type_info_ptr, (yyvsp[0].str_value), std::move(default_expr)); - free((yyvsp[0].str_value)); - - ParserHelper::ToLower((yyvsp[-5].str_value)); - (yyval.table_column_t)->name_ = (yyvsp[-5].str_value); - free((yyvsp[-5].str_value)); - /* - if (!$$->trySetNullableExplicit()) { - yyerror(&yyloc, result, scanner, ("Conflicting nullability constraints for " + std::string{$1}).c_str()); - } - */ + ParserHelper::ToLower((yyvsp[-3].str_value)); + (yyval.table_column_t)->name_ = (yyvsp[-3].str_value); + free((yyvsp[-3].str_value)); + /* + if (!$$->trySetNullableExplicit()) { + yyerror(&yyloc, result, scanner, ("Conflicting nullability constraints for " + std::string{$1}).c_str()); + } + */ +} +#line 4121 "parser.cpp" + break; + + case 49: /* table_column: IDENTIFIER column_type column_constraints default_expr */ +#line 855 "parser.y" + { + std::shared_ptr type_info_ptr{nullptr}; + switch((yyvsp[-2].column_type_t).logical_type_) { + case infinity::LogicalType::kDecimal: { + type_info_ptr = infinity::DecimalInfo::Make((yyvsp[-2].column_type_t).precision, (yyvsp[-2].column_type_t).scale); + break; } -#line 4201 "parser.cpp" - break; +// case infinity::LogicalType::kBitmap: { +// type_info_ptr = infinity::BitmapInfo::Make($2.width); +// break; +// } + case infinity::LogicalType::kEmbedding: + case infinity::LogicalType::kMultiVector: + case infinity::LogicalType::kTensor: + case infinity::LogicalType::kTensorArray: { + type_info_ptr = infinity::EmbeddingInfo::Make((yyvsp[-2].column_type_t).embedding_type_, (yyvsp[-2].column_type_t).width); + break; + } + default: { + break; + } + } - case 51: /* table_column: IDENTIFIER column_type column_constraints default_expr COMMENT STRING */ -#line 944 "parser.y" - { - std::shared_ptr type_info_ptr{nullptr}; - switch ((yyvsp[-4].column_type_t).logical_type_) { - case infinity::LogicalType::kDecimal: { - type_info_ptr = infinity::DecimalInfo::Make((yyvsp[-4].column_type_t).precision, (yyvsp[-4].column_type_t).scale); - break; - } - // case infinity::LogicalType::kBitmap: { - // type_info_ptr = infinity::BitmapInfo::Make($2.width); - // break; - // } - case infinity::LogicalType::kEmbedding: - case infinity::LogicalType::kMultiVector: - case infinity::LogicalType::kTensor: - case infinity::LogicalType::kTensorArray: { - type_info_ptr = infinity::EmbeddingInfo::Make((yyvsp[-4].column_type_t).embedding_type_, (yyvsp[-4].column_type_t).width); - break; - } - default: { - break; - } - } + std::shared_ptr default_expr((yyvsp[0].const_expr_t)); + (yyval.table_column_t) = new infinity::ColumnDef((yyvsp[-2].column_type_t).logical_type_, type_info_ptr, "", default_expr); + + ParserHelper::ToLower((yyvsp[-3].str_value)); + (yyval.table_column_t)->name_ = (yyvsp[-3].str_value); + (yyval.table_column_t)->constraints_ = *(yyvsp[-1].column_constraints_t); + delete (yyvsp[-1].column_constraints_t); + free((yyvsp[-3].str_value)); + /* + if (!$$->trySetNullableExplicit()) { + yyerror(&yyloc, result, scanner, ("Conflicting nullability constraints for " + std::string{$1}).c_str()); + } + */ +} +#line 4163 "parser.cpp" + break; - std::shared_ptr default_expr((yyvsp[-2].const_expr_t)); - (yyval.table_column_t) = - new infinity::ColumnDef((yyvsp[-4].column_type_t).logical_type_, type_info_ptr, (yyvsp[0].str_value), default_expr); - free((yyvsp[0].str_value)); - - ParserHelper::ToLower((yyvsp[-5].str_value)); - (yyval.table_column_t)->name_ = (yyvsp[-5].str_value); - (yyval.table_column_t)->constraints_ = *(yyvsp[-3].column_constraints_t); - delete (yyvsp[-3].column_constraints_t); - free((yyvsp[-5].str_value)); - /* - if (!$$->trySetNullableExplicit()) { - yyerror(&yyloc, result, scanner, ("Conflicting nullability constraints for " + std::string{$1}).c_str()); + case 50: /* table_column: IDENTIFIER column_type with_index_param_list default_expr COMMENT STRING */ +#line 892 "parser.y" + { + std::shared_ptr type_info_ptr{nullptr}; + std::vector> index_param_list = infinity::InitParameter::MakeInitParameterList((yyvsp[-3].with_index_param_list_t)); + switch((yyvsp[-4].column_type_t).logical_type_) { + case infinity::LogicalType::kDecimal: { + type_info_ptr = infinity::DecimalInfo::Make((yyvsp[-4].column_type_t).precision, (yyvsp[-4].column_type_t).scale); + if(type_info_ptr == nullptr) { + yyerror(&yyloc, scanner, result, "Fail to create decimal info."); + free((yyvsp[-5].str_value)); + YYERROR; } - */ + break; } -#line 4244 "parser.cpp" - break; - - case 52: /* column_type: BOOLEAN */ -#line 984 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kBoolean, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; +// case infinity::LogicalType::kBitmap: { +// type_info_ptr = infinity::BitmapInfo::Make($2.width); +// break; +// } + case infinity::LogicalType::kEmbedding: + case infinity::LogicalType::kMultiVector: + case infinity::LogicalType::kTensor: + case infinity::LogicalType::kTensorArray: { + type_info_ptr = infinity::EmbeddingInfo::Make((yyvsp[-4].column_type_t).embedding_type_, (yyvsp[-4].column_type_t).width); + break; } -#line 4250 "parser.cpp" - break; - - case 53: /* column_type: TINYINT */ -#line 985 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTinyInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; + case infinity::LogicalType::kSparse: { + auto store_type = infinity::SparseInfo::ParseStoreType(index_param_list); + type_info_ptr = infinity::SparseInfo::Make((yyvsp[-4].column_type_t).embedding_type_, (yyvsp[-4].column_type_t).width, store_type); + if (type_info_ptr == nullptr) { + yyerror(&yyloc, scanner, result, "Fail to create sparse info."); + free((yyvsp[-5].str_value)); + YYERROR; + } + break; } -#line 4256 "parser.cpp" - break; - - case 54: /* column_type: SMALLINT */ -#line 986 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSmallInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; + default: { + break; } -#line 4262 "parser.cpp" - break; + } - case 55: /* column_type: INTEGER */ -#line 987 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kInteger, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; + std::shared_ptr default_expr((yyvsp[-2].const_expr_t)); + (yyval.table_column_t) = new infinity::ColumnDef((yyvsp[-4].column_type_t).logical_type_, type_info_ptr, (yyvsp[0].str_value), std::move(default_expr)); + free((yyvsp[0].str_value)); + + ParserHelper::ToLower((yyvsp[-5].str_value)); + (yyval.table_column_t)->name_ = (yyvsp[-5].str_value); + free((yyvsp[-5].str_value)); + /* + if (!$$->trySetNullableExplicit()) { + yyerror(&yyloc, result, scanner, ("Conflicting nullability constraints for " + std::string{$1}).c_str()); + } + */ +} +#line 4220 "parser.cpp" + break; + + case 51: /* table_column: IDENTIFIER column_type column_constraints default_expr COMMENT STRING */ +#line 944 "parser.y" + { + std::shared_ptr type_info_ptr{nullptr}; + switch((yyvsp[-4].column_type_t).logical_type_) { + case infinity::LogicalType::kDecimal: { + type_info_ptr = infinity::DecimalInfo::Make((yyvsp[-4].column_type_t).precision, (yyvsp[-4].column_type_t).scale); + break; } -#line 4268 "parser.cpp" - break; +// case infinity::LogicalType::kBitmap: { +// type_info_ptr = infinity::BitmapInfo::Make($2.width); +// break; +// } + case infinity::LogicalType::kEmbedding: + case infinity::LogicalType::kMultiVector: + case infinity::LogicalType::kTensor: + case infinity::LogicalType::kTensorArray: { + type_info_ptr = infinity::EmbeddingInfo::Make((yyvsp[-4].column_type_t).embedding_type_, (yyvsp[-4].column_type_t).width); + break; + } + default: { + break; + } + } + + std::shared_ptr default_expr((yyvsp[-2].const_expr_t)); + (yyval.table_column_t) = new infinity::ColumnDef((yyvsp[-4].column_type_t).logical_type_, type_info_ptr, (yyvsp[0].str_value), default_expr); + free((yyvsp[0].str_value)); + + ParserHelper::ToLower((yyvsp[-5].str_value)); + (yyval.table_column_t)->name_ = (yyvsp[-5].str_value); + (yyval.table_column_t)->constraints_ = *(yyvsp[-3].column_constraints_t); + delete (yyvsp[-3].column_constraints_t); + free((yyvsp[-5].str_value)); + /* + if (!$$->trySetNullableExplicit()) { + yyerror(&yyloc, result, scanner, ("Conflicting nullability constraints for " + std::string{$1}).c_str()); + } + */ +} +#line 4263 "parser.cpp" + break; + + case 52: /* column_type: BOOLEAN */ +#line 984 "parser.y" + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kBoolean, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4269 "parser.cpp" + break; + + case 53: /* column_type: TINYINT */ +#line 985 "parser.y" + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTinyInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4275 "parser.cpp" + break; + + case 54: /* column_type: SMALLINT */ +#line 986 "parser.y" + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSmallInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4281 "parser.cpp" + break; + + case 55: /* column_type: INTEGER */ +#line 987 "parser.y" + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kInteger, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4287 "parser.cpp" + break; - case 56: /* column_type: INT */ + case 56: /* column_type: INT */ #line 988 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kInteger, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4274 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kInteger, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4293 "parser.cpp" + break; - case 57: /* column_type: BIGINT */ + case 57: /* column_type: BIGINT */ #line 989 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kBigInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4280 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kBigInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4299 "parser.cpp" + break; - case 58: /* column_type: HUGEINT */ + case 58: /* column_type: HUGEINT */ #line 990 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kHugeInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4286 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kHugeInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4305 "parser.cpp" + break; - case 59: /* column_type: FLOAT */ + case 59: /* column_type: FLOAT */ #line 991 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kFloat, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4292 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kFloat, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4311 "parser.cpp" + break; - case 60: /* column_type: REAL */ + case 60: /* column_type: REAL */ #line 992 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kFloat, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4298 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kFloat, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4317 "parser.cpp" + break; - case 61: /* column_type: DOUBLE */ + case 61: /* column_type: DOUBLE */ #line 993 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDouble, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4304 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDouble, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4323 "parser.cpp" + break; - case 62: /* column_type: FLOAT16 */ + case 62: /* column_type: FLOAT16 */ #line 994 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kFloat16, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4310 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kFloat16, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4329 "parser.cpp" + break; - case 63: /* column_type: BFLOAT16 */ + case 63: /* column_type: BFLOAT16 */ #line 995 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kBFloat16, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4316 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kBFloat16, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4335 "parser.cpp" + break; - case 64: /* column_type: DATE */ + case 64: /* column_type: DATE */ #line 996 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDate, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4322 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDate, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4341 "parser.cpp" + break; - case 65: /* column_type: TIME */ + case 65: /* column_type: TIME */ #line 997 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTime, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4328 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTime, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4347 "parser.cpp" + break; - case 66: /* column_type: DATETIME */ + case 66: /* column_type: DATETIME */ #line 998 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDateTime, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4334 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDateTime, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4353 "parser.cpp" + break; - case 67: /* column_type: TIMESTAMP */ + case 67: /* column_type: TIMESTAMP */ #line 999 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTimestamp, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4340 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTimestamp, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4359 "parser.cpp" + break; - case 68: /* column_type: UUID */ + case 68: /* column_type: UUID */ #line 1000 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kUuid, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4346 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kUuid, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4365 "parser.cpp" + break; - case 69: /* column_type: POINT */ + case 69: /* column_type: POINT */ #line 1001 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kPoint, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4352 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kPoint, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4371 "parser.cpp" + break; - case 70: /* column_type: LINE */ + case 70: /* column_type: LINE */ #line 1002 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kLine, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4358 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kLine, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4377 "parser.cpp" + break; - case 71: /* column_type: LSEG */ + case 71: /* column_type: LSEG */ #line 1003 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kLineSeg, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4364 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kLineSeg, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4383 "parser.cpp" + break; - case 72: /* column_type: BOX */ + case 72: /* column_type: BOX */ #line 1004 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kBox, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4370 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kBox, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4389 "parser.cpp" + break; - case 73: /* column_type: CIRCLE */ + case 73: /* column_type: CIRCLE */ #line 1007 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kCircle, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4376 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kCircle, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4395 "parser.cpp" + break; - case 74: /* column_type: VARCHAR */ + case 74: /* column_type: VARCHAR */ #line 1009 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kVarchar, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4382 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kVarchar, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4401 "parser.cpp" + break; - case 75: /* column_type: DECIMAL '(' LONG_VALUE ',' LONG_VALUE ')' */ + case 75: /* column_type: DECIMAL '(' LONG_VALUE ',' LONG_VALUE ')' */ #line 1010 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDecimal, - 0, - (yyvsp[-3].long_value), - (yyvsp[-1].long_value), - infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4388 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDecimal, 0, (yyvsp[-3].long_value), (yyvsp[-1].long_value), infinity::EmbeddingDataType::kElemInvalid}; } +#line 4407 "parser.cpp" + break; - case 76: /* column_type: DECIMAL '(' LONG_VALUE ')' */ + case 76: /* column_type: DECIMAL '(' LONG_VALUE ')' */ #line 1011 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kDecimal, 0, (yyvsp[-1].long_value), 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4394 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDecimal, 0, (yyvsp[-1].long_value), 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4413 "parser.cpp" + break; - case 77: /* column_type: DECIMAL */ + case 77: /* column_type: DECIMAL */ #line 1012 "parser.y" - { - (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDecimal, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; - } -#line 4400 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDecimal, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } +#line 4419 "parser.cpp" + break; - case 78: /* column_type: EMBEDDING '(' BIT ',' LONG_VALUE ')' */ + case 78: /* column_type: EMBEDDING '(' BIT ',' LONG_VALUE ')' */ #line 1015 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; - } -#line 4406 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; } +#line 4425 "parser.cpp" + break; - case 79: /* column_type: EMBEDDING '(' TINYINT ',' LONG_VALUE ')' */ + case 79: /* column_type: EMBEDDING '(' TINYINT ',' LONG_VALUE ')' */ #line 1016 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; - } -#line 4412 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; } +#line 4431 "parser.cpp" + break; - case 80: /* column_type: EMBEDDING '(' SMALLINT ',' LONG_VALUE ')' */ + case 80: /* column_type: EMBEDDING '(' SMALLINT ',' LONG_VALUE ')' */ #line 1017 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; - } -#line 4418 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; } +#line 4437 "parser.cpp" + break; - case 81: /* column_type: EMBEDDING '(' INTEGER ',' LONG_VALUE ')' */ + case 81: /* column_type: EMBEDDING '(' INTEGER ',' LONG_VALUE ')' */ #line 1018 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; - } -#line 4424 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } +#line 4443 "parser.cpp" + break; - case 82: /* column_type: EMBEDDING '(' INT ',' LONG_VALUE ')' */ + case 82: /* column_type: EMBEDDING '(' INT ',' LONG_VALUE ')' */ #line 1019 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; - } -#line 4430 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } +#line 4449 "parser.cpp" + break; - case 83: /* column_type: EMBEDDING '(' BIGINT ',' LONG_VALUE ')' */ + case 83: /* column_type: EMBEDDING '(' BIGINT ',' LONG_VALUE ')' */ #line 1020 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; - } -#line 4436 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; } +#line 4455 "parser.cpp" + break; - case 84: /* column_type: EMBEDDING '(' FLOAT ',' LONG_VALUE ')' */ + case 84: /* column_type: EMBEDDING '(' FLOAT ',' LONG_VALUE ')' */ #line 1021 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; - } -#line 4442 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; } +#line 4461 "parser.cpp" + break; - case 85: /* column_type: EMBEDDING '(' DOUBLE ',' LONG_VALUE ')' */ + case 85: /* column_type: EMBEDDING '(' DOUBLE ',' LONG_VALUE ')' */ #line 1022 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; - } -#line 4448 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; } +#line 4467 "parser.cpp" + break; - case 86: /* column_type: EMBEDDING '(' FLOAT16 ',' LONG_VALUE ')' */ + case 86: /* column_type: EMBEDDING '(' FLOAT16 ',' LONG_VALUE ')' */ #line 1023 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat16}; - } -#line 4454 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat16}; } +#line 4473 "parser.cpp" + break; - case 87: /* column_type: EMBEDDING '(' BFLOAT16 ',' LONG_VALUE ')' */ + case 87: /* column_type: EMBEDDING '(' BFLOAT16 ',' LONG_VALUE ')' */ #line 1024 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBFloat16}; - } -#line 4460 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBFloat16}; } +#line 4479 "parser.cpp" + break; - case 88: /* column_type: EMBEDDING '(' UNSIGNED TINYINT ',' LONG_VALUE ')' */ + case 88: /* column_type: EMBEDDING '(' UNSIGNED TINYINT ',' LONG_VALUE ')' */ #line 1025 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemUInt8}; - } -#line 4466 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemUInt8}; } +#line 4485 "parser.cpp" + break; - case 89: /* column_type: MULTIVECTOR '(' BIT ',' LONG_VALUE ')' */ + case 89: /* column_type: MULTIVECTOR '(' BIT ',' LONG_VALUE ')' */ #line 1026 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; - } -#line 4472 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; } +#line 4491 "parser.cpp" + break; - case 90: /* column_type: MULTIVECTOR '(' TINYINT ',' LONG_VALUE ')' */ + case 90: /* column_type: MULTIVECTOR '(' TINYINT ',' LONG_VALUE ')' */ #line 1027 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; - } -#line 4478 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; } +#line 4497 "parser.cpp" + break; - case 91: /* column_type: MULTIVECTOR '(' SMALLINT ',' LONG_VALUE ')' */ + case 91: /* column_type: MULTIVECTOR '(' SMALLINT ',' LONG_VALUE ')' */ #line 1028 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; - } -#line 4484 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; } +#line 4503 "parser.cpp" + break; - case 92: /* column_type: MULTIVECTOR '(' INTEGER ',' LONG_VALUE ')' */ + case 92: /* column_type: MULTIVECTOR '(' INTEGER ',' LONG_VALUE ')' */ #line 1029 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; - } -#line 4490 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } +#line 4509 "parser.cpp" + break; - case 93: /* column_type: MULTIVECTOR '(' INT ',' LONG_VALUE ')' */ + case 93: /* column_type: MULTIVECTOR '(' INT ',' LONG_VALUE ')' */ #line 1030 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; - } -#line 4496 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } +#line 4515 "parser.cpp" + break; - case 94: /* column_type: MULTIVECTOR '(' BIGINT ',' LONG_VALUE ')' */ + case 94: /* column_type: MULTIVECTOR '(' BIGINT ',' LONG_VALUE ')' */ #line 1031 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; - } -#line 4502 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; } +#line 4521 "parser.cpp" + break; - case 95: /* column_type: MULTIVECTOR '(' FLOAT ',' LONG_VALUE ')' */ + case 95: /* column_type: MULTIVECTOR '(' FLOAT ',' LONG_VALUE ')' */ #line 1032 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; - } -#line 4508 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; } +#line 4527 "parser.cpp" + break; - case 96: /* column_type: MULTIVECTOR '(' DOUBLE ',' LONG_VALUE ')' */ + case 96: /* column_type: MULTIVECTOR '(' DOUBLE ',' LONG_VALUE ')' */ #line 1033 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; - } -#line 4514 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; } +#line 4533 "parser.cpp" + break; - case 97: /* column_type: MULTIVECTOR '(' FLOAT16 ',' LONG_VALUE ')' */ + case 97: /* column_type: MULTIVECTOR '(' FLOAT16 ',' LONG_VALUE ')' */ #line 1034 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat16}; - } -#line 4520 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat16}; } +#line 4539 "parser.cpp" + break; - case 98: /* column_type: MULTIVECTOR '(' BFLOAT16 ',' LONG_VALUE ')' */ + case 98: /* column_type: MULTIVECTOR '(' BFLOAT16 ',' LONG_VALUE ')' */ #line 1035 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBFloat16}; - } -#line 4526 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBFloat16}; } +#line 4545 "parser.cpp" + break; - case 99: /* column_type: MULTIVECTOR '(' UNSIGNED TINYINT ',' LONG_VALUE ')' */ + case 99: /* column_type: MULTIVECTOR '(' UNSIGNED TINYINT ',' LONG_VALUE ')' */ #line 1036 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemUInt8}; - } -#line 4532 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemUInt8}; } +#line 4551 "parser.cpp" + break; - case 100: /* column_type: TENSOR '(' BIT ',' LONG_VALUE ')' */ + case 100: /* column_type: TENSOR '(' BIT ',' LONG_VALUE ')' */ #line 1037 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; - } -#line 4538 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; } +#line 4557 "parser.cpp" + break; - case 101: /* column_type: TENSOR '(' TINYINT ',' LONG_VALUE ')' */ + case 101: /* column_type: TENSOR '(' TINYINT ',' LONG_VALUE ')' */ #line 1038 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; - } -#line 4544 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; } +#line 4563 "parser.cpp" + break; - case 102: /* column_type: TENSOR '(' SMALLINT ',' LONG_VALUE ')' */ + case 102: /* column_type: TENSOR '(' SMALLINT ',' LONG_VALUE ')' */ #line 1039 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; - } -#line 4550 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; } +#line 4569 "parser.cpp" + break; - case 103: /* column_type: TENSOR '(' INTEGER ',' LONG_VALUE ')' */ + case 103: /* column_type: TENSOR '(' INTEGER ',' LONG_VALUE ')' */ #line 1040 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; - } -#line 4556 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } +#line 4575 "parser.cpp" + break; - case 104: /* column_type: TENSOR '(' INT ',' LONG_VALUE ')' */ + case 104: /* column_type: TENSOR '(' INT ',' LONG_VALUE ')' */ #line 1041 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; - } -#line 4562 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } +#line 4581 "parser.cpp" + break; - case 105: /* column_type: TENSOR '(' BIGINT ',' LONG_VALUE ')' */ + case 105: /* column_type: TENSOR '(' BIGINT ',' LONG_VALUE ')' */ #line 1042 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; - } -#line 4568 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; } +#line 4587 "parser.cpp" + break; - case 106: /* column_type: TENSOR '(' FLOAT ',' LONG_VALUE ')' */ + case 106: /* column_type: TENSOR '(' FLOAT ',' LONG_VALUE ')' */ #line 1043 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; - } -#line 4574 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; } +#line 4593 "parser.cpp" + break; - case 107: /* column_type: TENSOR '(' DOUBLE ',' LONG_VALUE ')' */ + case 107: /* column_type: TENSOR '(' DOUBLE ',' LONG_VALUE ')' */ #line 1044 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; - } -#line 4580 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; } +#line 4599 "parser.cpp" + break; - case 108: /* column_type: TENSOR '(' FLOAT16 ',' LONG_VALUE ')' */ + case 108: /* column_type: TENSOR '(' FLOAT16 ',' LONG_VALUE ')' */ #line 1045 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat16}; - } -#line 4586 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat16}; } +#line 4605 "parser.cpp" + break; - case 109: /* column_type: TENSOR '(' BFLOAT16 ',' LONG_VALUE ')' */ + case 109: /* column_type: TENSOR '(' BFLOAT16 ',' LONG_VALUE ')' */ #line 1046 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBFloat16}; - } -#line 4592 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBFloat16}; } +#line 4611 "parser.cpp" + break; - case 110: /* column_type: TENSOR '(' UNSIGNED TINYINT ',' LONG_VALUE ')' */ + case 110: /* column_type: TENSOR '(' UNSIGNED TINYINT ',' LONG_VALUE ')' */ #line 1047 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemUInt8}; - } -#line 4598 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemUInt8}; } +#line 4617 "parser.cpp" + break; - case 111: /* column_type: TENSORARRAY '(' BIT ',' LONG_VALUE ')' */ + case 111: /* column_type: TENSORARRAY '(' BIT ',' LONG_VALUE ')' */ #line 1048 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; - } -#line 4604 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; } +#line 4623 "parser.cpp" + break; - case 112: /* column_type: TENSORARRAY '(' TINYINT ',' LONG_VALUE ')' */ + case 112: /* column_type: TENSORARRAY '(' TINYINT ',' LONG_VALUE ')' */ #line 1049 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; - } -#line 4610 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; } +#line 4629 "parser.cpp" + break; - case 113: /* column_type: TENSORARRAY '(' SMALLINT ',' LONG_VALUE ')' */ + case 113: /* column_type: TENSORARRAY '(' SMALLINT ',' LONG_VALUE ')' */ #line 1050 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; - } -#line 4616 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; } +#line 4635 "parser.cpp" + break; - case 114: /* column_type: TENSORARRAY '(' INTEGER ',' LONG_VALUE ')' */ + case 114: /* column_type: TENSORARRAY '(' INTEGER ',' LONG_VALUE ')' */ #line 1051 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; - } -#line 4622 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } +#line 4641 "parser.cpp" + break; - case 115: /* column_type: TENSORARRAY '(' INT ',' LONG_VALUE ')' */ + case 115: /* column_type: TENSORARRAY '(' INT ',' LONG_VALUE ')' */ #line 1052 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; - } -#line 4628 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } +#line 4647 "parser.cpp" + break; - case 116: /* column_type: TENSORARRAY '(' BIGINT ',' LONG_VALUE ')' */ + case 116: /* column_type: TENSORARRAY '(' BIGINT ',' LONG_VALUE ')' */ #line 1053 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; - } -#line 4634 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; } +#line 4653 "parser.cpp" + break; - case 117: /* column_type: TENSORARRAY '(' FLOAT ',' LONG_VALUE ')' */ + case 117: /* column_type: TENSORARRAY '(' FLOAT ',' LONG_VALUE ')' */ #line 1054 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; - } -#line 4640 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; } +#line 4659 "parser.cpp" + break; - case 118: /* column_type: TENSORARRAY '(' DOUBLE ',' LONG_VALUE ')' */ + case 118: /* column_type: TENSORARRAY '(' DOUBLE ',' LONG_VALUE ')' */ #line 1055 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; - } -#line 4646 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; } +#line 4665 "parser.cpp" + break; - case 119: /* column_type: TENSORARRAY '(' FLOAT16 ',' LONG_VALUE ')' */ + case 119: /* column_type: TENSORARRAY '(' FLOAT16 ',' LONG_VALUE ')' */ #line 1056 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat16}; - } -#line 4652 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat16}; } +#line 4671 "parser.cpp" + break; - case 120: /* column_type: TENSORARRAY '(' BFLOAT16 ',' LONG_VALUE ')' */ + case 120: /* column_type: TENSORARRAY '(' BFLOAT16 ',' LONG_VALUE ')' */ #line 1057 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBFloat16}; - } -#line 4658 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBFloat16}; } +#line 4677 "parser.cpp" + break; - case 121: /* column_type: TENSORARRAY '(' UNSIGNED TINYINT ',' LONG_VALUE ')' */ + case 121: /* column_type: TENSORARRAY '(' UNSIGNED TINYINT ',' LONG_VALUE ')' */ #line 1058 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemUInt8}; - } -#line 4664 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemUInt8}; } +#line 4683 "parser.cpp" + break; - case 122: /* column_type: VECTOR '(' BIT ',' LONG_VALUE ')' */ + case 122: /* column_type: VECTOR '(' BIT ',' LONG_VALUE ')' */ #line 1059 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; - } -#line 4670 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; } +#line 4689 "parser.cpp" + break; - case 123: /* column_type: VECTOR '(' TINYINT ',' LONG_VALUE ')' */ + case 123: /* column_type: VECTOR '(' TINYINT ',' LONG_VALUE ')' */ #line 1060 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; - } -#line 4676 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; } +#line 4695 "parser.cpp" + break; - case 124: /* column_type: VECTOR '(' SMALLINT ',' LONG_VALUE ')' */ + case 124: /* column_type: VECTOR '(' SMALLINT ',' LONG_VALUE ')' */ #line 1061 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; - } -#line 4682 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; } +#line 4701 "parser.cpp" + break; - case 125: /* column_type: VECTOR '(' INTEGER ',' LONG_VALUE ')' */ + case 125: /* column_type: VECTOR '(' INTEGER ',' LONG_VALUE ')' */ #line 1062 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; - } -#line 4688 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } +#line 4707 "parser.cpp" + break; - case 126: /* column_type: VECTOR '(' INT ',' LONG_VALUE ')' */ + case 126: /* column_type: VECTOR '(' INT ',' LONG_VALUE ')' */ #line 1063 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; - } -#line 4694 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } +#line 4713 "parser.cpp" + break; - case 127: /* column_type: VECTOR '(' BIGINT ',' LONG_VALUE ')' */ + case 127: /* column_type: VECTOR '(' BIGINT ',' LONG_VALUE ')' */ #line 1064 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; - } -#line 4700 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; } +#line 4719 "parser.cpp" + break; - case 128: /* column_type: VECTOR '(' FLOAT ',' LONG_VALUE ')' */ + case 128: /* column_type: VECTOR '(' FLOAT ',' LONG_VALUE ')' */ #line 1065 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; - } -#line 4706 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; } +#line 4725 "parser.cpp" + break; - case 129: /* column_type: VECTOR '(' DOUBLE ',' LONG_VALUE ')' */ + case 129: /* column_type: VECTOR '(' DOUBLE ',' LONG_VALUE ')' */ #line 1066 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; - } -#line 4712 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; } +#line 4731 "parser.cpp" + break; - case 130: /* column_type: VECTOR '(' FLOAT16 ',' LONG_VALUE ')' */ + case 130: /* column_type: VECTOR '(' FLOAT16 ',' LONG_VALUE ')' */ #line 1067 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat16}; - } -#line 4718 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat16}; } +#line 4737 "parser.cpp" + break; - case 131: /* column_type: VECTOR '(' BFLOAT16 ',' LONG_VALUE ')' */ + case 131: /* column_type: VECTOR '(' BFLOAT16 ',' LONG_VALUE ')' */ #line 1068 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBFloat16}; - } -#line 4724 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBFloat16}; } +#line 4743 "parser.cpp" + break; - case 132: /* column_type: VECTOR '(' UNSIGNED TINYINT ',' LONG_VALUE ')' */ + case 132: /* column_type: VECTOR '(' UNSIGNED TINYINT ',' LONG_VALUE ')' */ #line 1069 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemUInt8}; - } -#line 4730 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemUInt8}; } +#line 4749 "parser.cpp" + break; - case 133: /* column_type: SPARSE '(' BIT ',' LONG_VALUE ')' */ + case 133: /* column_type: SPARSE '(' BIT ',' LONG_VALUE ')' */ #line 1070 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; - } -#line 4736 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; } +#line 4755 "parser.cpp" + break; - case 134: /* column_type: SPARSE '(' TINYINT ',' LONG_VALUE ')' */ + case 134: /* column_type: SPARSE '(' TINYINT ',' LONG_VALUE ')' */ #line 1071 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; - } -#line 4742 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; } +#line 4761 "parser.cpp" + break; - case 135: /* column_type: SPARSE '(' SMALLINT ',' LONG_VALUE ')' */ + case 135: /* column_type: SPARSE '(' SMALLINT ',' LONG_VALUE ')' */ #line 1072 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; - } -#line 4748 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; } +#line 4767 "parser.cpp" + break; - case 136: /* column_type: SPARSE '(' INTEGER ',' LONG_VALUE ')' */ + case 136: /* column_type: SPARSE '(' INTEGER ',' LONG_VALUE ')' */ #line 1073 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; - } -#line 4754 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } +#line 4773 "parser.cpp" + break; - case 137: /* column_type: SPARSE '(' INT ',' LONG_VALUE ')' */ + case 137: /* column_type: SPARSE '(' INT ',' LONG_VALUE ')' */ #line 1074 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; - } -#line 4760 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } +#line 4779 "parser.cpp" + break; - case 138: /* column_type: SPARSE '(' BIGINT ',' LONG_VALUE ')' */ + case 138: /* column_type: SPARSE '(' BIGINT ',' LONG_VALUE ')' */ #line 1075 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; - } -#line 4766 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; } +#line 4785 "parser.cpp" + break; - case 139: /* column_type: SPARSE '(' FLOAT ',' LONG_VALUE ')' */ + case 139: /* column_type: SPARSE '(' FLOAT ',' LONG_VALUE ')' */ #line 1076 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; - } -#line 4772 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; } +#line 4791 "parser.cpp" + break; - case 140: /* column_type: SPARSE '(' DOUBLE ',' LONG_VALUE ')' */ + case 140: /* column_type: SPARSE '(' DOUBLE ',' LONG_VALUE ')' */ #line 1077 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; - } -#line 4778 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; } +#line 4797 "parser.cpp" + break; - case 141: /* column_type: SPARSE '(' FLOAT16 ',' LONG_VALUE ')' */ + case 141: /* column_type: SPARSE '(' FLOAT16 ',' LONG_VALUE ')' */ #line 1078 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat16}; - } -#line 4784 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat16}; } +#line 4803 "parser.cpp" + break; - case 142: /* column_type: SPARSE '(' BFLOAT16 ',' LONG_VALUE ')' */ + case 142: /* column_type: SPARSE '(' BFLOAT16 ',' LONG_VALUE ')' */ #line 1079 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBFloat16}; - } -#line 4790 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBFloat16}; } +#line 4809 "parser.cpp" + break; - case 143: /* column_type: SPARSE '(' UNSIGNED TINYINT ',' LONG_VALUE ')' */ + case 143: /* column_type: SPARSE '(' UNSIGNED TINYINT ',' LONG_VALUE ')' */ #line 1080 "parser.y" - { - (yyval.column_type_t) = - infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemUInt8}; - } -#line 4796 "parser.cpp" - break; + { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemUInt8}; } +#line 4815 "parser.cpp" + break; - case 144: /* column_constraints: column_constraint */ + case 144: /* column_constraints: column_constraint */ #line 1099 "parser.y" - { - (yyval.column_constraints_t) = new std::set(); - (yyval.column_constraints_t)->insert((yyvsp[0].column_constraint_t)); - } -#line 4805 "parser.cpp" - break; + { + (yyval.column_constraints_t) = new std::set(); + (yyval.column_constraints_t)->insert((yyvsp[0].column_constraint_t)); +} +#line 4824 "parser.cpp" + break; - case 145: /* column_constraints: column_constraints column_constraint */ + case 145: /* column_constraints: column_constraints column_constraint */ #line 1103 "parser.y" - { - if ((yyvsp[-1].column_constraints_t)->contains((yyvsp[0].column_constraint_t))) { - yyerror(&yyloc, scanner, result, "Duplicate column constraint."); - delete (yyvsp[-1].column_constraints_t); - YYERROR; - } - (yyvsp[-1].column_constraints_t)->insert((yyvsp[0].column_constraint_t)); - (yyval.column_constraints_t) = (yyvsp[-1].column_constraints_t); - } -#line 4819 "parser.cpp" - break; + { + if((yyvsp[-1].column_constraints_t)->contains((yyvsp[0].column_constraint_t))) { + yyerror(&yyloc, scanner, result, "Duplicate column constraint."); + delete (yyvsp[-1].column_constraints_t); + YYERROR; + } + (yyvsp[-1].column_constraints_t)->insert((yyvsp[0].column_constraint_t)); + (yyval.column_constraints_t) = (yyvsp[-1].column_constraints_t); +} +#line 4838 "parser.cpp" + break; - case 146: /* column_constraint: PRIMARY KEY */ + case 146: /* column_constraint: PRIMARY KEY */ #line 1113 "parser.y" - { - (yyval.column_constraint_t) = infinity::ConstraintType::kPrimaryKey; - } -#line 4827 "parser.cpp" - break; + { + (yyval.column_constraint_t) = infinity::ConstraintType::kPrimaryKey; +} +#line 4846 "parser.cpp" + break; - case 147: /* column_constraint: UNIQUE */ + case 147: /* column_constraint: UNIQUE */ #line 1116 "parser.y" - { - (yyval.column_constraint_t) = infinity::ConstraintType::kUnique; - } -#line 4835 "parser.cpp" - break; + { + (yyval.column_constraint_t) = infinity::ConstraintType::kUnique; +} +#line 4854 "parser.cpp" + break; - case 148: /* column_constraint: NULLABLE */ + case 148: /* column_constraint: NULLABLE */ #line 1119 "parser.y" - { - (yyval.column_constraint_t) = infinity::ConstraintType::kNull; - } -#line 4843 "parser.cpp" - break; + { + (yyval.column_constraint_t) = infinity::ConstraintType::kNull; +} +#line 4862 "parser.cpp" + break; - case 149: /* column_constraint: NOT NULLABLE */ + case 149: /* column_constraint: NOT NULLABLE */ #line 1122 "parser.y" - { - (yyval.column_constraint_t) = infinity::ConstraintType::kNotNull; - } -#line 4851 "parser.cpp" - break; + { + (yyval.column_constraint_t) = infinity::ConstraintType::kNotNull; +} +#line 4870 "parser.cpp" + break; - case 150: /* default_expr: DEFAULT constant_expr */ + case 150: /* default_expr: DEFAULT constant_expr */ #line 1126 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[0].const_expr_t); - } -#line 4859 "parser.cpp" - break; + { + (yyval.const_expr_t) = (yyvsp[0].const_expr_t); +} +#line 4878 "parser.cpp" + break; - case 151: /* default_expr: %empty */ + case 151: /* default_expr: %empty */ #line 1129 "parser.y" - { - (yyval.const_expr_t) = nullptr; - } -#line 4867 "parser.cpp" - break; + { + (yyval.const_expr_t) = nullptr; +} +#line 4886 "parser.cpp" + break; - case 152: /* table_constraint: PRIMARY KEY '(' identifier_array ')' */ + case 152: /* table_constraint: PRIMARY KEY '(' identifier_array ')' */ #line 1134 "parser.y" - { - (yyval.table_constraint_t) = new infinity::TableConstraint(); - (yyval.table_constraint_t)->names_ptr_ = (yyvsp[-1].identifier_array_t); - (yyval.table_constraint_t)->constraint_ = infinity::ConstraintType::kPrimaryKey; - } -#line 4877 "parser.cpp" - break; + { + (yyval.table_constraint_t) = new infinity::TableConstraint(); + (yyval.table_constraint_t)->names_ptr_ = (yyvsp[-1].identifier_array_t); + (yyval.table_constraint_t)->constraint_ = infinity::ConstraintType::kPrimaryKey; +} +#line 4896 "parser.cpp" + break; - case 153: /* table_constraint: UNIQUE '(' identifier_array ')' */ + case 153: /* table_constraint: UNIQUE '(' identifier_array ')' */ #line 1139 "parser.y" - { - (yyval.table_constraint_t) = new infinity::TableConstraint(); - (yyval.table_constraint_t)->names_ptr_ = (yyvsp[-1].identifier_array_t); - (yyval.table_constraint_t)->constraint_ = infinity::ConstraintType::kUnique; - } -#line 4887 "parser.cpp" - break; + { + (yyval.table_constraint_t) = new infinity::TableConstraint(); + (yyval.table_constraint_t)->names_ptr_ = (yyvsp[-1].identifier_array_t); + (yyval.table_constraint_t)->constraint_ = infinity::ConstraintType::kUnique; +} +#line 4906 "parser.cpp" + break; - case 154: /* identifier_array: IDENTIFIER */ + case 154: /* identifier_array: IDENTIFIER */ #line 1146 "parser.y" - { - (yyval.identifier_array_t) = new std::vector(); - ParserHelper::ToLower((yyvsp[0].str_value)); - (yyval.identifier_array_t)->emplace_back((yyvsp[0].str_value)); - free((yyvsp[0].str_value)); - } -#line 4898 "parser.cpp" - break; + { + (yyval.identifier_array_t) = new std::vector(); + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.identifier_array_t)->emplace_back((yyvsp[0].str_value)); + free((yyvsp[0].str_value)); +} +#line 4917 "parser.cpp" + break; - case 155: /* identifier_array: identifier_array ',' IDENTIFIER */ + case 155: /* identifier_array: identifier_array ',' IDENTIFIER */ #line 1152 "parser.y" - { - ParserHelper::ToLower((yyvsp[0].str_value)); - (yyvsp[-2].identifier_array_t)->emplace_back((yyvsp[0].str_value)); - free((yyvsp[0].str_value)); - (yyval.identifier_array_t) = (yyvsp[-2].identifier_array_t); - } -#line 4909 "parser.cpp" - break; + { + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyvsp[-2].identifier_array_t)->emplace_back((yyvsp[0].str_value)); + free((yyvsp[0].str_value)); + (yyval.identifier_array_t) = (yyvsp[-2].identifier_array_t); +} +#line 4928 "parser.cpp" + break; - case 156: /* delete_statement: DELETE FROM table_name where_clause */ + case 156: /* delete_statement: DELETE FROM table_name where_clause */ #line 1162 "parser.y" - { - (yyval.delete_stmt) = new infinity::DeleteStatement(); + { + (yyval.delete_stmt) = new infinity::DeleteStatement(); - if ((yyvsp[-1].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.delete_stmt)->schema_name_ = (yyvsp[-1].table_name_t)->schema_name_ptr_; - free((yyvsp[-1].table_name_t)->schema_name_ptr_); - } - (yyval.delete_stmt)->table_name_ = (yyvsp[-1].table_name_t)->table_name_ptr_; - free((yyvsp[-1].table_name_t)->table_name_ptr_); - delete (yyvsp[-1].table_name_t); - (yyval.delete_stmt)->where_expr_ = (yyvsp[0].expr_t); - } -#line 4926 "parser.cpp" - break; + if((yyvsp[-1].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.delete_stmt)->schema_name_ = (yyvsp[-1].table_name_t)->schema_name_ptr_; + free((yyvsp[-1].table_name_t)->schema_name_ptr_); + } + (yyval.delete_stmt)->table_name_ = (yyvsp[-1].table_name_t)->table_name_ptr_; + free((yyvsp[-1].table_name_t)->table_name_ptr_); + delete (yyvsp[-1].table_name_t); + (yyval.delete_stmt)->where_expr_ = (yyvsp[0].expr_t); +} +#line 4945 "parser.cpp" + break; - case 157: /* insert_statement: INSERT INTO table_name optional_identifier_array VALUES insert_row_list */ + case 157: /* insert_statement: INSERT INTO table_name optional_identifier_array VALUES insert_row_list */ #line 1178 "parser.y" - { - bool is_error{false}; - for (auto expr_array : *(yyvsp[0].insert_row_list_t)) { - for (const auto &expr : expr_array->values_) { - if (expr->type_ != infinity::ParsedExprType::kConstant) { - yyerror(&yyloc, scanner, result, ("Value list has non-constant expression: " + expr->ToString()).c_str()); - is_error = true; - } - } - } - if (is_error) { - for (auto expr_array : *(yyvsp[0].insert_row_list_t)) { - delete (expr_array); - } - delete (yyvsp[0].insert_row_list_t); - delete (yyvsp[-3].table_name_t); - delete (yyvsp[-2].identifier_array_t); - YYERROR; + { + bool is_error{false}; + for (auto expr_array : *(yyvsp[0].insert_row_list_t)) { + for (const auto &expr : expr_array->values_) { + if(expr->type_ != infinity::ParsedExprType::kConstant) { + yyerror(&yyloc, scanner, result, ("Value list has non-constant expression: " + expr->ToString()).c_str()); + is_error = true; } - - (yyval.insert_stmt) = new infinity::InsertStatement(); - if ((yyvsp[-3].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.insert_stmt)->schema_name_ = (yyvsp[-3].table_name_t)->schema_name_ptr_; - free((yyvsp[-3].table_name_t)->schema_name_ptr_); - } - (yyval.insert_stmt)->table_name_ = (yyvsp[-3].table_name_t)->table_name_ptr_; - free((yyvsp[-3].table_name_t)->table_name_ptr_); - delete (yyvsp[-3].table_name_t); - for (infinity::InsertRowExpr *&expr_ptr : *(yyvsp[0].insert_row_list_t)) { - if ((yyvsp[-2].identifier_array_t)) { - expr_ptr->columns_ = *((yyvsp[-2].identifier_array_t)); - } - (yyval.insert_stmt)->insert_rows_.emplace_back(expr_ptr); - expr_ptr = nullptr; - } - delete (yyvsp[-2].identifier_array_t); - delete (yyvsp[0].insert_row_list_t); } -#line 4969 "parser.cpp" - break; + } + if(is_error) { + for (auto expr_array : *(yyvsp[0].insert_row_list_t)) { + delete (expr_array); + } + delete (yyvsp[0].insert_row_list_t); + delete (yyvsp[-3].table_name_t); + delete (yyvsp[-2].identifier_array_t); + YYERROR; + } - case 158: /* insert_statement: INSERT INTO table_name optional_identifier_array select_without_paren */ + (yyval.insert_stmt) = new infinity::InsertStatement(); + if((yyvsp[-3].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.insert_stmt)->schema_name_ = (yyvsp[-3].table_name_t)->schema_name_ptr_; + free((yyvsp[-3].table_name_t)->schema_name_ptr_); + } + (yyval.insert_stmt)->table_name_ = (yyvsp[-3].table_name_t)->table_name_ptr_; + free((yyvsp[-3].table_name_t)->table_name_ptr_); + delete (yyvsp[-3].table_name_t); + for (infinity::InsertRowExpr* &expr_ptr : *(yyvsp[0].insert_row_list_t)) { + if ((yyvsp[-2].identifier_array_t)) { + expr_ptr->columns_ = *((yyvsp[-2].identifier_array_t)); + } + (yyval.insert_stmt)->insert_rows_.emplace_back(expr_ptr); + expr_ptr = nullptr; + } + delete (yyvsp[-2].identifier_array_t); + delete (yyvsp[0].insert_row_list_t); +} +#line 4988 "parser.cpp" + break; + + case 158: /* insert_statement: INSERT INTO table_name optional_identifier_array select_without_paren */ #line 1216 "parser.y" - { - (yyval.insert_stmt) = new infinity::InsertStatement(); - if ((yyvsp[-2].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.insert_stmt)->schema_name_ = (yyvsp[-2].table_name_t)->schema_name_ptr_; - free((yyvsp[-2].table_name_t)->schema_name_ptr_); - } - (yyval.insert_stmt)->table_name_ = (yyvsp[-2].table_name_t)->table_name_ptr_; - free((yyvsp[-2].table_name_t)->table_name_ptr_); - delete (yyvsp[-2].table_name_t); - if ((yyvsp[-1].identifier_array_t)) { - (yyval.insert_stmt)->columns_for_select_ = std::move(*((yyvsp[-1].identifier_array_t))); - delete (yyvsp[-1].identifier_array_t); - } - (yyval.insert_stmt)->select_.reset((yyvsp[0].select_stmt)); - } -#line 4989 "parser.cpp" - break; + { + (yyval.insert_stmt) = new infinity::InsertStatement(); + if((yyvsp[-2].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.insert_stmt)->schema_name_ = (yyvsp[-2].table_name_t)->schema_name_ptr_; + free((yyvsp[-2].table_name_t)->schema_name_ptr_); + } + (yyval.insert_stmt)->table_name_ = (yyvsp[-2].table_name_t)->table_name_ptr_; + free((yyvsp[-2].table_name_t)->table_name_ptr_); + delete (yyvsp[-2].table_name_t); + if ((yyvsp[-1].identifier_array_t)) { + (yyval.insert_stmt)->columns_for_select_ = std::move(*((yyvsp[-1].identifier_array_t))); + delete (yyvsp[-1].identifier_array_t); + } + (yyval.insert_stmt)->select_.reset((yyvsp[0].select_stmt)); +} +#line 5008 "parser.cpp" + break; - case 159: /* optional_identifier_array: '(' identifier_array ')' */ + case 159: /* optional_identifier_array: '(' identifier_array ')' */ #line 1232 "parser.y" - { - (yyval.identifier_array_t) = (yyvsp[-1].identifier_array_t); - } -#line 4997 "parser.cpp" - break; + { + (yyval.identifier_array_t) = (yyvsp[-1].identifier_array_t); +} +#line 5016 "parser.cpp" + break; - case 160: /* optional_identifier_array: %empty */ + case 160: /* optional_identifier_array: %empty */ #line 1235 "parser.y" - { - (yyval.identifier_array_t) = nullptr; - } -#line 5005 "parser.cpp" - break; + { + (yyval.identifier_array_t) = nullptr; +} +#line 5024 "parser.cpp" + break; - case 161: /* explain_statement: EXPLAIN IDENTIFIER explainable_statement */ + case 161: /* explain_statement: EXPLAIN IDENTIFIER explainable_statement */ #line 1242 "parser.y" - { - (yyval.explain_stmt) = new infinity::ExplainStatement(); - ParserHelper::ToLower((yyvsp[-1].str_value)); - if (!strcmp((yyvsp[-1].str_value), "analyze")) - (yyval.explain_stmt)->type_ = infinity::ExplainType::kAnalyze; - else if (!strcmp((yyvsp[-1].str_value), "ast")) - (yyval.explain_stmt)->type_ = infinity::ExplainType::kAst; - else if (!strcmp((yyvsp[-1].str_value), "raw")) - (yyval.explain_stmt)->type_ = infinity::ExplainType::kUnOpt; - else if (!strcmp((yyvsp[-1].str_value), "logical")) - (yyval.explain_stmt)->type_ = infinity::ExplainType::kOpt; - else if (!strcmp((yyvsp[-1].str_value), "physical")) - (yyval.explain_stmt)->type_ = infinity::ExplainType::kPhysical; - else if (!strcmp((yyvsp[-1].str_value), "pipeline")) - (yyval.explain_stmt)->type_ = infinity::ExplainType::kPipeline; - else if (!strcmp((yyvsp[-1].str_value), "fragment")) - (yyval.explain_stmt)->type_ = infinity::ExplainType::kFragment; - free((yyvsp[-1].str_value)); - (yyval.explain_stmt)->statement_ = (yyvsp[0].base_stmt); - } -#line 5023 "parser.cpp" - break; + { + (yyval.explain_stmt) = new infinity::ExplainStatement(); + ParserHelper::ToLower((yyvsp[-1].str_value)); + if(!strcmp((yyvsp[-1].str_value), "analyze")) (yyval.explain_stmt)->type_ = infinity::ExplainType::kAnalyze; + else if(!strcmp((yyvsp[-1].str_value), "ast")) (yyval.explain_stmt)->type_ =infinity::ExplainType::kAst; + else if(!strcmp((yyvsp[-1].str_value), "raw")) (yyval.explain_stmt)->type_ =infinity::ExplainType::kUnOpt; + else if(!strcmp((yyvsp[-1].str_value), "logical")) (yyval.explain_stmt)->type_ =infinity::ExplainType::kOpt; + else if(!strcmp((yyvsp[-1].str_value), "physical")) (yyval.explain_stmt)->type_ =infinity::ExplainType::kPhysical; + else if(!strcmp((yyvsp[-1].str_value), "pipeline")) (yyval.explain_stmt)->type_ =infinity::ExplainType::kPipeline; + else if(!strcmp((yyvsp[-1].str_value), "fragment")) (yyval.explain_stmt)->type_ =infinity::ExplainType::kFragment; + free((yyvsp[-1].str_value)); + (yyval.explain_stmt)->statement_ = (yyvsp[0].base_stmt); +} +#line 5042 "parser.cpp" + break; - case 162: /* explain_statement: EXPLAIN explainable_statement */ + case 162: /* explain_statement: EXPLAIN explainable_statement */ #line 1254 "parser.y" - { - (yyval.explain_stmt) = new infinity::ExplainStatement(); - (yyval.explain_stmt)->type_ = infinity::ExplainType::kPhysical; - (yyval.explain_stmt)->statement_ = (yyvsp[0].base_stmt); - } -#line 5033 "parser.cpp" - break; + { + (yyval.explain_stmt) = new infinity::ExplainStatement(); + (yyval.explain_stmt)->type_ =infinity::ExplainType::kPhysical; + (yyval.explain_stmt)->statement_ = (yyvsp[0].base_stmt); +} +#line 5052 "parser.cpp" + break; - case 163: /* update_statement: UPDATE table_name SET update_expr_array where_clause */ + case 163: /* update_statement: UPDATE table_name SET update_expr_array where_clause */ #line 1263 "parser.y" - { - (yyval.update_stmt) = new infinity::UpdateStatement(); - if ((yyvsp[-3].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.update_stmt)->schema_name_ = (yyvsp[-3].table_name_t)->schema_name_ptr_; - free((yyvsp[-3].table_name_t)->schema_name_ptr_); - } - (yyval.update_stmt)->table_name_ = (yyvsp[-3].table_name_t)->table_name_ptr_; - free((yyvsp[-3].table_name_t)->table_name_ptr_); - delete (yyvsp[-3].table_name_t); - (yyval.update_stmt)->where_expr_ = (yyvsp[0].expr_t); - (yyval.update_stmt)->update_expr_array_ = (yyvsp[-1].update_expr_array_t); - } -#line 5050 "parser.cpp" - break; + { + (yyval.update_stmt) = new infinity::UpdateStatement(); + if((yyvsp[-3].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.update_stmt)->schema_name_ = (yyvsp[-3].table_name_t)->schema_name_ptr_; + free((yyvsp[-3].table_name_t)->schema_name_ptr_); + } + (yyval.update_stmt)->table_name_ = (yyvsp[-3].table_name_t)->table_name_ptr_; + free((yyvsp[-3].table_name_t)->table_name_ptr_); + delete (yyvsp[-3].table_name_t); + (yyval.update_stmt)->where_expr_ = (yyvsp[0].expr_t); + (yyval.update_stmt)->update_expr_array_ = (yyvsp[-1].update_expr_array_t); +} +#line 5069 "parser.cpp" + break; - case 164: /* update_expr_array: update_expr */ + case 164: /* update_expr_array: update_expr */ #line 1276 "parser.y" - { - (yyval.update_expr_array_t) = new std::vector(); - (yyval.update_expr_array_t)->emplace_back((yyvsp[0].update_expr_t)); - } -#line 5059 "parser.cpp" - break; + { + (yyval.update_expr_array_t) = new std::vector(); + (yyval.update_expr_array_t)->emplace_back((yyvsp[0].update_expr_t)); +} +#line 5078 "parser.cpp" + break; - case 165: /* update_expr_array: update_expr_array ',' update_expr */ + case 165: /* update_expr_array: update_expr_array ',' update_expr */ #line 1280 "parser.y" - { - (yyvsp[-2].update_expr_array_t)->emplace_back((yyvsp[0].update_expr_t)); - (yyval.update_expr_array_t) = (yyvsp[-2].update_expr_array_t); - } -#line 5068 "parser.cpp" - break; + { + (yyvsp[-2].update_expr_array_t)->emplace_back((yyvsp[0].update_expr_t)); + (yyval.update_expr_array_t) = (yyvsp[-2].update_expr_array_t); +} +#line 5087 "parser.cpp" + break; - case 166: /* update_expr: IDENTIFIER '=' expr */ + case 166: /* update_expr: IDENTIFIER '=' expr */ #line 1285 "parser.y" - { - (yyval.update_expr_t) = new infinity::UpdateExpr(); - ParserHelper::ToLower((yyvsp[-2].str_value)); - (yyval.update_expr_t)->column_name = (yyvsp[-2].str_value); - free((yyvsp[-2].str_value)); - (yyval.update_expr_t)->value = (yyvsp[0].expr_t); - } -#line 5080 "parser.cpp" - break; + { + (yyval.update_expr_t) = new infinity::UpdateExpr(); + ParserHelper::ToLower((yyvsp[-2].str_value)); + (yyval.update_expr_t)->column_name = (yyvsp[-2].str_value); + free((yyvsp[-2].str_value)); + (yyval.update_expr_t)->value = (yyvsp[0].expr_t); +} +#line 5099 "parser.cpp" + break; - case 167: /* drop_statement: DROP DATABASE if_exists IDENTIFIER */ + case 167: /* drop_statement: DROP DATABASE if_exists IDENTIFIER */ #line 1298 "parser.y" - { - (yyval.drop_stmt) = new infinity::DropStatement(); - std::shared_ptr drop_schema_info = std::make_shared(); + { + (yyval.drop_stmt) = new infinity::DropStatement(); + std::shared_ptr drop_schema_info = std::make_shared(); - ParserHelper::ToLower((yyvsp[0].str_value)); - drop_schema_info->schema_name_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); + ParserHelper::ToLower((yyvsp[0].str_value)); + drop_schema_info->schema_name_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); - (yyval.drop_stmt)->drop_info_ = drop_schema_info; - (yyval.drop_stmt)->drop_info_->conflict_type_ = (yyvsp[-1].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; - } -#line 5096 "parser.cpp" - break; + (yyval.drop_stmt)->drop_info_ = drop_schema_info; + (yyval.drop_stmt)->drop_info_->conflict_type_ = (yyvsp[-1].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; +} +#line 5115 "parser.cpp" + break; - case 168: /* drop_statement: DROP COLLECTION if_exists table_name */ + case 168: /* drop_statement: DROP COLLECTION if_exists table_name */ #line 1311 "parser.y" - { - (yyval.drop_stmt) = new infinity::DropStatement(); - std::shared_ptr drop_collection_info = std::make_unique(); - if ((yyvsp[0].table_name_t)->schema_name_ptr_ != nullptr) { - drop_collection_info->schema_name_ = (yyvsp[0].table_name_t)->schema_name_ptr_; - free((yyvsp[0].table_name_t)->schema_name_ptr_); - } - drop_collection_info->collection_name_ = (yyvsp[0].table_name_t)->table_name_ptr_; - free((yyvsp[0].table_name_t)->table_name_ptr_); - (yyval.drop_stmt)->drop_info_ = drop_collection_info; - (yyval.drop_stmt)->drop_info_->conflict_type_ = (yyvsp[-1].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; - delete (yyvsp[0].table_name_t); - } -#line 5114 "parser.cpp" - break; + { + (yyval.drop_stmt) = new infinity::DropStatement(); + std::shared_ptr drop_collection_info = std::make_unique(); + if((yyvsp[0].table_name_t)->schema_name_ptr_ != nullptr) { + drop_collection_info->schema_name_ = (yyvsp[0].table_name_t)->schema_name_ptr_; + free((yyvsp[0].table_name_t)->schema_name_ptr_); + } + drop_collection_info->collection_name_ = (yyvsp[0].table_name_t)->table_name_ptr_; + free((yyvsp[0].table_name_t)->table_name_ptr_); + (yyval.drop_stmt)->drop_info_ = drop_collection_info; + (yyval.drop_stmt)->drop_info_->conflict_type_ = (yyvsp[-1].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; + delete (yyvsp[0].table_name_t); +} +#line 5133 "parser.cpp" + break; - case 169: /* drop_statement: DROP TABLE if_exists table_name */ + case 169: /* drop_statement: DROP TABLE if_exists table_name */ #line 1326 "parser.y" - { - (yyval.drop_stmt) = new infinity::DropStatement(); - std::shared_ptr drop_table_info = std::make_unique(); - if ((yyvsp[0].table_name_t)->schema_name_ptr_ != nullptr) { - drop_table_info->schema_name_ = (yyvsp[0].table_name_t)->schema_name_ptr_; - free((yyvsp[0].table_name_t)->schema_name_ptr_); - } - drop_table_info->table_name_ = (yyvsp[0].table_name_t)->table_name_ptr_; - free((yyvsp[0].table_name_t)->table_name_ptr_); - (yyval.drop_stmt)->drop_info_ = drop_table_info; - (yyval.drop_stmt)->drop_info_->conflict_type_ = (yyvsp[-1].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; - delete (yyvsp[0].table_name_t); - } -#line 5132 "parser.cpp" - break; + { + (yyval.drop_stmt) = new infinity::DropStatement(); + std::shared_ptr drop_table_info = std::make_unique(); + if((yyvsp[0].table_name_t)->schema_name_ptr_ != nullptr) { + drop_table_info->schema_name_ = (yyvsp[0].table_name_t)->schema_name_ptr_; + free((yyvsp[0].table_name_t)->schema_name_ptr_); + } + drop_table_info->table_name_ = (yyvsp[0].table_name_t)->table_name_ptr_; + free((yyvsp[0].table_name_t)->table_name_ptr_); + (yyval.drop_stmt)->drop_info_ = drop_table_info; + (yyval.drop_stmt)->drop_info_->conflict_type_ = (yyvsp[-1].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; + delete (yyvsp[0].table_name_t); +} +#line 5151 "parser.cpp" + break; - case 170: /* drop_statement: DROP VIEW if_exists table_name */ + case 170: /* drop_statement: DROP VIEW if_exists table_name */ #line 1341 "parser.y" - { - (yyval.drop_stmt) = new infinity::DropStatement(); - std::shared_ptr drop_view_info = std::make_unique(); - if ((yyvsp[0].table_name_t)->schema_name_ptr_ != nullptr) { - drop_view_info->schema_name_ = (yyvsp[0].table_name_t)->schema_name_ptr_; - free((yyvsp[0].table_name_t)->schema_name_ptr_); - } - drop_view_info->view_name_ = (yyvsp[0].table_name_t)->table_name_ptr_; - free((yyvsp[0].table_name_t)->table_name_ptr_); - (yyval.drop_stmt)->drop_info_ = drop_view_info; - (yyval.drop_stmt)->drop_info_->conflict_type_ = (yyvsp[-1].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; - delete (yyvsp[0].table_name_t); - } -#line 5150 "parser.cpp" - break; + { + (yyval.drop_stmt) = new infinity::DropStatement(); + std::shared_ptr drop_view_info = std::make_unique(); + if((yyvsp[0].table_name_t)->schema_name_ptr_ != nullptr) { + drop_view_info->schema_name_ = (yyvsp[0].table_name_t)->schema_name_ptr_; + free((yyvsp[0].table_name_t)->schema_name_ptr_); + } + drop_view_info->view_name_ = (yyvsp[0].table_name_t)->table_name_ptr_; + free((yyvsp[0].table_name_t)->table_name_ptr_); + (yyval.drop_stmt)->drop_info_ = drop_view_info; + (yyval.drop_stmt)->drop_info_->conflict_type_ = (yyvsp[-1].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; + delete (yyvsp[0].table_name_t); +} +#line 5169 "parser.cpp" + break; - case 171: /* drop_statement: DROP INDEX if_exists IDENTIFIER ON table_name */ + case 171: /* drop_statement: DROP INDEX if_exists IDENTIFIER ON table_name */ #line 1356 "parser.y" - { - (yyval.drop_stmt) = new infinity::DropStatement(); - std::shared_ptr drop_index_info = std::make_shared(); + { + (yyval.drop_stmt) = new infinity::DropStatement(); + std::shared_ptr drop_index_info = std::make_shared(); - (yyval.drop_stmt)->drop_info_ = drop_index_info; - (yyval.drop_stmt)->drop_info_->conflict_type_ = (yyvsp[-3].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; + (yyval.drop_stmt)->drop_info_ = drop_index_info; + (yyval.drop_stmt)->drop_info_->conflict_type_ = (yyvsp[-3].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; - drop_index_info->index_name_ = (yyvsp[-2].str_value); - free((yyvsp[-2].str_value)); + drop_index_info->index_name_ = (yyvsp[-2].str_value); + free((yyvsp[-2].str_value)); - if ((yyvsp[0].table_name_t)->schema_name_ptr_ != nullptr) { - drop_index_info->schema_name_ = (yyvsp[0].table_name_t)->schema_name_ptr_; - free((yyvsp[0].table_name_t)->schema_name_ptr_); - } - drop_index_info->table_name_ = (yyvsp[0].table_name_t)->table_name_ptr_; - free((yyvsp[0].table_name_t)->table_name_ptr_); - delete (yyvsp[0].table_name_t); - } -#line 5173 "parser.cpp" - break; + if((yyvsp[0].table_name_t)->schema_name_ptr_ != nullptr) { + drop_index_info->schema_name_ = (yyvsp[0].table_name_t)->schema_name_ptr_; + free((yyvsp[0].table_name_t)->schema_name_ptr_); + } + drop_index_info->table_name_ = (yyvsp[0].table_name_t)->table_name_ptr_; + free((yyvsp[0].table_name_t)->table_name_ptr_); + delete (yyvsp[0].table_name_t); +} +#line 5192 "parser.cpp" + break; - case 172: /* copy_statement: COPY table_name TO file_path WITH '(' copy_option_list ')' */ + case 172: /* copy_statement: COPY table_name TO file_path WITH '(' copy_option_list ')' */ #line 1379 "parser.y" - { - (yyval.copy_stmt) = new infinity::CopyStatement(); + { + (yyval.copy_stmt) = new infinity::CopyStatement(); - // Copy To - (yyval.copy_stmt)->copy_from_ = false; + // Copy To + (yyval.copy_stmt)->copy_from_ = false; - // table_name - if ((yyvsp[-6].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.copy_stmt)->schema_name_ = (yyvsp[-6].table_name_t)->schema_name_ptr_; - free((yyvsp[-6].table_name_t)->schema_name_ptr_); + // table_name + if((yyvsp[-6].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.copy_stmt)->schema_name_ = (yyvsp[-6].table_name_t)->schema_name_ptr_; + free((yyvsp[-6].table_name_t)->schema_name_ptr_); + } + (yyval.copy_stmt)->table_name_ = (yyvsp[-6].table_name_t)->table_name_ptr_; + free((yyvsp[-6].table_name_t)->table_name_ptr_); + delete (yyvsp[-6].table_name_t); + + // file path + (yyval.copy_stmt)->file_path_ = (yyvsp[-4].str_value); + free((yyvsp[-4].str_value)); + + // copy options + size_t option_count = (*(yyvsp[-1].copy_option_array)).size(); + for(size_t idx = 0; idx < option_count; ++ idx) { + infinity::CopyOption* option_ptr = (*(yyvsp[-1].copy_option_array))[idx]; + switch(option_ptr->option_type_) { + case infinity::CopyOptionType::kFormat: { + (yyval.copy_stmt)->copy_file_type_ = option_ptr->file_type_; + break; } - (yyval.copy_stmt)->table_name_ = (yyvsp[-6].table_name_t)->table_name_ptr_; - free((yyvsp[-6].table_name_t)->table_name_ptr_); - delete (yyvsp[-6].table_name_t); - - // file path - (yyval.copy_stmt)->file_path_ = (yyvsp[-4].str_value); - free((yyvsp[-4].str_value)); - - // copy options - size_t option_count = (*(yyvsp[-1].copy_option_array)).size(); - for (size_t idx = 0; idx < option_count; ++idx) { - infinity::CopyOption *option_ptr = (*(yyvsp[-1].copy_option_array))[idx]; - switch (option_ptr->option_type_) { - case infinity::CopyOptionType::kFormat: { - (yyval.copy_stmt)->copy_file_type_ = option_ptr->file_type_; - break; - } - case infinity::CopyOptionType::kDelimiter: { - (yyval.copy_stmt)->delimiter_ = option_ptr->delimiter_; - break; - } - case infinity::CopyOptionType::kHeader: { - (yyval.copy_stmt)->header_ = option_ptr->header_; - break; - } - case infinity::CopyOptionType::kOffset: { - (yyval.copy_stmt)->offset_ = option_ptr->offset_; - break; - } - case infinity::CopyOptionType::kLimit: { - (yyval.copy_stmt)->limit_ = option_ptr->limit_; - break; - } - case infinity::CopyOptionType::kRowLimit: { - (yyval.copy_stmt)->row_limit_ = option_ptr->row_limit_; - break; - } - } - delete option_ptr; + case infinity::CopyOptionType::kDelimiter: { + (yyval.copy_stmt)->delimiter_ = option_ptr->delimiter_; + break; + } + case infinity::CopyOptionType::kHeader: { + (yyval.copy_stmt)->header_ = option_ptr->header_; + break; + } + case infinity::CopyOptionType::kOffset: { + (yyval.copy_stmt)->offset_ = option_ptr->offset_; + break; + } + case infinity::CopyOptionType::kLimit: { + (yyval.copy_stmt)->limit_ = option_ptr->limit_; + break; + } + case infinity::CopyOptionType::kRowLimit: { + (yyval.copy_stmt)->row_limit_ = option_ptr->row_limit_; + break; } - delete (yyvsp[-1].copy_option_array); } -#line 5231 "parser.cpp" - break; + delete option_ptr; + } + delete (yyvsp[-1].copy_option_array); +} +#line 5250 "parser.cpp" + break; - case 173: /* copy_statement: COPY table_name '(' expr_array ')' TO file_path WITH '(' copy_option_list ')' */ + case 173: /* copy_statement: COPY table_name '(' expr_array ')' TO file_path WITH '(' copy_option_list ')' */ #line 1432 "parser.y" - { - (yyval.copy_stmt) = new infinity::CopyStatement(); + { + (yyval.copy_stmt) = new infinity::CopyStatement(); - // Copy To - (yyval.copy_stmt)->copy_from_ = false; + // Copy To + (yyval.copy_stmt)->copy_from_ = false; - // table_name - if ((yyvsp[-9].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.copy_stmt)->schema_name_ = (yyvsp[-9].table_name_t)->schema_name_ptr_; - free((yyvsp[-9].table_name_t)->schema_name_ptr_); + // table_name + if((yyvsp[-9].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.copy_stmt)->schema_name_ = (yyvsp[-9].table_name_t)->schema_name_ptr_; + free((yyvsp[-9].table_name_t)->schema_name_ptr_); + } + (yyval.copy_stmt)->table_name_ = (yyvsp[-9].table_name_t)->table_name_ptr_; + free((yyvsp[-9].table_name_t)->table_name_ptr_); + delete (yyvsp[-9].table_name_t); + + (yyval.copy_stmt)->expr_array_ = (yyvsp[-7].expr_array_t); + + // file path + (yyval.copy_stmt)->file_path_ = (yyvsp[-4].str_value); + free((yyvsp[-4].str_value)); + + // copy options + size_t option_count = (*(yyvsp[-1].copy_option_array)).size(); + for(size_t idx = 0; idx < option_count; ++ idx) { + infinity::CopyOption* option_ptr = (*(yyvsp[-1].copy_option_array))[idx]; + switch(option_ptr->option_type_) { + case infinity::CopyOptionType::kFormat: { + (yyval.copy_stmt)->copy_file_type_ = option_ptr->file_type_; + break; } - (yyval.copy_stmt)->table_name_ = (yyvsp[-9].table_name_t)->table_name_ptr_; - free((yyvsp[-9].table_name_t)->table_name_ptr_); - delete (yyvsp[-9].table_name_t); - - (yyval.copy_stmt)->expr_array_ = (yyvsp[-7].expr_array_t); - - // file path - (yyval.copy_stmt)->file_path_ = (yyvsp[-4].str_value); - free((yyvsp[-4].str_value)); - - // copy options - size_t option_count = (*(yyvsp[-1].copy_option_array)).size(); - for (size_t idx = 0; idx < option_count; ++idx) { - infinity::CopyOption *option_ptr = (*(yyvsp[-1].copy_option_array))[idx]; - switch (option_ptr->option_type_) { - case infinity::CopyOptionType::kFormat: { - (yyval.copy_stmt)->copy_file_type_ = option_ptr->file_type_; - break; - } - case infinity::CopyOptionType::kDelimiter: { - (yyval.copy_stmt)->delimiter_ = option_ptr->delimiter_; - break; - } - case infinity::CopyOptionType::kHeader: { - (yyval.copy_stmt)->header_ = option_ptr->header_; - break; - } - case infinity::CopyOptionType::kOffset: { - (yyval.copy_stmt)->offset_ = option_ptr->offset_; - break; - } - case infinity::CopyOptionType::kLimit: { - (yyval.copy_stmt)->limit_ = option_ptr->limit_; - break; - } - case infinity::CopyOptionType::kRowLimit: { - (yyval.copy_stmt)->row_limit_ = option_ptr->row_limit_; - break; - } - } - delete option_ptr; + case infinity::CopyOptionType::kDelimiter: { + (yyval.copy_stmt)->delimiter_ = option_ptr->delimiter_; + break; + } + case infinity::CopyOptionType::kHeader: { + (yyval.copy_stmt)->header_ = option_ptr->header_; + break; + } + case infinity::CopyOptionType::kOffset: { + (yyval.copy_stmt)->offset_ = option_ptr->offset_; + break; + } + case infinity::CopyOptionType::kLimit: { + (yyval.copy_stmt)->limit_ = option_ptr->limit_; + break; + } + case infinity::CopyOptionType::kRowLimit: { + (yyval.copy_stmt)->row_limit_ = option_ptr->row_limit_; + break; } - delete (yyvsp[-1].copy_option_array); } -#line 5291 "parser.cpp" - break; + delete option_ptr; + } + delete (yyvsp[-1].copy_option_array); +} +#line 5310 "parser.cpp" + break; - case 174: /* copy_statement: COPY table_name FROM file_path WITH '(' copy_option_list ')' */ + case 174: /* copy_statement: COPY table_name FROM file_path WITH '(' copy_option_list ')' */ #line 1487 "parser.y" - { - (yyval.copy_stmt) = new infinity::CopyStatement(); + { + (yyval.copy_stmt) = new infinity::CopyStatement(); - // Copy From - (yyval.copy_stmt)->copy_from_ = true; + // Copy From + (yyval.copy_stmt)->copy_from_ = true; - // table_name - if ((yyvsp[-6].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.copy_stmt)->schema_name_ = (yyvsp[-6].table_name_t)->schema_name_ptr_; - free((yyvsp[-6].table_name_t)->schema_name_ptr_); + // table_name + if((yyvsp[-6].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.copy_stmt)->schema_name_ = (yyvsp[-6].table_name_t)->schema_name_ptr_; + free((yyvsp[-6].table_name_t)->schema_name_ptr_); + } + (yyval.copy_stmt)->table_name_ = (yyvsp[-6].table_name_t)->table_name_ptr_; + free((yyvsp[-6].table_name_t)->table_name_ptr_); + delete (yyvsp[-6].table_name_t); + + // file path + (yyval.copy_stmt)->file_path_ = (yyvsp[-4].str_value); + free((yyvsp[-4].str_value)); + + // copy options + size_t option_count = (*(yyvsp[-1].copy_option_array)).size(); + for(size_t idx = 0; idx < option_count; ++ idx) { + infinity::CopyOption* option_ptr = (*(yyvsp[-1].copy_option_array))[idx]; + switch(option_ptr->option_type_) { + case infinity::CopyOptionType::kFormat: { + (yyval.copy_stmt)->copy_file_type_ = option_ptr->file_type_; + break; } - (yyval.copy_stmt)->table_name_ = (yyvsp[-6].table_name_t)->table_name_ptr_; - free((yyvsp[-6].table_name_t)->table_name_ptr_); - delete (yyvsp[-6].table_name_t); - - // file path - (yyval.copy_stmt)->file_path_ = (yyvsp[-4].str_value); - free((yyvsp[-4].str_value)); - - // copy options - size_t option_count = (*(yyvsp[-1].copy_option_array)).size(); - for (size_t idx = 0; idx < option_count; ++idx) { - infinity::CopyOption *option_ptr = (*(yyvsp[-1].copy_option_array))[idx]; - switch (option_ptr->option_type_) { - case infinity::CopyOptionType::kFormat: { - (yyval.copy_stmt)->copy_file_type_ = option_ptr->file_type_; - break; - } - case infinity::CopyOptionType::kDelimiter: { - (yyval.copy_stmt)->delimiter_ = option_ptr->delimiter_; - break; - } - case infinity::CopyOptionType::kHeader: { - (yyval.copy_stmt)->header_ = option_ptr->header_; - break; - } - default: { - delete option_ptr; - delete (yyvsp[-1].copy_option_array); - yyerror(&yyloc, scanner, result, "Invalid import option"); - YYERROR; - } - } + case infinity::CopyOptionType::kDelimiter: { + (yyval.copy_stmt)->delimiter_ = option_ptr->delimiter_; + break; + } + case infinity::CopyOptionType::kHeader: { + (yyval.copy_stmt)->header_ = option_ptr->header_; + break; + } + default: { delete option_ptr; + delete (yyvsp[-1].copy_option_array); + yyerror(&yyloc, scanner, result, "Invalid import option"); + YYERROR; } - delete (yyvsp[-1].copy_option_array); } -#line 5343 "parser.cpp" - break; + delete option_ptr; + } + delete (yyvsp[-1].copy_option_array); +} +#line 5362 "parser.cpp" + break; - case 175: /* select_statement: select_without_paren */ + case 175: /* select_statement: select_without_paren */ #line 1538 "parser.y" - { - (yyval.select_stmt) = (yyvsp[0].select_stmt); - } -#line 5351 "parser.cpp" - break; + { + (yyval.select_stmt) = (yyvsp[0].select_stmt); +} +#line 5370 "parser.cpp" + break; - case 176: /* select_statement: select_with_paren */ + case 176: /* select_statement: select_with_paren */ #line 1541 "parser.y" - { - (yyval.select_stmt) = (yyvsp[0].select_stmt); - } -#line 5359 "parser.cpp" - break; + { + (yyval.select_stmt) = (yyvsp[0].select_stmt); +} +#line 5378 "parser.cpp" + break; - case 177: /* select_statement: select_statement set_operator select_clause_without_modifier_paren */ + case 177: /* select_statement: select_statement set_operator select_clause_without_modifier_paren */ #line 1544 "parser.y" - { - infinity::SelectStatement *node = (yyvsp[-2].select_stmt); - while (node->nested_select_ != nullptr) { - node = node->nested_select_; - } - node->set_op_ = (yyvsp[-1].set_operator_t); - node->nested_select_ = (yyvsp[0].select_stmt); - (yyval.select_stmt) = (yyvsp[-2].select_stmt); - } -#line 5373 "parser.cpp" - break; + { + infinity::SelectStatement* node = (yyvsp[-2].select_stmt); + while(node->nested_select_ != nullptr) { + node = node->nested_select_; + } + node->set_op_ = (yyvsp[-1].set_operator_t); + node->nested_select_ = (yyvsp[0].select_stmt); + (yyval.select_stmt) = (yyvsp[-2].select_stmt); +} +#line 5392 "parser.cpp" + break; - case 178: /* select_statement: select_statement set_operator select_clause_without_modifier */ + case 178: /* select_statement: select_statement set_operator select_clause_without_modifier */ #line 1553 "parser.y" - { - infinity::SelectStatement *node = (yyvsp[-2].select_stmt); - while (node->nested_select_ != nullptr) { - node = node->nested_select_; - } - node->set_op_ = (yyvsp[-1].set_operator_t); - node->nested_select_ = (yyvsp[0].select_stmt); - (yyval.select_stmt) = (yyvsp[-2].select_stmt); - } -#line 5387 "parser.cpp" - break; + { + infinity::SelectStatement* node = (yyvsp[-2].select_stmt); + while(node->nested_select_ != nullptr) { + node = node->nested_select_; + } + node->set_op_ = (yyvsp[-1].set_operator_t); + node->nested_select_ = (yyvsp[0].select_stmt); + (yyval.select_stmt) = (yyvsp[-2].select_stmt); +} +#line 5406 "parser.cpp" + break; - case 179: /* select_with_paren: '(' select_without_paren ')' */ + case 179: /* select_with_paren: '(' select_without_paren ')' */ #line 1563 "parser.y" - { - (yyval.select_stmt) = (yyvsp[-1].select_stmt); - } -#line 5395 "parser.cpp" - break; + { + (yyval.select_stmt) = (yyvsp[-1].select_stmt); +} +#line 5414 "parser.cpp" + break; - case 180: /* select_with_paren: '(' select_with_paren ')' */ + case 180: /* select_with_paren: '(' select_with_paren ')' */ #line 1566 "parser.y" - { - (yyval.select_stmt) = (yyvsp[-1].select_stmt); - } -#line 5403 "parser.cpp" - break; + { + (yyval.select_stmt) = (yyvsp[-1].select_stmt); +} +#line 5422 "parser.cpp" + break; - case 181: /* select_without_paren: with_clause select_clause_with_modifier */ + case 181: /* select_without_paren: with_clause select_clause_with_modifier */ #line 1570 "parser.y" - { - (yyvsp[0].select_stmt)->with_exprs_ = (yyvsp[-1].with_expr_list_t); - (yyval.select_stmt) = (yyvsp[0].select_stmt); - } -#line 5412 "parser.cpp" - break; + { + (yyvsp[0].select_stmt)->with_exprs_ = (yyvsp[-1].with_expr_list_t); + (yyval.select_stmt) = (yyvsp[0].select_stmt); +} +#line 5431 "parser.cpp" + break; - case 182: /* select_clause_with_modifier: select_clause_without_modifier order_by_clause limit_expr offset_expr */ + case 182: /* select_clause_with_modifier: select_clause_without_modifier order_by_clause limit_expr offset_expr */ #line 1575 "parser.y" - { - if ((yyvsp[-1].expr_t) == nullptr and (yyvsp[0].expr_t) != nullptr) { - delete (yyvsp[-3].select_stmt); - delete (yyvsp[-2].order_by_expr_list_t); - delete (yyvsp[0].expr_t); - yyerror(&yyloc, scanner, result, "Offset expression isn't valid without Limit expression"); - YYERROR; - } - if ((yyvsp[-3].select_stmt)->search_expr_ != nullptr and - ((yyvsp[-2].order_by_expr_list_t) != nullptr /*or $3 != nullptr or $4 != nullptr*/)) { - delete (yyvsp[-3].select_stmt); - if ((yyvsp[-2].order_by_expr_list_t)) { - for (auto ptr : *((yyvsp[-2].order_by_expr_list_t))) { - delete ptr; - } - delete (yyvsp[-2].order_by_expr_list_t); - } - delete (yyvsp[-1].expr_t); - delete (yyvsp[0].expr_t); - yyerror(&yyloc, scanner, result, "Result modifier(ORDER BY) is conflict with SEARCH expression."); - YYERROR; + { + if((yyvsp[-1].expr_t) == nullptr and (yyvsp[0].expr_t) != nullptr) { + delete (yyvsp[-3].select_stmt); + delete (yyvsp[-2].order_by_expr_list_t); + delete (yyvsp[0].expr_t); + yyerror(&yyloc, scanner, result, "Offset expression isn't valid without Limit expression"); + YYERROR; + } + if((yyvsp[-3].select_stmt)->search_expr_ != nullptr and ((yyvsp[-2].order_by_expr_list_t) != nullptr /*or $3 != nullptr or $4 != nullptr*/)) { + delete (yyvsp[-3].select_stmt); + if ((yyvsp[-2].order_by_expr_list_t)) { + for (auto ptr : *((yyvsp[-2].order_by_expr_list_t))) { + delete ptr; } - (yyvsp[-3].select_stmt)->order_by_list_ = (yyvsp[-2].order_by_expr_list_t); - (yyvsp[-3].select_stmt)->limit_expr_ = (yyvsp[-1].expr_t); - (yyvsp[-3].select_stmt)->offset_expr_ = (yyvsp[0].expr_t); - (yyval.select_stmt) = (yyvsp[-3].select_stmt); + delete (yyvsp[-2].order_by_expr_list_t); } -#line 5443 "parser.cpp" - break; + delete (yyvsp[-1].expr_t); + delete (yyvsp[0].expr_t); + yyerror(&yyloc, scanner, result, "Result modifier(ORDER BY) is conflict with SEARCH expression."); + YYERROR; + } + (yyvsp[-3].select_stmt)->order_by_list_ = (yyvsp[-2].order_by_expr_list_t); + (yyvsp[-3].select_stmt)->limit_expr_ = (yyvsp[-1].expr_t); + (yyvsp[-3].select_stmt)->offset_expr_ = (yyvsp[0].expr_t); + (yyval.select_stmt) = (yyvsp[-3].select_stmt); +} +#line 5462 "parser.cpp" + break; - case 183: /* select_clause_without_modifier_paren: '(' select_clause_without_modifier ')' */ + case 183: /* select_clause_without_modifier_paren: '(' select_clause_without_modifier ')' */ #line 1602 "parser.y" - { - (yyval.select_stmt) = (yyvsp[-1].select_stmt); - } -#line 5451 "parser.cpp" - break; + { + (yyval.select_stmt) = (yyvsp[-1].select_stmt); +} +#line 5470 "parser.cpp" + break; - case 184: /* select_clause_without_modifier_paren: '(' select_clause_without_modifier_paren ')' */ + case 184: /* select_clause_without_modifier_paren: '(' select_clause_without_modifier_paren ')' */ #line 1605 "parser.y" - { - (yyval.select_stmt) = (yyvsp[-1].select_stmt); - } -#line 5459 "parser.cpp" - break; + { + (yyval.select_stmt) = (yyvsp[-1].select_stmt); +} +#line 5478 "parser.cpp" + break; - case 185: /* select_clause_without_modifier: SELECT distinct expr_array highlight_clause from_clause unnest_clause search_clause where_clause - group_by_clause having_clause */ + case 185: /* select_clause_without_modifier: SELECT distinct expr_array highlight_clause from_clause unnest_clause search_clause where_clause group_by_clause having_clause */ #line 1610 "parser.y" - { - (yyval.select_stmt) = new infinity::SelectStatement(); - (yyval.select_stmt)->select_distinct_ = (yyvsp[-8].bool_value); - (yyval.select_stmt)->select_list_ = (yyvsp[-7].expr_array_t); - (yyval.select_stmt)->highlight_list_ = (yyvsp[-6].expr_array_t); - (yyval.select_stmt)->table_ref_ = (yyvsp[-5].table_reference_t); - (yyval.select_stmt)->unnest_expr_list_ = (yyvsp[-4].expr_array_t); - (yyval.select_stmt)->search_expr_ = (yyvsp[-3].expr_t); - (yyval.select_stmt)->where_expr_ = (yyvsp[-2].expr_t); - (yyval.select_stmt)->group_by_list_ = (yyvsp[-1].expr_array_t); - (yyval.select_stmt)->having_expr_ = (yyvsp[0].expr_t); - - if ((yyval.select_stmt)->group_by_list_ == nullptr && (yyval.select_stmt)->having_expr_ != nullptr) { - yyerror(&yyloc, scanner, result, "HAVING clause should follow after GROUP BY clause"); - YYERROR; - } - } -#line 5481 "parser.cpp" - break; + { + (yyval.select_stmt) = new infinity::SelectStatement(); + (yyval.select_stmt)->select_distinct_ = (yyvsp[-8].bool_value); + (yyval.select_stmt)->select_list_ = (yyvsp[-7].expr_array_t); + (yyval.select_stmt)->highlight_list_ = (yyvsp[-6].expr_array_t); + (yyval.select_stmt)->table_ref_ = (yyvsp[-5].table_reference_t); + (yyval.select_stmt)->unnest_expr_list_ = (yyvsp[-4].expr_array_t); + (yyval.select_stmt)->search_expr_ = (yyvsp[-3].expr_t); + (yyval.select_stmt)->where_expr_ = (yyvsp[-2].expr_t); + (yyval.select_stmt)->group_by_list_ = (yyvsp[-1].expr_array_t); + (yyval.select_stmt)->having_expr_ = (yyvsp[0].expr_t); + + if((yyval.select_stmt)->group_by_list_ == nullptr && (yyval.select_stmt)->having_expr_ != nullptr) { + yyerror(&yyloc, scanner, result, "HAVING clause should follow after GROUP BY clause"); + YYERROR; + } +} +#line 5500 "parser.cpp" + break; - case 186: /* order_by_clause: ORDER BY order_by_expr_list */ + case 186: /* order_by_clause: ORDER BY order_by_expr_list */ #line 1628 "parser.y" - { - (yyval.order_by_expr_list_t) = (yyvsp[0].order_by_expr_list_t); - } -#line 5489 "parser.cpp" - break; + { + (yyval.order_by_expr_list_t) = (yyvsp[0].order_by_expr_list_t); +} +#line 5508 "parser.cpp" + break; - case 187: /* order_by_clause: %empty */ + case 187: /* order_by_clause: %empty */ #line 1631 "parser.y" - { - (yyval.order_by_expr_list_t) = nullptr; - } -#line 5497 "parser.cpp" - break; + { + (yyval.order_by_expr_list_t) = nullptr; +} +#line 5516 "parser.cpp" + break; - case 188: /* order_by_expr_list: order_by_expr */ + case 188: /* order_by_expr_list: order_by_expr */ #line 1635 "parser.y" - { - (yyval.order_by_expr_list_t) = new std::vector(); - (yyval.order_by_expr_list_t)->emplace_back((yyvsp[0].order_by_expr_t)); - } -#line 5506 "parser.cpp" - break; + { + (yyval.order_by_expr_list_t) = new std::vector(); + (yyval.order_by_expr_list_t)->emplace_back((yyvsp[0].order_by_expr_t)); +} +#line 5525 "parser.cpp" + break; - case 189: /* order_by_expr_list: order_by_expr_list ',' order_by_expr */ + case 189: /* order_by_expr_list: order_by_expr_list ',' order_by_expr */ #line 1639 "parser.y" - { - (yyvsp[-2].order_by_expr_list_t)->emplace_back((yyvsp[0].order_by_expr_t)); - (yyval.order_by_expr_list_t) = (yyvsp[-2].order_by_expr_list_t); - } -#line 5515 "parser.cpp" - break; + { + (yyvsp[-2].order_by_expr_list_t)->emplace_back((yyvsp[0].order_by_expr_t)); + (yyval.order_by_expr_list_t) = (yyvsp[-2].order_by_expr_list_t); +} +#line 5534 "parser.cpp" + break; - case 190: /* order_by_expr: expr order_by_type */ + case 190: /* order_by_expr: expr order_by_type */ #line 1644 "parser.y" - { - (yyval.order_by_expr_t) = new infinity::OrderByExpr(); - (yyval.order_by_expr_t)->expr_ = (yyvsp[-1].expr_t); - (yyval.order_by_expr_t)->type_ = (yyvsp[0].order_by_type_t); - } -#line 5525 "parser.cpp" - break; + { + (yyval.order_by_expr_t) = new infinity::OrderByExpr(); + (yyval.order_by_expr_t)->expr_ = (yyvsp[-1].expr_t); + (yyval.order_by_expr_t)->type_ = (yyvsp[0].order_by_type_t); +} +#line 5544 "parser.cpp" + break; - case 191: /* order_by_type: ASC */ + case 191: /* order_by_type: ASC */ #line 1650 "parser.y" - { - (yyval.order_by_type_t) = infinity::kAsc; - } -#line 5533 "parser.cpp" - break; + { + (yyval.order_by_type_t) = infinity::kAsc; +} +#line 5552 "parser.cpp" + break; - case 192: /* order_by_type: DESC */ + case 192: /* order_by_type: DESC */ #line 1653 "parser.y" - { - (yyval.order_by_type_t) = infinity::kDesc; - } -#line 5541 "parser.cpp" - break; + { + (yyval.order_by_type_t) = infinity::kDesc; +} +#line 5560 "parser.cpp" + break; - case 193: /* order_by_type: %empty */ + case 193: /* order_by_type: %empty */ #line 1656 "parser.y" - { - (yyval.order_by_type_t) = infinity::kAsc; - } -#line 5549 "parser.cpp" - break; + { + (yyval.order_by_type_t) = infinity::kAsc; +} +#line 5568 "parser.cpp" + break; - case 194: /* limit_expr: LIMIT expr */ + case 194: /* limit_expr: LIMIT expr */ #line 1660 "parser.y" - { - (yyval.expr_t) = (yyvsp[0].expr_t); - } -#line 5557 "parser.cpp" - break; + { + (yyval.expr_t) = (yyvsp[0].expr_t); +} +#line 5576 "parser.cpp" + break; - case 195: /* limit_expr: %empty */ + case 195: /* limit_expr: %empty */ #line 1664 "parser.y" - { - (yyval.expr_t) = nullptr; - } -#line 5563 "parser.cpp" - break; +{ (yyval.expr_t) = nullptr; } +#line 5582 "parser.cpp" + break; - case 196: /* offset_expr: OFFSET expr */ + case 196: /* offset_expr: OFFSET expr */ #line 1666 "parser.y" - { - (yyval.expr_t) = (yyvsp[0].expr_t); - } -#line 5571 "parser.cpp" - break; + { + (yyval.expr_t) = (yyvsp[0].expr_t); +} +#line 5590 "parser.cpp" + break; - case 197: /* offset_expr: %empty */ + case 197: /* offset_expr: %empty */ #line 1670 "parser.y" - { - (yyval.expr_t) = nullptr; - } -#line 5577 "parser.cpp" - break; +{ (yyval.expr_t) = nullptr; } +#line 5596 "parser.cpp" + break; - case 198: /* distinct: DISTINCT */ + case 198: /* distinct: DISTINCT */ #line 1672 "parser.y" - { - (yyval.bool_value) = true; - } -#line 5585 "parser.cpp" - break; + { + (yyval.bool_value) = true; +} +#line 5604 "parser.cpp" + break; - case 199: /* distinct: %empty */ + case 199: /* distinct: %empty */ #line 1675 "parser.y" - { - (yyval.bool_value) = false; - } -#line 5593 "parser.cpp" - break; + { + (yyval.bool_value) = false; +} +#line 5612 "parser.cpp" + break; - case 200: /* unnest_clause: UNNEST expr_array */ + case 200: /* unnest_clause: UNNEST expr_array */ #line 1679 "parser.y" - { - (yyval.expr_array_t) = (yyvsp[0].expr_array_t); - } -#line 5601 "parser.cpp" - break; + { + (yyval.expr_array_t) = (yyvsp[0].expr_array_t); +} +#line 5620 "parser.cpp" + break; - case 201: /* unnest_clause: %empty */ + case 201: /* unnest_clause: %empty */ #line 1682 "parser.y" - { - (yyval.expr_array_t) = nullptr; - } -#line 5609 "parser.cpp" - break; + { + (yyval.expr_array_t) = nullptr; +} +#line 5628 "parser.cpp" + break; - case 202: /* highlight_clause: HIGHLIGHT expr_array */ + case 202: /* highlight_clause: HIGHLIGHT expr_array */ #line 1686 "parser.y" - { - (yyval.expr_array_t) = (yyvsp[0].expr_array_t); - } -#line 5617 "parser.cpp" - break; + { + (yyval.expr_array_t) = (yyvsp[0].expr_array_t); +} +#line 5636 "parser.cpp" + break; - case 203: /* highlight_clause: %empty */ + case 203: /* highlight_clause: %empty */ #line 1689 "parser.y" - { - (yyval.expr_array_t) = nullptr; - } -#line 5625 "parser.cpp" - break; + { + (yyval.expr_array_t) = nullptr; +} +#line 5644 "parser.cpp" + break; - case 204: /* from_clause: FROM table_reference */ + case 204: /* from_clause: FROM table_reference */ #line 1693 "parser.y" - { - (yyval.table_reference_t) = (yyvsp[0].table_reference_t); - } -#line 5633 "parser.cpp" - break; + { + (yyval.table_reference_t) = (yyvsp[0].table_reference_t); +} +#line 5652 "parser.cpp" + break; - case 205: /* from_clause: %empty */ + case 205: /* from_clause: %empty */ #line 1696 "parser.y" - { - (yyval.table_reference_t) = nullptr; - } -#line 5641 "parser.cpp" - break; + { + (yyval.table_reference_t) = nullptr; +} +#line 5660 "parser.cpp" + break; - case 206: /* search_clause: SEARCH sub_search_array */ + case 206: /* search_clause: SEARCH sub_search_array */ #line 1700 "parser.y" - { - infinity::SearchExpr *search_expr = new infinity::SearchExpr(); - search_expr->SetExprs((yyvsp[0].expr_array_t)); - (yyval.expr_t) = search_expr; - } -#line 5651 "parser.cpp" - break; + { + infinity::SearchExpr* search_expr = new infinity::SearchExpr(); + search_expr->SetExprs((yyvsp[0].expr_array_t)); + (yyval.expr_t) = search_expr; +} +#line 5670 "parser.cpp" + break; - case 207: /* search_clause: %empty */ + case 207: /* search_clause: %empty */ #line 1705 "parser.y" - { - (yyval.expr_t) = nullptr; - } -#line 5659 "parser.cpp" - break; + { + (yyval.expr_t) = nullptr; +} +#line 5678 "parser.cpp" + break; - case 208: /* optional_search_filter_expr: ',' WHERE expr */ + case 208: /* optional_search_filter_expr: ',' WHERE expr */ #line 1709 "parser.y" - { - (yyval.expr_t) = (yyvsp[0].expr_t); - } -#line 5667 "parser.cpp" - break; + { + (yyval.expr_t) = (yyvsp[0].expr_t); +} +#line 5686 "parser.cpp" + break; - case 209: /* optional_search_filter_expr: %empty */ + case 209: /* optional_search_filter_expr: %empty */ #line 1712 "parser.y" - { - (yyval.expr_t) = nullptr; - } -#line 5675 "parser.cpp" - break; + { + (yyval.expr_t) = nullptr; +} +#line 5694 "parser.cpp" + break; - case 210: /* where_clause: WHERE expr */ + case 210: /* where_clause: WHERE expr */ #line 1716 "parser.y" - { - (yyval.expr_t) = (yyvsp[0].expr_t); - } -#line 5683 "parser.cpp" - break; + { + (yyval.expr_t) = (yyvsp[0].expr_t); +} +#line 5702 "parser.cpp" + break; - case 211: /* where_clause: %empty */ + case 211: /* where_clause: %empty */ #line 1719 "parser.y" - { - (yyval.expr_t) = nullptr; - } -#line 5691 "parser.cpp" - break; + { + (yyval.expr_t) = nullptr; +} +#line 5710 "parser.cpp" + break; - case 212: /* having_clause: HAVING expr */ + case 212: /* having_clause: HAVING expr */ #line 1723 "parser.y" - { - (yyval.expr_t) = (yyvsp[0].expr_t); - } -#line 5699 "parser.cpp" - break; + { + (yyval.expr_t) = (yyvsp[0].expr_t); +} +#line 5718 "parser.cpp" + break; - case 213: /* having_clause: %empty */ + case 213: /* having_clause: %empty */ #line 1726 "parser.y" - { - (yyval.expr_t) = nullptr; - } -#line 5707 "parser.cpp" - break; + { + (yyval.expr_t) = nullptr; +} +#line 5726 "parser.cpp" + break; - case 214: /* group_by_clause: GROUP BY expr_array */ + case 214: /* group_by_clause: GROUP BY expr_array */ #line 1730 "parser.y" - { - (yyval.expr_array_t) = (yyvsp[0].expr_array_t); - } -#line 5715 "parser.cpp" - break; + { + (yyval.expr_array_t) = (yyvsp[0].expr_array_t); +} +#line 5734 "parser.cpp" + break; - case 215: /* group_by_clause: %empty */ + case 215: /* group_by_clause: %empty */ #line 1733 "parser.y" - { - (yyval.expr_array_t) = nullptr; - } -#line 5723 "parser.cpp" - break; + { + (yyval.expr_array_t) = nullptr; +} +#line 5742 "parser.cpp" + break; - case 216: /* set_operator: UNION */ + case 216: /* set_operator: UNION */ #line 1737 "parser.y" - { - (yyval.set_operator_t) = infinity::SetOperatorType::kUnion; - } -#line 5731 "parser.cpp" - break; + { + (yyval.set_operator_t) = infinity::SetOperatorType::kUnion; +} +#line 5750 "parser.cpp" + break; - case 217: /* set_operator: UNION ALL */ + case 217: /* set_operator: UNION ALL */ #line 1740 "parser.y" - { - (yyval.set_operator_t) = infinity::SetOperatorType::kUnionAll; - } -#line 5739 "parser.cpp" - break; + { + (yyval.set_operator_t) = infinity::SetOperatorType::kUnionAll; +} +#line 5758 "parser.cpp" + break; - case 218: /* set_operator: INTERSECT */ + case 218: /* set_operator: INTERSECT */ #line 1743 "parser.y" - { - (yyval.set_operator_t) = infinity::SetOperatorType::kIntersect; - } -#line 5747 "parser.cpp" - break; + { + (yyval.set_operator_t) = infinity::SetOperatorType::kIntersect; +} +#line 5766 "parser.cpp" + break; - case 219: /* set_operator: EXCEPT */ + case 219: /* set_operator: EXCEPT */ #line 1746 "parser.y" - { - (yyval.set_operator_t) = infinity::SetOperatorType::kExcept; - } -#line 5755 "parser.cpp" - break; + { + (yyval.set_operator_t) = infinity::SetOperatorType::kExcept; +} +#line 5774 "parser.cpp" + break; - case 220: /* table_reference: table_reference_unit */ + case 220: /* table_reference: table_reference_unit */ #line 1754 "parser.y" - { - (yyval.table_reference_t) = (yyvsp[0].table_reference_t); - } -#line 5763 "parser.cpp" - break; + { + (yyval.table_reference_t) = (yyvsp[0].table_reference_t); +} +#line 5782 "parser.cpp" + break; - case 221: /* table_reference: table_reference ',' table_reference_unit */ + case 221: /* table_reference: table_reference ',' table_reference_unit */ #line 1757 "parser.y" - { - infinity::CrossProductReference *cross_product_ref = nullptr; - if ((yyvsp[-2].table_reference_t)->type_ == infinity::TableRefType::kCrossProduct) { - cross_product_ref = (infinity::CrossProductReference *)(yyvsp[-2].table_reference_t); - cross_product_ref->tables_.emplace_back((yyvsp[0].table_reference_t)); - } else { - cross_product_ref = new infinity::CrossProductReference(); - cross_product_ref->tables_.emplace_back((yyvsp[-2].table_reference_t)); - cross_product_ref->tables_.emplace_back((yyvsp[0].table_reference_t)); - } + { + infinity::CrossProductReference* cross_product_ref = nullptr; + if((yyvsp[-2].table_reference_t)->type_ == infinity::TableRefType::kCrossProduct) { + cross_product_ref = (infinity::CrossProductReference*)(yyvsp[-2].table_reference_t); + cross_product_ref->tables_.emplace_back((yyvsp[0].table_reference_t)); + } else { + cross_product_ref = new infinity::CrossProductReference(); + cross_product_ref->tables_.emplace_back((yyvsp[-2].table_reference_t)); + cross_product_ref->tables_.emplace_back((yyvsp[0].table_reference_t)); + } - (yyval.table_reference_t) = cross_product_ref; - } -#line 5781 "parser.cpp" - break; + (yyval.table_reference_t) = cross_product_ref; +} +#line 5800 "parser.cpp" + break; - case 224: /* table_reference_name: table_name table_alias */ + case 224: /* table_reference_name: table_name table_alias */ #line 1774 "parser.y" - { - infinity::TableReference *table_ref = new infinity::TableReference(); - if ((yyvsp[-1].table_name_t)->schema_name_ptr_ != nullptr) { - table_ref->db_name_ = (yyvsp[-1].table_name_t)->schema_name_ptr_; - free((yyvsp[-1].table_name_t)->schema_name_ptr_); - } - table_ref->table_name_ = (yyvsp[-1].table_name_t)->table_name_ptr_; - free((yyvsp[-1].table_name_t)->table_name_ptr_); - delete (yyvsp[-1].table_name_t); + { + infinity::TableReference* table_ref = new infinity::TableReference(); + if((yyvsp[-1].table_name_t)->schema_name_ptr_ != nullptr) { + table_ref->db_name_ = (yyvsp[-1].table_name_t)->schema_name_ptr_; + free((yyvsp[-1].table_name_t)->schema_name_ptr_); + } + table_ref->table_name_ = (yyvsp[-1].table_name_t)->table_name_ptr_; + free((yyvsp[-1].table_name_t)->table_name_ptr_); + delete (yyvsp[-1].table_name_t); - table_ref->alias_ = (yyvsp[0].table_alias_t); - (yyval.table_reference_t) = table_ref; - } -#line 5799 "parser.cpp" - break; + table_ref->alias_ = (yyvsp[0].table_alias_t); + (yyval.table_reference_t) = table_ref; +} +#line 5818 "parser.cpp" + break; - case 225: /* table_reference_name: '(' select_statement ')' table_alias */ + case 225: /* table_reference_name: '(' select_statement ')' table_alias */ #line 1788 "parser.y" - { - infinity::SubqueryReference *subquery_reference = new infinity::SubqueryReference(); - subquery_reference->select_statement_ = (yyvsp[-2].select_stmt); - subquery_reference->alias_ = (yyvsp[0].table_alias_t); - (yyval.table_reference_t) = subquery_reference; - } -#line 5810 "parser.cpp" - break; + { + infinity::SubqueryReference* subquery_reference = new infinity::SubqueryReference(); + subquery_reference->select_statement_ = (yyvsp[-2].select_stmt); + subquery_reference->alias_ = (yyvsp[0].table_alias_t); + (yyval.table_reference_t) = subquery_reference; +} +#line 5829 "parser.cpp" + break; - case 226: /* table_name: IDENTIFIER */ + case 226: /* table_name: IDENTIFIER */ #line 1797 "parser.y" - { - (yyval.table_name_t) = new infinity::TableName(); - ParserHelper::ToLower((yyvsp[0].str_value)); - (yyval.table_name_t)->table_name_ptr_ = (yyvsp[0].str_value); - } -#line 5820 "parser.cpp" - break; + { + (yyval.table_name_t) = new infinity::TableName(); + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.table_name_t)->table_name_ptr_ = (yyvsp[0].str_value); +} +#line 5839 "parser.cpp" + break; - case 227: /* table_name: IDENTIFIER '.' IDENTIFIER */ + case 227: /* table_name: IDENTIFIER '.' IDENTIFIER */ #line 1802 "parser.y" - { - (yyval.table_name_t) = new infinity::TableName(); - ParserHelper::ToLower((yyvsp[-2].str_value)); - ParserHelper::ToLower((yyvsp[0].str_value)); - (yyval.table_name_t)->schema_name_ptr_ = (yyvsp[-2].str_value); - (yyval.table_name_t)->table_name_ptr_ = (yyvsp[0].str_value); - } -#line 5832 "parser.cpp" - break; + { + (yyval.table_name_t) = new infinity::TableName(); + ParserHelper::ToLower((yyvsp[-2].str_value)); + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.table_name_t)->schema_name_ptr_ = (yyvsp[-2].str_value); + (yyval.table_name_t)->table_name_ptr_ = (yyvsp[0].str_value); +} +#line 5851 "parser.cpp" + break; - case 228: /* table_alias: AS IDENTIFIER */ + case 228: /* table_alias: AS IDENTIFIER */ #line 1811 "parser.y" - { - (yyval.table_alias_t) = new infinity::TableAlias(); - ParserHelper::ToLower((yyvsp[0].str_value)); - (yyval.table_alias_t)->alias_ = (yyvsp[0].str_value); - } -#line 5842 "parser.cpp" - break; + { + (yyval.table_alias_t) = new infinity::TableAlias(); + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.table_alias_t)->alias_ = (yyvsp[0].str_value); +} +#line 5861 "parser.cpp" + break; - case 229: /* table_alias: IDENTIFIER */ + case 229: /* table_alias: IDENTIFIER */ #line 1816 "parser.y" - { - (yyval.table_alias_t) = new infinity::TableAlias(); - ParserHelper::ToLower((yyvsp[0].str_value)); - (yyval.table_alias_t)->alias_ = (yyvsp[0].str_value); - } -#line 5852 "parser.cpp" - break; + { + (yyval.table_alias_t) = new infinity::TableAlias(); + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.table_alias_t)->alias_ = (yyvsp[0].str_value); +} +#line 5871 "parser.cpp" + break; - case 230: /* table_alias: AS IDENTIFIER '(' identifier_array ')' */ + case 230: /* table_alias: AS IDENTIFIER '(' identifier_array ')' */ #line 1821 "parser.y" - { - (yyval.table_alias_t) = new infinity::TableAlias(); - ParserHelper::ToLower((yyvsp[-3].str_value)); - (yyval.table_alias_t)->alias_ = (yyvsp[-3].str_value); - (yyval.table_alias_t)->column_alias_array_ = (yyvsp[-1].identifier_array_t); - } -#line 5863 "parser.cpp" - break; + { + (yyval.table_alias_t) = new infinity::TableAlias(); + ParserHelper::ToLower((yyvsp[-3].str_value)); + (yyval.table_alias_t)->alias_ = (yyvsp[-3].str_value); + (yyval.table_alias_t)->column_alias_array_ = (yyvsp[-1].identifier_array_t); +} +#line 5882 "parser.cpp" + break; - case 231: /* table_alias: %empty */ + case 231: /* table_alias: %empty */ #line 1827 "parser.y" - { - (yyval.table_alias_t) = nullptr; - } -#line 5871 "parser.cpp" - break; + { + (yyval.table_alias_t) = nullptr; +} +#line 5890 "parser.cpp" + break; - case 232: /* with_clause: WITH with_expr_list */ + case 232: /* with_clause: WITH with_expr_list */ #line 1834 "parser.y" - { - (yyval.with_expr_list_t) = (yyvsp[0].with_expr_list_t); - } -#line 5879 "parser.cpp" - break; + { + (yyval.with_expr_list_t) = (yyvsp[0].with_expr_list_t); +} +#line 5898 "parser.cpp" + break; - case 233: /* with_clause: %empty */ + case 233: /* with_clause: %empty */ #line 1837 "parser.y" - { - (yyval.with_expr_list_t) = nullptr; - } -#line 5887 "parser.cpp" - break; + { + (yyval.with_expr_list_t) = nullptr; +} +#line 5906 "parser.cpp" + break; - case 234: /* with_expr_list: with_expr */ + case 234: /* with_expr_list: with_expr */ #line 1841 "parser.y" - { - (yyval.with_expr_list_t) = new std::vector(); - (yyval.with_expr_list_t)->emplace_back((yyvsp[0].with_expr_t)); - } -#line 5896 "parser.cpp" - break; + { + (yyval.with_expr_list_t) = new std::vector(); + (yyval.with_expr_list_t)->emplace_back((yyvsp[0].with_expr_t)); +} +#line 5915 "parser.cpp" + break; - case 235: /* with_expr_list: with_expr_list ',' with_expr */ + case 235: /* with_expr_list: with_expr_list ',' with_expr */ #line 1844 "parser.y" - { - (yyvsp[-2].with_expr_list_t)->emplace_back((yyvsp[0].with_expr_t)); - (yyval.with_expr_list_t) = (yyvsp[-2].with_expr_list_t); - } -#line 5905 "parser.cpp" - break; + { + (yyvsp[-2].with_expr_list_t)->emplace_back((yyvsp[0].with_expr_t)); + (yyval.with_expr_list_t) = (yyvsp[-2].with_expr_list_t); +} +#line 5924 "parser.cpp" + break; - case 236: /* with_expr: IDENTIFIER AS '(' select_clause_with_modifier ')' */ + case 236: /* with_expr: IDENTIFIER AS '(' select_clause_with_modifier ')' */ #line 1849 "parser.y" - { - (yyval.with_expr_t) = new infinity::WithExpr(); - ParserHelper::ToLower((yyvsp[-4].str_value)); - (yyval.with_expr_t)->alias_ = (yyvsp[-4].str_value); - free((yyvsp[-4].str_value)); - (yyval.with_expr_t)->select_ = (yyvsp[-1].select_stmt); - } -#line 5917 "parser.cpp" - break; + { + (yyval.with_expr_t) = new infinity::WithExpr(); + ParserHelper::ToLower((yyvsp[-4].str_value)); + (yyval.with_expr_t)->alias_ = (yyvsp[-4].str_value); + free((yyvsp[-4].str_value)); + (yyval.with_expr_t)->select_ = (yyvsp[-1].select_stmt); +} +#line 5936 "parser.cpp" + break; - case 237: /* join_clause: table_reference_unit NATURAL JOIN table_reference_name */ + case 237: /* join_clause: table_reference_unit NATURAL JOIN table_reference_name */ #line 1861 "parser.y" - { - infinity::JoinReference *join_reference = new infinity::JoinReference(); - join_reference->left_ = (yyvsp[-3].table_reference_t); - join_reference->right_ = (yyvsp[0].table_reference_t); - join_reference->join_type_ = infinity::JoinType::kNatural; - (yyval.table_reference_t) = join_reference; - } -#line 5929 "parser.cpp" - break; + { + infinity::JoinReference* join_reference = new infinity::JoinReference(); + join_reference->left_ = (yyvsp[-3].table_reference_t); + join_reference->right_ = (yyvsp[0].table_reference_t); + join_reference->join_type_ = infinity::JoinType::kNatural; + (yyval.table_reference_t) = join_reference; +} +#line 5948 "parser.cpp" + break; - case 238: /* join_clause: table_reference_unit join_type JOIN table_reference_name ON expr */ + case 238: /* join_clause: table_reference_unit join_type JOIN table_reference_name ON expr */ #line 1868 "parser.y" - { - infinity::JoinReference *join_reference = new infinity::JoinReference(); - join_reference->left_ = (yyvsp[-5].table_reference_t); - join_reference->right_ = (yyvsp[-2].table_reference_t); - join_reference->join_type_ = (yyvsp[-4].join_type_t); - join_reference->condition_ = (yyvsp[0].expr_t); - (yyval.table_reference_t) = join_reference; - } -#line 5942 "parser.cpp" - break; + { + infinity::JoinReference* join_reference = new infinity::JoinReference(); + join_reference->left_ = (yyvsp[-5].table_reference_t); + join_reference->right_ = (yyvsp[-2].table_reference_t); + join_reference->join_type_ = (yyvsp[-4].join_type_t); + join_reference->condition_ = (yyvsp[0].expr_t); + (yyval.table_reference_t) = join_reference; +} +#line 5961 "parser.cpp" + break; - case 239: /* join_type: INNER */ + case 239: /* join_type: INNER */ #line 1882 "parser.y" - { - (yyval.join_type_t) = infinity::JoinType::kInner; - } -#line 5950 "parser.cpp" - break; + { + (yyval.join_type_t) = infinity::JoinType::kInner; +} +#line 5969 "parser.cpp" + break; - case 240: /* join_type: LEFT */ + case 240: /* join_type: LEFT */ #line 1885 "parser.y" - { - (yyval.join_type_t) = infinity::JoinType::kLeft; - } -#line 5958 "parser.cpp" - break; + { + (yyval.join_type_t) = infinity::JoinType::kLeft; +} +#line 5977 "parser.cpp" + break; - case 241: /* join_type: RIGHT */ + case 241: /* join_type: RIGHT */ #line 1888 "parser.y" { - (yyval.join_type_t) = infinity::JoinType::kRight; - } -#line 5966 "parser.cpp" - break; + (yyval.join_type_t) = infinity::JoinType::kRight; +} +#line 5985 "parser.cpp" + break; - case 242: /* join_type: OUTER */ + case 242: /* join_type: OUTER */ #line 1891 "parser.y" { - (yyval.join_type_t) = infinity::JoinType::kFull; - } -#line 5974 "parser.cpp" - break; + (yyval.join_type_t) = infinity::JoinType::kFull; +} +#line 5993 "parser.cpp" + break; - case 243: /* join_type: FULL */ + case 243: /* join_type: FULL */ #line 1894 "parser.y" - { - (yyval.join_type_t) = infinity::JoinType::kFull; - } -#line 5982 "parser.cpp" - break; + { + (yyval.join_type_t) = infinity::JoinType::kFull; +} +#line 6001 "parser.cpp" + break; - case 244: /* join_type: CROSS */ + case 244: /* join_type: CROSS */ #line 1897 "parser.y" { - (yyval.join_type_t) = infinity::JoinType::kCross; - } -#line 5990 "parser.cpp" - break; + (yyval.join_type_t) = infinity::JoinType::kCross; +} +#line 6009 "parser.cpp" + break; - case 245: /* join_type: %empty */ + case 245: /* join_type: %empty */ #line 1900 "parser.y" - { - } -#line 5997 "parser.cpp" - break; + { +} +#line 6016 "parser.cpp" + break; - case 246: /* show_statement: SHOW DATABASES */ + case 246: /* show_statement: SHOW DATABASES */ #line 1906 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kDatabases; - } -#line 6006 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kDatabases; +} +#line 6025 "parser.cpp" + break; - case 247: /* show_statement: SHOW TABLES */ + case 247: /* show_statement: SHOW TABLES */ #line 1910 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kTables; - } -#line 6015 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kTables; +} +#line 6034 "parser.cpp" + break; - case 248: /* show_statement: SHOW VIEWS */ + case 248: /* show_statement: SHOW VIEWS */ #line 1914 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kViews; - } -#line 6024 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kViews; +} +#line 6043 "parser.cpp" + break; - case 249: /* show_statement: SHOW CONFIGS */ + case 249: /* show_statement: SHOW CONFIGS */ #line 1918 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kConfigs; - } -#line 6033 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kConfigs; +} +#line 6052 "parser.cpp" + break; - case 250: /* show_statement: SHOW CONFIG IDENTIFIER */ + case 250: /* show_statement: SHOW CONFIG IDENTIFIER */ #line 1922 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kConfig; - ParserHelper::ToLower((yyvsp[0].str_value)); - (yyval.show_stmt)->var_name_ = std::string((yyvsp[0].str_value)); - free((yyvsp[0].str_value)); - } -#line 6045 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kConfig; + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.show_stmt)->var_name_ = std::string((yyvsp[0].str_value)); + free((yyvsp[0].str_value)); +} +#line 6064 "parser.cpp" + break; - case 251: /* show_statement: SHOW PROFILES */ + case 251: /* show_statement: SHOW PROFILES */ #line 1929 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kProfiles; - } -#line 6054 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kProfiles; +} +#line 6073 "parser.cpp" + break; - case 252: /* show_statement: SHOW BUFFER */ + case 252: /* show_statement: SHOW BUFFER */ #line 1933 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kBuffer; - } -#line 6063 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kBuffer; +} +#line 6082 "parser.cpp" + break; - case 253: /* show_statement: SHOW MEMINDEX */ + case 253: /* show_statement: SHOW MEMINDEX */ #line 1937 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kMemIndex; - } -#line 6072 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kMemIndex; +} +#line 6091 "parser.cpp" + break; - case 254: /* show_statement: SHOW QUERIES */ + case 254: /* show_statement: SHOW QUERIES */ #line 1941 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kQueries; - } -#line 6081 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kQueries; +} +#line 6100 "parser.cpp" + break; - case 255: /* show_statement: SHOW QUERY LONG_VALUE */ + case 255: /* show_statement: SHOW QUERY LONG_VALUE */ #line 1945 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kQuery; - (yyval.show_stmt)->session_id_ = (yyvsp[0].long_value); - } -#line 6091 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kQuery; + (yyval.show_stmt)->session_id_ = (yyvsp[0].long_value); +} +#line 6110 "parser.cpp" + break; - case 256: /* show_statement: SHOW TRANSACTIONS */ + case 256: /* show_statement: SHOW TRANSACTIONS */ #line 1950 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kTransactions; - } -#line 6100 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kTransactions; +} +#line 6119 "parser.cpp" + break; - case 257: /* show_statement: SHOW TRANSACTION LONG_VALUE */ + case 257: /* show_statement: SHOW TRANSACTION LONG_VALUE */ #line 1954 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kTransaction; - (yyval.show_stmt)->txn_id_ = (yyvsp[0].long_value); - } -#line 6110 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kTransaction; + (yyval.show_stmt)->txn_id_ = (yyvsp[0].long_value); +} +#line 6129 "parser.cpp" + break; - case 258: /* show_statement: SHOW SESSION VARIABLES */ + case 258: /* show_statement: SHOW SESSION VARIABLES */ #line 1959 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kSessionVariables; - } -#line 6119 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kSessionVariables; +} +#line 6138 "parser.cpp" + break; - case 259: /* show_statement: SHOW GLOBAL VARIABLES */ + case 259: /* show_statement: SHOW GLOBAL VARIABLES */ #line 1963 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kGlobalVariables; - } -#line 6128 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kGlobalVariables; +} +#line 6147 "parser.cpp" + break; - case 260: /* show_statement: SHOW SESSION VARIABLE IDENTIFIER */ + case 260: /* show_statement: SHOW SESSION VARIABLE IDENTIFIER */ #line 1967 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kSessionVariable; - (yyval.show_stmt)->var_name_ = std::string((yyvsp[0].str_value)); - free((yyvsp[0].str_value)); - } -#line 6139 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kSessionVariable; + (yyval.show_stmt)->var_name_ = std::string((yyvsp[0].str_value)); + free((yyvsp[0].str_value)); +} +#line 6158 "parser.cpp" + break; - case 261: /* show_statement: SHOW GLOBAL VARIABLE IDENTIFIER */ + case 261: /* show_statement: SHOW GLOBAL VARIABLE IDENTIFIER */ #line 1973 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kGlobalVariable; - (yyval.show_stmt)->var_name_ = std::string((yyvsp[0].str_value)); - free((yyvsp[0].str_value)); - } -#line 6150 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kGlobalVariable; + (yyval.show_stmt)->var_name_ = std::string((yyvsp[0].str_value)); + free((yyvsp[0].str_value)); +} +#line 6169 "parser.cpp" + break; - case 262: /* show_statement: SHOW DATABASE IDENTIFIER */ + case 262: /* show_statement: SHOW DATABASE IDENTIFIER */ #line 1979 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kDatabase; - (yyval.show_stmt)->schema_name_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - } -#line 6161 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kDatabase; + (yyval.show_stmt)->schema_name_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); +} +#line 6180 "parser.cpp" + break; - case 263: /* show_statement: SHOW TABLE table_name */ + case 263: /* show_statement: SHOW TABLE table_name */ #line 1985 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kTable; - if ((yyvsp[0].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.show_stmt)->schema_name_ = (yyvsp[0].table_name_t)->schema_name_ptr_; - free((yyvsp[0].table_name_t)->schema_name_ptr_); - } - (yyval.show_stmt)->table_name_ = (yyvsp[0].table_name_t)->table_name_ptr_; - free((yyvsp[0].table_name_t)->table_name_ptr_); - delete (yyvsp[0].table_name_t); - } -#line 6177 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kTable; + if((yyvsp[0].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.show_stmt)->schema_name_ = (yyvsp[0].table_name_t)->schema_name_ptr_; + free((yyvsp[0].table_name_t)->schema_name_ptr_); + } + (yyval.show_stmt)->table_name_ = (yyvsp[0].table_name_t)->table_name_ptr_; + free((yyvsp[0].table_name_t)->table_name_ptr_); + delete (yyvsp[0].table_name_t); +} +#line 6196 "parser.cpp" + break; - case 264: /* show_statement: SHOW TABLE table_name COLUMNS */ + case 264: /* show_statement: SHOW TABLE table_name COLUMNS */ #line 1996 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kColumns; - if ((yyvsp[-1].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.show_stmt)->schema_name_ = (yyvsp[-1].table_name_t)->schema_name_ptr_; - free((yyvsp[-1].table_name_t)->schema_name_ptr_); - } - (yyval.show_stmt)->table_name_ = (yyvsp[-1].table_name_t)->table_name_ptr_; - free((yyvsp[-1].table_name_t)->table_name_ptr_); - delete (yyvsp[-1].table_name_t); - } -#line 6193 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kColumns; + if((yyvsp[-1].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.show_stmt)->schema_name_ = (yyvsp[-1].table_name_t)->schema_name_ptr_; + free((yyvsp[-1].table_name_t)->schema_name_ptr_); + } + (yyval.show_stmt)->table_name_ = (yyvsp[-1].table_name_t)->table_name_ptr_; + free((yyvsp[-1].table_name_t)->table_name_ptr_); + delete (yyvsp[-1].table_name_t); +} +#line 6212 "parser.cpp" + break; - case 265: /* show_statement: SHOW TABLE table_name SEGMENTS */ + case 265: /* show_statement: SHOW TABLE table_name SEGMENTS */ #line 2007 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kSegments; - if ((yyvsp[-1].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.show_stmt)->schema_name_ = (yyvsp[-1].table_name_t)->schema_name_ptr_; - free((yyvsp[-1].table_name_t)->schema_name_ptr_); - } - (yyval.show_stmt)->table_name_ = (yyvsp[-1].table_name_t)->table_name_ptr_; - free((yyvsp[-1].table_name_t)->table_name_ptr_); - delete (yyvsp[-1].table_name_t); - } -#line 6209 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kSegments; + if((yyvsp[-1].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.show_stmt)->schema_name_ = (yyvsp[-1].table_name_t)->schema_name_ptr_; + free((yyvsp[-1].table_name_t)->schema_name_ptr_); + } + (yyval.show_stmt)->table_name_ = (yyvsp[-1].table_name_t)->table_name_ptr_; + free((yyvsp[-1].table_name_t)->table_name_ptr_); + delete (yyvsp[-1].table_name_t); +} +#line 6228 "parser.cpp" + break; - case 266: /* show_statement: SHOW TABLE table_name SEGMENT LONG_VALUE */ + case 266: /* show_statement: SHOW TABLE table_name SEGMENT LONG_VALUE */ #line 2018 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kSegment; - if ((yyvsp[-2].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.show_stmt)->schema_name_ = (yyvsp[-2].table_name_t)->schema_name_ptr_; - free((yyvsp[-2].table_name_t)->schema_name_ptr_); - } - (yyval.show_stmt)->table_name_ = (yyvsp[-2].table_name_t)->table_name_ptr_; - free((yyvsp[-2].table_name_t)->table_name_ptr_); - (yyval.show_stmt)->segment_id_ = (yyvsp[0].long_value); - delete (yyvsp[-2].table_name_t); - } -#line 6226 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kSegment; + if((yyvsp[-2].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.show_stmt)->schema_name_ = (yyvsp[-2].table_name_t)->schema_name_ptr_; + free((yyvsp[-2].table_name_t)->schema_name_ptr_); + } + (yyval.show_stmt)->table_name_ = (yyvsp[-2].table_name_t)->table_name_ptr_; + free((yyvsp[-2].table_name_t)->table_name_ptr_); + (yyval.show_stmt)->segment_id_ = (yyvsp[0].long_value); + delete (yyvsp[-2].table_name_t); +} +#line 6245 "parser.cpp" + break; - case 267: /* show_statement: SHOW TABLE table_name SEGMENT LONG_VALUE BLOCKS */ + case 267: /* show_statement: SHOW TABLE table_name SEGMENT LONG_VALUE BLOCKS */ #line 2030 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kBlocks; - if ((yyvsp[-3].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.show_stmt)->schema_name_ = (yyvsp[-3].table_name_t)->schema_name_ptr_; - free((yyvsp[-3].table_name_t)->schema_name_ptr_); - } - (yyval.show_stmt)->table_name_ = (yyvsp[-3].table_name_t)->table_name_ptr_; - free((yyvsp[-3].table_name_t)->table_name_ptr_); - (yyval.show_stmt)->segment_id_ = (yyvsp[-1].long_value); - delete (yyvsp[-3].table_name_t); - } -#line 6243 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kBlocks; + if((yyvsp[-3].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.show_stmt)->schema_name_ = (yyvsp[-3].table_name_t)->schema_name_ptr_; + free((yyvsp[-3].table_name_t)->schema_name_ptr_); + } + (yyval.show_stmt)->table_name_ = (yyvsp[-3].table_name_t)->table_name_ptr_; + free((yyvsp[-3].table_name_t)->table_name_ptr_); + (yyval.show_stmt)->segment_id_ = (yyvsp[-1].long_value); + delete (yyvsp[-3].table_name_t); +} +#line 6262 "parser.cpp" + break; - case 268: /* show_statement: SHOW TABLE table_name SEGMENT LONG_VALUE BLOCK LONG_VALUE */ + case 268: /* show_statement: SHOW TABLE table_name SEGMENT LONG_VALUE BLOCK LONG_VALUE */ #line 2042 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kBlock; - if ((yyvsp[-4].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.show_stmt)->schema_name_ = (yyvsp[-4].table_name_t)->schema_name_ptr_; - free((yyvsp[-4].table_name_t)->schema_name_ptr_); - } - (yyval.show_stmt)->table_name_ = (yyvsp[-4].table_name_t)->table_name_ptr_; - free((yyvsp[-4].table_name_t)->table_name_ptr_); - (yyval.show_stmt)->segment_id_ = (yyvsp[-2].long_value); - (yyval.show_stmt)->block_id_ = (yyvsp[0].long_value); - delete (yyvsp[-4].table_name_t); - } -#line 6261 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kBlock; + if((yyvsp[-4].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.show_stmt)->schema_name_ = (yyvsp[-4].table_name_t)->schema_name_ptr_; + free((yyvsp[-4].table_name_t)->schema_name_ptr_); + } + (yyval.show_stmt)->table_name_ = (yyvsp[-4].table_name_t)->table_name_ptr_; + free((yyvsp[-4].table_name_t)->table_name_ptr_); + (yyval.show_stmt)->segment_id_ = (yyvsp[-2].long_value); + (yyval.show_stmt)->block_id_ = (yyvsp[0].long_value); + delete (yyvsp[-4].table_name_t); +} +#line 6280 "parser.cpp" + break; - case 269: /* show_statement: SHOW TABLE table_name SEGMENT LONG_VALUE BLOCK LONG_VALUE COLUMN LONG_VALUE */ + case 269: /* show_statement: SHOW TABLE table_name SEGMENT LONG_VALUE BLOCK LONG_VALUE COLUMN LONG_VALUE */ #line 2055 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kBlockColumn; - if ((yyvsp[-6].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.show_stmt)->schema_name_ = (yyvsp[-6].table_name_t)->schema_name_ptr_; - free((yyvsp[-6].table_name_t)->schema_name_ptr_); - } - (yyval.show_stmt)->table_name_ = (yyvsp[-6].table_name_t)->table_name_ptr_; - free((yyvsp[-6].table_name_t)->table_name_ptr_); - (yyval.show_stmt)->segment_id_ = (yyvsp[-4].long_value); - (yyval.show_stmt)->block_id_ = (yyvsp[-2].long_value); - (yyval.show_stmt)->column_id_ = (yyvsp[0].long_value); - delete (yyvsp[-6].table_name_t); - } -#line 6280 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kBlockColumn; + if((yyvsp[-6].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.show_stmt)->schema_name_ = (yyvsp[-6].table_name_t)->schema_name_ptr_; + free((yyvsp[-6].table_name_t)->schema_name_ptr_); + } + (yyval.show_stmt)->table_name_ = (yyvsp[-6].table_name_t)->table_name_ptr_; + free((yyvsp[-6].table_name_t)->table_name_ptr_); + (yyval.show_stmt)->segment_id_ = (yyvsp[-4].long_value); + (yyval.show_stmt)->block_id_ = (yyvsp[-2].long_value); + (yyval.show_stmt)->column_id_ = (yyvsp[0].long_value); + delete (yyvsp[-6].table_name_t); +} +#line 6299 "parser.cpp" + break; - case 270: /* show_statement: SHOW TABLE table_name INDEXES */ + case 270: /* show_statement: SHOW TABLE table_name INDEXES */ #line 2069 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kIndexes; - if ((yyvsp[-1].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.show_stmt)->schema_name_ = (yyvsp[-1].table_name_t)->schema_name_ptr_; - free((yyvsp[-1].table_name_t)->schema_name_ptr_); - } - (yyval.show_stmt)->table_name_ = (yyvsp[-1].table_name_t)->table_name_ptr_; - free((yyvsp[-1].table_name_t)->table_name_ptr_); - delete (yyvsp[-1].table_name_t); - } -#line 6296 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kIndexes; + if((yyvsp[-1].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.show_stmt)->schema_name_ = (yyvsp[-1].table_name_t)->schema_name_ptr_; + free((yyvsp[-1].table_name_t)->schema_name_ptr_); + } + (yyval.show_stmt)->table_name_ = (yyvsp[-1].table_name_t)->table_name_ptr_; + free((yyvsp[-1].table_name_t)->table_name_ptr_); + delete (yyvsp[-1].table_name_t); +} +#line 6315 "parser.cpp" + break; - case 271: /* show_statement: SHOW TABLE table_name INDEX IDENTIFIER */ + case 271: /* show_statement: SHOW TABLE table_name INDEX IDENTIFIER */ #line 2080 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kIndex; - if ((yyvsp[-2].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.show_stmt)->schema_name_ = (yyvsp[-2].table_name_t)->schema_name_ptr_; - free((yyvsp[-2].table_name_t)->schema_name_ptr_); - } - (yyval.show_stmt)->table_name_ = (yyvsp[-2].table_name_t)->table_name_ptr_; - free((yyvsp[-2].table_name_t)->table_name_ptr_); - delete (yyvsp[-2].table_name_t); + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kIndex; + if((yyvsp[-2].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.show_stmt)->schema_name_ = (yyvsp[-2].table_name_t)->schema_name_ptr_; + free((yyvsp[-2].table_name_t)->schema_name_ptr_); + } + (yyval.show_stmt)->table_name_ = (yyvsp[-2].table_name_t)->table_name_ptr_; + free((yyvsp[-2].table_name_t)->table_name_ptr_); + delete (yyvsp[-2].table_name_t); - (yyval.show_stmt)->index_name_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - } -#line 6315 "parser.cpp" - break; + (yyval.show_stmt)->index_name_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); +} +#line 6334 "parser.cpp" + break; - case 272: /* show_statement: SHOW TABLE table_name INDEX IDENTIFIER SEGMENT LONG_VALUE */ + case 272: /* show_statement: SHOW TABLE table_name INDEX IDENTIFIER SEGMENT LONG_VALUE */ #line 2094 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kIndexSegment; - if ((yyvsp[-4].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.show_stmt)->schema_name_ = (yyvsp[-4].table_name_t)->schema_name_ptr_; - free((yyvsp[-4].table_name_t)->schema_name_ptr_); - } - (yyval.show_stmt)->table_name_ = (yyvsp[-4].table_name_t)->table_name_ptr_; - free((yyvsp[-4].table_name_t)->table_name_ptr_); - delete (yyvsp[-4].table_name_t); + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kIndexSegment; + if((yyvsp[-4].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.show_stmt)->schema_name_ = (yyvsp[-4].table_name_t)->schema_name_ptr_; + free((yyvsp[-4].table_name_t)->schema_name_ptr_); + } + (yyval.show_stmt)->table_name_ = (yyvsp[-4].table_name_t)->table_name_ptr_; + free((yyvsp[-4].table_name_t)->table_name_ptr_); + delete (yyvsp[-4].table_name_t); - (yyval.show_stmt)->index_name_ = (yyvsp[-2].str_value); - free((yyvsp[-2].str_value)); + (yyval.show_stmt)->index_name_ = (yyvsp[-2].str_value); + free((yyvsp[-2].str_value)); - (yyval.show_stmt)->segment_id_ = (yyvsp[0].long_value); - } -#line 6336 "parser.cpp" - break; + (yyval.show_stmt)->segment_id_ = (yyvsp[0].long_value); +} +#line 6355 "parser.cpp" + break; - case 273: /* show_statement: SHOW TABLE table_name INDEX IDENTIFIER SEGMENT LONG_VALUE CHUNK LONG_VALUE */ + case 273: /* show_statement: SHOW TABLE table_name INDEX IDENTIFIER SEGMENT LONG_VALUE CHUNK LONG_VALUE */ #line 2110 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kIndexChunk; - if ((yyvsp[-6].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.show_stmt)->schema_name_ = (yyvsp[-6].table_name_t)->schema_name_ptr_; - free((yyvsp[-6].table_name_t)->schema_name_ptr_); - } - (yyval.show_stmt)->table_name_ = (yyvsp[-6].table_name_t)->table_name_ptr_; - free((yyvsp[-6].table_name_t)->table_name_ptr_); - delete (yyvsp[-6].table_name_t); - - (yyval.show_stmt)->index_name_ = (yyvsp[-4].str_value); - free((yyvsp[-4].str_value)); - - (yyval.show_stmt)->segment_id_ = (yyvsp[-2].long_value); - (yyval.show_stmt)->chunk_id_ = (yyvsp[0].long_value); - } -#line 6358 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kIndexChunk; + if((yyvsp[-6].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.show_stmt)->schema_name_ = (yyvsp[-6].table_name_t)->schema_name_ptr_; + free((yyvsp[-6].table_name_t)->schema_name_ptr_); + } + (yyval.show_stmt)->table_name_ = (yyvsp[-6].table_name_t)->table_name_ptr_; + free((yyvsp[-6].table_name_t)->table_name_ptr_); + delete (yyvsp[-6].table_name_t); + + (yyval.show_stmt)->index_name_ = (yyvsp[-4].str_value); + free((yyvsp[-4].str_value)); + + (yyval.show_stmt)->segment_id_ = (yyvsp[-2].long_value); + (yyval.show_stmt)->chunk_id_ = (yyvsp[0].long_value); +} +#line 6377 "parser.cpp" + break; - case 274: /* show_statement: SHOW LOGS */ + case 274: /* show_statement: SHOW LOGS */ #line 2127 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kLogs; - } -#line 6367 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kLogs; +} +#line 6386 "parser.cpp" + break; - case 275: /* show_statement: SHOW DELTA LOGS */ + case 275: /* show_statement: SHOW DELTA LOGS */ #line 2131 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kDeltaLogs; - } -#line 6376 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kDeltaLogs; +} +#line 6395 "parser.cpp" + break; - case 276: /* show_statement: SHOW CATALOGS */ + case 276: /* show_statement: SHOW CATALOGS */ #line 2135 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kCatalogs; - } -#line 6385 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kCatalogs; +} +#line 6404 "parser.cpp" + break; - case 277: /* show_statement: SHOW PERSISTENCE FILES */ + case 277: /* show_statement: SHOW PERSISTENCE FILES */ #line 2139 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kPersistenceFiles; - } -#line 6394 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kPersistenceFiles; +} +#line 6413 "parser.cpp" + break; - case 278: /* show_statement: SHOW PERSISTENCE OBJECTS */ + case 278: /* show_statement: SHOW PERSISTENCE OBJECTS */ #line 2143 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kPersistenceObjects; - } -#line 6403 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kPersistenceObjects; +} +#line 6422 "parser.cpp" + break; - case 279: /* show_statement: SHOW PERSISTENCE OBJECT STRING */ + case 279: /* show_statement: SHOW PERSISTENCE OBJECT STRING */ #line 2147 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kPersistenceObject; - (yyval.show_stmt)->file_name_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - } -#line 6414 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kPersistenceObject; + (yyval.show_stmt)->file_name_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); +} +#line 6433 "parser.cpp" + break; - case 280: /* show_statement: SHOW MEMORY */ + case 280: /* show_statement: SHOW MEMORY */ #line 2153 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kMemory; - } -#line 6423 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kMemory; +} +#line 6442 "parser.cpp" + break; - case 281: /* show_statement: SHOW MEMORY OBJECTS */ + case 281: /* show_statement: SHOW MEMORY OBJECTS */ #line 2157 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kMemoryObjects; - } -#line 6432 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kMemoryObjects; +} +#line 6451 "parser.cpp" + break; - case 282: /* show_statement: SHOW MEMORY ALLOCATION */ + case 282: /* show_statement: SHOW MEMORY ALLOCATION */ #line 2161 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kMemoryAllocation; - } -#line 6441 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kMemoryAllocation; +} +#line 6460 "parser.cpp" + break; - case 283: /* show_statement: SHOW IDENTIFIER '(' ')' */ + case 283: /* show_statement: SHOW IDENTIFIER '(' ')' */ #line 2165 "parser.y" - { - (yyval.show_stmt) = new infinity::ShowStatement(); - (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kFunction; - (yyval.show_stmt)->function_name_ = (yyvsp[-2].str_value); - free((yyvsp[-2].str_value)); - } -#line 6452 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kFunction; + (yyval.show_stmt)->function_name_ = (yyvsp[-2].str_value); + free((yyvsp[-2].str_value)); +} +#line 6471 "parser.cpp" + break; + + case 284: /* show_statement: SHOW SNAPSHOTS */ +#line 2171 "parser.y" + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kListSnapshots; +} +#line 6480 "parser.cpp" + break; - case 284: /* flush_statement: FLUSH DATA */ + case 285: /* show_statement: SHOW SNAPSHOT IDENTIFIER */ #line 2175 "parser.y" - { - (yyval.flush_stmt) = new infinity::FlushStatement(); - (yyval.flush_stmt)->type_ = infinity::FlushType::kData; - } -#line 6461 "parser.cpp" - break; + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kShowSnapshot; + (yyval.show_stmt)->snapshot_name_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); +} +#line 6491 "parser.cpp" + break; + + case 286: /* flush_statement: FLUSH DATA */ +#line 2185 "parser.y" + { + (yyval.flush_stmt) = new infinity::FlushStatement(); + (yyval.flush_stmt)->type_ = infinity::FlushType::kData; +} +#line 6500 "parser.cpp" + break; + + case 287: /* flush_statement: FLUSH LOG */ +#line 2189 "parser.y" + { + (yyval.flush_stmt) = new infinity::FlushStatement(); + (yyval.flush_stmt)->type_ = infinity::FlushType::kLog; +} +#line 6509 "parser.cpp" + break; + + case 288: /* flush_statement: FLUSH BUFFER */ +#line 2193 "parser.y" + { + (yyval.flush_stmt) = new infinity::FlushStatement(); + (yyval.flush_stmt)->type_ = infinity::FlushType::kBuffer; +} +#line 6518 "parser.cpp" + break; + + case 289: /* optimize_statement: OPTIMIZE table_name */ +#line 2201 "parser.y" + { + (yyval.optimize_stmt) = new infinity::OptimizeStatement(); + if((yyvsp[0].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.optimize_stmt)->schema_name_ = (yyvsp[0].table_name_t)->schema_name_ptr_; + free((yyvsp[0].table_name_t)->schema_name_ptr_); + } + (yyval.optimize_stmt)->table_name_ = (yyvsp[0].table_name_t)->table_name_ptr_; + free((yyvsp[0].table_name_t)->table_name_ptr_); + delete (yyvsp[0].table_name_t); +} +#line 6533 "parser.cpp" + break; + + case 290: /* optimize_statement: OPTIMIZE IDENTIFIER ON table_name with_index_param_list */ +#line 2212 "parser.y" + { + (yyval.optimize_stmt) = new infinity::OptimizeStatement(); + if((yyvsp[-1].table_name_t)->schema_name_ptr_ != nullptr) { + (yyval.optimize_stmt)->schema_name_ = (yyvsp[-1].table_name_t)->schema_name_ptr_; + free((yyvsp[-1].table_name_t)->schema_name_ptr_); + } + (yyval.optimize_stmt)->table_name_ = (yyvsp[-1].table_name_t)->table_name_ptr_; + free((yyvsp[-1].table_name_t)->table_name_ptr_); + delete (yyvsp[-1].table_name_t); - case 285: /* flush_statement: FLUSH LOG */ -#line 2179 "parser.y" - { - (yyval.flush_stmt) = new infinity::FlushStatement(); - (yyval.flush_stmt)->type_ = infinity::FlushType::kLog; - } -#line 6470 "parser.cpp" - break; + (yyval.optimize_stmt)->index_name_ = (yyvsp[-3].str_value); + free((yyvsp[-3].str_value)); - case 286: /* flush_statement: FLUSH BUFFER */ -#line 2183 "parser.y" - { - (yyval.flush_stmt) = new infinity::FlushStatement(); - (yyval.flush_stmt)->type_ = infinity::FlushType::kBuffer; - } -#line 6479 "parser.cpp" - break; + for (auto *&index_param : *(yyvsp[0].with_index_param_list_t)) { + (yyval.optimize_stmt)->opt_params_.emplace_back(std::unique_ptr(index_param)); + index_param = nullptr; + } + delete (yyvsp[0].with_index_param_list_t); +} +#line 6557 "parser.cpp" + break; + + case 291: /* command_statement: USE IDENTIFIER */ +#line 2235 "parser.y" + { + (yyval.command_stmt) = new infinity::CommandStatement(); + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.command_stmt)->command_info_ = std::make_shared((yyvsp[0].str_value)); + free((yyvsp[0].str_value)); +} +#line 6568 "parser.cpp" + break; + + case 292: /* command_statement: EXPORT PROFILES LONG_VALUE file_path */ +#line 2241 "parser.y" + { + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared((yyvsp[0].str_value), infinity::ExportType::kProfileRecord, (yyvsp[-1].long_value)); + free((yyvsp[0].str_value)); +} +#line 6578 "parser.cpp" + break; + + case 293: /* command_statement: SET SESSION IDENTIFIER ON */ +#line 2246 "parser.y" + { + ParserHelper::ToLower((yyvsp[-1].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kSession, infinity::SetVarType::kBool, (yyvsp[-1].str_value), true); + free((yyvsp[-1].str_value)); +} +#line 6589 "parser.cpp" + break; + + case 294: /* command_statement: SET SESSION IDENTIFIER OFF */ +#line 2252 "parser.y" + { + ParserHelper::ToLower((yyvsp[-1].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kSession, infinity::SetVarType::kBool, (yyvsp[-1].str_value), false); + free((yyvsp[-1].str_value)); +} +#line 6600 "parser.cpp" + break; + + case 295: /* command_statement: SET SESSION IDENTIFIER IDENTIFIER */ +#line 2258 "parser.y" + { + ParserHelper::ToLower((yyvsp[-1].str_value)); + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kSession, infinity::SetVarType::kString, (yyvsp[-1].str_value), (yyvsp[0].str_value)); + free((yyvsp[-1].str_value)); + free((yyvsp[0].str_value)); +} +#line 6613 "parser.cpp" + break; + + case 296: /* command_statement: SET SESSION IDENTIFIER LONG_VALUE */ +#line 2266 "parser.y" + { + ParserHelper::ToLower((yyvsp[-1].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kSession, infinity::SetVarType::kInteger, (yyvsp[-1].str_value), (yyvsp[0].long_value)); + free((yyvsp[-1].str_value)); +} +#line 6624 "parser.cpp" + break; + + case 297: /* command_statement: SET SESSION IDENTIFIER DOUBLE_VALUE */ +#line 2272 "parser.y" + { + ParserHelper::ToLower((yyvsp[-1].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kSession, infinity::SetVarType::kDouble, (yyvsp[-1].str_value), (yyvsp[0].double_value)); + free((yyvsp[-1].str_value)); +} +#line 6635 "parser.cpp" + break; + + case 298: /* command_statement: SET GLOBAL IDENTIFIER ON */ +#line 2278 "parser.y" + { + ParserHelper::ToLower((yyvsp[-1].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kGlobal, infinity::SetVarType::kBool, (yyvsp[-1].str_value), true); + free((yyvsp[-1].str_value)); +} +#line 6646 "parser.cpp" + break; + + case 299: /* command_statement: SET GLOBAL IDENTIFIER OFF */ +#line 2284 "parser.y" + { + ParserHelper::ToLower((yyvsp[-1].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kGlobal, infinity::SetVarType::kBool, (yyvsp[-1].str_value), false); + free((yyvsp[-1].str_value)); +} +#line 6657 "parser.cpp" + break; + + case 300: /* command_statement: SET GLOBAL IDENTIFIER IDENTIFIER */ +#line 2290 "parser.y" + { + ParserHelper::ToLower((yyvsp[-1].str_value)); + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kGlobal, infinity::SetVarType::kString, (yyvsp[-1].str_value), (yyvsp[0].str_value)); + free((yyvsp[-1].str_value)); + free((yyvsp[0].str_value)); +} +#line 6670 "parser.cpp" + break; + + case 301: /* command_statement: SET GLOBAL IDENTIFIER LONG_VALUE */ +#line 2298 "parser.y" + { + ParserHelper::ToLower((yyvsp[-1].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kGlobal, infinity::SetVarType::kInteger, (yyvsp[-1].str_value), (yyvsp[0].long_value)); + free((yyvsp[-1].str_value)); +} +#line 6681 "parser.cpp" + break; + + case 302: /* command_statement: SET GLOBAL IDENTIFIER DOUBLE_VALUE */ +#line 2304 "parser.y" + { + ParserHelper::ToLower((yyvsp[-1].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kGlobal, infinity::SetVarType::kDouble, (yyvsp[-1].str_value), (yyvsp[0].double_value)); + free((yyvsp[-1].str_value)); +} +#line 6692 "parser.cpp" + break; + + case 303: /* command_statement: SET CONFIG IDENTIFIER ON */ +#line 2310 "parser.y" + { + ParserHelper::ToLower((yyvsp[-1].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kConfig, infinity::SetVarType::kBool, (yyvsp[-1].str_value), true); + free((yyvsp[-1].str_value)); +} +#line 6703 "parser.cpp" + break; + + case 304: /* command_statement: SET CONFIG IDENTIFIER OFF */ +#line 2316 "parser.y" + { + ParserHelper::ToLower((yyvsp[-1].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kConfig, infinity::SetVarType::kBool, (yyvsp[-1].str_value), false); + free((yyvsp[-1].str_value)); +} +#line 6714 "parser.cpp" + break; + + case 305: /* command_statement: SET CONFIG IDENTIFIER IDENTIFIER */ +#line 2322 "parser.y" + { + ParserHelper::ToLower((yyvsp[-1].str_value)); + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kConfig, infinity::SetVarType::kString, (yyvsp[-1].str_value), (yyvsp[0].str_value)); + free((yyvsp[-1].str_value)); + free((yyvsp[0].str_value)); +} +#line 6727 "parser.cpp" + break; + + case 306: /* command_statement: SET CONFIG IDENTIFIER LONG_VALUE */ +#line 2330 "parser.y" + { + ParserHelper::ToLower((yyvsp[-1].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kConfig, infinity::SetVarType::kInteger, (yyvsp[-1].str_value), (yyvsp[0].long_value)); + free((yyvsp[-1].str_value)); +} +#line 6738 "parser.cpp" + break; + + case 307: /* command_statement: SET CONFIG IDENTIFIER DOUBLE_VALUE */ +#line 2336 "parser.y" + { + ParserHelper::ToLower((yyvsp[-1].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kConfig, infinity::SetVarType::kDouble, (yyvsp[-1].str_value), (yyvsp[0].double_value)); + free((yyvsp[-1].str_value)); +} +#line 6749 "parser.cpp" + break; + + case 308: /* command_statement: LOCK TABLE table_name */ +#line 2342 "parser.y" + { + (yyval.command_stmt) = new infinity::CommandStatement(); + ParserHelper::ToLower((yyvsp[0].table_name_t)->schema_name_ptr_); + ParserHelper::ToLower((yyvsp[0].table_name_t)->table_name_ptr_); + (yyval.command_stmt)->command_info_ = std::make_shared((yyvsp[0].table_name_t)->schema_name_ptr_, (yyvsp[0].table_name_t)->table_name_ptr_); + free((yyvsp[0].table_name_t)->schema_name_ptr_); + free((yyvsp[0].table_name_t)->table_name_ptr_); + delete (yyvsp[0].table_name_t); +} +#line 6763 "parser.cpp" + break; - case 287: /* optimize_statement: OPTIMIZE table_name */ -#line 2191 "parser.y" - { - (yyval.optimize_stmt) = new infinity::OptimizeStatement(); - if ((yyvsp[0].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.optimize_stmt)->schema_name_ = (yyvsp[0].table_name_t)->schema_name_ptr_; - free((yyvsp[0].table_name_t)->schema_name_ptr_); - } - (yyval.optimize_stmt)->table_name_ = (yyvsp[0].table_name_t)->table_name_ptr_; - free((yyvsp[0].table_name_t)->table_name_ptr_); - delete (yyvsp[0].table_name_t); - } -#line 6494 "parser.cpp" - break; + case 309: /* command_statement: UNLOCK TABLE table_name */ +#line 2351 "parser.y" + { + (yyval.command_stmt) = new infinity::CommandStatement(); + ParserHelper::ToLower((yyvsp[0].table_name_t)->schema_name_ptr_); + ParserHelper::ToLower((yyvsp[0].table_name_t)->table_name_ptr_); + (yyval.command_stmt)->command_info_ = std::make_shared((yyvsp[0].table_name_t)->schema_name_ptr_, (yyvsp[0].table_name_t)->table_name_ptr_); + free((yyvsp[0].table_name_t)->schema_name_ptr_); + free((yyvsp[0].table_name_t)->table_name_ptr_); + delete (yyvsp[0].table_name_t); +} +#line 6777 "parser.cpp" + break; + + case 310: /* command_statement: CREATE SNAPSHOT IDENTIFIER ON TABLE IDENTIFIER */ +#line 2360 "parser.y" + { + ParserHelper::ToLower((yyvsp[-3].str_value)); + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared((yyvsp[-3].str_value), infinity::SnapshotOp::kCreate, infinity::SnapshotScope::kTable, (yyvsp[0].str_value)); + free((yyvsp[-3].str_value)); + free((yyvsp[0].str_value)); +} +#line 6790 "parser.cpp" + break; - case 288: /* optimize_statement: OPTIMIZE IDENTIFIER ON table_name with_index_param_list */ -#line 2202 "parser.y" - { - (yyval.optimize_stmt) = new infinity::OptimizeStatement(); - if ((yyvsp[-1].table_name_t)->schema_name_ptr_ != nullptr) { - (yyval.optimize_stmt)->schema_name_ = (yyvsp[-1].table_name_t)->schema_name_ptr_; - free((yyvsp[-1].table_name_t)->schema_name_ptr_); - } - (yyval.optimize_stmt)->table_name_ = (yyvsp[-1].table_name_t)->table_name_ptr_; - free((yyvsp[-1].table_name_t)->table_name_ptr_); - delete (yyvsp[-1].table_name_t); + case 311: /* command_statement: CREATE SNAPSHOT IDENTIFIER ON DATABASE IDENTIFIER */ +#line 2368 "parser.y" + { + ParserHelper::ToLower((yyvsp[-3].str_value)); + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared((yyvsp[-3].str_value), infinity::SnapshotOp::kCreate, infinity::SnapshotScope::kDatabase, (yyvsp[0].str_value)); + free((yyvsp[-3].str_value)); + free((yyvsp[0].str_value)); +} +#line 6803 "parser.cpp" + break; + + case 312: /* command_statement: CREATE SNAPSHOT IDENTIFIER ON SYSTEM */ +#line 2376 "parser.y" + { + ParserHelper::ToLower((yyvsp[-2].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared((yyvsp[-2].str_value), infinity::SnapshotOp::kCreate, infinity::SnapshotScope::kSystem); + free((yyvsp[-2].str_value)); +} +#line 6814 "parser.cpp" + break; + + case 313: /* command_statement: DROP SNAPSHOT IDENTIFIER */ +#line 2382 "parser.y" + { + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared((yyvsp[0].str_value), infinity::SnapshotOp::kDrop, infinity::SnapshotScope::kIgnore); + free((yyvsp[0].str_value)); +} +#line 6825 "parser.cpp" + break; + + case 314: /* command_statement: RESTORE DATABASE SNAPSHOT IDENTIFIER */ +#line 2388 "parser.y" + { + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared((yyvsp[0].str_value), infinity::SnapshotOp::kRestore, infinity::SnapshotScope::kDatabase); + free((yyvsp[0].str_value)); +} +#line 6836 "parser.cpp" + break; - (yyval.optimize_stmt)->index_name_ = (yyvsp[-3].str_value); - free((yyvsp[-3].str_value)); + case 315: /* command_statement: RESTORE TABLE SNAPSHOT IDENTIFIER */ +#line 2394 "parser.y" + { + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.command_stmt) = new infinity::CommandStatement(); + (yyval.command_stmt)->command_info_ = std::make_shared((yyvsp[0].str_value), infinity::SnapshotOp::kRestore, infinity::SnapshotScope::kTable); + free((yyvsp[0].str_value)); +} +#line 6847 "parser.cpp" + break; + + case 316: /* compact_statement: COMPACT TABLE table_name */ +#line 2401 "parser.y" + { + std::string schema_name; + if ((yyvsp[0].table_name_t)->schema_name_ptr_ != nullptr) { + schema_name = std::string((yyvsp[0].table_name_t)->schema_name_ptr_); + free((yyvsp[0].table_name_t)->schema_name_ptr_); + } + std::string table_name = std::string((yyvsp[0].table_name_t)->table_name_ptr_); + free((yyvsp[0].table_name_t)->table_name_ptr_); - for (auto *&index_param : *(yyvsp[0].with_index_param_list_t)) { - (yyval.optimize_stmt)->opt_params_.emplace_back(std::unique_ptr(index_param)); - index_param = nullptr; - } - delete (yyvsp[0].with_index_param_list_t); - } -#line 6518 "parser.cpp" - break; + (yyval.compact_stmt) = new infinity::ManualCompactStatement(std::move(schema_name), std::move(table_name)); + delete (yyvsp[0].table_name_t); +} +#line 6864 "parser.cpp" + break; + + case 317: /* admin_statement: ADMIN SHOW CATALOGS */ +#line 2414 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListCatalogs; +} +#line 6873 "parser.cpp" + break; + + case 318: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE */ +#line 2418 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowCatalog; + (yyval.admin_stmt)->catalog_file_index_ = (yyvsp[0].long_value); +} +#line 6883 "parser.cpp" + break; - case 289: /* command_statement: USE IDENTIFIER */ -#line 2225 "parser.y" - { - (yyval.command_stmt) = new infinity::CommandStatement(); - ParserHelper::ToLower((yyvsp[0].str_value)); - (yyval.command_stmt)->command_info_ = std::make_shared((yyvsp[0].str_value)); - free((yyvsp[0].str_value)); - } -#line 6529 "parser.cpp" - break; + case 319: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASES */ +#line 2423 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListDatabases; + (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-2].long_value); + (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-1].long_value); +} +#line 6894 "parser.cpp" + break; + + case 320: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE */ +#line 2429 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowDatabase; + (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-3].long_value); + (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-2].long_value); + (yyval.admin_stmt)->database_meta_index_ = (yyvsp[0].long_value); +} +#line 6906 "parser.cpp" + break; + + case 321: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLES */ +#line 2436 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListTables; + (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-5].long_value); + (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-4].long_value); + (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-2].long_value); + (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-1].long_value); +} +#line 6919 "parser.cpp" + break; + + case 322: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE */ +#line 2444 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowTable; + (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-6].long_value); + (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-5].long_value); + (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-3].long_value); + (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-2].long_value); + (yyval.admin_stmt)->table_meta_index_ = (yyvsp[0].long_value); +} +#line 6933 "parser.cpp" + break; + + case 323: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE COLUMNS */ +#line 2453 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowColumn; + (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-8].long_value); + (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-7].long_value); + (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-5].long_value); + (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-4].long_value); + (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-2].long_value); + (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-1].long_value); +} +#line 6948 "parser.cpp" + break; + + case 324: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENTS */ +#line 2463 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListSegments; + (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-8].long_value); + (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-7].long_value); + (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-5].long_value); + (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-4].long_value); + (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-2].long_value); + (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-1].long_value); +} +#line 6963 "parser.cpp" + break; + + case 325: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENT LONG_VALUE */ +#line 2473 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowSegment; + (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-9].long_value); + (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-8].long_value); + (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-6].long_value); + (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-5].long_value); + (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-3].long_value); + (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-2].long_value); + (yyval.admin_stmt)->segment_index_ = (yyvsp[0].long_value); +} +#line 6979 "parser.cpp" + break; + + case 326: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENT LONG_VALUE BLOCKS */ +#line 2484 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListBlocks; + (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-10].long_value); + (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-9].long_value); + (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-7].long_value); + (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-6].long_value); + (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-4].long_value); + (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-3].long_value); + (yyval.admin_stmt)->segment_index_ = (yyvsp[-1].long_value); +} +#line 6995 "parser.cpp" + break; + + case 327: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENT LONG_VALUE BLOCK LONG_VALUE */ +#line 2495 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowBlock; + (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-11].long_value); + (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-10].long_value); + (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-8].long_value); + (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-7].long_value); + (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-5].long_value); + (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-4].long_value); + (yyval.admin_stmt)->segment_index_ = (yyvsp[-2].long_value); + (yyval.admin_stmt)->block_index_ = (yyvsp[0].long_value); +} +#line 7012 "parser.cpp" + break; + + case 328: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENT LONG_VALUE BLOCK LONG_VALUE COLUMNS */ +#line 2507 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListColumns; + (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-12].long_value); + (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-11].long_value); + (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-9].long_value); + (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-8].long_value); + (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-6].long_value); + (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-5].long_value); + (yyval.admin_stmt)->segment_index_ = (yyvsp[-3].long_value); + (yyval.admin_stmt)->block_index_ = (yyvsp[-1].long_value); +} +#line 7029 "parser.cpp" + break; - case 290: /* command_statement: EXPORT PROFILES LONG_VALUE file_path */ -#line 2231 "parser.y" - { - (yyval.command_stmt) = new infinity::CommandStatement(); - (yyval.command_stmt)->command_info_ = - std::make_shared((yyvsp[0].str_value), infinity::ExportType::kProfileRecord, (yyvsp[-1].long_value)); - free((yyvsp[0].str_value)); - } -#line 6539 "parser.cpp" - break; - - case 291: /* command_statement: SET SESSION IDENTIFIER ON */ -#line 2236 "parser.y" - { - ParserHelper::ToLower((yyvsp[-1].str_value)); - (yyval.command_stmt) = new infinity::CommandStatement(); - (yyval.command_stmt)->command_info_ = - std::make_shared(infinity::SetScope::kSession, infinity::SetVarType::kBool, (yyvsp[-1].str_value), true); - free((yyvsp[-1].str_value)); - } -#line 6550 "parser.cpp" - break; - - case 292: /* command_statement: SET SESSION IDENTIFIER OFF */ -#line 2242 "parser.y" - { - ParserHelper::ToLower((yyvsp[-1].str_value)); - (yyval.command_stmt) = new infinity::CommandStatement(); - (yyval.command_stmt)->command_info_ = - std::make_shared(infinity::SetScope::kSession, infinity::SetVarType::kBool, (yyvsp[-1].str_value), false); - free((yyvsp[-1].str_value)); - } -#line 6561 "parser.cpp" - break; + case 329: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE INDEXES */ +#line 2519 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListIndexes; + (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-8].long_value); + (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-7].long_value); + (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-5].long_value); + (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-4].long_value); + (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-2].long_value); + (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-1].long_value); +} +#line 7044 "parser.cpp" + break; - case 293: /* command_statement: SET SESSION IDENTIFIER IDENTIFIER */ -#line 2248 "parser.y" - { - ParserHelper::ToLower((yyvsp[-1].str_value)); - ParserHelper::ToLower((yyvsp[0].str_value)); - (yyval.command_stmt) = new infinity::CommandStatement(); - (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kSession, - infinity::SetVarType::kString, - (yyvsp[-1].str_value), - (yyvsp[0].str_value)); - free((yyvsp[-1].str_value)); - free((yyvsp[0].str_value)); - } -#line 6574 "parser.cpp" - break; + case 330: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE INDEX LONG_VALUE */ +#line 2529 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowIndex; + (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-9].long_value); + (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-8].long_value); + (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-6].long_value); + (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-5].long_value); + (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-3].long_value); + (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-2].long_value); + (yyval.admin_stmt)->index_meta_index_ = (yyvsp[0].long_value); +} +#line 7060 "parser.cpp" + break; + + case 331: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE INDEX LONG_VALUE LONG_VALUE SEGMENTS */ +#line 2540 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListIndexSegments; + (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-11].long_value); + (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-10].long_value); + (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-8].long_value); + (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-7].long_value); + (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-5].long_value); + (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-4].long_value); + (yyval.admin_stmt)->index_meta_index_ = (yyvsp[-2].long_value); + (yyval.admin_stmt)->index_entry_index_ = (yyvsp[-1].long_value); +} +#line 7077 "parser.cpp" + break; + + case 332: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE INDEX LONG_VALUE LONG_VALUE SEGMENT LONG_VALUE */ +#line 2552 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowIndexSegment; + (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-12].long_value); + (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-11].long_value); + (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-9].long_value); + (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-8].long_value); + (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-6].long_value); + (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-5].long_value); + (yyval.admin_stmt)->index_meta_index_ = (yyvsp[-3].long_value); + (yyval.admin_stmt)->index_entry_index_ = (yyvsp[-2].long_value); + (yyval.admin_stmt)->segment_index_ = (yyvsp[0].long_value); +} +#line 7095 "parser.cpp" + break; - case 294: /* command_statement: SET SESSION IDENTIFIER LONG_VALUE */ -#line 2256 "parser.y" - { - ParserHelper::ToLower((yyvsp[-1].str_value)); - (yyval.command_stmt) = new infinity::CommandStatement(); - (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kSession, - infinity::SetVarType::kInteger, - (yyvsp[-1].str_value), - (yyvsp[0].long_value)); - free((yyvsp[-1].str_value)); - } -#line 6585 "parser.cpp" - break; + case 333: /* admin_statement: ADMIN SHOW LOGS */ +#line 2565 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListLogFiles; +} +#line 7104 "parser.cpp" + break; - case 295: /* command_statement: SET SESSION IDENTIFIER DOUBLE_VALUE */ -#line 2262 "parser.y" - { - ParserHelper::ToLower((yyvsp[-1].str_value)); - (yyval.command_stmt) = new infinity::CommandStatement(); - (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kSession, - infinity::SetVarType::kDouble, - (yyvsp[-1].str_value), - (yyvsp[0].double_value)); - free((yyvsp[-1].str_value)); - } -#line 6596 "parser.cpp" - break; + case 334: /* admin_statement: ADMIN SHOW LOG LONG_VALUE */ +#line 2569 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowLogFile; + (yyval.admin_stmt)->log_file_index_ = (yyvsp[0].long_value); +} +#line 7114 "parser.cpp" + break; + + case 335: /* admin_statement: ADMIN SHOW LOG LONG_VALUE INDEXES */ +#line 2574 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListLogIndexes; + (yyval.admin_stmt)->log_file_index_ = (yyvsp[-1].long_value); +} +#line 7124 "parser.cpp" + break; + + case 336: /* admin_statement: ADMIN SHOW LOG LONG_VALUE INDEX LONG_VALUE */ +#line 2579 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowLogIndex; + (yyval.admin_stmt)->log_file_index_ = (yyvsp[-2].long_value); + (yyval.admin_stmt)->log_index_in_file_ = (yyvsp[0].long_value); +} +#line 7135 "parser.cpp" + break; + + case 337: /* admin_statement: ADMIN SHOW CONFIGS */ +#line 2585 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListConfigs; +} +#line 7144 "parser.cpp" + break; + + case 338: /* admin_statement: ADMIN SHOW VARIABLES */ +#line 2589 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListVariables; +} +#line 7153 "parser.cpp" + break; - case 296: /* command_statement: SET GLOBAL IDENTIFIER ON */ -#line 2268 "parser.y" - { - ParserHelper::ToLower((yyvsp[-1].str_value)); - (yyval.command_stmt) = new infinity::CommandStatement(); - (yyval.command_stmt)->command_info_ = - std::make_shared(infinity::SetScope::kGlobal, infinity::SetVarType::kBool, (yyvsp[-1].str_value), true); - free((yyvsp[-1].str_value)); - } -#line 6607 "parser.cpp" - break; + case 339: /* admin_statement: ADMIN SHOW VARIABLE IDENTIFIER */ +#line 2593 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowVariable; + (yyval.admin_stmt)->variable_name_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); +} +#line 7164 "parser.cpp" + break; + + case 340: /* admin_statement: ADMIN CREATE SNAPSHOT */ +#line 2599 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kCreateSnapshot; +} +#line 7173 "parser.cpp" + break; - case 297: /* command_statement: SET GLOBAL IDENTIFIER OFF */ -#line 2274 "parser.y" - { - ParserHelper::ToLower((yyvsp[-1].str_value)); - (yyval.command_stmt) = new infinity::CommandStatement(); - (yyval.command_stmt)->command_info_ = - std::make_shared(infinity::SetScope::kGlobal, infinity::SetVarType::kBool, (yyvsp[-1].str_value), false); - free((yyvsp[-1].str_value)); - } -#line 6618 "parser.cpp" - break; + case 341: /* admin_statement: ADMIN SHOW SNAPSHOTS */ +#line 2603 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListSnapshots; +} +#line 7182 "parser.cpp" + break; + + case 342: /* admin_statement: ADMIN SHOW SNAPSHOT IDENTIFIER */ +#line 2607 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowSnapshot; + (yyval.admin_stmt)->snapshot_name_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); +} +#line 7193 "parser.cpp" + break; - case 298: /* command_statement: SET GLOBAL IDENTIFIER IDENTIFIER */ -#line 2280 "parser.y" - { - ParserHelper::ToLower((yyvsp[-1].str_value)); - ParserHelper::ToLower((yyvsp[0].str_value)); - (yyval.command_stmt) = new infinity::CommandStatement(); - (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kGlobal, - infinity::SetVarType::kString, - (yyvsp[-1].str_value), - (yyvsp[0].str_value)); - free((yyvsp[-1].str_value)); - free((yyvsp[0].str_value)); - } -#line 6631 "parser.cpp" - break; + case 343: /* admin_statement: ADMIN DELETE SNAPSHOT STRING */ +#line 2613 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kDeleteSnapshot; + (yyval.admin_stmt)->snapshot_name_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); +} +#line 7204 "parser.cpp" + break; + + case 344: /* admin_statement: ADMIN EXPORT SNAPSHOT STRING TO STRING */ +#line 2619 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kExportSnapshot; + (yyval.admin_stmt)->snapshot_name_ = (yyvsp[-2].str_value); + (yyval.admin_stmt)->export_path_ = (yyvsp[0].str_value); + free((yyvsp[-2].str_value)); + free((yyvsp[0].str_value)); +} +#line 7217 "parser.cpp" + break; + + case 345: /* admin_statement: ADMIN RECOVER FROM SNAPSHOT STRING */ +#line 2627 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kRecoverFromSnapshot; + (yyval.admin_stmt)->snapshot_name_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); +} +#line 7228 "parser.cpp" + break; + + case 346: /* admin_statement: ADMIN SHOW NODES */ +#line 2633 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListNodes; +} +#line 7237 "parser.cpp" + break; + + case 347: /* admin_statement: ADMIN SHOW NODE STRING */ +#line 2637 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowNode; + (yyval.admin_stmt)->node_name_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); +} +#line 7248 "parser.cpp" + break; + + case 348: /* admin_statement: ADMIN SHOW NODE */ +#line 2643 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowCurrentNode; +} +#line 7257 "parser.cpp" + break; + + case 349: /* admin_statement: ADMIN REMOVE NODE STRING */ +#line 2647 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kRemoveNode; + (yyval.admin_stmt)->node_name_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); +} +#line 7268 "parser.cpp" + break; + + case 350: /* admin_statement: ADMIN SET ADMIN */ +#line 2653 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kSetRole; + (yyval.admin_stmt)->node_role_ = infinity::NodeRole::kAdmin; +} +#line 7278 "parser.cpp" + break; + + case 351: /* admin_statement: ADMIN SET STANDALONE */ +#line 2658 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kSetRole; + (yyval.admin_stmt)->node_role_ = infinity::NodeRole::kStandalone; +} +#line 7288 "parser.cpp" + break; + + case 352: /* admin_statement: ADMIN SET LEADER USING STRING */ +#line 2663 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kSetRole; + (yyval.admin_stmt)->node_role_ = infinity::NodeRole::kLeader; + (yyval.admin_stmt)->node_name_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); +} +#line 7300 "parser.cpp" + break; + + case 353: /* admin_statement: ADMIN CONNECT STRING AS FOLLOWER USING STRING */ +#line 2670 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kSetRole; + (yyval.admin_stmt)->node_role_ = infinity::NodeRole::kFollower; + (yyval.admin_stmt)->leader_address_ = (yyvsp[-4].str_value); + (yyval.admin_stmt)->node_name_ = (yyvsp[0].str_value); + free((yyvsp[-4].str_value)); + free((yyvsp[0].str_value)); +} +#line 7314 "parser.cpp" + break; + + case 354: /* admin_statement: ADMIN CONNECT STRING AS LEARNER USING STRING */ +#line 2679 "parser.y" + { + (yyval.admin_stmt) = new infinity::AdminStatement(); + (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kSetRole; + (yyval.admin_stmt)->node_role_ = infinity::NodeRole::kLearner; + (yyval.admin_stmt)->leader_address_ = (yyvsp[-4].str_value); + (yyval.admin_stmt)->node_name_ = (yyvsp[0].str_value); + free((yyvsp[-4].str_value)); + free((yyvsp[0].str_value)); +} +#line 7328 "parser.cpp" + break; + + case 355: /* alter_statement: ALTER TABLE table_name RENAME TO IDENTIFIER */ +#line 2689 "parser.y" + { + auto *ret = new infinity::RenameTableStatement((yyvsp[-3].table_name_t)->schema_name_ptr_, (yyvsp[-3].table_name_t)->table_name_ptr_); + (yyval.alter_stmt) = ret; + ret->new_table_name_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); + free((yyvsp[-3].table_name_t)->schema_name_ptr_); + free((yyvsp[-3].table_name_t)->table_name_ptr_); + delete (yyvsp[-3].table_name_t); +} +#line 7342 "parser.cpp" + break; - case 299: /* command_statement: SET GLOBAL IDENTIFIER LONG_VALUE */ -#line 2288 "parser.y" - { - ParserHelper::ToLower((yyvsp[-1].str_value)); - (yyval.command_stmt) = new infinity::CommandStatement(); - (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kGlobal, - infinity::SetVarType::kInteger, - (yyvsp[-1].str_value), - (yyvsp[0].long_value)); - free((yyvsp[-1].str_value)); - } -#line 6642 "parser.cpp" - break; + case 356: /* alter_statement: ALTER TABLE table_name ADD COLUMN '(' column_def_array ')' */ +#line 2698 "parser.y" + { + auto *ret = new infinity::AddColumnsStatement((yyvsp[-5].table_name_t)->schema_name_ptr_, (yyvsp[-5].table_name_t)->table_name_ptr_); + (yyval.alter_stmt) = ret; - case 300: /* command_statement: SET GLOBAL IDENTIFIER DOUBLE_VALUE */ -#line 2294 "parser.y" - { - ParserHelper::ToLower((yyvsp[-1].str_value)); - (yyval.command_stmt) = new infinity::CommandStatement(); - (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kGlobal, - infinity::SetVarType::kDouble, - (yyvsp[-1].str_value), - (yyvsp[0].double_value)); - free((yyvsp[-1].str_value)); - } -#line 6653 "parser.cpp" - break; + for (infinity::ColumnDef*& column_def : *(yyvsp[-1].column_def_array_t)) { + ret->column_defs_.emplace_back(column_def); + } + delete (yyvsp[-1].column_def_array_t); + free((yyvsp[-5].table_name_t)->schema_name_ptr_); + free((yyvsp[-5].table_name_t)->table_name_ptr_); + delete (yyvsp[-5].table_name_t); +} +#line 7359 "parser.cpp" + break; + + case 357: /* alter_statement: ALTER TABLE table_name DROP COLUMN '(' identifier_array ')' */ +#line 2710 "parser.y" + { + auto *ret = new infinity::DropColumnsStatement((yyvsp[-5].table_name_t)->schema_name_ptr_, (yyvsp[-5].table_name_t)->table_name_ptr_); + (yyval.alter_stmt) = ret; + for (std::string &column_name : *(yyvsp[-1].identifier_array_t)) { + ret->column_names_.emplace_back(std::move(column_name)); + } + delete (yyvsp[-1].identifier_array_t); + free((yyvsp[-5].table_name_t)->schema_name_ptr_); + free((yyvsp[-5].table_name_t)->table_name_ptr_); + delete (yyvsp[-5].table_name_t); +} +#line 7375 "parser.cpp" + break; + + case 358: /* expr_array: expr_alias */ +#line 2726 "parser.y" + { + (yyval.expr_array_t) = new std::vector(); + (yyval.expr_array_t)->emplace_back((yyvsp[0].expr_t)); +} +#line 7384 "parser.cpp" + break; + + case 359: /* expr_array: expr_array ',' expr_alias */ +#line 2730 "parser.y" + { + (yyvsp[-2].expr_array_t)->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_array_t) = (yyvsp[-2].expr_array_t); +} +#line 7393 "parser.cpp" + break; + + case 360: /* insert_row_list: '(' expr_array ')' */ +#line 2735 "parser.y" + { + auto res = std::make_unique(); + for (auto* &expr : *(yyvsp[-1].expr_array_t)) { + res->values_.emplace_back(expr); + expr = nullptr; + } + delete (yyvsp[-1].expr_array_t); + (yyval.insert_row_list_t) = new std::vector(); + (yyval.insert_row_list_t)->emplace_back(res.release()); +} +#line 7408 "parser.cpp" + break; + + case 361: /* insert_row_list: insert_row_list ',' '(' expr_array ')' */ +#line 2745 "parser.y" + { + (yyval.insert_row_list_t) = (yyvsp[-4].insert_row_list_t); + auto res = std::make_unique(); + for (auto* &expr : *(yyvsp[-1].expr_array_t)) { + res->values_.emplace_back(expr); + expr = nullptr; + } + delete (yyvsp[-1].expr_array_t); + (yyval.insert_row_list_t)->emplace_back(res.release()); +} +#line 7423 "parser.cpp" + break; + + case 362: /* expr_alias: expr AS IDENTIFIER */ +#line 2767 "parser.y" + { + (yyval.expr_t) = (yyvsp[-2].expr_t); + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.expr_t)->alias_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); +} +#line 7434 "parser.cpp" + break; - case 301: /* command_statement: SET CONFIG IDENTIFIER ON */ -#line 2300 "parser.y" - { - ParserHelper::ToLower((yyvsp[-1].str_value)); - (yyval.command_stmt) = new infinity::CommandStatement(); - (yyval.command_stmt)->command_info_ = - std::make_shared(infinity::SetScope::kConfig, infinity::SetVarType::kBool, (yyvsp[-1].str_value), true); - free((yyvsp[-1].str_value)); - } -#line 6664 "parser.cpp" - break; + case 363: /* expr_alias: expr */ +#line 2773 "parser.y" + { + (yyval.expr_t) = (yyvsp[0].expr_t); +} +#line 7442 "parser.cpp" + break; - case 302: /* command_statement: SET CONFIG IDENTIFIER OFF */ -#line 2306 "parser.y" - { - ParserHelper::ToLower((yyvsp[-1].str_value)); - (yyval.command_stmt) = new infinity::CommandStatement(); - (yyval.command_stmt)->command_info_ = - std::make_shared(infinity::SetScope::kConfig, infinity::SetVarType::kBool, (yyvsp[-1].str_value), false); - free((yyvsp[-1].str_value)); - } -#line 6675 "parser.cpp" - break; + case 369: /* operand: '(' expr ')' */ +#line 2783 "parser.y" + { + (yyval.expr_t) = (yyvsp[-1].expr_t); +} +#line 7450 "parser.cpp" + break; + + case 370: /* operand: '(' select_without_paren ')' */ +#line 2786 "parser.y" + { + infinity::SubqueryExpr* subquery_expr = new infinity::SubqueryExpr(); + subquery_expr->subquery_type_ = infinity::SubqueryType::kScalar; + subquery_expr->select_ = (yyvsp[-1].select_stmt); + (yyval.expr_t) = subquery_expr; +} +#line 7461 "parser.cpp" + break; - case 303: /* command_statement: SET CONFIG IDENTIFIER IDENTIFIER */ -#line 2312 "parser.y" - { - ParserHelper::ToLower((yyvsp[-1].str_value)); - ParserHelper::ToLower((yyvsp[0].str_value)); - (yyval.command_stmt) = new infinity::CommandStatement(); - (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kConfig, - infinity::SetVarType::kString, - (yyvsp[-1].str_value), - (yyvsp[0].str_value)); - free((yyvsp[-1].str_value)); - free((yyvsp[0].str_value)); - } -#line 6688 "parser.cpp" - break; + case 371: /* operand: constant_expr */ +#line 2792 "parser.y" + { + (yyval.expr_t) = (yyvsp[0].const_expr_t); +} +#line 7469 "parser.cpp" + break; + + case 382: /* match_tensor_expr: MATCH TENSOR '(' column_expr ',' common_array_expr ',' STRING ',' STRING ',' STRING optional_search_filter_expr ')' */ +#line 2808 "parser.y" + { + auto match_tensor_expr = std::make_unique(); + // search column + match_tensor_expr->SetSearchColumn((yyvsp[-10].expr_t)); + // search tensor + ParserHelper::ToLower((yyvsp[-6].str_value)); + match_tensor_expr->SetQueryTensor((yyvsp[-6].str_value), (yyvsp[-8].const_expr_t)); + // search method + ParserHelper::ToLower((yyvsp[-4].str_value)); + match_tensor_expr->SetSearchMethod((yyvsp[-4].str_value)); + // search options + match_tensor_expr->SetExtraOptions((yyvsp[-2].str_value)); + match_tensor_expr->SetOptionalFilter((yyvsp[-1].expr_t)); + (yyval.expr_t) = match_tensor_expr.release(); +} +#line 7489 "parser.cpp" + break; + + case 383: /* match_tensor_expr: MATCH TENSOR '(' column_expr ',' common_array_expr ',' STRING ',' STRING ',' STRING optional_search_filter_expr ')' USING INDEX '(' IDENTIFIER ')' */ +#line 2824 "parser.y" + { + auto match_tensor_expr = std::make_unique(); + // search column + match_tensor_expr->SetSearchColumn((yyvsp[-15].expr_t)); + // search tensor + ParserHelper::ToLower((yyvsp[-11].str_value)); + match_tensor_expr->SetQueryTensor((yyvsp[-11].str_value), (yyvsp[-13].const_expr_t)); + // search method + ParserHelper::ToLower((yyvsp[-9].str_value)); + match_tensor_expr->SetSearchMethod((yyvsp[-9].str_value)); + // search options + match_tensor_expr->SetExtraOptions((yyvsp[-7].str_value)); + match_tensor_expr->SetOptionalFilter((yyvsp[-6].expr_t)); + match_tensor_expr->index_name_ = (yyvsp[-1].str_value); + (yyval.expr_t) = match_tensor_expr.release(); +} +#line 7510 "parser.cpp" + break; + + case 384: /* match_tensor_expr: MATCH TENSOR '(' column_expr ',' common_array_expr ',' STRING ',' STRING ',' STRING optional_search_filter_expr ')' IGNORE INDEX */ +#line 2841 "parser.y" + { + auto match_tensor_expr = std::make_unique(); + // search column + match_tensor_expr->SetSearchColumn((yyvsp[-12].expr_t)); + // search tensor + ParserHelper::ToLower((yyvsp[-8].str_value)); + match_tensor_expr->SetQueryTensor((yyvsp[-8].str_value), (yyvsp[-10].const_expr_t)); + // search method + ParserHelper::ToLower((yyvsp[-6].str_value)); + match_tensor_expr->SetSearchMethod((yyvsp[-6].str_value)); + // search options + match_tensor_expr->ignore_index_ = true; + match_tensor_expr->SetExtraOptions((yyvsp[-4].str_value)); + match_tensor_expr->SetOptionalFilter((yyvsp[-3].expr_t)); + (yyval.expr_t) = match_tensor_expr.release(); +} +#line 7531 "parser.cpp" + break; + + case 385: /* match_vector_expr: MATCH VECTOR '(' expr ',' array_expr ',' STRING ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' USING INDEX '(' IDENTIFIER ')' with_index_param_list */ +#line 2859 "parser.y" + { + infinity::KnnExpr* match_vector_expr = new infinity::KnnExpr(); + (yyval.expr_t) = match_vector_expr; + + // vector search column + match_vector_expr->column_expr_ = (yyvsp[-16].expr_t); + + // vector distance type + ParserHelper::ToLower((yyvsp[-10].str_value)); + bool check = match_vector_expr->InitDistanceType((yyvsp[-10].str_value)); + if (!check) { + goto Error1; + } - case 304: /* command_statement: SET CONFIG IDENTIFIER LONG_VALUE */ -#line 2320 "parser.y" - { - ParserHelper::ToLower((yyvsp[-1].str_value)); - (yyval.command_stmt) = new infinity::CommandStatement(); - (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kConfig, - infinity::SetVarType::kInteger, - (yyvsp[-1].str_value), - (yyvsp[0].long_value)); - free((yyvsp[-1].str_value)); - } -#line 6699 "parser.cpp" - break; + // vector data type + ParserHelper::ToLower((yyvsp[-12].str_value)); + check = match_vector_expr->InitEmbedding((yyvsp[-12].str_value), (yyvsp[-14].const_expr_t)); + if (!check) { + goto Error1; + } + free((yyvsp[-12].str_value)); + free((yyvsp[-10].str_value)); + delete (yyvsp[-14].const_expr_t); + + match_vector_expr->index_name_ = (yyvsp[-2].str_value); + free((yyvsp[-2].str_value)); + match_vector_expr->topn_ = (yyvsp[-8].long_value); + match_vector_expr->filter_expr_.reset((yyvsp[-7].expr_t)); + match_vector_expr->opt_params_ = (yyvsp[0].with_index_param_list_t); + goto Return1; +Error1: + for (auto* param_ptr: *(yyvsp[0].with_index_param_list_t)) { + delete param_ptr; + } + delete (yyvsp[0].with_index_param_list_t); + free((yyvsp[-12].str_value)); + free((yyvsp[-10].str_value)); + free((yyvsp[-2].str_value)); + delete (yyvsp[-14].const_expr_t); + delete (yyval.expr_t); + yyerror(&yyloc, scanner, result, "Invalid vector search distance type"); + YYERROR; +Return1: + ; +} +#line 7581 "parser.cpp" + break; + + case 386: /* match_vector_expr: MATCH VECTOR '(' expr ',' array_expr ',' STRING ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' IGNORE INDEX */ +#line 2905 "parser.y" + { + infinity::KnnExpr* match_vector_expr = new infinity::KnnExpr(); + (yyval.expr_t) = match_vector_expr; + + // vector search column + match_vector_expr->column_expr_ = (yyvsp[-12].expr_t); + + // vector distance type + ParserHelper::ToLower((yyvsp[-6].str_value)); + bool check = match_vector_expr->InitDistanceType((yyvsp[-6].str_value)); + if (!check) { + goto Error2; + } - case 305: /* command_statement: SET CONFIG IDENTIFIER DOUBLE_VALUE */ -#line 2326 "parser.y" - { - ParserHelper::ToLower((yyvsp[-1].str_value)); - (yyval.command_stmt) = new infinity::CommandStatement(); - (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kConfig, - infinity::SetVarType::kDouble, - (yyvsp[-1].str_value), - (yyvsp[0].double_value)); - free((yyvsp[-1].str_value)); - } -#line 6710 "parser.cpp" - break; + // vector data type + ParserHelper::ToLower((yyvsp[-8].str_value)); + check = match_vector_expr->InitEmbedding((yyvsp[-8].str_value), (yyvsp[-10].const_expr_t)); + if (!check) { + goto Error2; + } + free((yyvsp[-8].str_value)); + free((yyvsp[-6].str_value)); + delete (yyvsp[-10].const_expr_t); + + match_vector_expr->topn_ = (yyvsp[-4].long_value); + match_vector_expr->filter_expr_.reset((yyvsp[-3].expr_t)); + match_vector_expr->ignore_index_ = true; + goto Return2; +Error2: + free((yyvsp[-8].str_value)); + free((yyvsp[-6].str_value)); + delete (yyvsp[-10].const_expr_t); + delete (yyval.expr_t); + yyerror(&yyloc, scanner, result, "Invalid vector search distance type"); + YYERROR; +Return2: + ; +} +#line 7624 "parser.cpp" + break; + + case 387: /* match_vector_expr: MATCH VECTOR '(' expr ',' array_expr ',' STRING ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' with_index_param_list */ +#line 2944 "parser.y" + { + infinity::KnnExpr* match_vector_expr = new infinity::KnnExpr(); + (yyval.expr_t) = match_vector_expr; + + // vector search column + match_vector_expr->column_expr_ = (yyvsp[-11].expr_t); + + // vector distance type + ParserHelper::ToLower((yyvsp[-5].str_value)); + bool check = match_vector_expr->InitDistanceType((yyvsp[-5].str_value)); + if (!check) { + goto Error3; + } - case 306: /* command_statement: LOCK TABLE table_name */ -#line 2332 "parser.y" - { - (yyval.command_stmt) = new infinity::CommandStatement(); - ParserHelper::ToLower((yyvsp[0].table_name_t)->schema_name_ptr_); - ParserHelper::ToLower((yyvsp[0].table_name_t)->table_name_ptr_); - (yyval.command_stmt)->command_info_ = - std::make_shared((yyvsp[0].table_name_t)->schema_name_ptr_, (yyvsp[0].table_name_t)->table_name_ptr_); - free((yyvsp[0].table_name_t)->schema_name_ptr_); - free((yyvsp[0].table_name_t)->table_name_ptr_); - delete (yyvsp[0].table_name_t); - } -#line 6724 "parser.cpp" - break; + // vector data type + ParserHelper::ToLower((yyvsp[-7].str_value)); + check = match_vector_expr->InitEmbedding((yyvsp[-7].str_value), (yyvsp[-9].const_expr_t)); + if (!check) { + goto Error3; + } + free((yyvsp[-7].str_value)); + free((yyvsp[-5].str_value)); + delete (yyvsp[-9].const_expr_t); + + match_vector_expr->topn_ = (yyvsp[-3].long_value); + match_vector_expr->filter_expr_.reset((yyvsp[-2].expr_t)); + match_vector_expr->opt_params_ = (yyvsp[0].with_index_param_list_t); + goto Return3; +Error3: + for (auto* param_ptr: *(yyvsp[0].with_index_param_list_t)) { + delete param_ptr; + } + delete (yyvsp[0].with_index_param_list_t); + free((yyvsp[-7].str_value)); + free((yyvsp[-5].str_value)); + delete (yyvsp[-9].const_expr_t); + delete (yyval.expr_t); + yyerror(&yyloc, scanner, result, "Invalid vector search distance type"); + YYERROR; +Return3: + ; +} +#line 7671 "parser.cpp" + break; + + case 388: /* match_vector_expr: MATCH VECTOR '(' expr ',' array_expr ',' STRING ',' STRING optional_search_filter_expr ')' with_index_param_list */ +#line 2987 "parser.y" + { + infinity::KnnExpr* match_vector_expr = new infinity::KnnExpr(); + (yyval.expr_t) = match_vector_expr; + + // vector search search column + match_vector_expr->column_expr_ = (yyvsp[-9].expr_t); + + // vector search distance type + ParserHelper::ToLower((yyvsp[-3].str_value)); + bool check = match_vector_expr->InitDistanceType((yyvsp[-3].str_value)); + if (!check) { + goto Error4; + } - case 307: /* command_statement: UNLOCK TABLE table_name */ -#line 2341 "parser.y" - { - (yyval.command_stmt) = new infinity::CommandStatement(); - ParserHelper::ToLower((yyvsp[0].table_name_t)->schema_name_ptr_); - ParserHelper::ToLower((yyvsp[0].table_name_t)->table_name_ptr_); - (yyval.command_stmt)->command_info_ = - std::make_shared((yyvsp[0].table_name_t)->schema_name_ptr_, (yyvsp[0].table_name_t)->table_name_ptr_); - free((yyvsp[0].table_name_t)->schema_name_ptr_); - free((yyvsp[0].table_name_t)->table_name_ptr_); - delete (yyvsp[0].table_name_t); - } -#line 6738 "parser.cpp" - break; + // vector search data type + ParserHelper::ToLower((yyvsp[-5].str_value)); + check = match_vector_expr->InitEmbedding((yyvsp[-5].str_value), (yyvsp[-7].const_expr_t)); + if (!check) { + goto Error4; + } + free((yyvsp[-5].str_value)); + free((yyvsp[-3].str_value)); + delete (yyvsp[-7].const_expr_t); + + match_vector_expr->topn_ = infinity::DEFAULT_MATCH_VECTOR_TOP_N; + match_vector_expr->filter_expr_.reset((yyvsp[-2].expr_t)); + match_vector_expr->opt_params_ = (yyvsp[0].with_index_param_list_t); + goto Return4; + +Error4: + for (auto* param_ptr: *(yyvsp[0].with_index_param_list_t)) { + delete param_ptr; + } + delete (yyvsp[0].with_index_param_list_t); + free((yyvsp[-5].str_value)); + free((yyvsp[-3].str_value)); + delete (yyvsp[-7].const_expr_t); + delete (yyval.expr_t); + yyerror(&yyloc, scanner, result, "Invalid vector search distance type"); + YYERROR; +Return4: + ; +} +#line 7719 "parser.cpp" + break; - case 308: /* compact_statement: COMPACT TABLE table_name */ -#line 2351 "parser.y" - { - std::string schema_name; - if ((yyvsp[0].table_name_t)->schema_name_ptr_ != nullptr) { - schema_name = std::string((yyvsp[0].table_name_t)->schema_name_ptr_); - free((yyvsp[0].table_name_t)->schema_name_ptr_); - } - std::string table_name = std::string((yyvsp[0].table_name_t)->table_name_ptr_); - free((yyvsp[0].table_name_t)->table_name_ptr_); + case 389: /* match_sparse_expr: MATCH SPARSE '(' expr ',' common_sparse_array_expr ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' USING INDEX '(' IDENTIFIER ')' with_index_param_list */ +#line 3034 "parser.y" + { + auto match_sparse_expr = new infinity::MatchSparseExpr(); + (yyval.expr_t) = match_sparse_expr; - (yyval.compact_stmt) = new infinity::ManualCompactStatement(std::move(schema_name), std::move(table_name)); - delete (yyvsp[0].table_name_t); - } -#line 6755 "parser.cpp" - break; + // search column + match_sparse_expr->SetSearchColumn((yyvsp[-14].expr_t)); - case 309: /* admin_statement: ADMIN SHOW CATALOGS */ -#line 2364 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListCatalogs; - } -#line 6764 "parser.cpp" - break; + // search sparse and data type + match_sparse_expr->SetQuerySparse((yyvsp[-12].const_expr_t)); - case 310: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE */ -#line 2368 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowCatalog; - (yyval.admin_stmt)->catalog_file_index_ = (yyvsp[0].long_value); - } -#line 6774 "parser.cpp" - break; + // metric type + ParserHelper::ToLower((yyvsp[-10].str_value)); + match_sparse_expr->SetMetricType((yyvsp[-10].str_value)); - case 311: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASES */ -#line 2373 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListDatabases; - (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-2].long_value); - (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-1].long_value); - } -#line 6785 "parser.cpp" - break; + // topn and options + match_sparse_expr->SetOptParams((yyvsp[-8].long_value), (yyvsp[0].with_index_param_list_t)); - case 312: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE */ -#line 2379 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowDatabase; - (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-3].long_value); - (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-2].long_value); - (yyval.admin_stmt)->database_meta_index_ = (yyvsp[0].long_value); - } -#line 6797 "parser.cpp" - break; + // optional filter + match_sparse_expr->SetOptionalFilter((yyvsp[-7].expr_t)); - case 313: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLES */ -#line 2386 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListTables; - (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-5].long_value); - (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-4].long_value); - (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-2].long_value); - (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-1].long_value); - } -#line 6810 "parser.cpp" - break; + match_sparse_expr->index_name_ = (yyvsp[-2].str_value); + free((yyvsp[-2].str_value)); +} +#line 7747 "parser.cpp" + break; - case 314: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE */ -#line 2394 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowTable; - (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-6].long_value); - (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-5].long_value); - (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-3].long_value); - (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-2].long_value); - (yyval.admin_stmt)->table_meta_index_ = (yyvsp[0].long_value); - } -#line 6824 "parser.cpp" - break; + case 390: /* match_sparse_expr: MATCH SPARSE '(' expr ',' common_sparse_array_expr ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' IGNORE INDEX */ +#line 3058 "parser.y" + { + auto match_sparse_expr = new infinity::MatchSparseExpr(); + (yyval.expr_t) = match_sparse_expr; - case 315: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE COLUMNS */ -#line 2403 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowColumn; - (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-8].long_value); - (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-7].long_value); - (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-5].long_value); - (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-4].long_value); - (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-2].long_value); - (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-1].long_value); - } -#line 6839 "parser.cpp" - break; + // search column + match_sparse_expr->SetSearchColumn((yyvsp[-10].expr_t)); - case 316: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENTS */ -#line 2413 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListSegments; - (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-8].long_value); - (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-7].long_value); - (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-5].long_value); - (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-4].long_value); - (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-2].long_value); - (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-1].long_value); - } -#line 6854 "parser.cpp" - break; + // search sparse and data type + match_sparse_expr->SetQuerySparse((yyvsp[-8].const_expr_t)); - case 317: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENT - LONG_VALUE */ -#line 2423 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowSegment; - (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-9].long_value); - (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-8].long_value); - (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-6].long_value); - (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-5].long_value); - (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-3].long_value); - (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-2].long_value); - (yyval.admin_stmt)->segment_index_ = (yyvsp[0].long_value); - } -#line 6870 "parser.cpp" - break; + // metric type + ParserHelper::ToLower((yyvsp[-6].str_value)); + match_sparse_expr->SetMetricType((yyvsp[-6].str_value)); - case 318: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENT - LONG_VALUE BLOCKS */ -#line 2434 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListBlocks; - (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-10].long_value); - (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-9].long_value); - (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-7].long_value); - (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-6].long_value); - (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-4].long_value); - (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-3].long_value); - (yyval.admin_stmt)->segment_index_ = (yyvsp[-1].long_value); - } -#line 6886 "parser.cpp" - break; + // topn and options + match_sparse_expr->topn_ = (yyvsp[-4].long_value); - case 319: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENT - LONG_VALUE BLOCK LONG_VALUE */ -#line 2445 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowBlock; - (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-11].long_value); - (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-10].long_value); - (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-8].long_value); - (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-7].long_value); - (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-5].long_value); - (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-4].long_value); - (yyval.admin_stmt)->segment_index_ = (yyvsp[-2].long_value); - (yyval.admin_stmt)->block_index_ = (yyvsp[0].long_value); - } -#line 6903 "parser.cpp" - break; + // optional filter + match_sparse_expr->SetOptionalFilter((yyvsp[-3].expr_t)); - case 320: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENT - LONG_VALUE BLOCK LONG_VALUE COLUMNS */ -#line 2457 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListColumns; - (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-12].long_value); - (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-11].long_value); - (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-9].long_value); - (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-8].long_value); - (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-6].long_value); - (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-5].long_value); - (yyval.admin_stmt)->segment_index_ = (yyvsp[-3].long_value); - (yyval.admin_stmt)->block_index_ = (yyvsp[-1].long_value); - } -#line 6920 "parser.cpp" - break; + match_sparse_expr->ignore_index_ = true; +} +#line 7774 "parser.cpp" + break; - case 321: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE INDEXES */ -#line 2469 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListIndexes; - (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-8].long_value); - (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-7].long_value); - (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-5].long_value); - (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-4].long_value); - (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-2].long_value); - (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-1].long_value); - } -#line 6935 "parser.cpp" - break; + case 391: /* match_sparse_expr: MATCH SPARSE '(' expr ',' common_sparse_array_expr ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' with_index_param_list */ +#line 3081 "parser.y" + { + auto match_sparse_expr = new infinity::MatchSparseExpr(); + (yyval.expr_t) = match_sparse_expr; - case 322: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE INDEX - LONG_VALUE */ -#line 2479 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowIndex; - (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-9].long_value); - (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-8].long_value); - (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-6].long_value); - (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-5].long_value); - (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-3].long_value); - (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-2].long_value); - (yyval.admin_stmt)->index_meta_index_ = (yyvsp[0].long_value); - } -#line 6951 "parser.cpp" - break; + // search column + match_sparse_expr->SetSearchColumn((yyvsp[-9].expr_t)); - case 323: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE INDEX - LONG_VALUE LONG_VALUE SEGMENTS */ -#line 2490 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListIndexSegments; - (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-11].long_value); - (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-10].long_value); - (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-8].long_value); - (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-7].long_value); - (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-5].long_value); - (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-4].long_value); - (yyval.admin_stmt)->index_meta_index_ = (yyvsp[-2].long_value); - (yyval.admin_stmt)->index_entry_index_ = (yyvsp[-1].long_value); - } -#line 6968 "parser.cpp" - break; + // search sparse and data type + match_sparse_expr->SetQuerySparse((yyvsp[-7].const_expr_t)); - case 324: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE INDEX - LONG_VALUE LONG_VALUE SEGMENT LONG_VALUE */ -#line 2502 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowIndexSegment; - (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-12].long_value); - (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-11].long_value); - (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-9].long_value); - (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-8].long_value); - (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-6].long_value); - (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-5].long_value); - (yyval.admin_stmt)->index_meta_index_ = (yyvsp[-3].long_value); - (yyval.admin_stmt)->index_entry_index_ = (yyvsp[-2].long_value); - (yyval.admin_stmt)->segment_index_ = (yyvsp[0].long_value); - } -#line 6986 "parser.cpp" - break; + // metric type + ParserHelper::ToLower((yyvsp[-5].str_value)); + match_sparse_expr->SetMetricType((yyvsp[-5].str_value)); - case 325: /* admin_statement: ADMIN SHOW LOGS */ -#line 2515 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListLogFiles; - } -#line 6995 "parser.cpp" - break; + // optional filter + match_sparse_expr->SetOptionalFilter((yyvsp[-2].expr_t)); - case 326: /* admin_statement: ADMIN SHOW LOG LONG_VALUE */ -#line 2519 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowLogFile; - (yyval.admin_stmt)->log_file_index_ = (yyvsp[0].long_value); - } -#line 7005 "parser.cpp" - break; + // topn and options + match_sparse_expr->SetOptParams((yyvsp[-3].long_value), (yyvsp[0].with_index_param_list_t)); +} +#line 7799 "parser.cpp" + break; - case 327: /* admin_statement: ADMIN SHOW LOG LONG_VALUE INDEXES */ -#line 2524 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListLogIndexes; - (yyval.admin_stmt)->log_file_index_ = (yyvsp[-1].long_value); - } -#line 7015 "parser.cpp" - break; + case 392: /* match_sparse_expr: MATCH SPARSE '(' expr ',' common_sparse_array_expr ',' STRING optional_search_filter_expr ')' with_index_param_list */ +#line 3102 "parser.y" + { + auto match_sparse_expr = new infinity::MatchSparseExpr(); + (yyval.expr_t) = match_sparse_expr; - case 328: /* admin_statement: ADMIN SHOW LOG LONG_VALUE INDEX LONG_VALUE */ -#line 2529 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowLogIndex; - (yyval.admin_stmt)->log_file_index_ = (yyvsp[-2].long_value); - (yyval.admin_stmt)->log_index_in_file_ = (yyvsp[0].long_value); - } -#line 7026 "parser.cpp" - break; + // search column + match_sparse_expr->SetSearchColumn((yyvsp[-7].expr_t)); - case 329: /* admin_statement: ADMIN SHOW CONFIGS */ -#line 2535 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListConfigs; - } -#line 7035 "parser.cpp" - break; + // search sparse and data type + match_sparse_expr->SetQuerySparse((yyvsp[-5].const_expr_t)); - case 330: /* admin_statement: ADMIN SHOW VARIABLES */ -#line 2539 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListVariables; - } -#line 7044 "parser.cpp" - break; + // metric type + ParserHelper::ToLower((yyvsp[-3].str_value)); + match_sparse_expr->SetMetricType((yyvsp[-3].str_value)); - case 331: /* admin_statement: ADMIN SHOW VARIABLE IDENTIFIER */ -#line 2543 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowVariable; - (yyval.admin_stmt)->variable_name_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - } -#line 7055 "parser.cpp" - break; + // optional filter + match_sparse_expr->SetOptionalFilter((yyvsp[-2].expr_t)); - case 332: /* admin_statement: ADMIN CREATE SNAPSHOT */ -#line 2549 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kCreateSnapshot; - } -#line 7064 "parser.cpp" - break; + // topn and options + match_sparse_expr->SetOptParams(infinity::DEFAULT_MATCH_SPARSE_TOP_N, (yyvsp[0].with_index_param_list_t)); +} +#line 7824 "parser.cpp" + break; + + case 393: /* match_text_expr: MATCH TEXT '(' STRING ',' STRING optional_search_filter_expr ')' */ +#line 3123 "parser.y" + { + infinity::MatchExpr* match_text_expr = new infinity::MatchExpr(); + match_text_expr->fields_ = std::string((yyvsp[-4].str_value)); + match_text_expr->matching_text_ = std::string((yyvsp[-2].str_value)); + match_text_expr->filter_expr_.reset((yyvsp[-1].expr_t)); + free((yyvsp[-4].str_value)); + free((yyvsp[-2].str_value)); + (yyval.expr_t) = match_text_expr; +} +#line 7838 "parser.cpp" + break; + + case 394: /* match_text_expr: MATCH TEXT '(' STRING ',' STRING ',' STRING optional_search_filter_expr ')' */ +#line 3132 "parser.y" + { + infinity::MatchExpr* match_text_expr = new infinity::MatchExpr(); + match_text_expr->fields_ = std::string((yyvsp[-6].str_value)); + match_text_expr->matching_text_ = std::string((yyvsp[-4].str_value)); + match_text_expr->options_text_ = std::string((yyvsp[-2].str_value)); + match_text_expr->filter_expr_.reset((yyvsp[-1].expr_t)); + free((yyvsp[-6].str_value)); + free((yyvsp[-4].str_value)); + free((yyvsp[-2].str_value)); + (yyval.expr_t) = match_text_expr; +} +#line 7854 "parser.cpp" + break; + + case 395: /* match_text_expr: MATCH TEXT '(' STRING ',' STRING optional_search_filter_expr ')' USING INDEXES '(' STRING ')' */ +#line 3143 "parser.y" + { + infinity::MatchExpr* match_text_expr = new infinity::MatchExpr(); + match_text_expr->fields_ = std::string((yyvsp[-9].str_value)); + match_text_expr->matching_text_ = std::string((yyvsp[-7].str_value)); + match_text_expr->filter_expr_.reset((yyvsp[-6].expr_t)); + match_text_expr->index_names_ = std::string((yyvsp[-1].str_value)); + free((yyvsp[-9].str_value)); + free((yyvsp[-7].str_value)); + free((yyvsp[-1].str_value)); + (yyval.expr_t) = match_text_expr; +} +#line 7870 "parser.cpp" + break; + + case 396: /* match_text_expr: MATCH TEXT '(' STRING ',' STRING ',' STRING optional_search_filter_expr ')' USING INDEXES '(' STRING ')' */ +#line 3154 "parser.y" + { + infinity::MatchExpr* match_text_expr = new infinity::MatchExpr(); + match_text_expr->fields_ = std::string((yyvsp[-11].str_value)); + match_text_expr->matching_text_ = std::string((yyvsp[-9].str_value)); + match_text_expr->options_text_ = std::string((yyvsp[-7].str_value)); + match_text_expr->filter_expr_.reset((yyvsp[-6].expr_t)); + match_text_expr->index_names_ = std::string((yyvsp[-1].str_value)); + free((yyvsp[-11].str_value)); + free((yyvsp[-9].str_value)); + free((yyvsp[-7].str_value)); + free((yyvsp[-1].str_value)); + (yyval.expr_t) = match_text_expr; +} +#line 7888 "parser.cpp" + break; - case 333: /* admin_statement: ADMIN SHOW SNAPSHOTS */ -#line 2553 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListSnapshots; - } -#line 7073 "parser.cpp" - break; + case 397: /* query_expr: QUERY '(' STRING optional_search_filter_expr ')' */ +#line 3168 "parser.y" + { + infinity::MatchExpr* match_text_expr = new infinity::MatchExpr(); + match_text_expr->matching_text_ = std::string((yyvsp[-2].str_value)); + match_text_expr->filter_expr_.reset((yyvsp[-1].expr_t)); + free((yyvsp[-2].str_value)); + (yyval.expr_t) = match_text_expr; +} +#line 7900 "parser.cpp" + break; + + case 398: /* query_expr: QUERY '(' STRING ',' STRING optional_search_filter_expr ')' */ +#line 3175 "parser.y" + { + infinity::MatchExpr* match_text_expr = new infinity::MatchExpr(); + match_text_expr->matching_text_ = std::string((yyvsp[-4].str_value)); + match_text_expr->options_text_ = std::string((yyvsp[-2].str_value)); + match_text_expr->filter_expr_.reset((yyvsp[-1].expr_t)); + free((yyvsp[-4].str_value)); + free((yyvsp[-2].str_value)); + (yyval.expr_t) = match_text_expr; +} +#line 7914 "parser.cpp" + break; + + case 399: /* fusion_expr: FUSION '(' STRING ')' */ +#line 3185 "parser.y" + { + infinity::FusionExpr* fusion_expr = new infinity::FusionExpr(); + fusion_expr->method_ = std::string((yyvsp[-1].str_value)); + free((yyvsp[-1].str_value)); + (yyval.expr_t) = fusion_expr; +} +#line 7925 "parser.cpp" + break; + + case 400: /* fusion_expr: FUSION '(' STRING ',' STRING ')' */ +#line 3191 "parser.y" + { + auto fusion_expr = std::make_unique(); + fusion_expr->method_ = std::string((yyvsp[-3].str_value)); + free((yyvsp[-3].str_value)); + (yyvsp[-3].str_value) = nullptr; + fusion_expr->SetOptions((yyvsp[-1].str_value)); + free((yyvsp[-1].str_value)); + (yyvsp[-1].str_value) = nullptr; + fusion_expr->JobAfterParser(); + (yyval.expr_t) = fusion_expr.release(); +} +#line 7941 "parser.cpp" + break; - case 334: /* admin_statement: ADMIN SHOW SNAPSHOT STRING */ -#line 2557 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowSnapshot; - (yyval.admin_stmt)->snapshot_name_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - } -#line 7084 "parser.cpp" - break; + case 401: /* sub_search: match_vector_expr */ +#line 3203 "parser.y" + { + (yyval.expr_t) = (yyvsp[0].expr_t); +} +#line 7949 "parser.cpp" + break; - case 335: /* admin_statement: ADMIN DELETE SNAPSHOT STRING */ -#line 2563 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kDeleteSnapshot; - (yyval.admin_stmt)->snapshot_name_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - } -#line 7095 "parser.cpp" - break; + case 402: /* sub_search: match_text_expr */ +#line 3206 "parser.y" + { + (yyval.expr_t) = (yyvsp[0].expr_t); +} +#line 7957 "parser.cpp" + break; - case 336: /* admin_statement: ADMIN EXPORT SNAPSHOT STRING TO STRING */ -#line 2569 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kExportSnapshot; - (yyval.admin_stmt)->snapshot_name_ = (yyvsp[-2].str_value); - (yyval.admin_stmt)->export_path_ = (yyvsp[0].str_value); - free((yyvsp[-2].str_value)); - free((yyvsp[0].str_value)); - } -#line 7108 "parser.cpp" - break; + case 403: /* sub_search: match_tensor_expr */ +#line 3209 "parser.y" + { + (yyval.expr_t) = (yyvsp[0].expr_t); +} +#line 7965 "parser.cpp" + break; - case 337: /* admin_statement: ADMIN RECOVER FROM SNAPSHOT STRING */ -#line 2577 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kRecoverFromSnapshot; - (yyval.admin_stmt)->snapshot_name_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - } -#line 7119 "parser.cpp" - break; + case 404: /* sub_search: match_sparse_expr */ +#line 3212 "parser.y" + { + (yyval.expr_t) = (yyvsp[0].expr_t); +} +#line 7973 "parser.cpp" + break; - case 338: /* admin_statement: ADMIN SHOW NODES */ -#line 2583 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListNodes; - } -#line 7128 "parser.cpp" - break; + case 405: /* sub_search: query_expr */ +#line 3215 "parser.y" + { + (yyval.expr_t) = (yyvsp[0].expr_t); +} +#line 7981 "parser.cpp" + break; - case 339: /* admin_statement: ADMIN SHOW NODE STRING */ -#line 2587 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowNode; - (yyval.admin_stmt)->node_name_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - } -#line 7139 "parser.cpp" - break; + case 406: /* sub_search: fusion_expr */ +#line 3218 "parser.y" + { + (yyval.expr_t) = (yyvsp[0].expr_t); +} +#line 7989 "parser.cpp" + break; + + case 407: /* sub_search_array: sub_search */ +#line 3222 "parser.y" + { + (yyval.expr_array_t) = new std::vector(); + (yyval.expr_array_t)->emplace_back((yyvsp[0].expr_t)); +} +#line 7998 "parser.cpp" + break; - case 340: /* admin_statement: ADMIN SHOW NODE */ -#line 2593 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowCurrentNode; - } -#line 7148 "parser.cpp" - break; - - case 341: /* admin_statement: ADMIN REMOVE NODE STRING */ -#line 2597 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kRemoveNode; - (yyval.admin_stmt)->node_name_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - } -#line 7159 "parser.cpp" - break; - - case 342: /* admin_statement: ADMIN SET ADMIN */ -#line 2603 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kSetRole; - (yyval.admin_stmt)->node_role_ = infinity::NodeRole::kAdmin; - } -#line 7169 "parser.cpp" - break; - - case 343: /* admin_statement: ADMIN SET STANDALONE */ -#line 2608 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kSetRole; - (yyval.admin_stmt)->node_role_ = infinity::NodeRole::kStandalone; - } -#line 7179 "parser.cpp" - break; - - case 344: /* admin_statement: ADMIN SET LEADER USING STRING */ -#line 2613 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kSetRole; - (yyval.admin_stmt)->node_role_ = infinity::NodeRole::kLeader; - (yyval.admin_stmt)->node_name_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - } -#line 7191 "parser.cpp" - break; - - case 345: /* admin_statement: ADMIN CONNECT STRING AS FOLLOWER USING STRING */ -#line 2620 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kSetRole; - (yyval.admin_stmt)->node_role_ = infinity::NodeRole::kFollower; - (yyval.admin_stmt)->leader_address_ = (yyvsp[-4].str_value); - (yyval.admin_stmt)->node_name_ = (yyvsp[0].str_value); - free((yyvsp[-4].str_value)); - free((yyvsp[0].str_value)); - } -#line 7205 "parser.cpp" - break; - - case 346: /* admin_statement: ADMIN CONNECT STRING AS LEARNER USING STRING */ -#line 2629 "parser.y" - { - (yyval.admin_stmt) = new infinity::AdminStatement(); - (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kSetRole; - (yyval.admin_stmt)->node_role_ = infinity::NodeRole::kLearner; - (yyval.admin_stmt)->leader_address_ = (yyvsp[-4].str_value); - (yyval.admin_stmt)->node_name_ = (yyvsp[0].str_value); - free((yyvsp[-4].str_value)); - free((yyvsp[0].str_value)); - } -#line 7219 "parser.cpp" - break; - - case 347: /* alter_statement: ALTER TABLE table_name RENAME TO IDENTIFIER */ -#line 2639 "parser.y" - { - auto *ret = new infinity::RenameTableStatement((yyvsp[-3].table_name_t)->schema_name_ptr_, (yyvsp[-3].table_name_t)->table_name_ptr_); - (yyval.alter_stmt) = ret; - ret->new_table_name_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - free((yyvsp[-3].table_name_t)->schema_name_ptr_); - free((yyvsp[-3].table_name_t)->table_name_ptr_); - delete (yyvsp[-3].table_name_t); - } -#line 7233 "parser.cpp" - break; - - case 348: /* alter_statement: ALTER TABLE table_name ADD COLUMN '(' column_def_array ')' */ -#line 2648 "parser.y" - { - auto *ret = new infinity::AddColumnsStatement((yyvsp[-5].table_name_t)->schema_name_ptr_, (yyvsp[-5].table_name_t)->table_name_ptr_); - (yyval.alter_stmt) = ret; - - for (infinity::ColumnDef *&column_def : *(yyvsp[-1].column_def_array_t)) { - ret->column_defs_.emplace_back(column_def); - } - delete (yyvsp[-1].column_def_array_t); - free((yyvsp[-5].table_name_t)->schema_name_ptr_); - free((yyvsp[-5].table_name_t)->table_name_ptr_); - delete (yyvsp[-5].table_name_t); - } -#line 7250 "parser.cpp" - break; - - case 349: /* alter_statement: ALTER TABLE table_name DROP COLUMN '(' identifier_array ')' */ -#line 2660 "parser.y" - { - auto *ret = new infinity::DropColumnsStatement((yyvsp[-5].table_name_t)->schema_name_ptr_, (yyvsp[-5].table_name_t)->table_name_ptr_); - (yyval.alter_stmt) = ret; - for (std::string &column_name : *(yyvsp[-1].identifier_array_t)) { - ret->column_names_.emplace_back(std::move(column_name)); - } - delete (yyvsp[-1].identifier_array_t); - free((yyvsp[-5].table_name_t)->schema_name_ptr_); - free((yyvsp[-5].table_name_t)->table_name_ptr_); - delete (yyvsp[-5].table_name_t); - } -#line 7266 "parser.cpp" - break; - - case 350: /* expr_array: expr_alias */ -#line 2676 "parser.y" - { - (yyval.expr_array_t) = new std::vector(); - (yyval.expr_array_t)->emplace_back((yyvsp[0].expr_t)); - } -#line 7275 "parser.cpp" - break; - - case 351: /* expr_array: expr_array ',' expr_alias */ -#line 2680 "parser.y" - { - (yyvsp[-2].expr_array_t)->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_array_t) = (yyvsp[-2].expr_array_t); - } -#line 7284 "parser.cpp" - break; - - case 352: /* insert_row_list: '(' expr_array ')' */ -#line 2685 "parser.y" - { - auto res = std::make_unique(); - for (auto *&expr : *(yyvsp[-1].expr_array_t)) { - res->values_.emplace_back(expr); - expr = nullptr; - } - delete (yyvsp[-1].expr_array_t); - (yyval.insert_row_list_t) = new std::vector(); - (yyval.insert_row_list_t)->emplace_back(res.release()); - } -#line 7299 "parser.cpp" - break; - - case 353: /* insert_row_list: insert_row_list ',' '(' expr_array ')' */ -#line 2695 "parser.y" - { - (yyval.insert_row_list_t) = (yyvsp[-4].insert_row_list_t); - auto res = std::make_unique(); - for (auto *&expr : *(yyvsp[-1].expr_array_t)) { - res->values_.emplace_back(expr); - expr = nullptr; - } - delete (yyvsp[-1].expr_array_t); - (yyval.insert_row_list_t)->emplace_back(res.release()); - } -#line 7314 "parser.cpp" - break; - - case 354: /* expr_alias: expr AS IDENTIFIER */ -#line 2717 "parser.y" - { - (yyval.expr_t) = (yyvsp[-2].expr_t); - ParserHelper::ToLower((yyvsp[0].str_value)); - (yyval.expr_t)->alias_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - } -#line 7325 "parser.cpp" - break; - - case 355: /* expr_alias: expr */ -#line 2723 "parser.y" - { - (yyval.expr_t) = (yyvsp[0].expr_t); - } -#line 7333 "parser.cpp" - break; - - case 361: /* operand: '(' expr ')' */ -#line 2733 "parser.y" - { - (yyval.expr_t) = (yyvsp[-1].expr_t); - } -#line 7341 "parser.cpp" - break; - - case 362: /* operand: '(' select_without_paren ')' */ -#line 2736 "parser.y" - { - infinity::SubqueryExpr *subquery_expr = new infinity::SubqueryExpr(); - subquery_expr->subquery_type_ = infinity::SubqueryType::kScalar; - subquery_expr->select_ = (yyvsp[-1].select_stmt); - (yyval.expr_t) = subquery_expr; - } -#line 7352 "parser.cpp" - break; - - case 363: /* operand: constant_expr */ -#line 2742 "parser.y" - { - (yyval.expr_t) = (yyvsp[0].const_expr_t); - } -#line 7360 "parser.cpp" - break; - - case 374: /* match_tensor_expr: MATCH TENSOR '(' column_expr ',' common_array_expr ',' STRING ',' STRING ',' STRING - optional_search_filter_expr ')' */ -#line 2758 "parser.y" - { - auto match_tensor_expr = std::make_unique(); - // search column - match_tensor_expr->SetSearchColumn((yyvsp[-10].expr_t)); - // search tensor - ParserHelper::ToLower((yyvsp[-6].str_value)); - match_tensor_expr->SetQueryTensor((yyvsp[-6].str_value), (yyvsp[-8].const_expr_t)); - // search method - ParserHelper::ToLower((yyvsp[-4].str_value)); - match_tensor_expr->SetSearchMethod((yyvsp[-4].str_value)); - // search options - match_tensor_expr->SetExtraOptions((yyvsp[-2].str_value)); - match_tensor_expr->SetOptionalFilter((yyvsp[-1].expr_t)); - (yyval.expr_t) = match_tensor_expr.release(); - } -#line 7380 "parser.cpp" - break; - - case 375: /* match_tensor_expr: MATCH TENSOR '(' column_expr ',' common_array_expr ',' STRING ',' STRING ',' STRING - optional_search_filter_expr ')' USING INDEX '(' IDENTIFIER ')' */ -#line 2774 "parser.y" - { - auto match_tensor_expr = std::make_unique(); - // search column - match_tensor_expr->SetSearchColumn((yyvsp[-15].expr_t)); - // search tensor - ParserHelper::ToLower((yyvsp[-11].str_value)); - match_tensor_expr->SetQueryTensor((yyvsp[-11].str_value), (yyvsp[-13].const_expr_t)); - // search method - ParserHelper::ToLower((yyvsp[-9].str_value)); - match_tensor_expr->SetSearchMethod((yyvsp[-9].str_value)); - // search options - match_tensor_expr->SetExtraOptions((yyvsp[-7].str_value)); - match_tensor_expr->SetOptionalFilter((yyvsp[-6].expr_t)); - match_tensor_expr->index_name_ = (yyvsp[-1].str_value); - (yyval.expr_t) = match_tensor_expr.release(); - } -#line 7401 "parser.cpp" - break; - - case 376: /* match_tensor_expr: MATCH TENSOR '(' column_expr ',' common_array_expr ',' STRING ',' STRING ',' STRING - optional_search_filter_expr ')' IGNORE INDEX */ -#line 2791 "parser.y" - { - auto match_tensor_expr = std::make_unique(); - // search column - match_tensor_expr->SetSearchColumn((yyvsp[-12].expr_t)); - // search tensor - ParserHelper::ToLower((yyvsp[-8].str_value)); - match_tensor_expr->SetQueryTensor((yyvsp[-8].str_value), (yyvsp[-10].const_expr_t)); - // search method - ParserHelper::ToLower((yyvsp[-6].str_value)); - match_tensor_expr->SetSearchMethod((yyvsp[-6].str_value)); - // search options - match_tensor_expr->ignore_index_ = true; - match_tensor_expr->SetExtraOptions((yyvsp[-4].str_value)); - match_tensor_expr->SetOptionalFilter((yyvsp[-3].expr_t)); - (yyval.expr_t) = match_tensor_expr.release(); - } -#line 7422 "parser.cpp" - break; - - case 377: /* match_vector_expr: MATCH VECTOR '(' expr ',' array_expr ',' STRING ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' - USING INDEX '(' IDENTIFIER ')' with_index_param_list */ -#line 2809 "parser.y" - { - infinity::KnnExpr *match_vector_expr = new infinity::KnnExpr(); - (yyval.expr_t) = match_vector_expr; - - // vector search column - match_vector_expr->column_expr_ = (yyvsp[-16].expr_t); - - // vector distance type - ParserHelper::ToLower((yyvsp[-10].str_value)); - bool check = match_vector_expr->InitDistanceType((yyvsp[-10].str_value)); - if (!check) { - goto Error1; - } - - // vector data type - ParserHelper::ToLower((yyvsp[-12].str_value)); - check = match_vector_expr->InitEmbedding((yyvsp[-12].str_value), (yyvsp[-14].const_expr_t)); - if (!check) { - goto Error1; - } - free((yyvsp[-12].str_value)); - free((yyvsp[-10].str_value)); - delete (yyvsp[-14].const_expr_t); - - match_vector_expr->index_name_ = (yyvsp[-2].str_value); - free((yyvsp[-2].str_value)); - match_vector_expr->topn_ = (yyvsp[-8].long_value); - match_vector_expr->filter_expr_.reset((yyvsp[-7].expr_t)); - match_vector_expr->opt_params_ = (yyvsp[0].with_index_param_list_t); - goto Return1; - Error1: - for (auto *param_ptr : *(yyvsp[0].with_index_param_list_t)) { - delete param_ptr; - } - delete (yyvsp[0].with_index_param_list_t); - free((yyvsp[-12].str_value)); - free((yyvsp[-10].str_value)); - free((yyvsp[-2].str_value)); - delete (yyvsp[-14].const_expr_t); - delete (yyval.expr_t); - yyerror(&yyloc, scanner, result, "Invalid vector search distance type"); - YYERROR; - Return1:; - } -#line 7472 "parser.cpp" - break; - - case 378: /* match_vector_expr: MATCH VECTOR '(' expr ',' array_expr ',' STRING ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' - IGNORE INDEX */ -#line 2855 "parser.y" - { - infinity::KnnExpr *match_vector_expr = new infinity::KnnExpr(); - (yyval.expr_t) = match_vector_expr; - - // vector search column - match_vector_expr->column_expr_ = (yyvsp[-12].expr_t); - - // vector distance type - ParserHelper::ToLower((yyvsp[-6].str_value)); - bool check = match_vector_expr->InitDistanceType((yyvsp[-6].str_value)); - if (!check) { - goto Error2; - } - - // vector data type - ParserHelper::ToLower((yyvsp[-8].str_value)); - check = match_vector_expr->InitEmbedding((yyvsp[-8].str_value), (yyvsp[-10].const_expr_t)); - if (!check) { - goto Error2; - } - free((yyvsp[-8].str_value)); - free((yyvsp[-6].str_value)); - delete (yyvsp[-10].const_expr_t); - - match_vector_expr->topn_ = (yyvsp[-4].long_value); - match_vector_expr->filter_expr_.reset((yyvsp[-3].expr_t)); - match_vector_expr->ignore_index_ = true; - goto Return2; - Error2: - free((yyvsp[-8].str_value)); - free((yyvsp[-6].str_value)); - delete (yyvsp[-10].const_expr_t); - delete (yyval.expr_t); - yyerror(&yyloc, scanner, result, "Invalid vector search distance type"); - YYERROR; - Return2:; - } -#line 7515 "parser.cpp" - break; - - case 379: /* match_vector_expr: MATCH VECTOR '(' expr ',' array_expr ',' STRING ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' - with_index_param_list */ -#line 2894 "parser.y" - { - infinity::KnnExpr *match_vector_expr = new infinity::KnnExpr(); - (yyval.expr_t) = match_vector_expr; - - // vector search column - match_vector_expr->column_expr_ = (yyvsp[-11].expr_t); - - // vector distance type - ParserHelper::ToLower((yyvsp[-5].str_value)); - bool check = match_vector_expr->InitDistanceType((yyvsp[-5].str_value)); - if (!check) { - goto Error3; - } - - // vector data type - ParserHelper::ToLower((yyvsp[-7].str_value)); - check = match_vector_expr->InitEmbedding((yyvsp[-7].str_value), (yyvsp[-9].const_expr_t)); - if (!check) { - goto Error3; - } - free((yyvsp[-7].str_value)); - free((yyvsp[-5].str_value)); - delete (yyvsp[-9].const_expr_t); - - match_vector_expr->topn_ = (yyvsp[-3].long_value); - match_vector_expr->filter_expr_.reset((yyvsp[-2].expr_t)); - match_vector_expr->opt_params_ = (yyvsp[0].with_index_param_list_t); - goto Return3; - Error3: - for (auto *param_ptr : *(yyvsp[0].with_index_param_list_t)) { - delete param_ptr; - } - delete (yyvsp[0].with_index_param_list_t); - free((yyvsp[-7].str_value)); - free((yyvsp[-5].str_value)); - delete (yyvsp[-9].const_expr_t); - delete (yyval.expr_t); - yyerror(&yyloc, scanner, result, "Invalid vector search distance type"); - YYERROR; - Return3:; - } -#line 7562 "parser.cpp" - break; - - case 380: /* match_vector_expr: MATCH VECTOR '(' expr ',' array_expr ',' STRING ',' STRING optional_search_filter_expr ')' - with_index_param_list */ -#line 2937 "parser.y" - { - infinity::KnnExpr *match_vector_expr = new infinity::KnnExpr(); - (yyval.expr_t) = match_vector_expr; - - // vector search search column - match_vector_expr->column_expr_ = (yyvsp[-9].expr_t); - - // vector search distance type - ParserHelper::ToLower((yyvsp[-3].str_value)); - bool check = match_vector_expr->InitDistanceType((yyvsp[-3].str_value)); - if (!check) { - goto Error4; - } - - // vector search data type - ParserHelper::ToLower((yyvsp[-5].str_value)); - check = match_vector_expr->InitEmbedding((yyvsp[-5].str_value), (yyvsp[-7].const_expr_t)); - if (!check) { - goto Error4; - } - free((yyvsp[-5].str_value)); - free((yyvsp[-3].str_value)); - delete (yyvsp[-7].const_expr_t); - - match_vector_expr->topn_ = infinity::DEFAULT_MATCH_VECTOR_TOP_N; - match_vector_expr->filter_expr_.reset((yyvsp[-2].expr_t)); - match_vector_expr->opt_params_ = (yyvsp[0].with_index_param_list_t); - goto Return4; - - Error4: - for (auto *param_ptr : *(yyvsp[0].with_index_param_list_t)) { - delete param_ptr; - } - delete (yyvsp[0].with_index_param_list_t); - free((yyvsp[-5].str_value)); - free((yyvsp[-3].str_value)); - delete (yyvsp[-7].const_expr_t); - delete (yyval.expr_t); - yyerror(&yyloc, scanner, result, "Invalid vector search distance type"); - YYERROR; - Return4:; - } -#line 7610 "parser.cpp" - break; - - case 381: /* match_sparse_expr: MATCH SPARSE '(' expr ',' common_sparse_array_expr ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' - USING INDEX '(' IDENTIFIER ')' with_index_param_list */ -#line 2984 "parser.y" - { - auto match_sparse_expr = new infinity::MatchSparseExpr(); - (yyval.expr_t) = match_sparse_expr; - - // search column - match_sparse_expr->SetSearchColumn((yyvsp[-14].expr_t)); - - // search sparse and data type - match_sparse_expr->SetQuerySparse((yyvsp[-12].const_expr_t)); - - // metric type - ParserHelper::ToLower((yyvsp[-10].str_value)); - match_sparse_expr->SetMetricType((yyvsp[-10].str_value)); - - // topn and options - match_sparse_expr->SetOptParams((yyvsp[-8].long_value), (yyvsp[0].with_index_param_list_t)); - - // optional filter - match_sparse_expr->SetOptionalFilter((yyvsp[-7].expr_t)); - - match_sparse_expr->index_name_ = (yyvsp[-2].str_value); - free((yyvsp[-2].str_value)); - } -#line 7638 "parser.cpp" - break; - - case 382: /* match_sparse_expr: MATCH SPARSE '(' expr ',' common_sparse_array_expr ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' - IGNORE INDEX */ -#line 3008 "parser.y" - { - auto match_sparse_expr = new infinity::MatchSparseExpr(); - (yyval.expr_t) = match_sparse_expr; - - // search column - match_sparse_expr->SetSearchColumn((yyvsp[-10].expr_t)); - - // search sparse and data type - match_sparse_expr->SetQuerySparse((yyvsp[-8].const_expr_t)); - - // metric type - ParserHelper::ToLower((yyvsp[-6].str_value)); - match_sparse_expr->SetMetricType((yyvsp[-6].str_value)); - - // topn and options - match_sparse_expr->topn_ = (yyvsp[-4].long_value); - - // optional filter - match_sparse_expr->SetOptionalFilter((yyvsp[-3].expr_t)); - - match_sparse_expr->ignore_index_ = true; - } -#line 7665 "parser.cpp" - break; - - case 383: /* match_sparse_expr: MATCH SPARSE '(' expr ',' common_sparse_array_expr ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' - with_index_param_list */ -#line 3031 "parser.y" - { - auto match_sparse_expr = new infinity::MatchSparseExpr(); - (yyval.expr_t) = match_sparse_expr; - - // search column - match_sparse_expr->SetSearchColumn((yyvsp[-9].expr_t)); - - // search sparse and data type - match_sparse_expr->SetQuerySparse((yyvsp[-7].const_expr_t)); - - // metric type - ParserHelper::ToLower((yyvsp[-5].str_value)); - match_sparse_expr->SetMetricType((yyvsp[-5].str_value)); - - // optional filter - match_sparse_expr->SetOptionalFilter((yyvsp[-2].expr_t)); - - // topn and options - match_sparse_expr->SetOptParams((yyvsp[-3].long_value), (yyvsp[0].with_index_param_list_t)); - } -#line 7690 "parser.cpp" - break; - - case 384: /* match_sparse_expr: MATCH SPARSE '(' expr ',' common_sparse_array_expr ',' STRING optional_search_filter_expr ')' - with_index_param_list */ -#line 3052 "parser.y" - { - auto match_sparse_expr = new infinity::MatchSparseExpr(); - (yyval.expr_t) = match_sparse_expr; - - // search column - match_sparse_expr->SetSearchColumn((yyvsp[-7].expr_t)); - - // search sparse and data type - match_sparse_expr->SetQuerySparse((yyvsp[-5].const_expr_t)); - - // metric type - ParserHelper::ToLower((yyvsp[-3].str_value)); - match_sparse_expr->SetMetricType((yyvsp[-3].str_value)); - - // optional filter - match_sparse_expr->SetOptionalFilter((yyvsp[-2].expr_t)); - - // topn and options - match_sparse_expr->SetOptParams(infinity::DEFAULT_MATCH_SPARSE_TOP_N, (yyvsp[0].with_index_param_list_t)); - } -#line 7715 "parser.cpp" - break; - - case 385: /* match_text_expr: MATCH TEXT '(' STRING ',' STRING optional_search_filter_expr ')' */ -#line 3073 "parser.y" - { - infinity::MatchExpr *match_text_expr = new infinity::MatchExpr(); - match_text_expr->fields_ = std::string((yyvsp[-4].str_value)); - match_text_expr->matching_text_ = std::string((yyvsp[-2].str_value)); - match_text_expr->filter_expr_.reset((yyvsp[-1].expr_t)); - free((yyvsp[-4].str_value)); - free((yyvsp[-2].str_value)); - (yyval.expr_t) = match_text_expr; - } -#line 7729 "parser.cpp" - break; - - case 386: /* match_text_expr: MATCH TEXT '(' STRING ',' STRING ',' STRING optional_search_filter_expr ')' */ -#line 3082 "parser.y" - { - infinity::MatchExpr *match_text_expr = new infinity::MatchExpr(); - match_text_expr->fields_ = std::string((yyvsp[-6].str_value)); - match_text_expr->matching_text_ = std::string((yyvsp[-4].str_value)); - match_text_expr->options_text_ = std::string((yyvsp[-2].str_value)); - match_text_expr->filter_expr_.reset((yyvsp[-1].expr_t)); - free((yyvsp[-6].str_value)); - free((yyvsp[-4].str_value)); - free((yyvsp[-2].str_value)); - (yyval.expr_t) = match_text_expr; - } -#line 7745 "parser.cpp" - break; - - case 387: /* match_text_expr: MATCH TEXT '(' STRING ',' STRING optional_search_filter_expr ')' USING INDEXES '(' STRING ')' */ -#line 3093 "parser.y" - { - infinity::MatchExpr *match_text_expr = new infinity::MatchExpr(); - match_text_expr->fields_ = std::string((yyvsp[-9].str_value)); - match_text_expr->matching_text_ = std::string((yyvsp[-7].str_value)); - match_text_expr->filter_expr_.reset((yyvsp[-6].expr_t)); - match_text_expr->index_names_ = std::string((yyvsp[-1].str_value)); - free((yyvsp[-9].str_value)); - free((yyvsp[-7].str_value)); - free((yyvsp[-1].str_value)); - (yyval.expr_t) = match_text_expr; - } -#line 7761 "parser.cpp" - break; - - case 388: /* match_text_expr: MATCH TEXT '(' STRING ',' STRING ',' STRING optional_search_filter_expr ')' USING INDEXES '(' STRING ')' */ -#line 3104 "parser.y" - { - infinity::MatchExpr *match_text_expr = new infinity::MatchExpr(); - match_text_expr->fields_ = std::string((yyvsp[-11].str_value)); - match_text_expr->matching_text_ = std::string((yyvsp[-9].str_value)); - match_text_expr->options_text_ = std::string((yyvsp[-7].str_value)); - match_text_expr->filter_expr_.reset((yyvsp[-6].expr_t)); - match_text_expr->index_names_ = std::string((yyvsp[-1].str_value)); - free((yyvsp[-11].str_value)); - free((yyvsp[-9].str_value)); - free((yyvsp[-7].str_value)); - free((yyvsp[-1].str_value)); - (yyval.expr_t) = match_text_expr; - } -#line 7779 "parser.cpp" - break; - - case 389: /* query_expr: QUERY '(' STRING optional_search_filter_expr ')' */ -#line 3118 "parser.y" - { - infinity::MatchExpr *match_text_expr = new infinity::MatchExpr(); - match_text_expr->matching_text_ = std::string((yyvsp[-2].str_value)); - match_text_expr->filter_expr_.reset((yyvsp[-1].expr_t)); - free((yyvsp[-2].str_value)); - (yyval.expr_t) = match_text_expr; - } -#line 7791 "parser.cpp" - break; - - case 390: /* query_expr: QUERY '(' STRING ',' STRING optional_search_filter_expr ')' */ -#line 3125 "parser.y" - { - infinity::MatchExpr *match_text_expr = new infinity::MatchExpr(); - match_text_expr->matching_text_ = std::string((yyvsp[-4].str_value)); - match_text_expr->options_text_ = std::string((yyvsp[-2].str_value)); - match_text_expr->filter_expr_.reset((yyvsp[-1].expr_t)); - free((yyvsp[-4].str_value)); - free((yyvsp[-2].str_value)); - (yyval.expr_t) = match_text_expr; - } -#line 7805 "parser.cpp" - break; - - case 391: /* fusion_expr: FUSION '(' STRING ')' */ -#line 3135 "parser.y" - { - infinity::FusionExpr *fusion_expr = new infinity::FusionExpr(); - fusion_expr->method_ = std::string((yyvsp[-1].str_value)); - free((yyvsp[-1].str_value)); - (yyval.expr_t) = fusion_expr; - } -#line 7816 "parser.cpp" - break; - - case 392: /* fusion_expr: FUSION '(' STRING ',' STRING ')' */ -#line 3141 "parser.y" - { - auto fusion_expr = std::make_unique(); - fusion_expr->method_ = std::string((yyvsp[-3].str_value)); - free((yyvsp[-3].str_value)); - (yyvsp[-3].str_value) = nullptr; - fusion_expr->SetOptions((yyvsp[-1].str_value)); - free((yyvsp[-1].str_value)); - (yyvsp[-1].str_value) = nullptr; - fusion_expr->JobAfterParser(); - (yyval.expr_t) = fusion_expr.release(); - } -#line 7832 "parser.cpp" - break; - - case 393: /* sub_search: match_vector_expr */ -#line 3153 "parser.y" - { - (yyval.expr_t) = (yyvsp[0].expr_t); - } -#line 7840 "parser.cpp" - break; - - case 394: /* sub_search: match_text_expr */ -#line 3156 "parser.y" - { - (yyval.expr_t) = (yyvsp[0].expr_t); - } -#line 7848 "parser.cpp" - break; - - case 395: /* sub_search: match_tensor_expr */ -#line 3159 "parser.y" - { - (yyval.expr_t) = (yyvsp[0].expr_t); - } -#line 7856 "parser.cpp" - break; - - case 396: /* sub_search: match_sparse_expr */ -#line 3162 "parser.y" - { - (yyval.expr_t) = (yyvsp[0].expr_t); - } -#line 7864 "parser.cpp" - break; - - case 397: /* sub_search: query_expr */ -#line 3165 "parser.y" - { - (yyval.expr_t) = (yyvsp[0].expr_t); - } -#line 7872 "parser.cpp" - break; - - case 398: /* sub_search: fusion_expr */ -#line 3168 "parser.y" - { - (yyval.expr_t) = (yyvsp[0].expr_t); - } -#line 7880 "parser.cpp" - break; - - case 399: /* sub_search_array: sub_search */ -#line 3172 "parser.y" - { - (yyval.expr_array_t) = new std::vector(); - (yyval.expr_array_t)->emplace_back((yyvsp[0].expr_t)); - } -#line 7889 "parser.cpp" - break; - - case 400: /* sub_search_array: sub_search_array ',' sub_search */ -#line 3176 "parser.y" - { - (yyvsp[-2].expr_array_t)->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_array_t) = (yyvsp[-2].expr_array_t); - } -#line 7898 "parser.cpp" - break; - - case 401: /* function_expr: IDENTIFIER '(' ')' */ -#line 3181 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - ParserHelper::ToLower((yyvsp[-2].str_value)); - func_expr->func_name_ = (yyvsp[-2].str_value); - free((yyvsp[-2].str_value)); - func_expr->arguments_ = nullptr; - (yyval.expr_t) = func_expr; - } -#line 7911 "parser.cpp" - break; - - case 402: /* function_expr: IDENTIFIER '(' expr_array ')' */ -#line 3189 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - ParserHelper::ToLower((yyvsp[-3].str_value)); - func_expr->func_name_ = (yyvsp[-3].str_value); - free((yyvsp[-3].str_value)); - func_expr->arguments_ = (yyvsp[-1].expr_array_t); - (yyval.expr_t) = func_expr; - } -#line 7924 "parser.cpp" - break; - - case 403: /* function_expr: IDENTIFIER '(' DISTINCT expr_array ')' */ -#line 3197 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - ParserHelper::ToLower((yyvsp[-4].str_value)); - func_expr->func_name_ = (yyvsp[-4].str_value); - free((yyvsp[-4].str_value)); - func_expr->arguments_ = (yyvsp[-1].expr_array_t); - func_expr->distinct_ = true; - (yyval.expr_t) = func_expr; - } -#line 7938 "parser.cpp" - break; - - case 404: /* function_expr: operand IS NOT NULLABLE */ -#line 3206 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "is_not_null"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-3].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 7950 "parser.cpp" - break; - - case 405: /* function_expr: operand IS NULLABLE */ -#line 3213 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "is_null"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 7962 "parser.cpp" - break; - - case 406: /* function_expr: NOT operand */ -#line 3220 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "not"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 7974 "parser.cpp" - break; - - case 407: /* function_expr: '-' operand */ -#line 3227 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "-"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 7986 "parser.cpp" - break; - - case 408: /* function_expr: '+' operand */ -#line 3234 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "+"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 7998 "parser.cpp" - break; - - case 409: /* function_expr: operand '-' operand */ -#line 3241 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "-"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 8011 "parser.cpp" - break; - - case 410: /* function_expr: operand '+' operand */ -#line 3249 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "+"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 8024 "parser.cpp" - break; - - case 411: /* function_expr: operand '*' operand */ -#line 3257 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "*"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 8037 "parser.cpp" - break; - - case 412: /* function_expr: operand '/' operand */ -#line 3265 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "/"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 8050 "parser.cpp" - break; - - case 413: /* function_expr: operand '%' operand */ -#line 3273 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "%"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 8063 "parser.cpp" - break; - - case 414: /* function_expr: operand '=' operand */ -#line 3281 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "="; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 8076 "parser.cpp" - break; - - case 415: /* function_expr: operand EQUAL operand */ -#line 3289 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "="; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 8089 "parser.cpp" - break; - - case 416: /* function_expr: operand NOT_EQ operand */ -#line 3297 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "<>"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 8102 "parser.cpp" - break; - - case 417: /* function_expr: operand '<' operand */ -#line 3305 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "<"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 8115 "parser.cpp" - break; - - case 418: /* function_expr: operand '>' operand */ -#line 3313 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = ">"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 8128 "parser.cpp" - break; - - case 419: /* function_expr: operand LESS_EQ operand */ -#line 3321 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "<="; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 8141 "parser.cpp" - break; - - case 420: /* function_expr: operand GREATER_EQ operand */ -#line 3329 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = ">="; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 8154 "parser.cpp" - break; - - case 421: /* function_expr: EXTRACT '(' STRING FROM operand ')' */ -#line 3337 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - ParserHelper::ToLower((yyvsp[-3].str_value)); - if (strcmp((yyvsp[-3].str_value), "year") == 0) { - func_expr->func_name_ = "extract_year"; - func_expr->arguments_ = new std::vector(); - } else if (strcmp((yyvsp[-3].str_value), "month") == 0) { - func_expr->func_name_ = "extract_month"; - func_expr->arguments_ = new std::vector(); - } else if (strcmp((yyvsp[-3].str_value), "day") == 0) { - func_expr->func_name_ = "extract_day"; - func_expr->arguments_ = new std::vector(); - } else if (strcmp((yyvsp[-3].str_value), "hour") == 0) { - func_expr->func_name_ = "extract_hour"; - func_expr->arguments_ = new std::vector(); - } else if (strcmp((yyvsp[-3].str_value), "minute") == 0) { - func_expr->func_name_ = "extract_minute"; - func_expr->arguments_ = new std::vector(); - } else if (strcmp((yyvsp[-3].str_value), "second") == 0) { - func_expr->func_name_ = "extract_second"; - func_expr->arguments_ = new std::vector(); - } else { - delete func_expr; - yyerror(&yyloc, scanner, result, "Invalid column expression format"); - YYERROR; - } - free((yyvsp[-3].str_value)); - func_expr->arguments_->emplace_back((yyvsp[-1].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 8189 "parser.cpp" - break; - - case 422: /* function_expr: operand LIKE operand */ -#line 3367 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "like"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 8202 "parser.cpp" - break; - - case 423: /* function_expr: operand NOT LIKE operand */ -#line 3375 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "not_like"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-3].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 8215 "parser.cpp" - break; - - case 424: /* conjunction_expr: expr AND expr */ -#line 3384 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "and"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 8228 "parser.cpp" - break; - - case 425: /* conjunction_expr: expr OR expr */ -#line 3392 "parser.y" - { - infinity::FunctionExpr *func_expr = new infinity::FunctionExpr(); - func_expr->func_name_ = "or"; - func_expr->arguments_ = new std::vector(); - func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); - func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); - (yyval.expr_t) = func_expr; - } -#line 8241 "parser.cpp" - break; - - case 426: /* between_expr: operand BETWEEN operand AND operand */ -#line 3401 "parser.y" - { - infinity::BetweenExpr *between_expr = new infinity::BetweenExpr(); - between_expr->value_ = (yyvsp[-4].expr_t); - between_expr->lower_bound_ = (yyvsp[-2].expr_t); - between_expr->upper_bound_ = (yyvsp[0].expr_t); - (yyval.expr_t) = between_expr; - } -#line 8253 "parser.cpp" - break; - - case 427: /* in_expr: operand IN '(' expr_array ')' */ -#line 3409 "parser.y" - { - infinity::InExpr *in_expr = new infinity::InExpr(true); - in_expr->left_ = (yyvsp[-4].expr_t); - in_expr->arguments_ = (yyvsp[-1].expr_array_t); - (yyval.expr_t) = in_expr; - } -#line 8264 "parser.cpp" - break; - - case 428: /* in_expr: operand NOT IN '(' expr_array ')' */ -#line 3415 "parser.y" - { - infinity::InExpr *in_expr = new infinity::InExpr(false); - in_expr->left_ = (yyvsp[-5].expr_t); - in_expr->arguments_ = (yyvsp[-1].expr_array_t); - (yyval.expr_t) = in_expr; - } -#line 8275 "parser.cpp" - break; - - case 429: /* case_expr: CASE expr case_check_array END */ -#line 3422 "parser.y" - { - infinity::CaseExpr *case_expr = new infinity::CaseExpr(); - case_expr->expr_ = (yyvsp[-2].expr_t); - case_expr->case_check_array_ = (yyvsp[-1].case_check_array_t); - (yyval.expr_t) = case_expr; - } -#line 8286 "parser.cpp" - break; - - case 430: /* case_expr: CASE expr case_check_array ELSE expr END */ -#line 3428 "parser.y" - { - infinity::CaseExpr *case_expr = new infinity::CaseExpr(); - case_expr->expr_ = (yyvsp[-4].expr_t); - case_expr->case_check_array_ = (yyvsp[-3].case_check_array_t); - case_expr->else_expr_ = (yyvsp[-1].expr_t); - (yyval.expr_t) = case_expr; - } -#line 8298 "parser.cpp" - break; - - case 431: /* case_expr: CASE case_check_array END */ -#line 3435 "parser.y" - { - infinity::CaseExpr *case_expr = new infinity::CaseExpr(); - case_expr->case_check_array_ = (yyvsp[-1].case_check_array_t); - (yyval.expr_t) = case_expr; - } -#line 8308 "parser.cpp" - break; - - case 432: /* case_expr: CASE case_check_array ELSE expr END */ -#line 3440 "parser.y" - { - infinity::CaseExpr *case_expr = new infinity::CaseExpr(); - case_expr->case_check_array_ = (yyvsp[-3].case_check_array_t); - case_expr->else_expr_ = (yyvsp[-1].expr_t); - (yyval.expr_t) = case_expr; - } -#line 8319 "parser.cpp" - break; - - case 433: /* case_check_array: WHEN expr THEN expr */ -#line 3447 "parser.y" - { - (yyval.case_check_array_t) = new std::vector(); - infinity::WhenThen *when_then_ptr = new infinity::WhenThen(); - when_then_ptr->when_ = (yyvsp[-2].expr_t); - when_then_ptr->then_ = (yyvsp[0].expr_t); - (yyval.case_check_array_t)->emplace_back(when_then_ptr); - } -#line 8331 "parser.cpp" - break; - - case 434: /* case_check_array: case_check_array WHEN expr THEN expr */ -#line 3454 "parser.y" - { - infinity::WhenThen *when_then_ptr = new infinity::WhenThen(); - when_then_ptr->when_ = (yyvsp[-2].expr_t); - when_then_ptr->then_ = (yyvsp[0].expr_t); - (yyvsp[-4].case_check_array_t)->emplace_back(when_then_ptr); - (yyval.case_check_array_t) = (yyvsp[-4].case_check_array_t); - } -#line 8343 "parser.cpp" - break; - - case 435: /* cast_expr: CAST '(' expr AS column_type ')' */ -#line 3462 "parser.y" - { - std::shared_ptr type_info_ptr{nullptr}; - switch ((yyvsp[-1].column_type_t).logical_type_) { - case infinity::LogicalType::kDecimal: { - type_info_ptr = infinity::DecimalInfo::Make((yyvsp[-1].column_type_t).precision, (yyvsp[-1].column_type_t).scale); - break; - } - // case infinity::LogicalType::kBitmap: { - // type_info_ptr = infinity::BitmapInfo::Make($5.width); - // break; - // } - case infinity::LogicalType::kEmbedding: - case infinity::LogicalType::kMultiVector: - case infinity::LogicalType::kTensor: - case infinity::LogicalType::kTensorArray: { - type_info_ptr = infinity::EmbeddingInfo::Make((yyvsp[-1].column_type_t).embedding_type_, (yyvsp[-1].column_type_t).width); - break; - } - default: { - break; - } - } - infinity::CastExpr *cast_expr = new infinity::CastExpr((yyvsp[-1].column_type_t).logical_type_, type_info_ptr); - cast_expr->expr_ = (yyvsp[-3].expr_t); - (yyval.expr_t) = cast_expr; - } -#line 8374 "parser.cpp" - break; - - case 436: /* subquery_expr: EXISTS '(' select_without_paren ')' */ -#line 3489 "parser.y" - { - infinity::SubqueryExpr *subquery_expr = new infinity::SubqueryExpr(); - subquery_expr->subquery_type_ = infinity::SubqueryType::kExists; - subquery_expr->select_ = (yyvsp[-1].select_stmt); - (yyval.expr_t) = subquery_expr; - } -#line 8385 "parser.cpp" - break; - - case 437: /* subquery_expr: NOT EXISTS '(' select_without_paren ')' */ -#line 3495 "parser.y" - { - infinity::SubqueryExpr *subquery_expr = new infinity::SubqueryExpr(); - subquery_expr->subquery_type_ = infinity::SubqueryType::kNotExists; - subquery_expr->select_ = (yyvsp[-1].select_stmt); - (yyval.expr_t) = subquery_expr; - } -#line 8396 "parser.cpp" - break; - - case 438: /* subquery_expr: operand IN '(' select_without_paren ')' */ -#line 3501 "parser.y" - { - infinity::SubqueryExpr *subquery_expr = new infinity::SubqueryExpr(); - subquery_expr->subquery_type_ = infinity::SubqueryType::kIn; - subquery_expr->left_ = (yyvsp[-4].expr_t); - subquery_expr->select_ = (yyvsp[-1].select_stmt); - (yyval.expr_t) = subquery_expr; - } -#line 8408 "parser.cpp" - break; - - case 439: /* subquery_expr: operand NOT IN '(' select_without_paren ')' */ -#line 3508 "parser.y" - { - infinity::SubqueryExpr *subquery_expr = new infinity::SubqueryExpr(); - subquery_expr->subquery_type_ = infinity::SubqueryType::kNotIn; - subquery_expr->left_ = (yyvsp[-5].expr_t); - subquery_expr->select_ = (yyvsp[-1].select_stmt); - (yyval.expr_t) = subquery_expr; - } -#line 8420 "parser.cpp" - break; - - case 440: /* column_expr: IDENTIFIER */ -#line 3516 "parser.y" - { - infinity::ColumnExpr *column_expr = new infinity::ColumnExpr(); - ParserHelper::ToLower((yyvsp[0].str_value)); - column_expr->names_.emplace_back((yyvsp[0].str_value)); - free((yyvsp[0].str_value)); - (yyval.expr_t) = column_expr; - } -#line 8432 "parser.cpp" - break; - - case 441: /* column_expr: column_expr '.' IDENTIFIER */ -#line 3523 "parser.y" - { - infinity::ColumnExpr *column_expr = (infinity::ColumnExpr *)(yyvsp[-2].expr_t); - ParserHelper::ToLower((yyvsp[0].str_value)); - column_expr->names_.emplace_back((yyvsp[0].str_value)); - free((yyvsp[0].str_value)); - (yyval.expr_t) = column_expr; + case 408: /* sub_search_array: sub_search_array ',' sub_search */ +#line 3226 "parser.y" + { + (yyvsp[-2].expr_array_t)->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_array_t) = (yyvsp[-2].expr_array_t); +} +#line 8007 "parser.cpp" + break; + + case 409: /* function_expr: IDENTIFIER '(' ')' */ +#line 3231 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + ParserHelper::ToLower((yyvsp[-2].str_value)); + func_expr->func_name_ = (yyvsp[-2].str_value); + free((yyvsp[-2].str_value)); + func_expr->arguments_ = nullptr; + (yyval.expr_t) = func_expr; +} +#line 8020 "parser.cpp" + break; + + case 410: /* function_expr: IDENTIFIER '(' expr_array ')' */ +#line 3239 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + ParserHelper::ToLower((yyvsp[-3].str_value)); + func_expr->func_name_ = (yyvsp[-3].str_value); + free((yyvsp[-3].str_value)); + func_expr->arguments_ = (yyvsp[-1].expr_array_t); + (yyval.expr_t) = func_expr; +} +#line 8033 "parser.cpp" + break; + + case 411: /* function_expr: IDENTIFIER '(' DISTINCT expr_array ')' */ +#line 3247 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + ParserHelper::ToLower((yyvsp[-4].str_value)); + func_expr->func_name_ = (yyvsp[-4].str_value); + free((yyvsp[-4].str_value)); + func_expr->arguments_ = (yyvsp[-1].expr_array_t); + func_expr->distinct_ = true; + (yyval.expr_t) = func_expr; +} +#line 8047 "parser.cpp" + break; + + case 412: /* function_expr: operand IS NOT NULLABLE */ +#line 3256 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "is_not_null"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-3].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8059 "parser.cpp" + break; + + case 413: /* function_expr: operand IS NULLABLE */ +#line 3263 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "is_null"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8071 "parser.cpp" + break; + + case 414: /* function_expr: NOT operand */ +#line 3270 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "not"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8083 "parser.cpp" + break; + + case 415: /* function_expr: '-' operand */ +#line 3277 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "-"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8095 "parser.cpp" + break; + + case 416: /* function_expr: '+' operand */ +#line 3284 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "+"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8107 "parser.cpp" + break; + + case 417: /* function_expr: operand '-' operand */ +#line 3291 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "-"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8120 "parser.cpp" + break; + + case 418: /* function_expr: operand '+' operand */ +#line 3299 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "+"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8133 "parser.cpp" + break; + + case 419: /* function_expr: operand '*' operand */ +#line 3307 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "*"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8146 "parser.cpp" + break; + + case 420: /* function_expr: operand '/' operand */ +#line 3315 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "/"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8159 "parser.cpp" + break; + + case 421: /* function_expr: operand '%' operand */ +#line 3323 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "%"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8172 "parser.cpp" + break; + + case 422: /* function_expr: operand '=' operand */ +#line 3331 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "="; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8185 "parser.cpp" + break; + + case 423: /* function_expr: operand EQUAL operand */ +#line 3339 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "="; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8198 "parser.cpp" + break; + + case 424: /* function_expr: operand NOT_EQ operand */ +#line 3347 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "<>"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8211 "parser.cpp" + break; + + case 425: /* function_expr: operand '<' operand */ +#line 3355 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "<"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8224 "parser.cpp" + break; + + case 426: /* function_expr: operand '>' operand */ +#line 3363 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = ">"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8237 "parser.cpp" + break; + + case 427: /* function_expr: operand LESS_EQ operand */ +#line 3371 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "<="; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8250 "parser.cpp" + break; + + case 428: /* function_expr: operand GREATER_EQ operand */ +#line 3379 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = ">="; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8263 "parser.cpp" + break; + + case 429: /* function_expr: EXTRACT '(' STRING FROM operand ')' */ +#line 3387 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + ParserHelper::ToLower((yyvsp[-3].str_value)); + if(strcmp((yyvsp[-3].str_value), "year") == 0) { + func_expr->func_name_ = "extract_year"; + func_expr->arguments_ = new std::vector(); + } else if(strcmp((yyvsp[-3].str_value), "month") == 0) { + func_expr->func_name_ = "extract_month"; + func_expr->arguments_ = new std::vector(); + } else if(strcmp((yyvsp[-3].str_value), "day") == 0) { + func_expr->func_name_ = "extract_day"; + func_expr->arguments_ = new std::vector(); + } else if(strcmp((yyvsp[-3].str_value), "hour") == 0) { + func_expr->func_name_ = "extract_hour"; + func_expr->arguments_ = new std::vector(); + } else if(strcmp((yyvsp[-3].str_value), "minute") == 0) { + func_expr->func_name_ = "extract_minute"; + func_expr->arguments_ = new std::vector(); + } else if(strcmp((yyvsp[-3].str_value), "second") == 0) { + func_expr->func_name_ = "extract_second"; + func_expr->arguments_ = new std::vector(); + } else { + delete func_expr; + yyerror(&yyloc, scanner, result, "Invalid column expression format"); + YYERROR; + } + free((yyvsp[-3].str_value)); + func_expr->arguments_->emplace_back((yyvsp[-1].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8298 "parser.cpp" + break; + + case 430: /* function_expr: operand LIKE operand */ +#line 3417 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "like"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8311 "parser.cpp" + break; + + case 431: /* function_expr: operand NOT LIKE operand */ +#line 3425 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "not_like"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-3].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8324 "parser.cpp" + break; + + case 432: /* conjunction_expr: expr AND expr */ +#line 3434 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "and"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8337 "parser.cpp" + break; + + case 433: /* conjunction_expr: expr OR expr */ +#line 3442 "parser.y" + { + infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); + func_expr->func_name_ = "or"; + func_expr->arguments_ = new std::vector(); + func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); + func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); + (yyval.expr_t) = func_expr; +} +#line 8350 "parser.cpp" + break; + + case 434: /* between_expr: operand BETWEEN operand AND operand */ +#line 3451 "parser.y" + { + infinity::BetweenExpr* between_expr = new infinity::BetweenExpr(); + between_expr->value_ = (yyvsp[-4].expr_t); + between_expr->lower_bound_ = (yyvsp[-2].expr_t); + between_expr->upper_bound_ = (yyvsp[0].expr_t); + (yyval.expr_t) = between_expr; +} +#line 8362 "parser.cpp" + break; + + case 435: /* in_expr: operand IN '(' expr_array ')' */ +#line 3459 "parser.y" + { + infinity::InExpr* in_expr = new infinity::InExpr(true); + in_expr->left_ = (yyvsp[-4].expr_t); + in_expr->arguments_ = (yyvsp[-1].expr_array_t); + (yyval.expr_t) = in_expr; +} +#line 8373 "parser.cpp" + break; + + case 436: /* in_expr: operand NOT IN '(' expr_array ')' */ +#line 3465 "parser.y" + { + infinity::InExpr* in_expr = new infinity::InExpr(false); + in_expr->left_ = (yyvsp[-5].expr_t); + in_expr->arguments_ = (yyvsp[-1].expr_array_t); + (yyval.expr_t) = in_expr; +} +#line 8384 "parser.cpp" + break; + + case 437: /* case_expr: CASE expr case_check_array END */ +#line 3472 "parser.y" + { + infinity::CaseExpr* case_expr = new infinity::CaseExpr(); + case_expr->expr_ = (yyvsp[-2].expr_t); + case_expr->case_check_array_ = (yyvsp[-1].case_check_array_t); + (yyval.expr_t) = case_expr; +} +#line 8395 "parser.cpp" + break; + + case 438: /* case_expr: CASE expr case_check_array ELSE expr END */ +#line 3478 "parser.y" + { + infinity::CaseExpr* case_expr = new infinity::CaseExpr(); + case_expr->expr_ = (yyvsp[-4].expr_t); + case_expr->case_check_array_ = (yyvsp[-3].case_check_array_t); + case_expr->else_expr_ = (yyvsp[-1].expr_t); + (yyval.expr_t) = case_expr; +} +#line 8407 "parser.cpp" + break; + + case 439: /* case_expr: CASE case_check_array END */ +#line 3485 "parser.y" + { + infinity::CaseExpr* case_expr = new infinity::CaseExpr(); + case_expr->case_check_array_ = (yyvsp[-1].case_check_array_t); + (yyval.expr_t) = case_expr; +} +#line 8417 "parser.cpp" + break; + + case 440: /* case_expr: CASE case_check_array ELSE expr END */ +#line 3490 "parser.y" + { + infinity::CaseExpr* case_expr = new infinity::CaseExpr(); + case_expr->case_check_array_ = (yyvsp[-3].case_check_array_t); + case_expr->else_expr_ = (yyvsp[-1].expr_t); + (yyval.expr_t) = case_expr; +} +#line 8428 "parser.cpp" + break; + + case 441: /* case_check_array: WHEN expr THEN expr */ +#line 3497 "parser.y" + { + (yyval.case_check_array_t) = new std::vector(); + infinity::WhenThen* when_then_ptr = new infinity::WhenThen(); + when_then_ptr->when_ = (yyvsp[-2].expr_t); + when_then_ptr->then_ = (yyvsp[0].expr_t); + (yyval.case_check_array_t)->emplace_back(when_then_ptr); +} +#line 8440 "parser.cpp" + break; + + case 442: /* case_check_array: case_check_array WHEN expr THEN expr */ +#line 3504 "parser.y" + { + infinity::WhenThen* when_then_ptr = new infinity::WhenThen(); + when_then_ptr->when_ = (yyvsp[-2].expr_t); + when_then_ptr->then_ = (yyvsp[0].expr_t); + (yyvsp[-4].case_check_array_t)->emplace_back(when_then_ptr); + (yyval.case_check_array_t) = (yyvsp[-4].case_check_array_t); +} +#line 8452 "parser.cpp" + break; + + case 443: /* cast_expr: CAST '(' expr AS column_type ')' */ +#line 3512 "parser.y" + { + std::shared_ptr type_info_ptr{nullptr}; + switch((yyvsp[-1].column_type_t).logical_type_) { + case infinity::LogicalType::kDecimal: { + type_info_ptr = infinity::DecimalInfo::Make((yyvsp[-1].column_type_t).precision, (yyvsp[-1].column_type_t).scale); + break; } -#line 8444 "parser.cpp" - break; - - case 442: /* column_expr: '*' */ -#line 3530 "parser.y" - { - infinity::ColumnExpr *column_expr = new infinity::ColumnExpr(); - column_expr->star_ = true; - (yyval.expr_t) = column_expr; +// case infinity::LogicalType::kBitmap: { +// type_info_ptr = infinity::BitmapInfo::Make($5.width); +// break; +// } + case infinity::LogicalType::kEmbedding: + case infinity::LogicalType::kMultiVector: + case infinity::LogicalType::kTensor: + case infinity::LogicalType::kTensorArray: { + type_info_ptr = infinity::EmbeddingInfo::Make((yyvsp[-1].column_type_t).embedding_type_, (yyvsp[-1].column_type_t).width); + break; } -#line 8454 "parser.cpp" - break; - - case 443: /* column_expr: column_expr '.' '*' */ -#line 3535 "parser.y" - { - infinity::ColumnExpr *column_expr = (infinity::ColumnExpr *)(yyvsp[-2].expr_t); - if (column_expr->star_) { - yyerror(&yyloc, scanner, result, "Invalid column expression format"); - YYERROR; - } - column_expr->star_ = true; - (yyval.expr_t) = column_expr; + default: { + break; } -#line 8468 "parser.cpp" - break; + } + infinity::CastExpr* cast_expr = new infinity::CastExpr((yyvsp[-1].column_type_t).logical_type_, type_info_ptr); + cast_expr->expr_ = (yyvsp[-3].expr_t); + (yyval.expr_t) = cast_expr; +} +#line 8483 "parser.cpp" + break; + + case 444: /* subquery_expr: EXISTS '(' select_without_paren ')' */ +#line 3539 "parser.y" + { + infinity::SubqueryExpr* subquery_expr = new infinity::SubqueryExpr(); + subquery_expr->subquery_type_ = infinity::SubqueryType::kExists; + subquery_expr->select_ = (yyvsp[-1].select_stmt); + (yyval.expr_t) = subquery_expr; +} +#line 8494 "parser.cpp" + break; - case 444: /* constant_expr: STRING */ + case 445: /* subquery_expr: NOT EXISTS '(' select_without_paren ')' */ #line 3545 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kString); - const_expr->str_value_ = (yyvsp[0].str_value); - (yyval.const_expr_t) = const_expr; - } -#line 8478 "parser.cpp" - break; - - case 445: /* constant_expr: TRUE */ -#line 3550 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kBoolean); - const_expr->bool_value_ = true; - (yyval.const_expr_t) = const_expr; - } -#line 8488 "parser.cpp" - break; - - case 446: /* constant_expr: FALSE */ -#line 3555 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kBoolean); - const_expr->bool_value_ = false; - (yyval.const_expr_t) = const_expr; - } -#line 8498 "parser.cpp" - break; - - case 447: /* constant_expr: DOUBLE_VALUE */ -#line 3560 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDouble); - const_expr->double_value_ = (yyvsp[0].double_value); - (yyval.const_expr_t) = const_expr; - } -#line 8508 "parser.cpp" - break; - - case 448: /* constant_expr: LONG_VALUE */ -#line 3565 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInteger); - const_expr->integer_value_ = (yyvsp[0].long_value); - (yyval.const_expr_t) = const_expr; - } -#line 8518 "parser.cpp" - break; - - case 449: /* constant_expr: DATE STRING */ -#line 3570 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDate); - const_expr->date_value_ = (yyvsp[0].str_value); - (yyval.const_expr_t) = const_expr; - } -#line 8528 "parser.cpp" - break; - - case 450: /* constant_expr: TIME STRING */ -#line 3575 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kTime); - const_expr->date_value_ = (yyvsp[0].str_value); - (yyval.const_expr_t) = const_expr; - } -#line 8538 "parser.cpp" - break; + { + infinity::SubqueryExpr* subquery_expr = new infinity::SubqueryExpr(); + subquery_expr->subquery_type_ = infinity::SubqueryType::kNotExists; + subquery_expr->select_ = (yyvsp[-1].select_stmt); + (yyval.expr_t) = subquery_expr; +} +#line 8505 "parser.cpp" + break; + + case 446: /* subquery_expr: operand IN '(' select_without_paren ')' */ +#line 3551 "parser.y" + { + infinity::SubqueryExpr* subquery_expr = new infinity::SubqueryExpr(); + subquery_expr->subquery_type_ = infinity::SubqueryType::kIn; + subquery_expr->left_ = (yyvsp[-4].expr_t); + subquery_expr->select_ = (yyvsp[-1].select_stmt); + (yyval.expr_t) = subquery_expr; +} +#line 8517 "parser.cpp" + break; + + case 447: /* subquery_expr: operand NOT IN '(' select_without_paren ')' */ +#line 3558 "parser.y" + { + infinity::SubqueryExpr* subquery_expr = new infinity::SubqueryExpr(); + subquery_expr->subquery_type_ = infinity::SubqueryType::kNotIn; + subquery_expr->left_ = (yyvsp[-5].expr_t); + subquery_expr->select_ = (yyvsp[-1].select_stmt); + (yyval.expr_t) = subquery_expr; +} +#line 8529 "parser.cpp" + break; + + case 448: /* column_expr: IDENTIFIER */ +#line 3566 "parser.y" + { + infinity::ColumnExpr* column_expr = new infinity::ColumnExpr(); + ParserHelper::ToLower((yyvsp[0].str_value)); + column_expr->names_.emplace_back((yyvsp[0].str_value)); + free((yyvsp[0].str_value)); + (yyval.expr_t) = column_expr; +} +#line 8541 "parser.cpp" + break; + + case 449: /* column_expr: column_expr '.' IDENTIFIER */ +#line 3573 "parser.y" + { + infinity::ColumnExpr* column_expr = (infinity::ColumnExpr*)(yyvsp[-2].expr_t); + ParserHelper::ToLower((yyvsp[0].str_value)); + column_expr->names_.emplace_back((yyvsp[0].str_value)); + free((yyvsp[0].str_value)); + (yyval.expr_t) = column_expr; +} +#line 8553 "parser.cpp" + break; - case 451: /* constant_expr: DATETIME STRING */ + case 450: /* column_expr: '*' */ #line 3580 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDateTime); - const_expr->date_value_ = (yyvsp[0].str_value); - (yyval.const_expr_t) = const_expr; - } -#line 8548 "parser.cpp" - break; + { + infinity::ColumnExpr* column_expr = new infinity::ColumnExpr(); + column_expr->star_ = true; + (yyval.expr_t) = column_expr; +} +#line 8563 "parser.cpp" + break; - case 452: /* constant_expr: TIMESTAMP STRING */ + case 451: /* column_expr: column_expr '.' '*' */ #line 3585 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kTimestamp); - const_expr->date_value_ = (yyvsp[0].str_value); - (yyval.const_expr_t) = const_expr; - } -#line 8558 "parser.cpp" - break; - - case 453: /* constant_expr: INTERVAL interval_expr */ -#line 3590 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[0].const_expr_t); - } -#line 8566 "parser.cpp" - break; - - case 454: /* constant_expr: interval_expr */ -#line 3593 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[0].const_expr_t); - } -#line 8574 "parser.cpp" - break; - - case 455: /* constant_expr: common_array_expr */ -#line 3596 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[0].const_expr_t); - } -#line 8582 "parser.cpp" - break; - - case 456: /* common_array_expr: array_expr */ -#line 3600 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[0].const_expr_t); - } -#line 8590 "parser.cpp" - break; - - case 457: /* common_array_expr: subarray_array_expr */ -#line 3603 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[0].const_expr_t); - } -#line 8598 "parser.cpp" - break; - - case 458: /* common_array_expr: sparse_array_expr */ -#line 3606 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[0].const_expr_t); - } -#line 8606 "parser.cpp" - break; - - case 459: /* common_array_expr: empty_array_expr */ -#line 3609 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[0].const_expr_t); - } -#line 8614 "parser.cpp" - break; - - case 460: /* common_sparse_array_expr: sparse_array_expr */ -#line 3613 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[0].const_expr_t); - } -#line 8622 "parser.cpp" - break; - - case 461: /* common_sparse_array_expr: array_expr */ -#line 3616 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[0].const_expr_t); - } -#line 8630 "parser.cpp" - break; - - case 462: /* common_sparse_array_expr: empty_array_expr */ -#line 3619 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[0].const_expr_t); - } -#line 8638 "parser.cpp" - break; - - case 463: /* subarray_array_expr: unclosed_subarray_array_expr ']' */ -#line 3623 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[-1].const_expr_t); - } -#line 8646 "parser.cpp" - break; - - case 464: /* unclosed_subarray_array_expr: '[' common_array_expr */ -#line 3627 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kSubArrayArray); - const_expr->sub_array_array_.emplace_back((yyvsp[0].const_expr_t)); - (yyval.const_expr_t) = const_expr; - } -#line 8656 "parser.cpp" - break; - - case 465: /* unclosed_subarray_array_expr: unclosed_subarray_array_expr ',' common_array_expr */ -#line 3632 "parser.y" - { - (yyvsp[-2].const_expr_t)->sub_array_array_.emplace_back((yyvsp[0].const_expr_t)); - (yyval.const_expr_t) = (yyvsp[-2].const_expr_t); - } -#line 8665 "parser.cpp" - break; - - case 466: /* sparse_array_expr: long_sparse_array_expr */ -#line 3637 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[0].const_expr_t); - } -#line 8673 "parser.cpp" - break; - - case 467: /* sparse_array_expr: double_sparse_array_expr */ -#line 3640 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[0].const_expr_t); - } -#line 8681 "parser.cpp" - break; - - case 468: /* long_sparse_array_expr: unclosed_long_sparse_array_expr ']' */ -#line 3644 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[-1].const_expr_t); - } -#line 8689 "parser.cpp" - break; - - case 469: /* unclosed_long_sparse_array_expr: '[' int_sparse_ele */ -#line 3648 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kLongSparseArray); - const_expr->long_sparse_array_.first.emplace_back((yyvsp[0].int_sparse_ele_t)->first); - const_expr->long_sparse_array_.second.emplace_back((yyvsp[0].int_sparse_ele_t)->second); - delete (yyvsp[0].int_sparse_ele_t); - (yyval.const_expr_t) = const_expr; - } -#line 8701 "parser.cpp" - break; - - case 470: /* unclosed_long_sparse_array_expr: unclosed_long_sparse_array_expr ',' int_sparse_ele */ -#line 3655 "parser.y" - { - (yyvsp[-2].const_expr_t)->long_sparse_array_.first.emplace_back((yyvsp[0].int_sparse_ele_t)->first); - (yyvsp[-2].const_expr_t)->long_sparse_array_.second.emplace_back((yyvsp[0].int_sparse_ele_t)->second); - delete (yyvsp[0].int_sparse_ele_t); - (yyval.const_expr_t) = (yyvsp[-2].const_expr_t); - } -#line 8712 "parser.cpp" - break; - - case 471: /* double_sparse_array_expr: unclosed_double_sparse_array_expr ']' */ -#line 3662 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[-1].const_expr_t); - } -#line 8720 "parser.cpp" - break; - - case 472: /* unclosed_double_sparse_array_expr: '[' float_sparse_ele */ -#line 3666 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDoubleSparseArray); - const_expr->double_sparse_array_.first.emplace_back((yyvsp[0].float_sparse_ele_t)->first); - const_expr->double_sparse_array_.second.emplace_back((yyvsp[0].float_sparse_ele_t)->second); - delete (yyvsp[0].float_sparse_ele_t); - (yyval.const_expr_t) = const_expr; - } -#line 8732 "parser.cpp" - break; - - case 473: /* unclosed_double_sparse_array_expr: unclosed_double_sparse_array_expr ',' float_sparse_ele */ -#line 3673 "parser.y" - { - (yyvsp[-2].const_expr_t)->double_sparse_array_.first.emplace_back((yyvsp[0].float_sparse_ele_t)->first); - (yyvsp[-2].const_expr_t)->double_sparse_array_.second.emplace_back((yyvsp[0].float_sparse_ele_t)->second); - delete (yyvsp[0].float_sparse_ele_t); - (yyval.const_expr_t) = (yyvsp[-2].const_expr_t); - } -#line 8743 "parser.cpp" - break; - - case 474: /* empty_array_expr: '[' ']' */ -#line 3680 "parser.y" - { - (yyval.const_expr_t) = new infinity::ConstantExpr(infinity::LiteralType::kEmptyArray); - } -#line 8751 "parser.cpp" - break; - - case 475: /* int_sparse_ele: LONG_VALUE ':' LONG_VALUE */ -#line 3684 "parser.y" - { - (yyval.int_sparse_ele_t) = new std::pair{(yyvsp[-2].long_value), (yyvsp[0].long_value)}; - } -#line 8759 "parser.cpp" - break; - - case 476: /* float_sparse_ele: LONG_VALUE ':' DOUBLE_VALUE */ -#line 3688 "parser.y" - { - (yyval.float_sparse_ele_t) = new std::pair{(yyvsp[-2].long_value), (yyvsp[0].double_value)}; - } -#line 8767 "parser.cpp" - break; - - case 477: /* array_expr: long_array_expr */ -#line 3692 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[0].const_expr_t); - } -#line 8775 "parser.cpp" - break; - - case 478: /* array_expr: double_array_expr */ -#line 3695 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[0].const_expr_t); - } -#line 8783 "parser.cpp" - break; - - case 479: /* long_array_expr: unclosed_long_array_expr ']' */ -#line 3699 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[-1].const_expr_t); - } -#line 8791 "parser.cpp" - break; - - case 480: /* unclosed_long_array_expr: '[' LONG_VALUE */ -#line 3703 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kIntegerArray); - const_expr->long_array_.emplace_back((yyvsp[0].long_value)); - (yyval.const_expr_t) = const_expr; - } -#line 8801 "parser.cpp" - break; - - case 481: /* unclosed_long_array_expr: unclosed_long_array_expr ',' LONG_VALUE */ -#line 3708 "parser.y" - { - (yyvsp[-2].const_expr_t)->long_array_.emplace_back((yyvsp[0].long_value)); - (yyval.const_expr_t) = (yyvsp[-2].const_expr_t); - } -#line 8810 "parser.cpp" - break; - - case 482: /* double_array_expr: unclosed_double_array_expr ']' */ -#line 3713 "parser.y" - { - (yyval.const_expr_t) = (yyvsp[-1].const_expr_t); - } -#line 8818 "parser.cpp" - break; - - case 483: /* unclosed_double_array_expr: '[' DOUBLE_VALUE */ -#line 3717 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDoubleArray); - const_expr->double_array_.emplace_back((yyvsp[0].double_value)); - (yyval.const_expr_t) = const_expr; - } -#line 8828 "parser.cpp" - break; - - case 484: /* unclosed_double_array_expr: unclosed_double_array_expr ',' DOUBLE_VALUE */ -#line 3722 "parser.y" - { - (yyvsp[-2].const_expr_t)->double_array_.emplace_back((yyvsp[0].double_value)); - (yyval.const_expr_t) = (yyvsp[-2].const_expr_t); - } -#line 8837 "parser.cpp" - break; - - case 485: /* interval_expr: LONG_VALUE SECONDS */ -#line 3727 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kSecond; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } -#line 8848 "parser.cpp" - break; - - case 486: /* interval_expr: LONG_VALUE SECOND */ -#line 3733 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kSecond; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } -#line 8859 "parser.cpp" - break; - - case 487: /* interval_expr: LONG_VALUE MINUTES */ -#line 3739 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kMinute; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } -#line 8870 "parser.cpp" - break; + { + infinity::ColumnExpr* column_expr = (infinity::ColumnExpr*)(yyvsp[-2].expr_t); + if(column_expr->star_) { + yyerror(&yyloc, scanner, result, "Invalid column expression format"); + YYERROR; + } + column_expr->star_ = true; + (yyval.expr_t) = column_expr; +} +#line 8577 "parser.cpp" + break; + + case 452: /* constant_expr: STRING */ +#line 3595 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kString); + const_expr->str_value_ = (yyvsp[0].str_value); + (yyval.const_expr_t) = const_expr; +} +#line 8587 "parser.cpp" + break; - case 488: /* interval_expr: LONG_VALUE MINUTE */ -#line 3745 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kMinute; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } -#line 8881 "parser.cpp" - break; + case 453: /* constant_expr: TRUE */ +#line 3600 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kBoolean); + const_expr->bool_value_ = true; + (yyval.const_expr_t) = const_expr; +} +#line 8597 "parser.cpp" + break; - case 489: /* interval_expr: LONG_VALUE HOURS */ -#line 3751 "parser.y" + case 454: /* constant_expr: FALSE */ +#line 3605 "parser.y" { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kHour; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } -#line 8892 "parser.cpp" - break; + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kBoolean); + const_expr->bool_value_ = false; + (yyval.const_expr_t) = const_expr; +} +#line 8607 "parser.cpp" + break; + + case 455: /* constant_expr: DOUBLE_VALUE */ +#line 3610 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDouble); + const_expr->double_value_ = (yyvsp[0].double_value); + (yyval.const_expr_t) = const_expr; +} +#line 8617 "parser.cpp" + break; + + case 456: /* constant_expr: LONG_VALUE */ +#line 3615 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInteger); + const_expr->integer_value_ = (yyvsp[0].long_value); + (yyval.const_expr_t) = const_expr; +} +#line 8627 "parser.cpp" + break; + + case 457: /* constant_expr: DATE STRING */ +#line 3620 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDate); + const_expr->date_value_ = (yyvsp[0].str_value); + (yyval.const_expr_t) = const_expr; +} +#line 8637 "parser.cpp" + break; + + case 458: /* constant_expr: TIME STRING */ +#line 3625 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kTime); + const_expr->date_value_ = (yyvsp[0].str_value); + (yyval.const_expr_t) = const_expr; +} +#line 8647 "parser.cpp" + break; + + case 459: /* constant_expr: DATETIME STRING */ +#line 3630 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDateTime); + const_expr->date_value_ = (yyvsp[0].str_value); + (yyval.const_expr_t) = const_expr; +} +#line 8657 "parser.cpp" + break; + + case 460: /* constant_expr: TIMESTAMP STRING */ +#line 3635 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kTimestamp); + const_expr->date_value_ = (yyvsp[0].str_value); + (yyval.const_expr_t) = const_expr; +} +#line 8667 "parser.cpp" + break; - case 490: /* interval_expr: LONG_VALUE HOUR */ -#line 3757 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kHour; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } -#line 8903 "parser.cpp" - break; + case 461: /* constant_expr: INTERVAL interval_expr */ +#line 3640 "parser.y" + { + (yyval.const_expr_t) = (yyvsp[0].const_expr_t); +} +#line 8675 "parser.cpp" + break; - case 491: /* interval_expr: LONG_VALUE DAYS */ -#line 3763 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kDay; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } -#line 8914 "parser.cpp" - break; + case 462: /* constant_expr: interval_expr */ +#line 3643 "parser.y" + { + (yyval.const_expr_t) = (yyvsp[0].const_expr_t); +} +#line 8683 "parser.cpp" + break; - case 492: /* interval_expr: LONG_VALUE DAY */ -#line 3769 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kDay; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } -#line 8925 "parser.cpp" - break; + case 463: /* constant_expr: common_array_expr */ +#line 3646 "parser.y" + { + (yyval.const_expr_t) = (yyvsp[0].const_expr_t); +} +#line 8691 "parser.cpp" + break; - case 493: /* interval_expr: LONG_VALUE MONTHS */ -#line 3775 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kMonth; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } -#line 8936 "parser.cpp" - break; + case 464: /* common_array_expr: array_expr */ +#line 3650 "parser.y" + { + (yyval.const_expr_t) = (yyvsp[0].const_expr_t); +} +#line 8699 "parser.cpp" + break; - case 494: /* interval_expr: LONG_VALUE MONTH */ -#line 3781 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kMonth; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } -#line 8947 "parser.cpp" - break; + case 465: /* common_array_expr: subarray_array_expr */ +#line 3653 "parser.y" + { + (yyval.const_expr_t) = (yyvsp[0].const_expr_t); +} +#line 8707 "parser.cpp" + break; - case 495: /* interval_expr: LONG_VALUE YEARS */ -#line 3787 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kYear; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } -#line 8958 "parser.cpp" - break; + case 466: /* common_array_expr: sparse_array_expr */ +#line 3656 "parser.y" + { + (yyval.const_expr_t) = (yyvsp[0].const_expr_t); +} +#line 8715 "parser.cpp" + break; - case 496: /* interval_expr: LONG_VALUE YEAR */ -#line 3793 "parser.y" - { - infinity::ConstantExpr *const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); - const_expr->interval_type_ = infinity::TimeUnit::kYear; - const_expr->integer_value_ = (yyvsp[-1].long_value); - (yyval.const_expr_t) = const_expr; - } -#line 8969 "parser.cpp" - break; + case 467: /* common_array_expr: empty_array_expr */ +#line 3659 "parser.y" + { + (yyval.const_expr_t) = (yyvsp[0].const_expr_t); +} +#line 8723 "parser.cpp" + break; - case 497: /* copy_option_list: copy_option */ -#line 3804 "parser.y" - { - (yyval.copy_option_array) = new std::vector(); - (yyval.copy_option_array)->push_back((yyvsp[0].copy_option_t)); - } -#line 8978 "parser.cpp" - break; + case 468: /* common_sparse_array_expr: sparse_array_expr */ +#line 3663 "parser.y" + { + (yyval.const_expr_t) = (yyvsp[0].const_expr_t); +} +#line 8731 "parser.cpp" + break; - case 498: /* copy_option_list: copy_option_list ',' copy_option */ -#line 3808 "parser.y" - { - (yyvsp[-2].copy_option_array)->push_back((yyvsp[0].copy_option_t)); - (yyval.copy_option_array) = (yyvsp[-2].copy_option_array); - } -#line 8987 "parser.cpp" - break; + case 469: /* common_sparse_array_expr: array_expr */ +#line 3666 "parser.y" + { + (yyval.const_expr_t) = (yyvsp[0].const_expr_t); +} +#line 8739 "parser.cpp" + break; - case 499: /* copy_option: FORMAT IDENTIFIER */ -#line 3813 "parser.y" - { - (yyval.copy_option_t) = new infinity::CopyOption(); - (yyval.copy_option_t)->option_type_ = infinity::CopyOptionType::kFormat; - if (strcasecmp((yyvsp[0].str_value), "csv") == 0) { - (yyval.copy_option_t)->file_type_ = infinity::CopyFileType::kCSV; - free((yyvsp[0].str_value)); - } else if (strcasecmp((yyvsp[0].str_value), "json") == 0) { - (yyval.copy_option_t)->file_type_ = infinity::CopyFileType::kJSON; - free((yyvsp[0].str_value)); - } else if (strcasecmp((yyvsp[0].str_value), "jsonl") == 0) { - (yyval.copy_option_t)->file_type_ = infinity::CopyFileType::kJSONL; - free((yyvsp[0].str_value)); - } else if (strcasecmp((yyvsp[0].str_value), "fvecs") == 0) { - (yyval.copy_option_t)->file_type_ = infinity::CopyFileType::kFVECS; - free((yyvsp[0].str_value)); - } else if (strcasecmp((yyvsp[0].str_value), "csr") == 0) { - (yyval.copy_option_t)->file_type_ = infinity::CopyFileType::kCSR; - free((yyvsp[0].str_value)); - } else if (strcasecmp((yyvsp[0].str_value), "bvecs") == 0) { - (yyval.copy_option_t)->file_type_ = infinity::CopyFileType::kBVECS; - free((yyvsp[0].str_value)); - } else if (strcasecmp((yyvsp[0].str_value), "parquet") == 0) { - (yyval.copy_option_t)->file_type_ = infinity::CopyFileType::kPARQUET; - free((yyvsp[0].str_value)); - } else { - free((yyvsp[0].str_value)); - delete (yyval.copy_option_t); - yyerror(&yyloc, scanner, result, "Unknown file format"); - YYERROR; - } - } -#line 9023 "parser.cpp" - break; + case 470: /* common_sparse_array_expr: empty_array_expr */ +#line 3669 "parser.y" + { + (yyval.const_expr_t) = (yyvsp[0].const_expr_t); +} +#line 8747 "parser.cpp" + break; - case 500: /* copy_option: DELIMITER STRING */ -#line 3844 "parser.y" - { - (yyval.copy_option_t) = new infinity::CopyOption(); - (yyval.copy_option_t)->option_type_ = infinity::CopyOptionType::kDelimiter; - if (strlen((yyvsp[0].str_value)) > 1 && (yyvsp[0].str_value)[0] == '\\') { - if ((yyvsp[0].str_value)[1] == 't') - (yyval.copy_option_t)->delimiter_ = '\t'; - } else { - (yyval.copy_option_t)->delimiter_ = (yyvsp[0].str_value)[0]; - } - free((yyvsp[0].str_value)); - } -#line 9038 "parser.cpp" - break; + case 471: /* subarray_array_expr: unclosed_subarray_array_expr ']' */ +#line 3673 "parser.y" + { + (yyval.const_expr_t) = (yyvsp[-1].const_expr_t); +} +#line 8755 "parser.cpp" + break; + + case 472: /* unclosed_subarray_array_expr: '[' common_array_expr */ +#line 3677 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kSubArrayArray); + const_expr->sub_array_array_.emplace_back((yyvsp[0].const_expr_t)); + (yyval.const_expr_t) = const_expr; +} +#line 8765 "parser.cpp" + break; + + case 473: /* unclosed_subarray_array_expr: unclosed_subarray_array_expr ',' common_array_expr */ +#line 3682 "parser.y" + { + (yyvsp[-2].const_expr_t)->sub_array_array_.emplace_back((yyvsp[0].const_expr_t)); + (yyval.const_expr_t) = (yyvsp[-2].const_expr_t); +} +#line 8774 "parser.cpp" + break; - case 501: /* copy_option: HEADER */ -#line 3854 "parser.y" - { - (yyval.copy_option_t) = new infinity::CopyOption(); - (yyval.copy_option_t)->option_type_ = infinity::CopyOptionType::kHeader; - (yyval.copy_option_t)->header_ = true; - } -#line 9048 "parser.cpp" - break; + case 474: /* sparse_array_expr: long_sparse_array_expr */ +#line 3687 "parser.y" + { + (yyval.const_expr_t) = (yyvsp[0].const_expr_t); +} +#line 8782 "parser.cpp" + break; - case 502: /* copy_option: OFFSET LONG_VALUE */ -#line 3859 "parser.y" - { - (yyval.copy_option_t) = new infinity::CopyOption(); - (yyval.copy_option_t)->option_type_ = infinity::CopyOptionType::kOffset; - (yyval.copy_option_t)->offset_ = (yyvsp[0].long_value); - } -#line 9058 "parser.cpp" - break; + case 475: /* sparse_array_expr: double_sparse_array_expr */ +#line 3690 "parser.y" + { + (yyval.const_expr_t) = (yyvsp[0].const_expr_t); +} +#line 8790 "parser.cpp" + break; - case 503: /* copy_option: LIMIT LONG_VALUE */ -#line 3864 "parser.y" - { - (yyval.copy_option_t) = new infinity::CopyOption(); - (yyval.copy_option_t)->option_type_ = infinity::CopyOptionType::kLimit; - (yyval.copy_option_t)->limit_ = (yyvsp[0].long_value); - } -#line 9068 "parser.cpp" - break; + case 476: /* long_sparse_array_expr: unclosed_long_sparse_array_expr ']' */ +#line 3694 "parser.y" + { + (yyval.const_expr_t) = (yyvsp[-1].const_expr_t); +} +#line 8798 "parser.cpp" + break; + + case 477: /* unclosed_long_sparse_array_expr: '[' int_sparse_ele */ +#line 3698 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kLongSparseArray); + const_expr->long_sparse_array_.first.emplace_back((yyvsp[0].int_sparse_ele_t)->first); + const_expr->long_sparse_array_.second.emplace_back((yyvsp[0].int_sparse_ele_t)->second); + delete (yyvsp[0].int_sparse_ele_t); + (yyval.const_expr_t) = const_expr; +} +#line 8810 "parser.cpp" + break; + + case 478: /* unclosed_long_sparse_array_expr: unclosed_long_sparse_array_expr ',' int_sparse_ele */ +#line 3705 "parser.y" + { + (yyvsp[-2].const_expr_t)->long_sparse_array_.first.emplace_back((yyvsp[0].int_sparse_ele_t)->first); + (yyvsp[-2].const_expr_t)->long_sparse_array_.second.emplace_back((yyvsp[0].int_sparse_ele_t)->second); + delete (yyvsp[0].int_sparse_ele_t); + (yyval.const_expr_t) = (yyvsp[-2].const_expr_t); +} +#line 8821 "parser.cpp" + break; - case 504: /* copy_option: ROWLIMIT LONG_VALUE */ -#line 3869 "parser.y" - { - (yyval.copy_option_t) = new infinity::CopyOption(); - (yyval.copy_option_t)->option_type_ = infinity::CopyOptionType::kRowLimit; - (yyval.copy_option_t)->row_limit_ = (yyvsp[0].long_value); - } -#line 9078 "parser.cpp" - break; + case 479: /* double_sparse_array_expr: unclosed_double_sparse_array_expr ']' */ +#line 3712 "parser.y" + { + (yyval.const_expr_t) = (yyvsp[-1].const_expr_t); +} +#line 8829 "parser.cpp" + break; + + case 480: /* unclosed_double_sparse_array_expr: '[' float_sparse_ele */ +#line 3716 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDoubleSparseArray); + const_expr->double_sparse_array_.first.emplace_back((yyvsp[0].float_sparse_ele_t)->first); + const_expr->double_sparse_array_.second.emplace_back((yyvsp[0].float_sparse_ele_t)->second); + delete (yyvsp[0].float_sparse_ele_t); + (yyval.const_expr_t) = const_expr; +} +#line 8841 "parser.cpp" + break; + + case 481: /* unclosed_double_sparse_array_expr: unclosed_double_sparse_array_expr ',' float_sparse_ele */ +#line 3723 "parser.y" + { + (yyvsp[-2].const_expr_t)->double_sparse_array_.first.emplace_back((yyvsp[0].float_sparse_ele_t)->first); + (yyvsp[-2].const_expr_t)->double_sparse_array_.second.emplace_back((yyvsp[0].float_sparse_ele_t)->second); + delete (yyvsp[0].float_sparse_ele_t); + (yyval.const_expr_t) = (yyvsp[-2].const_expr_t); +} +#line 8852 "parser.cpp" + break; - case 505: /* file_path: STRING */ -#line 3875 "parser.y" - { - (yyval.str_value) = (yyvsp[0].str_value); - } -#line 9086 "parser.cpp" - break; + case 482: /* empty_array_expr: '[' ']' */ +#line 3730 "parser.y" + { + (yyval.const_expr_t) = new infinity::ConstantExpr(infinity::LiteralType::kEmptyArray); +} +#line 8860 "parser.cpp" + break; - case 506: /* if_exists: IF EXISTS */ -#line 3879 "parser.y" - { - (yyval.bool_value) = true; - } -#line 9092 "parser.cpp" - break; + case 483: /* int_sparse_ele: LONG_VALUE ':' LONG_VALUE */ +#line 3734 "parser.y" + { + (yyval.int_sparse_ele_t) = new std::pair{(yyvsp[-2].long_value), (yyvsp[0].long_value)}; +} +#line 8868 "parser.cpp" + break; - case 507: /* if_exists: %empty */ -#line 3880 "parser.y" - { - (yyval.bool_value) = false; - } -#line 9098 "parser.cpp" - break; + case 484: /* float_sparse_ele: LONG_VALUE ':' DOUBLE_VALUE */ +#line 3738 "parser.y" + { + (yyval.float_sparse_ele_t) = new std::pair{(yyvsp[-2].long_value), (yyvsp[0].double_value)}; +} +#line 8876 "parser.cpp" + break; - case 508: /* if_not_exists: IF NOT EXISTS */ -#line 3882 "parser.y" - { - (yyval.bool_value) = true; - } -#line 9104 "parser.cpp" - break; + case 485: /* array_expr: long_array_expr */ +#line 3742 "parser.y" + { + (yyval.const_expr_t) = (yyvsp[0].const_expr_t); +} +#line 8884 "parser.cpp" + break; - case 509: /* if_not_exists: %empty */ -#line 3883 "parser.y" - { - (yyval.bool_value) = false; - } -#line 9110 "parser.cpp" - break; + case 486: /* array_expr: double_array_expr */ +#line 3745 "parser.y" + { + (yyval.const_expr_t) = (yyvsp[0].const_expr_t); +} +#line 8892 "parser.cpp" + break; - case 512: /* if_not_exists_info: if_not_exists IDENTIFIER */ -#line 3898 "parser.y" - { - (yyval.if_not_exists_info_t) = new infinity::IfNotExistsInfo(); - (yyval.if_not_exists_info_t)->exists_ = true; - (yyval.if_not_exists_info_t)->if_not_exists_ = (yyvsp[-1].bool_value); - ParserHelper::ToLower((yyvsp[0].str_value)); - (yyval.if_not_exists_info_t)->info_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - } -#line 9123 "parser.cpp" - break; + case 487: /* long_array_expr: unclosed_long_array_expr ']' */ +#line 3749 "parser.y" + { + (yyval.const_expr_t) = (yyvsp[-1].const_expr_t); +} +#line 8900 "parser.cpp" + break; + + case 488: /* unclosed_long_array_expr: '[' LONG_VALUE */ +#line 3753 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kIntegerArray); + const_expr->long_array_.emplace_back((yyvsp[0].long_value)); + (yyval.const_expr_t) = const_expr; +} +#line 8910 "parser.cpp" + break; + + case 489: /* unclosed_long_array_expr: unclosed_long_array_expr ',' LONG_VALUE */ +#line 3758 "parser.y" + { + (yyvsp[-2].const_expr_t)->long_array_.emplace_back((yyvsp[0].long_value)); + (yyval.const_expr_t) = (yyvsp[-2].const_expr_t); +} +#line 8919 "parser.cpp" + break; - case 513: /* if_not_exists_info: %empty */ -#line 3906 "parser.y" - { - (yyval.if_not_exists_info_t) = new infinity::IfNotExistsInfo(); - } -#line 9131 "parser.cpp" - break; + case 490: /* double_array_expr: unclosed_double_array_expr ']' */ +#line 3763 "parser.y" + { + (yyval.const_expr_t) = (yyvsp[-1].const_expr_t); +} +#line 8927 "parser.cpp" + break; + + case 491: /* unclosed_double_array_expr: '[' DOUBLE_VALUE */ +#line 3767 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDoubleArray); + const_expr->double_array_.emplace_back((yyvsp[0].double_value)); + (yyval.const_expr_t) = const_expr; +} +#line 8937 "parser.cpp" + break; + + case 492: /* unclosed_double_array_expr: unclosed_double_array_expr ',' DOUBLE_VALUE */ +#line 3772 "parser.y" + { + (yyvsp[-2].const_expr_t)->double_array_.emplace_back((yyvsp[0].double_value)); + (yyval.const_expr_t) = (yyvsp[-2].const_expr_t); +} +#line 8946 "parser.cpp" + break; + + case 493: /* interval_expr: LONG_VALUE SECONDS */ +#line 3777 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kSecond; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} +#line 8957 "parser.cpp" + break; + + case 494: /* interval_expr: LONG_VALUE SECOND */ +#line 3783 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kSecond; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} +#line 8968 "parser.cpp" + break; + + case 495: /* interval_expr: LONG_VALUE MINUTES */ +#line 3789 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kMinute; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} +#line 8979 "parser.cpp" + break; + + case 496: /* interval_expr: LONG_VALUE MINUTE */ +#line 3795 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kMinute; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} +#line 8990 "parser.cpp" + break; + + case 497: /* interval_expr: LONG_VALUE HOURS */ +#line 3801 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kHour; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} +#line 9001 "parser.cpp" + break; + + case 498: /* interval_expr: LONG_VALUE HOUR */ +#line 3807 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kHour; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} +#line 9012 "parser.cpp" + break; - case 514: /* with_index_param_list: WITH '(' index_param_list ')' */ -#line 3910 "parser.y" - { - (yyval.with_index_param_list_t) = (yyvsp[-1].index_param_list_t); - } -#line 9139 "parser.cpp" - break; + case 499: /* interval_expr: LONG_VALUE DAYS */ +#line 3813 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kDay; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} +#line 9023 "parser.cpp" + break; + + case 500: /* interval_expr: LONG_VALUE DAY */ +#line 3819 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kDay; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} +#line 9034 "parser.cpp" + break; + + case 501: /* interval_expr: LONG_VALUE MONTHS */ +#line 3825 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kMonth; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} +#line 9045 "parser.cpp" + break; + + case 502: /* interval_expr: LONG_VALUE MONTH */ +#line 3831 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kMonth; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} +#line 9056 "parser.cpp" + break; + + case 503: /* interval_expr: LONG_VALUE YEARS */ +#line 3837 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kYear; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} +#line 9067 "parser.cpp" + break; + + case 504: /* interval_expr: LONG_VALUE YEAR */ +#line 3843 "parser.y" + { + infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); + const_expr->interval_type_ = infinity::TimeUnit::kYear; + const_expr->integer_value_ = (yyvsp[-1].long_value); + (yyval.const_expr_t) = const_expr; +} +#line 9078 "parser.cpp" + break; - case 515: /* with_index_param_list: %empty */ -#line 3913 "parser.y" - { - (yyval.with_index_param_list_t) = new std::vector(); - } + case 505: /* copy_option_list: copy_option */ +#line 3854 "parser.y" + { + (yyval.copy_option_array) = new std::vector(); + (yyval.copy_option_array)->push_back((yyvsp[0].copy_option_t)); +} +#line 9087 "parser.cpp" + break; + + case 506: /* copy_option_list: copy_option_list ',' copy_option */ +#line 3858 "parser.y" + { + (yyvsp[-2].copy_option_array)->push_back((yyvsp[0].copy_option_t)); + (yyval.copy_option_array) = (yyvsp[-2].copy_option_array); +} +#line 9096 "parser.cpp" + break; + + case 507: /* copy_option: FORMAT IDENTIFIER */ +#line 3863 "parser.y" + { + (yyval.copy_option_t) = new infinity::CopyOption(); + (yyval.copy_option_t)->option_type_ = infinity::CopyOptionType::kFormat; + if (strcasecmp((yyvsp[0].str_value), "csv") == 0) { + (yyval.copy_option_t)->file_type_ = infinity::CopyFileType::kCSV; + free((yyvsp[0].str_value)); + } else if (strcasecmp((yyvsp[0].str_value), "json") == 0) { + (yyval.copy_option_t)->file_type_ = infinity::CopyFileType::kJSON; + free((yyvsp[0].str_value)); + } else if (strcasecmp((yyvsp[0].str_value), "jsonl") == 0) { + (yyval.copy_option_t)->file_type_ = infinity::CopyFileType::kJSONL; + free((yyvsp[0].str_value)); + } else if (strcasecmp((yyvsp[0].str_value), "fvecs") == 0) { + (yyval.copy_option_t)->file_type_ = infinity::CopyFileType::kFVECS; + free((yyvsp[0].str_value)); + } else if (strcasecmp((yyvsp[0].str_value), "csr") == 0) { + (yyval.copy_option_t)->file_type_ = infinity::CopyFileType::kCSR; + free((yyvsp[0].str_value)); + } else if (strcasecmp((yyvsp[0].str_value), "bvecs") == 0) { + (yyval.copy_option_t)->file_type_ = infinity::CopyFileType::kBVECS; + free((yyvsp[0].str_value)); + } else if (strcasecmp((yyvsp[0].str_value), "parquet") == 0) { + (yyval.copy_option_t)->file_type_ = infinity::CopyFileType::kPARQUET; + free((yyvsp[0].str_value)); + } else { + free((yyvsp[0].str_value)); + delete (yyval.copy_option_t); + yyerror(&yyloc, scanner, result, "Unknown file format"); + YYERROR; + } +} +#line 9132 "parser.cpp" + break; + + case 508: /* copy_option: DELIMITER STRING */ +#line 3894 "parser.y" + { + (yyval.copy_option_t) = new infinity::CopyOption(); + (yyval.copy_option_t)->option_type_ = infinity::CopyOptionType::kDelimiter; + if(strlen((yyvsp[0].str_value)) > 1 && (yyvsp[0].str_value)[0] == '\\') { + if((yyvsp[0].str_value)[1] == 't') (yyval.copy_option_t)->delimiter_ = '\t'; + }else { + (yyval.copy_option_t)->delimiter_ = (yyvsp[0].str_value)[0]; + } + free((yyvsp[0].str_value)); +} #line 9147 "parser.cpp" - break; - - case 516: /* optional_table_properties_list: PROPERTIES '(' index_param_list ')' */ -#line 3917 "parser.y" - { - (yyval.with_index_param_list_t) = (yyvsp[-1].index_param_list_t); - } -#line 9155 "parser.cpp" - break; - - case 517: /* optional_table_properties_list: %empty */ -#line 3920 "parser.y" - { - (yyval.with_index_param_list_t) = nullptr; - } -#line 9163 "parser.cpp" - break; + break; + + case 509: /* copy_option: HEADER */ +#line 3904 "parser.y" + { + (yyval.copy_option_t) = new infinity::CopyOption(); + (yyval.copy_option_t)->option_type_ = infinity::CopyOptionType::kHeader; + (yyval.copy_option_t)->header_ = true; +} +#line 9157 "parser.cpp" + break; + + case 510: /* copy_option: OFFSET LONG_VALUE */ +#line 3909 "parser.y" + { + (yyval.copy_option_t) = new infinity::CopyOption(); + (yyval.copy_option_t)->option_type_ = infinity::CopyOptionType::kOffset; + (yyval.copy_option_t)->offset_ = (yyvsp[0].long_value); +} +#line 9167 "parser.cpp" + break; + + case 511: /* copy_option: LIMIT LONG_VALUE */ +#line 3914 "parser.y" + { + (yyval.copy_option_t) = new infinity::CopyOption(); + (yyval.copy_option_t)->option_type_ = infinity::CopyOptionType::kLimit; + (yyval.copy_option_t)->limit_ = (yyvsp[0].long_value); +} +#line 9177 "parser.cpp" + break; + + case 512: /* copy_option: ROWLIMIT LONG_VALUE */ +#line 3919 "parser.y" + { + (yyval.copy_option_t) = new infinity::CopyOption(); + (yyval.copy_option_t)->option_type_ = infinity::CopyOptionType::kRowLimit; + (yyval.copy_option_t)->row_limit_ = (yyvsp[0].long_value); +} +#line 9187 "parser.cpp" + break; - case 518: /* index_param_list: index_param */ -#line 3924 "parser.y" - { - (yyval.index_param_list_t) = new std::vector(); - (yyval.index_param_list_t)->push_back((yyvsp[0].index_param_t)); - } -#line 9172 "parser.cpp" - break; + case 513: /* file_path: STRING */ +#line 3925 "parser.y" + { + (yyval.str_value) = (yyvsp[0].str_value); +} +#line 9195 "parser.cpp" + break; + + case 514: /* if_exists: IF EXISTS */ +#line 3929 "parser.y" + { (yyval.bool_value) = true; } +#line 9201 "parser.cpp" + break; + + case 515: /* if_exists: %empty */ +#line 3930 "parser.y" + { (yyval.bool_value) = false; } +#line 9207 "parser.cpp" + break; - case 519: /* index_param_list: index_param_list ',' index_param */ -#line 3928 "parser.y" - { - (yyvsp[-2].index_param_list_t)->push_back((yyvsp[0].index_param_t)); - (yyval.index_param_list_t) = (yyvsp[-2].index_param_list_t); - } -#line 9181 "parser.cpp" - break; + case 516: /* if_not_exists: IF NOT EXISTS */ +#line 3932 "parser.y" + { (yyval.bool_value) = true; } +#line 9213 "parser.cpp" + break; - case 520: /* index_param: IDENTIFIER */ + case 517: /* if_not_exists: %empty */ #line 3933 "parser.y" - { - ParserHelper::ToLower((yyvsp[0].str_value)); - (yyval.index_param_t) = new infinity::InitParameter(); - (yyval.index_param_t)->param_name_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - } -#line 9192 "parser.cpp" - break; - - case 521: /* index_param: IDENTIFIER '=' IDENTIFIER */ -#line 3939 "parser.y" - { - ParserHelper::ToLower((yyvsp[-2].str_value)); - ParserHelper::ToLower((yyvsp[0].str_value)); - (yyval.index_param_t) = new infinity::InitParameter(); - (yyval.index_param_t)->param_name_ = (yyvsp[-2].str_value); - free((yyvsp[-2].str_value)); - - (yyval.index_param_t)->param_value_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - } -#line 9207 "parser.cpp" - break; + { (yyval.bool_value) = false; } +#line 9219 "parser.cpp" + break; + + case 520: /* if_not_exists_info: if_not_exists IDENTIFIER */ +#line 3948 "parser.y" + { + (yyval.if_not_exists_info_t) = new infinity::IfNotExistsInfo(); + (yyval.if_not_exists_info_t)->exists_ = true; + (yyval.if_not_exists_info_t)->if_not_exists_ = (yyvsp[-1].bool_value); + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.if_not_exists_info_t)->info_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); +} +#line 9232 "parser.cpp" + break; - case 522: /* index_param: IDENTIFIER '=' STRING */ -#line 3949 "parser.y" - { - ParserHelper::ToLower((yyvsp[-2].str_value)); - ParserHelper::ToLower((yyvsp[0].str_value)); - (yyval.index_param_t) = new infinity::InitParameter(); - (yyval.index_param_t)->param_name_ = (yyvsp[-2].str_value); - free((yyvsp[-2].str_value)); - - (yyval.index_param_t)->param_value_ = (yyvsp[0].str_value); - free((yyvsp[0].str_value)); - } -#line 9222 "parser.cpp" - break; + case 521: /* if_not_exists_info: %empty */ +#line 3956 "parser.y" + { + (yyval.if_not_exists_info_t) = new infinity::IfNotExistsInfo(); +} +#line 9240 "parser.cpp" + break; - case 523: /* index_param: IDENTIFIER '=' LONG_VALUE */ -#line 3959 "parser.y" - { - ParserHelper::ToLower((yyvsp[-2].str_value)); - (yyval.index_param_t) = new infinity::InitParameter(); - (yyval.index_param_t)->param_name_ = (yyvsp[-2].str_value); - free((yyvsp[-2].str_value)); + case 522: /* with_index_param_list: WITH '(' index_param_list ')' */ +#line 3960 "parser.y" + { + (yyval.with_index_param_list_t) = (yyvsp[-1].index_param_list_t); +} +#line 9248 "parser.cpp" + break; - (yyval.index_param_t)->param_value_ = std::to_string((yyvsp[0].long_value)); - } -#line 9235 "parser.cpp" - break; + case 523: /* with_index_param_list: %empty */ +#line 3963 "parser.y" + { + (yyval.with_index_param_list_t) = new std::vector(); +} +#line 9256 "parser.cpp" + break; - case 524: /* index_param: IDENTIFIER '=' DOUBLE_VALUE */ + case 524: /* optional_table_properties_list: PROPERTIES '(' index_param_list ')' */ #line 3967 "parser.y" - { - ParserHelper::ToLower((yyvsp[-2].str_value)); - (yyval.index_param_t) = new infinity::InitParameter(); - (yyval.index_param_t)->param_name_ = (yyvsp[-2].str_value); - free((yyvsp[-2].str_value)); + { + (yyval.with_index_param_list_t) = (yyvsp[-1].index_param_list_t); +} +#line 9264 "parser.cpp" + break; - (yyval.index_param_t)->param_value_ = std::to_string((yyvsp[0].double_value)); - } -#line 9248 "parser.cpp" - break; + case 525: /* optional_table_properties_list: %empty */ +#line 3970 "parser.y" + { + (yyval.with_index_param_list_t) = nullptr; +} +#line 9272 "parser.cpp" + break; + + case 526: /* index_param_list: index_param */ +#line 3974 "parser.y" + { + (yyval.index_param_list_t) = new std::vector(); + (yyval.index_param_list_t)->push_back((yyvsp[0].index_param_t)); +} +#line 9281 "parser.cpp" + break; - case 525: /* index_info: '(' IDENTIFIER ')' USING IDENTIFIER with_index_param_list */ + case 527: /* index_param_list: index_param_list ',' index_param */ #line 3978 "parser.y" - { - ParserHelper::ToLower((yyvsp[-1].str_value)); - infinity::IndexType index_type = infinity::IndexType::kInvalid; - if (strcmp((yyvsp[-1].str_value), "fulltext") == 0) { - index_type = infinity::IndexType::kFullText; - } else if (strcmp((yyvsp[-1].str_value), "hnsw") == 0) { - index_type = infinity::IndexType::kHnsw; - } else if (strcmp((yyvsp[-1].str_value), "bmp") == 0) { - index_type = infinity::IndexType::kBMP; - } else if (strcmp((yyvsp[-1].str_value), "ivf") == 0) { - index_type = infinity::IndexType::kIVF; - } else if (strcmp((yyvsp[-1].str_value), "emvb") == 0) { - index_type = infinity::IndexType::kEMVB; - } else if (strcmp((yyvsp[-1].str_value), "diskann") == 0) { - index_type = infinity::IndexType::kDiskAnn; - } else { - free((yyvsp[-1].str_value)); - free((yyvsp[-4].str_value)); - delete (yyvsp[0].with_index_param_list_t); - yyerror(&yyloc, scanner, result, "Unknown index type"); - YYERROR; - } - free((yyvsp[-1].str_value)); + { + (yyvsp[-2].index_param_list_t)->push_back((yyvsp[0].index_param_t)); + (yyval.index_param_list_t) = (yyvsp[-2].index_param_list_t); +} +#line 9290 "parser.cpp" + break; + + case 528: /* index_param: IDENTIFIER */ +#line 3983 "parser.y" + { + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.index_param_t) = new infinity::InitParameter(); + (yyval.index_param_t)->param_name_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); +} +#line 9301 "parser.cpp" + break; + + case 529: /* index_param: IDENTIFIER '=' IDENTIFIER */ +#line 3989 "parser.y" + { + ParserHelper::ToLower((yyvsp[-2].str_value)); + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.index_param_t) = new infinity::InitParameter(); + (yyval.index_param_t)->param_name_ = (yyvsp[-2].str_value); + free((yyvsp[-2].str_value)); + + (yyval.index_param_t)->param_value_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); +} +#line 9316 "parser.cpp" + break; + + case 530: /* index_param: IDENTIFIER '=' STRING */ +#line 3999 "parser.y" + { + ParserHelper::ToLower((yyvsp[-2].str_value)); + ParserHelper::ToLower((yyvsp[0].str_value)); + (yyval.index_param_t) = new infinity::InitParameter(); + (yyval.index_param_t)->param_name_ = (yyvsp[-2].str_value); + free((yyvsp[-2].str_value)); + + (yyval.index_param_t)->param_value_ = (yyvsp[0].str_value); + free((yyvsp[0].str_value)); +} +#line 9331 "parser.cpp" + break; - (yyval.index_info_t) = new infinity::IndexInfo(); + case 531: /* index_param: IDENTIFIER '=' LONG_VALUE */ +#line 4009 "parser.y" + { + ParserHelper::ToLower((yyvsp[-2].str_value)); + (yyval.index_param_t) = new infinity::InitParameter(); + (yyval.index_param_t)->param_name_ = (yyvsp[-2].str_value); + free((yyvsp[-2].str_value)); - (yyval.index_info_t)->index_type_ = index_type; - (yyval.index_info_t)->column_name_ = (yyvsp[-4].str_value); - (yyval.index_info_t)->index_param_list_ = (yyvsp[0].with_index_param_list_t); - free((yyvsp[-4].str_value)); - } -#line 9284 "parser.cpp" - break; + (yyval.index_param_t)->param_value_ = std::to_string((yyvsp[0].long_value)); +} +#line 9344 "parser.cpp" + break; + + case 532: /* index_param: IDENTIFIER '=' DOUBLE_VALUE */ +#line 4017 "parser.y" + { + ParserHelper::ToLower((yyvsp[-2].str_value)); + (yyval.index_param_t) = new infinity::InitParameter(); + (yyval.index_param_t)->param_name_ = (yyvsp[-2].str_value); + free((yyvsp[-2].str_value)); + + (yyval.index_param_t)->param_value_ = std::to_string((yyvsp[0].double_value)); +} +#line 9357 "parser.cpp" + break; + + case 533: /* index_info: '(' IDENTIFIER ')' USING IDENTIFIER with_index_param_list */ +#line 4028 "parser.y" + { + ParserHelper::ToLower((yyvsp[-1].str_value)); + infinity::IndexType index_type = infinity::IndexType::kInvalid; + if(strcmp((yyvsp[-1].str_value), "fulltext") == 0) { + index_type = infinity::IndexType::kFullText; + } else if (strcmp((yyvsp[-1].str_value), "hnsw") == 0) { + index_type = infinity::IndexType::kHnsw; + } else if (strcmp((yyvsp[-1].str_value), "bmp") == 0) { + index_type = infinity::IndexType::kBMP; + } else if (strcmp((yyvsp[-1].str_value), "ivf") == 0) { + index_type = infinity::IndexType::kIVF; + } else if (strcmp((yyvsp[-1].str_value), "emvb") == 0) { + index_type = infinity::IndexType::kEMVB; + } else if(strcmp((yyvsp[-1].str_value), "diskann") == 0){ + index_type = infinity::IndexType::kDiskAnn; + } else { + free((yyvsp[-1].str_value)); + free((yyvsp[-4].str_value)); + delete (yyvsp[0].with_index_param_list_t); + yyerror(&yyloc, scanner, result, "Unknown index type"); + YYERROR; + } + free((yyvsp[-1].str_value)); - case 526: /* index_info: '(' IDENTIFIER ')' */ -#line 4009 "parser.y" - { - (yyval.index_info_t) = new infinity::IndexInfo(); - (yyval.index_info_t)->index_type_ = infinity::IndexType::kSecondary; - (yyval.index_info_t)->column_name_ = (yyvsp[-1].str_value); - free((yyvsp[-1].str_value)); - } -#line 9295 "parser.cpp" - break; + (yyval.index_info_t) = new infinity::IndexInfo(); -#line 9299 "parser.cpp" + (yyval.index_info_t)->index_type_ = index_type; + (yyval.index_info_t)->column_name_ = (yyvsp[-4].str_value); + (yyval.index_info_t)->index_param_list_ = (yyvsp[0].with_index_param_list_t); + free((yyvsp[-4].str_value)); +} +#line 9393 "parser.cpp" + break; + + case 534: /* index_info: '(' IDENTIFIER ')' */ +#line 4059 "parser.y" + { + (yyval.index_info_t) = new infinity::IndexInfo(); + (yyval.index_info_t)->index_type_ = infinity::IndexType::kSecondary; + (yyval.index_info_t)->column_name_ = (yyvsp[-1].str_value); + free((yyvsp[-1].str_value)); +} +#line 9404 "parser.cpp" + break; - default: - break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT("-> $$ =", YY_CAST(yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); - - YYPOPSTACK(yylen); - yylen = 0; - - *++yyvsp = yyval; - *++yylsp = yyloc; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - { - const int yylhs = yyr1[yyn] - YYNTOKENS; - const int yyi = yypgoto[yylhs] + *yyssp; - yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp ? yytable[yyi] : yydefgoto[yylhs]); + +#line 9408 "parser.cpp" + + default: break; } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + + *++yyvsp = yyval; + *++yylsp = yyloc; + + /* Now 'shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + { + const int yylhs = yyr1[yyn] - YYNTOKENS; + const int yyi = yypgoto[yylhs] + *yyssp; + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp + ? yytable[yyi] + : yydefgoto[yylhs]); + } + + goto yynewstate; - goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == SQLEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE(yychar); - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) { - ++yynerrs; - { - yypcontext_t yyctx = {yyssp, yytoken, &yylloc}; - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = yysyntax_error(&yymsg_alloc, &yymsg, &yyctx); - if (yysyntax_error_status == 0) + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == SQLEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; + { + yypcontext_t yyctx + = {yyssp, yytoken, &yylloc}; + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == -1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = YY_CAST (char *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); + if (yymsg) + { + yysyntax_error_status + = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); yymsgp = yymsg; - else if (yysyntax_error_status == -1) { - if (yymsg != yymsgbuf) - YYSTACK_FREE(yymsg); - yymsg = YY_CAST(char *, YYSTACK_ALLOC(YY_CAST(YYSIZE_T, yymsg_alloc))); - if (yymsg) { - yysyntax_error_status = yysyntax_error(&yymsg_alloc, &yymsg, &yyctx); - yymsgp = yymsg; - } else { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = YYENOMEM; - } - } - yyerror(&yylloc, scanner, result, yymsgp); - if (yysyntax_error_status == YYENOMEM) - YYNOMEM; - } + } + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = YYENOMEM; + } + } + yyerror (&yylloc, scanner, result, yymsgp); + if (yysyntax_error_status == YYENOMEM) + YYNOMEM; + } } - yyerror_range[1] = yylloc; - if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + yyerror_range[1] = yylloc; + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ - if (yychar <= SQLEOF) { - /* Return failure if at end of input. */ - if (yychar == SQLEOF) - YYABORT; - } else { - yydestruct("Error: discarding", yytoken, &yylval, &yylloc, scanner, result); - yychar = SQLEMPTY; + if (yychar <= SQLEOF) + { + /* Return failure if at end of input. */ + if (yychar == SQLEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval, &yylloc, scanner, result); + yychar = SQLEMPTY; } } - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and the - label yyerrorlab therefore never appears in user code. */ - if (0) - YYERROR; - ++yynerrs; + /* Pacify compilers when the user code never invokes YYERROR and the + label yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR; + ++yynerrs; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK(yylen); - yylen = 0; - YY_STACK_PRINT(yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - /* Pop stack until we find a state that shifts the error token. */ - for (;;) { - yyn = yypact[yystate]; - if (!yypact_value_is_default(yyn)) { - yyn += YYSYMBOL_YYerror; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) { - yyn = yytable[yyn]; - if (0 < yyn) - break; + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + /* Pop stack until we find a state that shifts the error token. */ + for (;;) + { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; } } - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; - yyerror_range[1] = *yylsp; - yydestruct("Error: popping", YY_ACCESSING_SYMBOL(yystate), yyvsp, yylsp, scanner, result); - YYPOPSTACK(1); - yystate = *yyssp; - YY_STACK_PRINT(yyss, yyssp); + yyerror_range[1] = *yylsp; + yydestruct ("Error: popping", + YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, scanner, result); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); } - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END - yyerror_range[2] = yylloc; - ++yylsp; - YYLLOC_DEFAULT(*yylsp, yyerror_range, 2); + yyerror_range[2] = yylloc; + ++yylsp; + YYLLOC_DEFAULT (*yylsp, yyerror_range, 2); - /* Shift the error token. */ - YY_SYMBOL_PRINT("Shifting", YY_ACCESSING_SYMBOL(yyn), yyvsp, yylsp); + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; - yystate = yyn; - goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: - yyresult = 0; - goto yyreturnlab; + yyresult = 0; + goto yyreturnlab; + /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: - yyresult = 1; - goto yyreturnlab; + yyresult = 1; + goto yyreturnlab; + /*-----------------------------------------------------------. | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | `-----------------------------------------------------------*/ yyexhaustedlab: - yyerror(&yylloc, scanner, result, YY_("memory exhausted")); - yyresult = 2; - goto yyreturnlab; + yyerror (&yylloc, scanner, result, YY_("memory exhausted")); + yyresult = 2; + goto yyreturnlab; + /*----------------------------------------------------------. | yyreturnlab -- parsing is finished, clean up and return. | `----------------------------------------------------------*/ yyreturnlab: - if (yychar != SQLEMPTY) { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE(yychar); - yydestruct("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc, scanner, result); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK(yylen); - YY_STACK_PRINT(yyss, yyssp); - while (yyssp != yyss) { - yydestruct("Cleanup: popping", YY_ACCESSING_SYMBOL(+*yyssp), yyvsp, yylsp, scanner, result); - YYPOPSTACK(1); + if (yychar != SQLEMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, &yylloc, scanner, result); + } + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, scanner, result); + YYPOPSTACK (1); } #ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE(yyss); + if (yyss != yyssa) + YYSTACK_FREE (yyss); #endif - if (yymsg != yymsgbuf) - YYSTACK_FREE(yymsg); - return yyresult; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + return yyresult; } -#line 4016 "parser.y" +#line 4066 "parser.y" + -void yyerror(YYLTYPE *llocp, void *lexer, infinity::ParserResult *result, const char *msg) { - if (result->IsError()) - return; +void +yyerror(YYLTYPE * llocp, void* lexer, infinity::ParserResult* result, const char* msg) { + if(result->IsError()) return ; result->error_message_ = std::string(msg) + ", " + std::to_string(llocp->first_column); - fprintf(stderr, "Error: %s, %d:%d\n", msg, llocp->first_line, llocp->first_column); + fprintf(stderr, "Error: %s, %d:%d\n", msg, llocp->first_line, llocp->first_column); } diff --git a/src/parser/parser.h b/src/parser/parser.h index b1488c3aef..0adebe02a0 100644 --- a/src/parser/parser.h +++ b/src/parser/parser.h @@ -36,33 +36,30 @@ private implementation details that can be changed or removed. */ #ifndef YY_SQL_PARSER_H_INCLUDED -#define YY_SQL_PARSER_H_INCLUDED +# define YY_SQL_PARSER_H_INCLUDED /* Debug traces. */ #ifndef SQLDEBUG -#if defined YYDEBUG +# if defined YYDEBUG #if YYDEBUG -#define SQLDEBUG 1 -#else -#define SQLDEBUG 0 -#endif -#else /* ! defined YYDEBUG */ -#define SQLDEBUG 1 -#endif /* ! defined YYDEBUG */ -#endif /* ! defined SQLDEBUG */ +# define SQLDEBUG 1 +# else +# define SQLDEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define SQLDEBUG 1 +# endif /* ! defined YYDEBUG */ +#endif /* ! defined SQLDEBUG */ #if SQLDEBUG extern int sqldebug; #endif /* "%code requires" blocks. */ #line 11 "parser.y" -#include "defer_operation.h" + #include "expression.h" -#include "parser_helper.h" #include "parser_result.h" -#include "statement/admin_statement.h" +#include "defer_operation.h" #include "statement/alter_statement.h" -#include "statement/command_statement.h" -#include "statement/compact_statement.h" #include "statement/copy_statement.h" #include "statement/create_statement.h" #include "statement/delete_statement.h" @@ -70,17 +67,21 @@ extern int sqldebug; #include "statement/execute_statement.h" #include "statement/explain_statement.h" #include "statement/flush_statement.h" -#include "statement/insert_statement.h" #include "statement/optimize_statement.h" +#include "statement/insert_statement.h" #include "statement/prepare_statement.h" #include "statement/select_statement.h" #include "statement/show_statement.h" #include "statement/update_statement.h" +#include "statement/command_statement.h" +#include "statement/compact_statement.h" +#include "statement/admin_statement.h" #include "table_reference/base_table_reference.h" -#include "table_reference/cross_product_reference.h" #include "table_reference/join_reference.h" -#include "table_reference/subquery_reference.h" +#include "table_reference/cross_product_reference.h" #include "table_reference/table_reference.h" +#include "table_reference/subquery_reference.h" +#include "parser_helper.h" #include @@ -96,343 +97,353 @@ struct SQL_LTYPE { int total_column; int string_length; - std::vector parameters; + std::vector parameters; }; #define SQLLTYPE SQL_LTYPE #define SQLLTYPE_IS_DECLARED 1 -#define YY_USER_ACTION \ - yylloc->first_line = yylloc->last_line; \ - yylloc->first_column = yylloc->last_column; \ - for (int i = 0; yytext[i] != '\0'; ++i) { \ - yylloc->total_column++; \ - yylloc->string_length++; \ - if (yytext[i] == '\n') { \ - yylloc->last_line++; \ - yylloc->last_column = 0; \ - } else { \ - yylloc->last_column++; \ - } \ +#define YY_USER_ACTION \ + yylloc->first_line = yylloc->last_line; \ + yylloc->first_column = yylloc->last_column; \ + for(int i = 0; yytext[i] != '\0'; ++ i) { \ + yylloc->total_column++; \ + yylloc->string_length++; \ + if (yytext[i] == '\n') { \ + yylloc->last_line++; \ + yylloc->last_column = 0; \ + } else { \ + yylloc->last_column++; \ + } \ } #line 121 "parser.h" /* Token kinds. */ #ifndef SQLTOKENTYPE -#define SQLTOKENTYPE -enum sqltokentype { +# define SQLTOKENTYPE + enum sqltokentype + { SQLEMPTY = -2, - SQLEOF = 0, /* "end of file" */ - SQLerror = 256, /* error */ - SQLUNDEF = 257, /* "invalid token" */ - IDENTIFIER = 258, /* IDENTIFIER */ - STRING = 259, /* STRING */ - DOUBLE_VALUE = 260, /* DOUBLE_VALUE */ - LONG_VALUE = 261, /* LONG_VALUE */ - CREATE = 262, /* CREATE */ - SELECT = 263, /* SELECT */ - INSERT = 264, /* INSERT */ - DROP = 265, /* DROP */ - UPDATE = 266, /* UPDATE */ - DELETE = 267, /* DELETE */ - COPY = 268, /* COPY */ - SET = 269, /* SET */ - EXPLAIN = 270, /* EXPLAIN */ - SHOW = 271, /* SHOW */ - ALTER = 272, /* ALTER */ - EXECUTE = 273, /* EXECUTE */ - PREPARE = 274, /* PREPARE */ - UNION = 275, /* UNION */ - ALL = 276, /* ALL */ - INTERSECT = 277, /* INTERSECT */ - COMPACT = 278, /* COMPACT */ - LOCK = 279, /* LOCK */ - UNLOCK = 280, /* UNLOCK */ - ADD = 281, /* ADD */ - RENAME = 282, /* RENAME */ - EXCEPT = 283, /* EXCEPT */ - FLUSH = 284, /* FLUSH */ - USE = 285, /* USE */ - OPTIMIZE = 286, /* OPTIMIZE */ - PROPERTIES = 287, /* PROPERTIES */ - DATABASE = 288, /* DATABASE */ - TABLE = 289, /* TABLE */ - COLLECTION = 290, /* COLLECTION */ - TABLES = 291, /* TABLES */ - INTO = 292, /* INTO */ - VALUES = 293, /* VALUES */ - VIEW = 294, /* VIEW */ - INDEX = 295, /* INDEX */ - VIEWS = 296, /* VIEWS */ - DATABASES = 297, /* DATABASES */ - SEGMENT = 298, /* SEGMENT */ - SEGMENTS = 299, /* SEGMENTS */ - BLOCK = 300, /* BLOCK */ - BLOCKS = 301, /* BLOCKS */ - COLUMN = 302, /* COLUMN */ - COLUMNS = 303, /* COLUMNS */ - INDEXES = 304, /* INDEXES */ - CHUNK = 305, /* CHUNK */ - GROUP = 306, /* GROUP */ - BY = 307, /* BY */ - HAVING = 308, /* HAVING */ - AS = 309, /* AS */ - NATURAL = 310, /* NATURAL */ - JOIN = 311, /* JOIN */ - LEFT = 312, /* LEFT */ - RIGHT = 313, /* RIGHT */ - OUTER = 314, /* OUTER */ - FULL = 315, /* FULL */ - ON = 316, /* ON */ - INNER = 317, /* INNER */ - CROSS = 318, /* CROSS */ - DISTINCT = 319, /* DISTINCT */ - WHERE = 320, /* WHERE */ - ORDER = 321, /* ORDER */ - LIMIT = 322, /* LIMIT */ - OFFSET = 323, /* OFFSET */ - ASC = 324, /* ASC */ - DESC = 325, /* DESC */ - IF = 326, /* IF */ - NOT = 327, /* NOT */ - EXISTS = 328, /* EXISTS */ - IN = 329, /* IN */ - FROM = 330, /* FROM */ - TO = 331, /* TO */ - WITH = 332, /* WITH */ - DELIMITER = 333, /* DELIMITER */ - FORMAT = 334, /* FORMAT */ - HEADER = 335, /* HEADER */ - HIGHLIGHT = 336, /* HIGHLIGHT */ - CAST = 337, /* CAST */ - END = 338, /* END */ - CASE = 339, /* CASE */ - ELSE = 340, /* ELSE */ - THEN = 341, /* THEN */ - WHEN = 342, /* WHEN */ - UNNEST = 343, /* UNNEST */ - BOOLEAN = 344, /* BOOLEAN */ - INTEGER = 345, /* INTEGER */ - INT = 346, /* INT */ - TINYINT = 347, /* TINYINT */ - SMALLINT = 348, /* SMALLINT */ - BIGINT = 349, /* BIGINT */ - HUGEINT = 350, /* HUGEINT */ - VARCHAR = 351, /* VARCHAR */ - FLOAT = 352, /* FLOAT */ - DOUBLE = 353, /* DOUBLE */ - REAL = 354, /* REAL */ - DECIMAL = 355, /* DECIMAL */ - DATE = 356, /* DATE */ - TIME = 357, /* TIME */ - DATETIME = 358, /* DATETIME */ - FLOAT16 = 359, /* FLOAT16 */ - BFLOAT16 = 360, /* BFLOAT16 */ - UNSIGNED = 361, /* UNSIGNED */ - TIMESTAMP = 362, /* TIMESTAMP */ - UUID = 363, /* UUID */ - POINT = 364, /* POINT */ - LINE = 365, /* LINE */ - LSEG = 366, /* LSEG */ - BOX = 367, /* BOX */ - PATH = 368, /* PATH */ - POLYGON = 369, /* POLYGON */ - CIRCLE = 370, /* CIRCLE */ - BLOB = 371, /* BLOB */ - BITMAP = 372, /* BITMAP */ - EMBEDDING = 373, /* EMBEDDING */ - VECTOR = 374, /* VECTOR */ - BIT = 375, /* BIT */ - TEXT = 376, /* TEXT */ - MULTIVECTOR = 377, /* MULTIVECTOR */ - TENSOR = 378, /* TENSOR */ - SPARSE = 379, /* SPARSE */ - TENSORARRAY = 380, /* TENSORARRAY */ - IGNORE = 381, /* IGNORE */ - PRIMARY = 382, /* PRIMARY */ - KEY = 383, /* KEY */ - UNIQUE = 384, /* UNIQUE */ - NULLABLE = 385, /* NULLABLE */ - IS = 386, /* IS */ - DEFAULT = 387, /* DEFAULT */ - COMMENT = 388, /* COMMENT */ - TRUE = 389, /* TRUE */ - FALSE = 390, /* FALSE */ - INTERVAL = 391, /* INTERVAL */ - SECOND = 392, /* SECOND */ - SECONDS = 393, /* SECONDS */ - MINUTE = 394, /* MINUTE */ - MINUTES = 395, /* MINUTES */ - HOUR = 396, /* HOUR */ - HOURS = 397, /* HOURS */ - DAY = 398, /* DAY */ - DAYS = 399, /* DAYS */ - MONTH = 400, /* MONTH */ - MONTHS = 401, /* MONTHS */ - YEAR = 402, /* YEAR */ - YEARS = 403, /* YEARS */ - EQUAL = 404, /* EQUAL */ - NOT_EQ = 405, /* NOT_EQ */ - LESS_EQ = 406, /* LESS_EQ */ - GREATER_EQ = 407, /* GREATER_EQ */ - BETWEEN = 408, /* BETWEEN */ - AND = 409, /* AND */ - OR = 410, /* OR */ - EXTRACT = 411, /* EXTRACT */ - LIKE = 412, /* LIKE */ - DATA = 413, /* DATA */ - LOG = 414, /* LOG */ - BUFFER = 415, /* BUFFER */ - TRANSACTIONS = 416, /* TRANSACTIONS */ - TRANSACTION = 417, /* TRANSACTION */ - MEMINDEX = 418, /* MEMINDEX */ - USING = 419, /* USING */ - SESSION = 420, /* SESSION */ - GLOBAL = 421, /* GLOBAL */ - OFF = 422, /* OFF */ - EXPORT = 423, /* EXPORT */ - CONFIGS = 424, /* CONFIGS */ - CONFIG = 425, /* CONFIG */ - PROFILES = 426, /* PROFILES */ - VARIABLES = 427, /* VARIABLES */ - VARIABLE = 428, /* VARIABLE */ - DELTA = 429, /* DELTA */ - LOGS = 430, /* LOGS */ - CATALOGS = 431, /* CATALOGS */ - CATALOG = 432, /* CATALOG */ - SEARCH = 433, /* SEARCH */ - MATCH = 434, /* MATCH */ - MAXSIM = 435, /* MAXSIM */ - QUERY = 436, /* QUERY */ - QUERIES = 437, /* QUERIES */ - FUSION = 438, /* FUSION */ - ROWLIMIT = 439, /* ROWLIMIT */ - ADMIN = 440, /* ADMIN */ - LEADER = 441, /* LEADER */ - FOLLOWER = 442, /* FOLLOWER */ - LEARNER = 443, /* LEARNER */ - CONNECT = 444, /* CONNECT */ - STANDALONE = 445, /* STANDALONE */ - NODES = 446, /* NODES */ - NODE = 447, /* NODE */ - REMOVE = 448, /* REMOVE */ - SNAPSHOT = 449, /* SNAPSHOT */ - SNAPSHOTS = 450, /* SNAPSHOTS */ - RECOVER = 451, /* RECOVER */ - PERSISTENCE = 452, /* PERSISTENCE */ - OBJECT = 453, /* OBJECT */ - OBJECTS = 454, /* OBJECTS */ - FILES = 455, /* FILES */ - MEMORY = 456, /* MEMORY */ - ALLOCATION = 457, /* ALLOCATION */ - NUMBER = 458 /* NUMBER */ -}; -typedef enum sqltokentype sqltoken_kind_t; + SQLEOF = 0, /* "end of file" */ + SQLerror = 256, /* error */ + SQLUNDEF = 257, /* "invalid token" */ + IDENTIFIER = 258, /* IDENTIFIER */ + STRING = 259, /* STRING */ + DOUBLE_VALUE = 260, /* DOUBLE_VALUE */ + LONG_VALUE = 261, /* LONG_VALUE */ + CREATE = 262, /* CREATE */ + SELECT = 263, /* SELECT */ + INSERT = 264, /* INSERT */ + DROP = 265, /* DROP */ + UPDATE = 266, /* UPDATE */ + DELETE = 267, /* DELETE */ + COPY = 268, /* COPY */ + SET = 269, /* SET */ + EXPLAIN = 270, /* EXPLAIN */ + SHOW = 271, /* SHOW */ + ALTER = 272, /* ALTER */ + EXECUTE = 273, /* EXECUTE */ + PREPARE = 274, /* PREPARE */ + UNION = 275, /* UNION */ + ALL = 276, /* ALL */ + INTERSECT = 277, /* INTERSECT */ + COMPACT = 278, /* COMPACT */ + LOCK = 279, /* LOCK */ + UNLOCK = 280, /* UNLOCK */ + ADD = 281, /* ADD */ + RENAME = 282, /* RENAME */ + EXCEPT = 283, /* EXCEPT */ + FLUSH = 284, /* FLUSH */ + USE = 285, /* USE */ + OPTIMIZE = 286, /* OPTIMIZE */ + PROPERTIES = 287, /* PROPERTIES */ + DATABASE = 288, /* DATABASE */ + TABLE = 289, /* TABLE */ + COLLECTION = 290, /* COLLECTION */ + TABLES = 291, /* TABLES */ + INTO = 292, /* INTO */ + VALUES = 293, /* VALUES */ + VIEW = 294, /* VIEW */ + INDEX = 295, /* INDEX */ + VIEWS = 296, /* VIEWS */ + DATABASES = 297, /* DATABASES */ + SEGMENT = 298, /* SEGMENT */ + SEGMENTS = 299, /* SEGMENTS */ + BLOCK = 300, /* BLOCK */ + BLOCKS = 301, /* BLOCKS */ + COLUMN = 302, /* COLUMN */ + COLUMNS = 303, /* COLUMNS */ + INDEXES = 304, /* INDEXES */ + CHUNK = 305, /* CHUNK */ + SYSTEM = 306, /* SYSTEM */ + GROUP = 307, /* GROUP */ + BY = 308, /* BY */ + HAVING = 309, /* HAVING */ + AS = 310, /* AS */ + NATURAL = 311, /* NATURAL */ + JOIN = 312, /* JOIN */ + LEFT = 313, /* LEFT */ + RIGHT = 314, /* RIGHT */ + OUTER = 315, /* OUTER */ + FULL = 316, /* FULL */ + ON = 317, /* ON */ + INNER = 318, /* INNER */ + CROSS = 319, /* CROSS */ + DISTINCT = 320, /* DISTINCT */ + WHERE = 321, /* WHERE */ + ORDER = 322, /* ORDER */ + LIMIT = 323, /* LIMIT */ + OFFSET = 324, /* OFFSET */ + ASC = 325, /* ASC */ + DESC = 326, /* DESC */ + IF = 327, /* IF */ + NOT = 328, /* NOT */ + EXISTS = 329, /* EXISTS */ + IN = 330, /* IN */ + FROM = 331, /* FROM */ + TO = 332, /* TO */ + WITH = 333, /* WITH */ + DELIMITER = 334, /* DELIMITER */ + FORMAT = 335, /* FORMAT */ + HEADER = 336, /* HEADER */ + HIGHLIGHT = 337, /* HIGHLIGHT */ + CAST = 338, /* CAST */ + END = 339, /* END */ + CASE = 340, /* CASE */ + ELSE = 341, /* ELSE */ + THEN = 342, /* THEN */ + WHEN = 343, /* WHEN */ + UNNEST = 344, /* UNNEST */ + BOOLEAN = 345, /* BOOLEAN */ + INTEGER = 346, /* INTEGER */ + INT = 347, /* INT */ + TINYINT = 348, /* TINYINT */ + SMALLINT = 349, /* SMALLINT */ + BIGINT = 350, /* BIGINT */ + HUGEINT = 351, /* HUGEINT */ + VARCHAR = 352, /* VARCHAR */ + FLOAT = 353, /* FLOAT */ + DOUBLE = 354, /* DOUBLE */ + REAL = 355, /* REAL */ + DECIMAL = 356, /* DECIMAL */ + DATE = 357, /* DATE */ + TIME = 358, /* TIME */ + DATETIME = 359, /* DATETIME */ + FLOAT16 = 360, /* FLOAT16 */ + BFLOAT16 = 361, /* BFLOAT16 */ + UNSIGNED = 362, /* UNSIGNED */ + TIMESTAMP = 363, /* TIMESTAMP */ + UUID = 364, /* UUID */ + POINT = 365, /* POINT */ + LINE = 366, /* LINE */ + LSEG = 367, /* LSEG */ + BOX = 368, /* BOX */ + PATH = 369, /* PATH */ + POLYGON = 370, /* POLYGON */ + CIRCLE = 371, /* CIRCLE */ + BLOB = 372, /* BLOB */ + BITMAP = 373, /* BITMAP */ + EMBEDDING = 374, /* EMBEDDING */ + VECTOR = 375, /* VECTOR */ + BIT = 376, /* BIT */ + TEXT = 377, /* TEXT */ + MULTIVECTOR = 378, /* MULTIVECTOR */ + TENSOR = 379, /* TENSOR */ + SPARSE = 380, /* SPARSE */ + TENSORARRAY = 381, /* TENSORARRAY */ + IGNORE = 382, /* IGNORE */ + PRIMARY = 383, /* PRIMARY */ + KEY = 384, /* KEY */ + UNIQUE = 385, /* UNIQUE */ + NULLABLE = 386, /* NULLABLE */ + IS = 387, /* IS */ + DEFAULT = 388, /* DEFAULT */ + COMMENT = 389, /* COMMENT */ + TRUE = 390, /* TRUE */ + FALSE = 391, /* FALSE */ + INTERVAL = 392, /* INTERVAL */ + SECOND = 393, /* SECOND */ + SECONDS = 394, /* SECONDS */ + MINUTE = 395, /* MINUTE */ + MINUTES = 396, /* MINUTES */ + HOUR = 397, /* HOUR */ + HOURS = 398, /* HOURS */ + DAY = 399, /* DAY */ + DAYS = 400, /* DAYS */ + MONTH = 401, /* MONTH */ + MONTHS = 402, /* MONTHS */ + YEAR = 403, /* YEAR */ + YEARS = 404, /* YEARS */ + EQUAL = 405, /* EQUAL */ + NOT_EQ = 406, /* NOT_EQ */ + LESS_EQ = 407, /* LESS_EQ */ + GREATER_EQ = 408, /* GREATER_EQ */ + BETWEEN = 409, /* BETWEEN */ + AND = 410, /* AND */ + OR = 411, /* OR */ + EXTRACT = 412, /* EXTRACT */ + LIKE = 413, /* LIKE */ + DATA = 414, /* DATA */ + LOG = 415, /* LOG */ + BUFFER = 416, /* BUFFER */ + TRANSACTIONS = 417, /* TRANSACTIONS */ + TRANSACTION = 418, /* TRANSACTION */ + MEMINDEX = 419, /* MEMINDEX */ + USING = 420, /* USING */ + SESSION = 421, /* SESSION */ + GLOBAL = 422, /* GLOBAL */ + OFF = 423, /* OFF */ + EXPORT = 424, /* EXPORT */ + CONFIGS = 425, /* CONFIGS */ + CONFIG = 426, /* CONFIG */ + PROFILES = 427, /* PROFILES */ + VARIABLES = 428, /* VARIABLES */ + VARIABLE = 429, /* VARIABLE */ + DELTA = 430, /* DELTA */ + LOGS = 431, /* LOGS */ + CATALOGS = 432, /* CATALOGS */ + CATALOG = 433, /* CATALOG */ + SEARCH = 434, /* SEARCH */ + MATCH = 435, /* MATCH */ + MAXSIM = 436, /* MAXSIM */ + QUERY = 437, /* QUERY */ + QUERIES = 438, /* QUERIES */ + FUSION = 439, /* FUSION */ + ROWLIMIT = 440, /* ROWLIMIT */ + ADMIN = 441, /* ADMIN */ + LEADER = 442, /* LEADER */ + FOLLOWER = 443, /* FOLLOWER */ + LEARNER = 444, /* LEARNER */ + CONNECT = 445, /* CONNECT */ + STANDALONE = 446, /* STANDALONE */ + NODES = 447, /* NODES */ + NODE = 448, /* NODE */ + REMOVE = 449, /* REMOVE */ + SNAPSHOT = 450, /* SNAPSHOT */ + SNAPSHOTS = 451, /* SNAPSHOTS */ + RECOVER = 452, /* RECOVER */ + RESTORE = 453, /* RESTORE */ + PERSISTENCE = 454, /* PERSISTENCE */ + OBJECT = 455, /* OBJECT */ + OBJECTS = 456, /* OBJECTS */ + FILES = 457, /* FILES */ + MEMORY = 458, /* MEMORY */ + ALLOCATION = 459, /* ALLOCATION */ + NUMBER = 460 /* NUMBER */ + }; + typedef enum sqltokentype sqltoken_kind_t; #endif /* Value type. */ -#if !defined SQLSTYPE && !defined SQLSTYPE_IS_DECLARED -union SQLSTYPE { +#if ! defined SQLSTYPE && ! defined SQLSTYPE_IS_DECLARED +union SQLSTYPE +{ #line 104 "parser.y" - bool bool_value; - char *str_value; - double double_value; + bool bool_value; + char* str_value; + double double_value; int64_t long_value; - infinity::BaseStatement *base_stmt; - infinity::SelectStatement *select_stmt; - infinity::CopyStatement *copy_stmt; - infinity::InsertStatement *insert_stmt; - infinity::UpdateStatement *update_stmt; - infinity::DeleteStatement *delete_stmt; - infinity::CreateStatement *create_stmt; - infinity::DropStatement *drop_stmt; - infinity::PrepareStatement *prepare_stmt; - infinity::ExecuteStatement *execute_stmt; - infinity::AlterStatement *alter_stmt; - infinity::ShowStatement *show_stmt; - infinity::ExplainStatement *explain_stmt; - infinity::FlushStatement *flush_stmt; - infinity::OptimizeStatement *optimize_stmt; - infinity::CommandStatement *command_stmt; - infinity::CompactStatement *compact_stmt; - infinity::AdminStatement *admin_stmt; - - std::vector *stmt_array; - - std::vector *table_element_array_t; - std::vector *column_def_array_t; - infinity::TableElement *table_element_t; - infinity::ColumnDef *table_column_t; - infinity::ColumnType column_type_t; - infinity::ConstraintType column_constraint_t; - std::set *column_constraints_t; - std::vector *identifier_array_t; - infinity::TableConstraint *table_constraint_t; - - infinity::BaseTableReference *table_reference_t; - infinity::TableAlias *table_alias_t; - infinity::JoinType join_type_t; - - infinity::OrderByExpr *order_by_expr_t; - std::vector *order_by_expr_list_t; - infinity::OrderType order_by_type_t; - - infinity::WithExpr *with_expr_t; - std::vector *with_expr_list_t; - - infinity::SetOperatorType set_operator_t; - - infinity::ExplainType explain_type_t; - - infinity::ParsedExpr *expr_t; - infinity::ConstantExpr *const_expr_t; - std::vector *expr_array_t; - std::vector *insert_row_list_t; - - std::vector *case_check_array_t; - - infinity::UpdateExpr *update_expr_t; - std::vector *update_expr_array_t; - - infinity::TableName *table_name_t; - infinity::CopyOption *copy_option_t; - std::vector *copy_option_array; - - infinity::InitParameter *index_param_t; - std::vector *index_param_list_t; - std::vector *with_index_param_list_t; - - infinity::IndexInfo *index_info_t; + infinity::BaseStatement* base_stmt; + infinity::SelectStatement* select_stmt; + infinity::CopyStatement* copy_stmt; + infinity::InsertStatement* insert_stmt; + infinity::UpdateStatement* update_stmt; + infinity::DeleteStatement* delete_stmt; + infinity::CreateStatement* create_stmt; + infinity::DropStatement* drop_stmt; + infinity::PrepareStatement* prepare_stmt; + infinity::ExecuteStatement* execute_stmt; + infinity::AlterStatement* alter_stmt; + infinity::ShowStatement* show_stmt; + infinity::ExplainStatement* explain_stmt; + infinity::FlushStatement* flush_stmt; + infinity::OptimizeStatement* optimize_stmt; + infinity::CommandStatement* command_stmt; + infinity::CompactStatement* compact_stmt; + infinity::AdminStatement* admin_stmt; + + std::vector* stmt_array; + + std::vector* table_element_array_t; + std::vector* column_def_array_t; + infinity::TableElement* table_element_t; + infinity::ColumnDef* table_column_t; + infinity::ColumnType column_type_t; + infinity::ConstraintType column_constraint_t; + std::set* column_constraints_t; + std::vector* identifier_array_t; + infinity::TableConstraint* table_constraint_t; + + infinity::BaseTableReference* table_reference_t; + infinity::TableAlias * table_alias_t; + infinity::JoinType join_type_t; + + infinity::OrderByExpr* order_by_expr_t; + std::vector* order_by_expr_list_t; + infinity::OrderType order_by_type_t; + + infinity::WithExpr* with_expr_t; + std::vector* with_expr_list_t; + + infinity::SetOperatorType set_operator_t; + + infinity::ExplainType explain_type_t; + + infinity::ParsedExpr* expr_t; + infinity::ConstantExpr* const_expr_t; + std::vector* expr_array_t; + std::vector* insert_row_list_t; + + std::vector* case_check_array_t; + + infinity::UpdateExpr* update_expr_t; + std::vector* update_expr_array_t; + + infinity::TableName* table_name_t; + infinity::CopyOption* copy_option_t; + std::vector* copy_option_array; + + infinity::InitParameter* index_param_t; + std::vector* index_param_list_t; + std::vector* with_index_param_list_t; + + infinity::IndexInfo* index_info_t; // infinity::IfExistsInfo* if_exists_info_t; - infinity::IfNotExistsInfo *if_not_exists_info_t; + infinity::IfNotExistsInfo* if_not_exists_info_t; - std::pair *int_sparse_ele_t; - std::pair *float_sparse_ele_t; + std::pair* int_sparse_ele_t; + std::pair* float_sparse_ele_t; + +#line 422 "parser.h" -#line 420 "parser.h" }; typedef union SQLSTYPE SQLSTYPE; -#define SQLSTYPE_IS_TRIVIAL 1 -#define SQLSTYPE_IS_DECLARED 1 +# define SQLSTYPE_IS_TRIVIAL 1 +# define SQLSTYPE_IS_DECLARED 1 #endif /* Location type. */ -#if !defined SQLLTYPE && !defined SQLLTYPE_IS_DECLARED +#if ! defined SQLLTYPE && ! defined SQLLTYPE_IS_DECLARED typedef struct SQLLTYPE SQLLTYPE; -struct SQLLTYPE { - int first_line; - int first_column; - int last_line; - int last_column; +struct SQLLTYPE +{ + int first_line; + int first_column; + int last_line; + int last_column; }; -#define SQLLTYPE_IS_DECLARED 1 -#define SQLLTYPE_IS_TRIVIAL 1 +# define SQLLTYPE_IS_DECLARED 1 +# define SQLLTYPE_IS_TRIVIAL 1 #endif -int sqlparse(void *scanner, infinity::ParserResult *result); + + + +int sqlparse (void *scanner, infinity::ParserResult* result); + #endif /* !YY_SQL_PARSER_H_INCLUDED */ diff --git a/src/parser/parser.y b/src/parser/parser.y index d8c87d2840..56d6fb0be1 100644 --- a/src/parser/parser.y +++ b/src/parser/parser.y @@ -384,7 +384,7 @@ struct SQL_LTYPE { %token CREATE SELECT INSERT DROP UPDATE DELETE COPY SET EXPLAIN SHOW ALTER EXECUTE PREPARE UNION ALL INTERSECT COMPACT LOCK UNLOCK ADD RENAME %token EXCEPT FLUSH USE OPTIMIZE PROPERTIES -%token DATABASE TABLE COLLECTION TABLES INTO VALUES VIEW INDEX VIEWS DATABASES SEGMENT SEGMENTS BLOCK BLOCKS COLUMN COLUMNS INDEXES CHUNK +%token DATABASE TABLE COLLECTION TABLES INTO VALUES VIEW INDEX VIEWS DATABASES SEGMENT SEGMENTS BLOCK BLOCKS COLUMN COLUMNS INDEXES CHUNK SYSTEM %token GROUP BY HAVING AS NATURAL JOIN LEFT RIGHT OUTER FULL ON INNER CROSS DISTINCT WHERE ORDER LIMIT OFFSET ASC DESC %token IF NOT EXISTS IN FROM TO WITH DELIMITER FORMAT HEADER HIGHLIGHT CAST END CASE ELSE THEN WHEN UNNEST %token BOOLEAN INTEGER INT TINYINT SMALLINT BIGINT HUGEINT VARCHAR FLOAT DOUBLE REAL DECIMAL DATE TIME DATETIME FLOAT16 BFLOAT16 UNSIGNED @@ -395,7 +395,7 @@ struct SQL_LTYPE { %token DATA LOG BUFFER TRANSACTIONS TRANSACTION MEMINDEX %token USING SESSION GLOBAL OFF EXPORT CONFIGS CONFIG PROFILES VARIABLES VARIABLE DELTA LOGS CATALOGS CATALOG %token SEARCH MATCH MAXSIM QUERY QUERIES FUSION ROWLIMIT -%token ADMIN LEADER FOLLOWER LEARNER CONNECT STANDALONE NODES NODE REMOVE SNAPSHOT SNAPSHOTS RECOVER +%token ADMIN LEADER FOLLOWER LEARNER CONNECT STANDALONE NODES NODE REMOVE SNAPSHOT SNAPSHOTS RECOVER RESTORE %token PERSISTENCE OBJECT OBJECTS FILES MEMORY ALLOCATION %token NUMBER @@ -2167,7 +2167,17 @@ show_statement: SHOW DATABASES { $$->show_type_ = infinity::ShowStmtType::kFunction; $$->function_name_ = $2; free($2); -}; +} +| SHOW SNAPSHOTS { + $$ = new infinity::ShowStatement(); + $$->show_type_ = infinity::ShowStmtType::kListSnapshots; +} +| SHOW SNAPSHOT IDENTIFIER { + $$ = new infinity::ShowStatement(); + $$->show_type_ = infinity::ShowStmtType::kShowSnapshot; + $$->snapshot_name_ = $3; + free($3); +} /* * FLUSH STATEMENT @@ -2347,6 +2357,46 @@ command_statement: USE IDENTIFIER { free($3->table_name_ptr_); delete $3; } +| CREATE SNAPSHOT IDENTIFIER ON TABLE IDENTIFIER { + ParserHelper::ToLower($3); + ParserHelper::ToLower($6); + $$ = new infinity::CommandStatement(); + $$->command_info_ = std::make_shared($3, infinity::SnapshotOp::kCreate, infinity::SnapshotScope::kTable, $6); + free($3); + free($6); +} +| CREATE SNAPSHOT IDENTIFIER ON DATABASE IDENTIFIER { + ParserHelper::ToLower($3); + ParserHelper::ToLower($6); + $$ = new infinity::CommandStatement(); + $$->command_info_ = std::make_shared($3, infinity::SnapshotOp::kCreate, infinity::SnapshotScope::kDatabase, $6); + free($3); + free($6); +} +| CREATE SNAPSHOT IDENTIFIER ON SYSTEM { + ParserHelper::ToLower($3); + $$ = new infinity::CommandStatement(); + $$->command_info_ = std::make_shared($3, infinity::SnapshotOp::kCreate, infinity::SnapshotScope::kSystem); + free($3); +} +| DROP SNAPSHOT IDENTIFIER { + ParserHelper::ToLower($3); + $$ = new infinity::CommandStatement(); + $$->command_info_ = std::make_shared($3, infinity::SnapshotOp::kDrop, infinity::SnapshotScope::kIgnore); + free($3); +} +| RESTORE DATABASE SNAPSHOT IDENTIFIER { + ParserHelper::ToLower($4); + $$ = new infinity::CommandStatement(); + $$->command_info_ = std::make_shared($4, infinity::SnapshotOp::kRestore, infinity::SnapshotScope::kDatabase); + free($4); +} +| RESTORE TABLE SNAPSHOT IDENTIFIER { + ParserHelper::ToLower($4); + $$ = new infinity::CommandStatement(); + $$->command_info_ = std::make_shared($4, infinity::SnapshotOp::kRestore, infinity::SnapshotScope::kTable); + free($4); +} compact_statement: COMPACT TABLE table_name { std::string schema_name; @@ -2554,7 +2604,7 @@ admin_statement: ADMIN SHOW CATALOGS { $$ = new infinity::AdminStatement(); $$->admin_type_ = infinity::AdminStmtType::kListSnapshots; } -| ADMIN SHOW SNAPSHOT STRING { +| ADMIN SHOW SNAPSHOT IDENTIFIER { $$ = new infinity::AdminStatement(); $$->admin_type_ = infinity::AdminStmtType::kShowSnapshot; $$->snapshot_name_ = $4; diff --git a/src/parser/search_lexer.cpp b/src/parser/search_lexer.cpp index 7a2237e1a5..0ea9ecf996 100644 --- a/src/parser/search_lexer.cpp +++ b/src/parser/search_lexer.cpp @@ -2,7 +2,7 @@ #line 4 "search_lexer.cpp" -#define YY_INT_ALIGNED short int +#define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ @@ -22,13 +22,13 @@ #endif /* %if-c++-only */ -/* The c++ scanner is a mess. The FlexLexer.h header file relies on the - * following macro. This is required in order to pass the c++-multiple-scanners - * test in the regression suite. We get reports that it breaks inheritance. - * We will address this in a future release of flex, or omit the C++ scanner - * altogether. - */ -#define yyFlexLexer SearchScannerInfinitySyntaxFlexLexer + /* The c++ scanner is a mess. The FlexLexer.h header file relies on the + * following macro. This is required in order to pass the c++-multiple-scanners + * test in the regression suite. We get reports that it breaks inheritance. + * We will address this in a future release of flex, or omit the C++ scanner + * altogether. + */ + #define yyFlexLexer SearchScannerInfinitySyntaxFlexLexer /* %endif */ /* %if-c-only */ @@ -73,10 +73,10 @@ /* C99 systems have . Non-C99 systems may or may not. */ -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -93,41 +93,41 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN -#define INT8_MIN (-128) +#define INT8_MIN (-128) #endif #ifndef INT16_MIN -#define INT16_MIN (-32767 - 1) +#define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN -#define INT32_MIN (-2147483647 - 1) +#define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX -#define INT8_MAX (127) +#define INT8_MAX (127) #endif #ifndef INT16_MAX -#define INT16_MAX (32767) +#define INT16_MAX (32767) #endif #ifndef INT32_MAX -#define INT32_MAX (2147483647) +#define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX -#define UINT8_MAX (255U) +#define UINT8_MAX (255U) #endif #ifndef UINT16_MAX -#define UINT16_MAX (65535U) +#define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) +#define UINT32_MAX (4294967295U) #endif #ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) +#define SIZE_MAX (~(size_t)0) #endif #endif /* ! C99 */ @@ -138,11 +138,11 @@ typedef unsigned int flex_uint32_t; /* begin standard C++ headers. */ /* %if-c++-only */ -#include +#include +#include #include +#include #include -#include -#include /* end standard C++ headers. */ /* %endif */ @@ -164,7 +164,7 @@ typedef unsigned int flex_uint32_t; /* Promotes a possibly negative, possibly signed char to an * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((YY_CHAR)(c)) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* %ok-for-header */ /* %if-reentrant */ @@ -188,7 +188,7 @@ typedef unsigned int flex_uint32_t; /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin) +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -206,7 +206,7 @@ typedef unsigned int flex_uint32_t; /* The state buf must be large enough to hold one state per character in the main buffer. */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE @@ -230,88 +230,93 @@ extern int yyleng; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - -#define YY_LESS_LINENO(n) -#define YY_LINENO_REWIND_TO(ptr) - + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + /* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg); \ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } while (0) -#define unput(c) yyunput(c, (yytext_ptr)) +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state { - /* %if-c-only */ - /* %endif */ +struct yy_buffer_state + { +/* %if-c-only */ +/* %endif */ - /* %if-c++-only */ - std::streambuf *yy_input_file; - /* %endif */ +/* %if-c++-only */ + std::streambuf* yy_input_file; +/* %endif */ - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; - int yy_buffer_status; + int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ #define YY_BUFFER_EOF_PENDING 2 -}; + + }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* %if-c-only Standard (non-C++) definition */ @@ -328,7 +333,9 @@ struct yy_buffer_state { * * Returns the top of the stack, or NULL. */ -#define YY_CURRENT_BUFFER ((yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : NULL) +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ @@ -342,27 +349,29 @@ struct yy_buffer_state { /* %endif */ /* %endif */ -void *yyalloc(yy_size_t); -void *yyrealloc(void *, yy_size_t); -void yyfree(void *); +void *yyalloc ( yy_size_t ); +void *yyrealloc ( void *, yy_size_t ); +void yyfree ( void * ); #define yy_new_buffer yy_create_buffer -#define yy_set_interactive(is_interactive) \ - { \ - if (!YY_CURRENT_BUFFER) { \ - yyensure_buffer_stack(); \ - YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } -#define yy_set_bol(at_bol) \ - { \ - if (!YY_CURRENT_BUFFER) { \ - yyensure_buffer_stack(); \ - YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */ @@ -377,10 +386,11 @@ typedef flex_uint8_t YY_CHAR; #include int yyFlexLexer::yywrap() { return 1; } -int yyFlexLexer::yylex() { - LexerError("yyFlexLexer::yylex invoked but %option yyclass used"); - return 0; -} +int yyFlexLexer::yylex() + { + LexerError( "yyFlexLexer::yylex invoked but %option yyclass used" ); + return 0; + } #define YY_DECL int infinity::SearchScannerInfinitySyntax::yylex() @@ -392,65 +402,140 @@ int yyFlexLexer::yylex() { /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */ \ - yyleng = (int)(yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */ \ - (yy_c_buf_p) = yy_cp; +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ +/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\ + yyleng = (int) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ +/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\ + (yy_c_buf_p) = yy_cp; /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */ #define YY_NUM_RULES 20 #define YY_END_OF_BUFFER 21 /* This struct is not used in this scanner, but its presence is necessary. */ -struct yy_trans_info { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; -}; -static const flex_int16_t yy_accept[56] = {0, 0, 0, 0, 0, 0, 0, 21, 20, 1, 11, 16, 12, 5, 6, 7, 11, 11, 11, 20, 20, 20, 20, 20, 20, 13, 15, 14, - 17, 19, 18, 1, 11, 0, 0, 0, 0, 11, 11, 3, 0, 8, 10, 0, 0, 13, 14, 17, 18, 2, 4, 9, 8, 0, 8, 0}; - -static const YY_CHAR yy_ec[256] = { - 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 4, - 5, 4, 4, 4, 4, 6, 7, 8, 9, 4, 4, 4, 10, 4, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 4, 4, 4, 4, 9, 4, 13, 4, 4, - 14, 4, 4, 4, 4, 4, 4, 4, 4, 4, 15, 16, 4, 4, 17, 4, 18, 4, 4, 4, 4, 4, 4, 4, 19, 4, 20, 4, 4, 4, 4, 4, 4, - - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 21, 1, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 1, 1, 23, 23, 23, 23, 23, 23, 23, - - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - -static const YY_CHAR yy_meta[26] = {0, 1, 1, 2, 3, 4, 5, 2, 2, 2, 3, 3, 2, 3, 3, 3, 3, 3, 3, 6, 2, 2, 1, 3, 3, 3}; - -static const flex_int16_t yy_base[64] = {0, 0, 0, 20, 21, 23, 24, 116, 117, 28, 25, 117, 117, 117, 117, 117, 36, 17, 19, 0, 27, 104, - 92, 91, 90, 0, 117, 0, 0, 117, 0, 43, 96, 0, 88, 87, 86, 38, 39, 92, 95, 52, 87, 59, - 56, 0, 117, 0, 117, 62, 43, 45, 36, 19, 24, 117, 63, 69, 73, 78, 84, 88, 94, 99}; - -static const flex_int16_t yy_def[64] = {0, 55, 1, 56, 56, 57, 57, 55, 55, 55, 58, 55, 55, 55, 55, 55, 58, 16, 16, 59, 55, 55, - 55, 55, 55, 60, 55, 61, 62, 55, 63, 55, 16, 59, 55, 55, 55, 16, 16, 16, 55, 55, 55, 55, - 55, 60, 55, 62, 55, 16, 16, 55, 55, 55, 55, 0, 55, 55, 55, 55, 55, 55, 55, 55}; - -static const flex_int16_t yy_nxt[143] = {0, 8, 9, 9, 10, 11, 12, 13, 14, 8, 10, 10, 15, 16, 10, 17, 18, 10, 10, 19, 20, 21, 8, 22, 23, 24, - 26, 26, 29, 29, 31, 31, 32, 38, 32, 54, 39, 40, 41, 27, 27, 32, 30, 30, 33, 31, 31, 54, 34, 35, 36, 37, - 49, 32, 32, 33, 51, 50, 32, 34, 35, 36, 52, 41, 25, 25, 25, 25, 25, 25, 28, 28, 28, 28, 28, 28, 32, 32, - 53, 32, 32, 32, 32, 32, 32, 45, 45, 45, 45, 46, 46, 46, 46, 46, 46, 47, 47, 47, 42, 47, 48, - - 48, 48, 48, 48, 48, 51, 32, 44, 43, 32, 32, 44, 43, 32, 42, 55, 7, 55, 55, 55, 55, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55}; - -static const flex_int16_t yy_chk[143] = {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 4, 5, 6, 9, 9, 17, 17, 18, 54, 18, 20, 20, 3, 4, 53, 5, 6, 10, 31, 31, 52, 10, 10, 10, 16, - 37, 37, 38, 16, 51, 38, 50, 16, 16, 16, 41, 41, 56, 56, 56, 56, 56, 56, 57, 57, 57, 57, 57, 57, 58, 49, - 44, 58, 59, 43, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, 61, 61, 61, 62, 62, 62, 42, 62, 63, - - 63, 63, 63, 63, 63, 40, 39, 36, 35, 34, 32, 24, 23, 22, 21, 7, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55}; - -static const flex_int16_t yy_rule_linenum[20] = {0, 65, 67, 69, 71, 73, 75, 77, 79, 80, 82, 84, 86, 87, 88, 89, 92, 93, 94, 95}; +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[56] = + { 0, + 0, 0, 0, 0, 0, 0, 21, 20, 1, 11, + 16, 12, 5, 6, 7, 11, 11, 11, 20, 20, + 20, 20, 20, 20, 13, 15, 14, 17, 19, 18, + 1, 11, 0, 0, 0, 0, 11, 11, 3, 0, + 8, 10, 0, 0, 13, 14, 17, 18, 2, 4, + 9, 8, 0, 8, 0 + } ; + +static const YY_CHAR yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 4, 5, 4, 4, 4, 4, 6, 7, + 8, 9, 4, 4, 4, 10, 4, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 12, 4, 4, + 4, 4, 9, 4, 13, 4, 4, 14, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 15, 16, 4, + 4, 17, 4, 18, 4, 4, 4, 4, 4, 4, + 4, 19, 4, 20, 4, 4, 4, 4, 4, 4, + + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 21, 1, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 1, 1, 23, 23, 23, 23, 23, 23, 23, + + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, + 25, 25, 25, 25, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static const YY_CHAR yy_meta[26] = + { 0, + 1, 1, 2, 3, 4, 5, 2, 2, 2, 3, + 3, 2, 3, 3, 3, 3, 3, 3, 6, 2, + 2, 1, 3, 3, 3 + } ; + +static const flex_int16_t yy_base[64] = + { 0, + 0, 0, 20, 21, 23, 24, 116, 117, 28, 25, + 117, 117, 117, 117, 117, 36, 17, 19, 0, 27, + 104, 92, 91, 90, 0, 117, 0, 0, 117, 0, + 43, 96, 0, 88, 87, 86, 38, 39, 92, 95, + 52, 87, 59, 56, 0, 117, 0, 117, 62, 43, + 45, 36, 19, 24, 117, 63, 69, 73, 78, 84, + 88, 94, 99 + } ; + +static const flex_int16_t yy_def[64] = + { 0, + 55, 1, 56, 56, 57, 57, 55, 55, 55, 58, + 55, 55, 55, 55, 55, 58, 16, 16, 59, 55, + 55, 55, 55, 55, 60, 55, 61, 62, 55, 63, + 55, 16, 59, 55, 55, 55, 16, 16, 16, 55, + 55, 55, 55, 55, 60, 55, 62, 55, 16, 16, + 55, 55, 55, 55, 0, 55, 55, 55, 55, 55, + 55, 55, 55 + } ; + +static const flex_int16_t yy_nxt[143] = + { 0, + 8, 9, 9, 10, 11, 12, 13, 14, 8, 10, + 10, 15, 16, 10, 17, 18, 10, 10, 19, 20, + 21, 8, 22, 23, 24, 26, 26, 29, 29, 31, + 31, 32, 38, 32, 54, 39, 40, 41, 27, 27, + 32, 30, 30, 33, 31, 31, 54, 34, 35, 36, + 37, 49, 32, 32, 33, 51, 50, 32, 34, 35, + 36, 52, 41, 25, 25, 25, 25, 25, 25, 28, + 28, 28, 28, 28, 28, 32, 32, 53, 32, 32, + 32, 32, 32, 32, 45, 45, 45, 45, 46, 46, + 46, 46, 46, 46, 47, 47, 47, 42, 47, 48, + + 48, 48, 48, 48, 48, 51, 32, 44, 43, 32, + 32, 44, 43, 32, 42, 55, 7, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55 + } ; + +static const flex_int16_t yy_chk[143] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 4, 5, 6, 9, + 9, 17, 17, 18, 54, 18, 20, 20, 3, 4, + 53, 5, 6, 10, 31, 31, 52, 10, 10, 10, + 16, 37, 37, 38, 16, 51, 38, 50, 16, 16, + 16, 41, 41, 56, 56, 56, 56, 56, 56, 57, + 57, 57, 57, 57, 57, 58, 49, 44, 58, 59, + 43, 59, 59, 59, 60, 60, 60, 60, 61, 61, + 61, 61, 61, 61, 62, 62, 62, 42, 62, 63, + + 63, 63, 63, 63, 63, 40, 39, 36, 35, 34, + 32, 24, 23, 22, 21, 7, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55 + } ; + +static const flex_int16_t yy_rule_linenum[20] = + { 0, + 65, 67, 69, 71, 73, 75, 77, 79, 80, 82, + 84, 86, 87, 88, 89, 92, 93, 94, 95 + } ; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. @@ -461,32 +546,29 @@ static const flex_int16_t yy_rule_linenum[20] = {0, 65, 67, 69, 71, 73, 75, 77, #define YY_RESTORE_YY_MORE_OFFSET #line 1 "search_lexer.l" #line 2 "search_lexer.l" -#include -#include -#include #include +#include +#include +#include /* Implementation of yyFlexScanner */ #define SearchScannerDerived SearchScannerInfinitySyntax #include "search_scanner_derived.h" #undef SearchScannerDerived -#undef YY_DECL -#define YY_DECL \ - int infinity::SearchScannerInfinitySyntax::yylex(infinity::SearchParser::semantic_type *const lval, infinity::SearchParser::location_type *loc) +#undef YY_DECL +#define YY_DECL int infinity::SearchScannerInfinitySyntax::yylex(infinity::SearchParser::semantic_type * const lval, infinity::SearchParser::location_type *loc) /* typedef to make the returns for the tokens shorter */ using token = infinity::SearchParser::token; /* define yyterminate as this instead of NULL */ -#define yyterminate() return (token::END) +#define yyterminate() return( token::END ) /* msvc2010 requires that we exclude this header file. */ #define YY_NO_UNISTD_H /* update location on matching */ -#define YY_USER_ACTION \ - loc->step(); \ - loc->columns(yyleng); +#define YY_USER_ACTION loc->step(); loc->columns(yyleng); /* for temporary storage of quoted string */ static thread_local std::stringstream string_buffer; @@ -531,11 +613,11 @@ static thread_local std::stringstream string_buffer; /* %endif */ #ifndef yytext_ptr -static void yy_flex_strncpy(char *, const char *, int); +static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen(const char *); +static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT @@ -564,7 +646,7 @@ static int yy_flex_strlen(const char *); /* %if-c-only Standard (non-C++) definition */ /* %endif */ /* %if-c++-only C++ definition */ -#define ECHO LexerOutput(yytext, yyleng) +#define ECHO LexerOutput( yytext, yyleng ) /* %endif */ #endif @@ -572,12 +654,12 @@ static int yy_flex_strlen(const char *); * is returned in "result". */ #ifndef YY_INPUT -#define YY_INPUT(buf, result, max_size) \ - /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */ \ - \ - /* %if-c++-only C++ definition \ */ \ - if ((int)(result = LexerInput((char *)buf, max_size)) < 0) \ - YY_FATAL_ERROR("input in flex scanner failed"); +#define YY_INPUT(buf,result,max_size) \ +/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\ +\ +/* %if-c++-only C++ definition \ */\ + if ( (int)(result = LexerInput( (char *) buf, max_size )) < 0 ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); /* %endif */ #endif @@ -600,7 +682,7 @@ static int yy_flex_strlen(const char *); /* %if-c-only */ /* %endif */ /* %if-c++-only */ -#define YY_FATAL_ERROR(msg) LexerError(msg) +#define YY_FATAL_ERROR(msg) LexerError( msg ) /* %endif */ #endif @@ -636,418 +718,390 @@ static int yy_flex_strlen(const char *); /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK /*LINTED*/ break; +#define YY_BREAK /*LINTED*/break; #endif /* %% [6.0] YY_RULE_SETUP definition goes here */ -#define YY_RULE_SETUP YY_USER_ACTION +#define YY_RULE_SETUP \ + YY_USER_ACTION /* %not-for-header */ /** The main scanner function which does all the work. */ -YY_DECL { - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - - if (!(yy_init)) { - (yy_init) = 1; +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + + if ( !(yy_init) ) + { + (yy_init) = 1; #ifdef YY_USER_INIT - YY_USER_INIT; + YY_USER_INIT; #endif - if (!(yy_start)) - (yy_start) = 1; /* first start state */ - - if (!yyin) - /* %if-c-only */ - /* %endif */ - /* %if-c++-only */ - yyin.rdbuf(std::cin.rdbuf()); - /* %endif */ - - if (!yyout) - /* %if-c-only */ - /* %endif */ - /* %if-c++-only */ - yyout.rdbuf(std::cout.rdbuf()); - /* %endif */ - - if (!YY_CURRENT_BUFFER) { - yyensure_buffer_stack(); - YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE); - } - - yy_load_buffer_state(); - } + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ - { + if ( ! yyin ) +/* %if-c-only */ +/* %endif */ +/* %if-c++-only */ + yyin.rdbuf(std::cin.rdbuf()); +/* %endif */ + + if ( ! yyout ) +/* %if-c-only */ +/* %endif */ +/* %if-c++-only */ + yyout.rdbuf(std::cout.rdbuf()); +/* %endif */ + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE ); + } + + yy_load_buffer_state( ); + } + + { /* %% [7.0] user's declarations go here */ #line 57 "search_lexer.l" - /** Code executed at the beginning of yylex **/ + /** Code executed at the beginning of yylex **/ #line 60 "search_lexer.l" - yylval = lval; + yylval = lval; + + /* Note: special characters in pattern shall be double-quoted or escaped with backslash: ' ()^"~*?:\\' */ - /* Note: special characters in pattern shall be double-quoted or escaped with backslash: ' ()^"~*?:\\' */ #line 783 "search_lexer.cpp" - while (/*CONSTCOND*/ 1) /* loops until end-of-file is reached */ - { - /* %% [8.0] yymore()-related code goes here */ - yy_cp = (yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - /* %% [9.0] code to set up and find next match goes here */ - yy_current_state = (yy_start); - yy_match: - do { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if (yy_accept[yy_current_state]) { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { - yy_current_state = (int)yy_def[yy_current_state]; - if (yy_current_state >= 56) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - ++yy_cp; - } while (yy_current_state != 55); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - - yy_find_action: - /* %% [10.0] code to find the action number goes here */ - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - - /* %% [11.0] code for yylineno update goes here */ - - do_action: /* This label is used only to access EOF actions. */ - - /* %% [12.0] debug code goes here */ - if (yy_flex_debug) { - if (yy_act == 0) - std::cerr << "--scanner backing up\n"; - else if (yy_act < 20) - std::cerr << "--accepting rule at line " << yy_rule_linenum[yy_act] << "(\"" << yytext << "\")\n"; - else if (yy_act == 20) - std::cerr << "--accepting default rule (\"" << yytext << "\")\n"; - else if (yy_act == 21) - std::cerr << "--(end of buffer or a NUL)\n"; - else - std::cerr << "--EOF (start condition " << YY_START << ")\n"; - } - - switch (yy_act) { /* beginning of action switch */ - /* %% [13.0] actions go here */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - - case 1: - /* rule 1 can match eol */ - YY_RULE_SETUP + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { +/* %% [8.0] yymore()-related code goes here */ + yy_cp = (yy_c_buf_p); + + /* Support of yytext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + +/* %% [9.0] code to set up and find next match goes here */ + yy_current_state = (yy_start); +yy_match: + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 56 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + ++yy_cp; + } + while ( yy_current_state != 55 ); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + +yy_find_action: +/* %% [10.0] code to find the action number goes here */ + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +/* %% [11.0] code for yylineno update goes here */ + +do_action: /* This label is used only to access EOF actions. */ + +/* %% [12.0] debug code goes here */ + if ( yy_flex_debug ) + { + if ( yy_act == 0 ) + std::cerr << "--scanner backing up\n"; + else if ( yy_act < 20 ) + std::cerr << "--accepting rule at line " << yy_rule_linenum[yy_act] << + "(\"" << yytext << "\")\n"; + else if ( yy_act == 20 ) + std::cerr << "--accepting default rule (\"" << yytext << "\")\n"; + else if ( yy_act == 21 ) + std::cerr << "--(end of buffer or a NUL)\n"; + else + std::cerr << "--EOF (start condition " << YY_START << ")\n"; + } + + switch ( yy_act ) + { /* beginning of action switch */ +/* %% [13.0] actions go here */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + +case 1: +/* rule 1 can match eol */ +YY_RULE_SETUP #line 65 "search_lexer.l" - /* ignore \t\n and space */; - YY_BREAK - case 2: - YY_RULE_SETUP +/* ignore \t\n and space */; + YY_BREAK +case 2: +YY_RULE_SETUP #line 67 "search_lexer.l" - { - return token::AND; - } - YY_BREAK - case 3: - YY_RULE_SETUP +{ return token::AND; } + YY_BREAK +case 3: +YY_RULE_SETUP #line 69 "search_lexer.l" - { - return token::OR; - } - YY_BREAK - case 4: - YY_RULE_SETUP +{ return token::OR; } + YY_BREAK +case 4: +YY_RULE_SETUP #line 71 "search_lexer.l" - { - return token::NOT; - } - YY_BREAK - case 5: - YY_RULE_SETUP +{ return token::NOT; } + YY_BREAK +case 5: +YY_RULE_SETUP #line 73 "search_lexer.l" - { - return token::LPAREN; - } - YY_BREAK - case 6: - YY_RULE_SETUP +{ return token::LPAREN; } + YY_BREAK +case 6: +YY_RULE_SETUP #line 75 "search_lexer.l" - { - return token::RPAREN; - } - YY_BREAK - case 7: - YY_RULE_SETUP +{ return token::RPAREN; } + YY_BREAK +case 7: +YY_RULE_SETUP #line 77 "search_lexer.l" - { - return token::OP_COLON; - } - YY_BREAK - case 8: +{ return token::OP_COLON; } + YY_BREAK +case 8: #line 80 "search_lexer.l" - case 9: - YY_RULE_SETUP +case 9: +YY_RULE_SETUP #line 80 "search_lexer.l" - { - yylval->build(std::strtof(yytext + 1, NULL)); - return token::CARAT; - } - YY_BREAK - case 10: - YY_RULE_SETUP +{ yylval->build(std::strtof(yytext+1, NULL)); return token::CARAT; } + YY_BREAK +case 10: +YY_RULE_SETUP #line 82 "search_lexer.l" - { - yylval->build(std::strtoul(yytext + 1, NULL, 10)); - return token::TILDE; - } - YY_BREAK - case 11: - YY_RULE_SETUP +{ yylval->build(std::strtoul(yytext+1, NULL, 10)); return token::TILDE; } + YY_BREAK +case 11: +YY_RULE_SETUP #line 84 "search_lexer.l" - { - yylval->build(InfString(yytext, false)); - return token::STRING; - } // https://stackoverflow.com/questions/9611682/flexlexer-support-for-unicode - YY_BREAK - case 12: - YY_RULE_SETUP +{ yylval->build(InfString(yytext, false)); return token::STRING; } // https://stackoverflow.com/questions/9611682/flexlexer-support-for-unicode + YY_BREAK +case 12: +YY_RULE_SETUP #line 86 "search_lexer.l" - { - BEGIN SINGLE_QUOTED_STRING; - string_buffer.clear(); - string_buffer.str(""); - } // Clear strbuf manually, see #170 - YY_BREAK - case 13: - /* rule 13 can match eol */ - YY_RULE_SETUP +{ BEGIN SINGLE_QUOTED_STRING; string_buffer.clear(); string_buffer.str(""); } // Clear strbuf manually, see #170 + YY_BREAK +case 13: +/* rule 13 can match eol */ +YY_RULE_SETUP #line 87 "search_lexer.l" - { - string_buffer << yytext; - } - YY_BREAK - case 14: - /* rule 14 can match eol */ - YY_RULE_SETUP +{ string_buffer << yytext; } + YY_BREAK +case 14: +/* rule 14 can match eol */ +YY_RULE_SETUP #line 88 "search_lexer.l" - { - string_buffer << yytext; - } - YY_BREAK - case 15: - YY_RULE_SETUP +{ string_buffer << yytext; } + YY_BREAK +case 15: +YY_RULE_SETUP #line 89 "search_lexer.l" - { - BEGIN INITIAL; - yylval->build(InfString(std::move(string_buffer).str(), true)); - return token::STRING; - } - YY_BREAK - case YY_STATE_EOF(SINGLE_QUOTED_STRING): +{ BEGIN INITIAL; yylval->build(InfString(std::move(string_buffer).str(), true)); return token::STRING; } + YY_BREAK +case YY_STATE_EOF(SINGLE_QUOTED_STRING): #line 90 "search_lexer.l" - { - std::cerr << "[Lucene-Lexer-Error] Unterminated string" << std::endl; - return 0; - } - YY_BREAK - case 16: - YY_RULE_SETUP +{ std::cerr << "[Lucene-Lexer-Error] Unterminated string" << std::endl; return 0; } + YY_BREAK +case 16: +YY_RULE_SETUP #line 92 "search_lexer.l" - { - BEGIN DOUBLE_QUOTED_STRING; - string_buffer.clear(); - string_buffer.str(""); - } // Clear strbuf manually, see #170 - YY_BREAK - case 17: - /* rule 17 can match eol */ - YY_RULE_SETUP +{ BEGIN DOUBLE_QUOTED_STRING; string_buffer.clear(); string_buffer.str(""); } // Clear strbuf manually, see #170 + YY_BREAK +case 17: +/* rule 17 can match eol */ +YY_RULE_SETUP #line 93 "search_lexer.l" - { - string_buffer << yytext; - } - YY_BREAK - case 18: - /* rule 18 can match eol */ - YY_RULE_SETUP +{ string_buffer << yytext; } + YY_BREAK +case 18: +/* rule 18 can match eol */ +YY_RULE_SETUP #line 94 "search_lexer.l" - { - string_buffer << yytext; - } - YY_BREAK - case 19: - YY_RULE_SETUP +{ string_buffer << yytext; } + YY_BREAK +case 19: +YY_RULE_SETUP #line 95 "search_lexer.l" - { - BEGIN INITIAL; - yylval->build(InfString(std::move(string_buffer).str(), true)); - return token::STRING; - } - YY_BREAK - case YY_STATE_EOF(DOUBLE_QUOTED_STRING): +{ BEGIN INITIAL; yylval->build(InfString(std::move(string_buffer).str(), true)); return token::STRING; } + YY_BREAK +case YY_STATE_EOF(DOUBLE_QUOTED_STRING): #line 96 "search_lexer.l" - { - std::cerr << "[Lucene-Lexer-Error] Unterminated string" << std::endl; - return 0; - } - YY_BREAK - case 20: - YY_RULE_SETUP +{ std::cerr << "[Lucene-Lexer-Error] Unterminated string" << std::endl; return 0; } + YY_BREAK +case 20: +YY_RULE_SETUP #line 98 "search_lexer.l" - ECHO; - YY_BREAK +ECHO; + YY_BREAK #line 968 "search_lexer.cpp" - case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int)(yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW) { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - /* %if-c-only */ - /* %endif */ - /* %if-c++-only */ - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin.rdbuf(); - /* %endif */ - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ((yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]) { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans(yy_current_state); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if (yy_next_state) { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else { - /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - } - } - - else - switch (yy_get_next_buffer()) { - case EOB_ACT_END_OF_FILE: { - (yy_did_buffer_switch_on_eof) = 0; - - if (yywrap()) { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else { - if (!(yy_did_buffer_switch_on_eof)) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR("fatal flex scanner internal error--no action found"); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; +/* %if-c-only */ +/* %endif */ +/* %if-c++-only */ + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin.rdbuf(); +/* %endif */ + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { +/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( yywrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of yylex */ /* %ok-for-header */ @@ -1057,106 +1111,121 @@ YY_DECL { * This constructor simply maintains backward compatibility. * DEPRECATED */ -yyFlexLexer::yyFlexLexer(std::istream *arg_yyin, std::ostream *arg_yyout) - : yyin(arg_yyin ? arg_yyin->rdbuf() : std::cin.rdbuf()), yyout(arg_yyout ? arg_yyout->rdbuf() : std::cout.rdbuf()) { - ctor_common(); +yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout ): + yyin(arg_yyin ? arg_yyin->rdbuf() : std::cin.rdbuf()), + yyout(arg_yyout ? arg_yyout->rdbuf() : std::cout.rdbuf()) +{ + ctor_common(); } /* The contents of this function are C++ specific, so the () macro is not used. */ -yyFlexLexer::yyFlexLexer(std::istream &arg_yyin, std::ostream &arg_yyout) : yyin(arg_yyin.rdbuf()), yyout(arg_yyout.rdbuf()) { ctor_common(); } +yyFlexLexer::yyFlexLexer( std::istream& arg_yyin, std::ostream& arg_yyout ): + yyin(arg_yyin.rdbuf()), + yyout(arg_yyout.rdbuf()) +{ + ctor_common(); +} /* The contents of this function are C++ specific, so the () macro is not used. */ -void yyFlexLexer::ctor_common() { - yy_c_buf_p = 0; - yy_init = 0; - yy_start = 0; - yy_flex_debug = 0; - yylineno = 1; // this will only get updated if %option yylineno +void yyFlexLexer::ctor_common() +{ + yy_c_buf_p = 0; + yy_init = 0; + yy_start = 0; + yy_flex_debug = 0; + yylineno = 1; // this will only get updated if %option yylineno + + yy_did_buffer_switch_on_eof = 0; - yy_did_buffer_switch_on_eof = 0; + yy_looking_for_trail_begin = 0; + yy_more_flag = 0; + yy_more_len = 0; + yy_more_offset = yy_prev_more_offset = 0; - yy_looking_for_trail_begin = 0; - yy_more_flag = 0; - yy_more_len = 0; - yy_more_offset = yy_prev_more_offset = 0; + yy_start_stack_ptr = yy_start_stack_depth = 0; + yy_start_stack = NULL; - yy_start_stack_ptr = yy_start_stack_depth = 0; - yy_start_stack = NULL; + yy_buffer_stack = NULL; + yy_buffer_stack_top = 0; + yy_buffer_stack_max = 0; - yy_buffer_stack = NULL; - yy_buffer_stack_top = 0; - yy_buffer_stack_max = 0; + yy_state_buf = 0; - yy_state_buf = 0; } /* The contents of this function are C++ specific, so the () macro is not used. */ -yyFlexLexer::~yyFlexLexer() { - delete[] yy_state_buf; - yyfree(yy_start_stack); - yy_delete_buffer(YY_CURRENT_BUFFER); - yyfree(yy_buffer_stack); +yyFlexLexer::~yyFlexLexer() +{ + delete [] yy_state_buf; + yyfree( yy_start_stack ); + yy_delete_buffer( YY_CURRENT_BUFFER ); + yyfree( yy_buffer_stack ); } /* The contents of this function are C++ specific, so the () macro is not used. */ -void yyFlexLexer::switch_streams(std::istream &new_in, std::ostream &new_out) { - // was if( new_in ) - yy_delete_buffer(YY_CURRENT_BUFFER); - yy_switch_to_buffer(yy_create_buffer(new_in, YY_BUF_SIZE)); +void yyFlexLexer::switch_streams( std::istream& new_in, std::ostream& new_out ) +{ + // was if( new_in ) + yy_delete_buffer( YY_CURRENT_BUFFER ); + yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) ); - // was if( new_out ) - yyout.rdbuf(new_out.rdbuf()); + // was if( new_out ) + yyout.rdbuf(new_out.rdbuf()); } /* The contents of this function are C++ specific, so the () macro is not used. */ -void yyFlexLexer::switch_streams(std::istream *new_in, std::ostream *new_out) { - if (!new_in) { - new_in = &yyin; - } +void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out ) +{ + if( ! new_in ) { + new_in = &yyin; + } - if (!new_out) { - new_out = &yyout; - } + if ( ! new_out ) { + new_out = &yyout; + } - switch_streams(*new_in, *new_out); + switch_streams(*new_in, *new_out); } #ifdef YY_INTERACTIVE -int yyFlexLexer::LexerInput(char *buf, int /* max_size */) +int yyFlexLexer::LexerInput( char* buf, int /* max_size */ ) #else -int yyFlexLexer::LexerInput(char *buf, int max_size) +int yyFlexLexer::LexerInput( char* buf, int max_size ) #endif { - if (yyin.eof() || yyin.fail()) - return 0; + if ( yyin.eof() || yyin.fail() ) + return 0; #ifdef YY_INTERACTIVE - yyin.get(buf[0]); + yyin.get( buf[0] ); - if (yyin.eof()) - return 0; + if ( yyin.eof() ) + return 0; - if (yyin.bad()) - return -1; + if ( yyin.bad() ) + return -1; - return 1; + return 1; #else - (void)yyin.read(buf, max_size); + (void) yyin.read( buf, max_size ); - if (yyin.bad()) - return -1; - else - return yyin.gcount(); + if ( yyin.bad() ) + return -1; + else + return yyin.gcount(); #endif } -void yyFlexLexer::LexerOutput(const char *buf, int size) { (void)yyout.write(buf, size); } +void yyFlexLexer::LexerOutput( const char* buf, int size ) +{ + (void) yyout.write( buf, size ); +} /* %ok-for-header */ /* %endif */ @@ -1174,118 +1243,138 @@ void yyFlexLexer::LexerOutput(const char *buf, int size) { (void)yyout.write(buf int yyFlexLexer::yy_get_next_buffer() /* %endif */ { - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - int number_to_move, i; - int ret_val; - - if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1]) - YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed"); - - if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0) { /* Don't try to fill the buffer, so this is an EOF. */ - if ((yy_c_buf_p) - (yytext_ptr)-YY_MORE_ADJ == 1) { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int)((yy_c_buf_p) - (yytext_ptr)-1); - - for (i = 0; i < number_to_move; ++i) - *(dest++) = *(source++); - - if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else { - int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while (num_to_read <= 0) { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = (int)((yy_c_buf_p)-b->yy_ch_buf); - - if (b->yy_is_our_buffer) { - int new_size = b->yy_buf_size * 2; - - if (new_size <= 0) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc((void *)b->yy_ch_buf, (yy_size_t)(b->yy_buf_size + 2)); - } else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; - - if (!b->yy_ch_buf) - YY_FATAL_ERROR("fatal error - scanner input buffer overflow"); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - } - - if (num_to_read > YY_READ_BUF_SIZE) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ((yy_n_chars) == 0) { - if (number_to_move == YY_MORE_ADJ) { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin); - } - - else { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *)yyrealloc((void *)YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t)new_size); - if (!YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) - YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()"); - /* "- 2" to take care of EOB's */ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int)(new_size - 2); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = (yytext_ptr); + int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ @@ -1294,31 +1383,34 @@ int yyFlexLexer::yy_get_next_buffer() /* %not-for-header */ /* %endif */ /* %if-c++-only */ -yy_state_type yyFlexLexer::yy_get_previous_state() + yy_state_type yyFlexLexer::yy_get_previous_state() /* %endif */ { - yy_state_type yy_current_state; - char *yy_cp; - - /* %% [15.0] code to get the start state into yy_current_state goes here */ - yy_current_state = (yy_start); - - for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp) { - /* %% [16.0] code to find the next state goes here */ - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if (yy_accept[yy_current_state]) { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { - yy_current_state = (int)yy_def[yy_current_state]; - if (yy_current_state >= 56) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - } - - return yy_current_state; + yy_state_type yy_current_state; + char *yy_cp; + +/* %% [15.0] code to get the start state into yy_current_state goes here */ + yy_current_state = (yy_start); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { +/* %% [16.0] code to find the next state goes here */ + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 56 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + } + + return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character @@ -1329,67 +1421,73 @@ yy_state_type yyFlexLexer::yy_get_previous_state() /* %if-c-only */ /* %endif */ /* %if-c++-only */ -yy_state_type yyFlexLexer::yy_try_NUL_trans(yy_state_type yy_current_state) + yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) /* %endif */ { - int yy_is_jam; + int yy_is_jam; /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */ - char *yy_cp = (yy_c_buf_p); - - YY_CHAR yy_c = 1; - if (yy_accept[yy_current_state]) { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) { - yy_current_state = (int)yy_def[yy_current_state]; - if (yy_current_state >= 56) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 55); - - return yy_is_jam ? 0 : yy_current_state; + char *yy_cp = (yy_c_buf_p); + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 56 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 55); + + return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT /* %if-c-only */ /* %endif */ /* %if-c++-only */ -void yyFlexLexer::yyunput(int c, char *yy_bp) + void yyFlexLexer::yyunput( int c, char* yy_bp) /* %endif */ { - char *yy_cp; - + char *yy_cp; + yy_cp = (yy_c_buf_p); - /* undo effects of setting up yytext */ - *yy_cp = (yy_hold_char); + /* undo effects of setting up yytext */ + *yy_cp = (yy_hold_char); - if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2) { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - int number_to_move = (yy_n_chars) + 2; - char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + int number_to_move = (yy_n_chars) + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - while (source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) - *--dest = *--source; + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; - yy_cp += (int)(dest - source); - yy_bp += (int)(dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = (int)YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2) - YY_FATAL_ERROR("flex scanner push-back overflow"); - } + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } - *--yy_cp = (char)c; + *--yy_cp = (char) c; - /* %% [18.0] update yylineno here */ +/* %% [18.0] update yylineno here */ - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; } /* %if-c-only */ /* %endif */ @@ -1398,228 +1496,238 @@ void yyFlexLexer::yyunput(int c, char *yy_bp) /* %if-c-only */ /* %endif */ /* %if-c++-only */ -int yyFlexLexer::yyinput() + int yyFlexLexer::yyinput() /* %endif */ { - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if (*(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR) { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ((yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else { /* need more input */ - int offset = (int)((yy_c_buf_p) - (yytext_ptr)); - ++(yy_c_buf_p); - - switch (yy_get_next_buffer()) { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart(yyin); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: { - if (yywrap()) - return 0; - - if (!(yy_did_buffer_switch_on_eof)) - YY_NEW_FILE; + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( ) ) + return 0; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; #ifdef __cplusplus - return yyinput(); + return yyinput(); #else - return input(); + return input(); #endif - } + } - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } - c = *(unsigned char *)(yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ + (yy_hold_char) = *++(yy_c_buf_p); - /* %% [19.0] update BOL and yylineno */ +/* %% [19.0] update BOL and yylineno */ - return c; + return c; } /* %if-c-only */ /* %endif */ /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ -void yyFlexLexer::yyrestart(std::istream &input_file) + void yyFlexLexer::yyrestart( std::istream& input_file ) /* %endif */ { - - if (!YY_CURRENT_BUFFER) { - yyensure_buffer_stack(); - YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE); - } - - yy_init_buffer(YY_CURRENT_BUFFER, input_file); - yy_load_buffer_state(); + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE ); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); } /* %if-c++-only */ /** Delegate to the new version that takes an istream reference. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ -void yyFlexLexer::yyrestart(std::istream *input_file) { - if (!input_file) { - input_file = &yyin; - } - yyrestart(*input_file); +void yyFlexLexer::yyrestart( std::istream* input_file ) +{ + if( ! input_file ) { + input_file = &yyin; + } + yyrestart( *input_file ); } /* %endif */ /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ -void yyFlexLexer::yy_switch_to_buffer(YY_BUFFER_STATE new_buffer) + void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) /* %endif */ { - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack(); - if (YY_CURRENT_BUFFER == new_buffer) - return; - - if (YY_CURRENT_BUFFER) { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); */ - (yy_did_buffer_switch_on_eof) = 1; + yyensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; } /* %if-c-only */ /* %endif */ /* %if-c++-only */ -void yyFlexLexer::yy_load_buffer_state() + void yyFlexLexer::yy_load_buffer_state() /* %endif */ { - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - /* %if-c-only */ - /* %endif */ - /* %if-c++-only */ - yyin.rdbuf(YY_CURRENT_BUFFER_LVALUE->yy_input_file); - /* %endif */ - (yy_hold_char) = *(yy_c_buf_p); + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; +/* %if-c-only */ +/* %endif */ +/* %if-c++-only */ + yyin.rdbuf(YY_CURRENT_BUFFER_LVALUE->yy_input_file); +/* %endif */ + (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ -YY_BUFFER_STATE yyFlexLexer::yy_create_buffer(std::istream &file, int size) + YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream& file, int size ) /* %endif */ { - YY_BUFFER_STATE b; + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b = (YY_BUFFER_STATE)yyalloc(sizeof(struct yy_buffer_state)); - if (!b) - YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); + b->yy_buf_size = size; - b->yy_buf_size = size; + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *)yyalloc((yy_size_t)(b->yy_buf_size + 2)); - if (!b->yy_ch_buf) - YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); + b->yy_is_our_buffer = 1; - b->yy_is_our_buffer = 1; + yy_init_buffer( b, file ); - yy_init_buffer(b, file); - - return b; + return b; } /* %if-c++-only */ /** Delegate creation of buffers to the new version that takes an istream reference. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ -YY_BUFFER_STATE yyFlexLexer::yy_create_buffer(std::istream *file, int size) { return yy_create_buffer(*file, size); } + YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size ) +{ + return yy_create_buffer( *file, size ); +} /* %endif */ /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() - * + * */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ -void yyFlexLexer::yy_delete_buffer(YY_BUFFER_STATE b) + void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b ) /* %endif */ { + + if ( ! b ) + return; - if (!b) - return; + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE)0; + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf ); - if (b->yy_is_our_buffer) - yyfree((void *)b->yy_ch_buf); - - yyfree((void *)b); + yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. @@ -1629,67 +1737,67 @@ void yyFlexLexer::yy_delete_buffer(YY_BUFFER_STATE b) /* %if-c-only */ /* %endif */ /* %if-c++-only */ -void yyFlexLexer::yy_init_buffer(YY_BUFFER_STATE b, std::istream &file) + void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream& file ) /* %endif */ { - int oerrno = errno; - - yy_flush_buffer(b); + int oerrno = errno; + + yy_flush_buffer( b ); - /* %if-c-only */ - /* %endif */ - /* %if-c++-only */ - b->yy_input_file = file.rdbuf(); - /* %endif */ - b->yy_fill_buffer = 1; +/* %if-c-only */ +/* %endif */ +/* %if-c++-only */ + b->yy_input_file = file.rdbuf(); +/* %endif */ + b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ - if (b != YY_CURRENT_BUFFER) { + if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } - /* %if-c-only */ - /* %endif */ - /* %if-c++-only */ - b->yy_is_interactive = 0; - /* %endif */ - errno = oerrno; +/* %if-c-only */ +/* %endif */ +/* %if-c++-only */ + b->yy_is_interactive = 0; +/* %endif */ + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ -void yyFlexLexer::yy_flush_buffer(YY_BUFFER_STATE b) + void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b ) /* %endif */ { - if (!b) - return; + if ( ! b ) + return; - b->yy_n_chars = 0; + b->yy_n_chars = 0; - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - b->yy_buf_pos = &b->yy_ch_buf[0]; + b->yy_buf_pos = &b->yy_ch_buf[0]; - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; - if (b == YY_CURRENT_BUFFER) - yy_load_buffer_state(); + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( ); } /* %if-c-or-c++ */ @@ -1697,61 +1805,62 @@ void yyFlexLexer::yy_flush_buffer(YY_BUFFER_STATE b) * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ -void yyFlexLexer::yypush_buffer_state(YY_BUFFER_STATE new_buffer) +void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer) /* %endif */ { - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if (YY_CURRENT_BUFFER) { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state(); - (yy_did_buffer_switch_on_eof) = 1; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; } /* %endif */ /* %if-c-or-c++ */ /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ /* %if-c-only */ /* %endif */ /* %if-c++-only */ -void yyFlexLexer::yypop_buffer_state(void) +void yyFlexLexer::yypop_buffer_state (void) /* %endif */ { - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state(); - (yy_did_buffer_switch_on_eof) = 1; - } + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } } /* %endif */ @@ -1765,40 +1874,45 @@ void yyFlexLexer::yypop_buffer_state(void) void yyFlexLexer::yyensure_buffer_stack(void) /* %endif */ { - yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { + yy_size_t num_to_alloc; + + if (!(yy_buffer_stack)) { - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ - (yy_buffer_stack) = (struct yy_buffer_state **)yyalloc(num_to_alloc * sizeof(struct yy_buffer_state *)); - if (!(yy_buffer_stack)) - YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state *)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1) { - - /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state **)yyrealloc((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state *)); - if (!(yy_buffer_stack)) - YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state *)); - (yy_buffer_stack_max) = num_to_alloc; - } + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } } /* %endif */ @@ -1814,49 +1928,51 @@ void yyFlexLexer::yyensure_buffer_stack(void) /* %if-c-only */ /* %endif */ /* %if-c++-only */ -void yyFlexLexer::yy_push_state(int _new_state) + void yyFlexLexer::yy_push_state( int _new_state ) /* %endif */ { - if ((yy_start_stack_ptr) >= (yy_start_stack_depth)) { - yy_size_t new_size; + if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) + { + yy_size_t new_size; - (yy_start_stack_depth) += YY_START_STACK_INCR; - new_size = (yy_size_t)(yy_start_stack_depth) * sizeof(int); + (yy_start_stack_depth) += YY_START_STACK_INCR; + new_size = (yy_size_t) (yy_start_stack_depth) * sizeof( int ); - if (!(yy_start_stack)) - (yy_start_stack) = (int *)yyalloc(new_size); + if ( ! (yy_start_stack) ) + (yy_start_stack) = (int *) yyalloc( new_size ); - else - (yy_start_stack) = (int *)yyrealloc((void *)(yy_start_stack), new_size); + else + (yy_start_stack) = (int *) yyrealloc( + (void *) (yy_start_stack), new_size ); - if (!(yy_start_stack)) - YY_FATAL_ERROR("out of memory expanding start-condition stack"); - } + if ( ! (yy_start_stack) ) + YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); + } - (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; + (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; - BEGIN(_new_state); + BEGIN(_new_state); } /* %if-c-only */ /* %endif */ /* %if-c++-only */ -void yyFlexLexer::yy_pop_state() + void yyFlexLexer::yy_pop_state() /* %endif */ { - if (--(yy_start_stack_ptr) < 0) - YY_FATAL_ERROR("start-condition stack underflow"); + if ( --(yy_start_stack_ptr) < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); - BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); + BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); } /* %if-c-only */ /* %endif */ /* %if-c++-only */ -int yyFlexLexer::yy_top_state() + int yyFlexLexer::yy_top_state() /* %endif */ { - return (yy_start_stack)[(yy_start_stack_ptr)-1]; + return (yy_start_stack)[(yy_start_stack_ptr) - 1]; } #ifndef YY_EXIT_FAILURE @@ -1866,26 +1982,29 @@ int yyFlexLexer::yy_top_state() /* %if-c-only */ /* %endif */ /* %if-c++-only */ -void yyFlexLexer::LexerError(const char *msg) { - std::cerr << msg << std::endl; - exit(YY_EXIT_FAILURE); +void yyFlexLexer::LexerError( const char* msg ) +{ + std::cerr << msg << std::endl; + exit( YY_EXIT_FAILURE ); } /* %endif */ /* Redefine yyless() so it works in section 3 code. */ #undef yyless -#define yyless(n) \ - do { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg); \ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } while (0) +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ @@ -1914,39 +2033,48 @@ void yyFlexLexer::LexerError(const char *msg) { */ #ifndef yytext_ptr -static void yy_flex_strncpy(char *s1, const char *s2, int n) { - - int i; - for (i = 0; i < n; ++i) - s1[i] = s2[i]; +static void yy_flex_strncpy (char* s1, const char * s2, int n ) +{ + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen(const char *s) { - int n; - for (n = 0; s[n]; ++n) - ; +static int yy_flex_strlen (const char * s ) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; - return n; + return n; } #endif -void *yyalloc(yy_size_t size) { return malloc(size); } - -void *yyrealloc(void *ptr, yy_size_t size) { +void *yyalloc (yy_size_t size ) +{ + return malloc(size); +} - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return realloc(ptr, size); +void *yyrealloc (void * ptr, yy_size_t size ) +{ + + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return realloc(ptr, size); } -void yyfree(void *ptr) { free((char *)ptr); /* see yyrealloc() for (char *) cast */ } +void yyfree (void * ptr ) +{ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} /* %if-tables-serialization definitions */ /* %define-yytables The name for this specific scanner's tables. */ @@ -1956,3 +2084,5 @@ void yyfree(void *ptr) { free((char *)ptr); /* see yyrealloc() for (char *) cast /* %ok-for-header */ #line 98 "search_lexer.l" + + diff --git a/src/parser/search_parser.cpp b/src/parser/search_parser.cpp index 23d9445741..fc6e5368c3 100644 --- a/src/parser/search_parser.cpp +++ b/src/parser/search_parser.cpp @@ -34,49 +34,56 @@ // especially those whose name start with YY_ or yy_. They are // private implementation details that can be changed or removed. + + + + #include "search_parser.h" + // Unqualified %code blocks. #line 42 "search_parser.y" -#include "search_driver.h" -#include "search_scanner.h" + #include "search_driver.h" + #include "search_scanner.h" -#undef yylex -#define yylex scanner.yylex + #undef yylex + #define yylex scanner.yylex -#include "query_node.h" -#include -#include -#include -#include + #include + #include + #include + #include + #include "query_node.h" -// Avoid warnings with the error counter. -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic ignored "-Wunused-but-set-variable" -#endif + // Avoid warnings with the error counter. + #if defined(__GNUC__) || defined(__clang__) + #pragma GCC diagnostic ignored "-Wunused-but-set-variable" + #endif #line 65 "search_parser.cpp" + #ifndef YY_ -#if defined YYENABLE_NLS && YYENABLE_NLS -#if ENABLE_NLS -#include // FIXME: INFRINGES ON USER NAME SPACE. -#define YY_(msgid) dgettext("bison-runtime", msgid) -#endif -#endif -#ifndef YY_ -#define YY_(msgid) msgid -#endif +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include // FIXME: INFRINGES ON USER NAME SPACE. +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif #endif + // Whether we are compiled with exception support. #ifndef YY_EXCEPTIONS -#if defined __GNUC__ && !defined __EXCEPTIONS -#define YY_EXCEPTIONS 0 -#else -#define YY_EXCEPTIONS 1 -#endif +# if defined __GNUC__ && !defined __EXCEPTIONS +# define YY_EXCEPTIONS 0 +# else +# define YY_EXCEPTIONS 1 +# endif #endif #define YYRHSLOC(Rhs, K) ((Rhs)[K].location) @@ -84,404 +91,529 @@ If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ -#ifndef YYLLOC_DEFAULT -#define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) { \ - (Current).begin = YYRHSLOC(Rhs, 1).begin; \ - (Current).end = YYRHSLOC(Rhs, N).end; \ - } else { \ - (Current).begin = (Current).end = YYRHSLOC(Rhs, 0).end; \ - } \ +# ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).begin = YYRHSLOC (Rhs, 1).begin; \ + (Current).end = YYRHSLOC (Rhs, N).end; \ + } \ + else \ + { \ + (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ + } \ while (false) -#endif +# endif + // Enable debugging if requested. #if YYDEBUG // A pseudo ostream that takes yydebug_ into account. -#define YYCDEBUG \ - if (yydebug_) \ - (*yycdebug_) - -#define YY_SYMBOL_PRINT(Title, Symbol) \ - do { \ - if (yydebug_) { \ - *yycdebug_ << Title << ' '; \ - yy_print_(*yycdebug_, Symbol); \ - *yycdebug_ << '\n'; \ - } \ - } while (false) - -#define YY_REDUCE_PRINT(Rule) \ - do { \ - if (yydebug_) \ - yy_reduce_print_(Rule); \ - } while (false) - -#define YY_STACK_PRINT() \ - do { \ - if (yydebug_) \ - yy_stack_print_(); \ - } while (false) +# define YYCDEBUG if (yydebug_) (*yycdebug_) + +# define YY_SYMBOL_PRINT(Title, Symbol) \ + do { \ + if (yydebug_) \ + { \ + *yycdebug_ << Title << ' '; \ + yy_print_ (*yycdebug_, Symbol); \ + *yycdebug_ << '\n'; \ + } \ + } while (false) + +# define YY_REDUCE_PRINT(Rule) \ + do { \ + if (yydebug_) \ + yy_reduce_print_ (Rule); \ + } while (false) + +# define YY_STACK_PRINT() \ + do { \ + if (yydebug_) \ + yy_stack_print_ (); \ + } while (false) #else // !YYDEBUG -#define YYCDEBUG \ - if (false) \ - std::cerr -#define YY_SYMBOL_PRINT(Title, Symbol) YY_USE(Symbol) -#define YY_REDUCE_PRINT(Rule) static_cast(0) -#define YY_STACK_PRINT() static_cast(0) +# define YYCDEBUG if (false) std::cerr +# define YY_SYMBOL_PRINT(Title, Symbol) YY_USE (Symbol) +# define YY_REDUCE_PRINT(Rule) static_cast (0) +# define YY_STACK_PRINT() static_cast (0) #endif // !YYDEBUG -#define yyerrok (yyerrstatus_ = 0) -#define yyclearin (yyla.clear()) +#define yyerrok (yyerrstatus_ = 0) +#define yyclearin (yyla.clear ()) -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab -#define YYRECOVERING() (!!yyerrstatus_) +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYRECOVERING() (!!yyerrstatus_) #line 10 "search_parser.y" namespace infinity { #line 158 "search_parser.cpp" -/// Build a parser object. -SearchParser::SearchParser(SearchScanner &scanner_yyarg, - const SearchDriver &driver_yyarg, - const std::string &default_field_yyarg, - std::unique_ptr &parse_result_yyarg) + /// Build a parser object. + SearchParser::SearchParser (SearchScanner &scanner_yyarg, const SearchDriver &driver_yyarg, const std::string &default_field_yyarg, std::unique_ptr &parse_result_yyarg) #if YYDEBUG - : yydebug_(false), yycdebug_(&std::cerr), + : yydebug_ (false), + yycdebug_ (&std::cerr), #else : #endif - scanner(scanner_yyarg), driver(driver_yyarg), default_field(default_field_yyarg), parse_result(parse_result_yyarg) { -} - -SearchParser::~SearchParser() {} - -SearchParser::syntax_error::~syntax_error() YY_NOEXCEPT YY_NOTHROW {} - -/*---------. -| symbol. | -`---------*/ - -// basic_symbol. -template -SearchParser::basic_symbol::basic_symbol(const basic_symbol &that) : Base(that), value(), location(that.location) { - switch (this->kind()) { - case symbol_kind::S_STRING: // STRING - value.copy(YY_MOVE(that.value)); - break; - - case symbol_kind::S_CARAT: // CARAT - value.copy(YY_MOVE(that.value)); - break; - - case symbol_kind::S_topLevelQuery: // topLevelQuery - case symbol_kind::S_query: // query - case symbol_kind::S_clause: // clause - case symbol_kind::S_term: // term - case symbol_kind::S_basic_filter_boost: // basic_filter_boost - case symbol_kind::S_basic_filter: // basic_filter - value.copy>(YY_MOVE(that.value)); - break; - - case symbol_kind::S_TILDE: // TILDE - value.copy(YY_MOVE(that.value)); - break; - - default: - break; + scanner (scanner_yyarg), + driver (driver_yyarg), + default_field (default_field_yyarg), + parse_result (parse_result_yyarg) + {} + + SearchParser::~SearchParser () + {} + + SearchParser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW + {} + + /*---------. + | symbol. | + `---------*/ + + // basic_symbol. + template + SearchParser::basic_symbol::basic_symbol (const basic_symbol& that) + : Base (that) + , value () + , location (that.location) + { + switch (this->kind ()) + { + case symbol_kind::S_STRING: // STRING + value.copy< InfString > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_CARAT: // CARAT + value.copy< float > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_topLevelQuery: // topLevelQuery + case symbol_kind::S_query: // query + case symbol_kind::S_clause: // clause + case symbol_kind::S_term: // term + case symbol_kind::S_basic_filter_boost: // basic_filter_boost + case symbol_kind::S_basic_filter: // basic_filter + value.copy< std::unique_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_TILDE: // TILDE + value.copy< unsigned long > (YY_MOVE (that.value)); + break; + + default: + break; } -} -template -SearchParser::symbol_kind_type SearchParser::basic_symbol::type_get() const YY_NOEXCEPT { - return this->kind(); -} + } -template -bool SearchParser::basic_symbol::empty() const YY_NOEXCEPT { - return this->kind() == symbol_kind::S_YYEMPTY; -} -template -void SearchParser::basic_symbol::move(basic_symbol &s) { - super_type::move(s); - switch (this->kind()) { - case symbol_kind::S_STRING: // STRING - value.move(YY_MOVE(s.value)); - break; - - case symbol_kind::S_CARAT: // CARAT - value.move(YY_MOVE(s.value)); - break; - - case symbol_kind::S_topLevelQuery: // topLevelQuery - case symbol_kind::S_query: // query - case symbol_kind::S_clause: // clause - case symbol_kind::S_term: // term - case symbol_kind::S_basic_filter_boost: // basic_filter_boost - case symbol_kind::S_basic_filter: // basic_filter - value.move>(YY_MOVE(s.value)); - break; - - case symbol_kind::S_TILDE: // TILDE - value.move(YY_MOVE(s.value)); - break; - - default: - break; + + + template + SearchParser::symbol_kind_type + SearchParser::basic_symbol::type_get () const YY_NOEXCEPT + { + return this->kind (); + } + + + template + bool + SearchParser::basic_symbol::empty () const YY_NOEXCEPT + { + return this->kind () == symbol_kind::S_YYEMPTY; + } + + template + void + SearchParser::basic_symbol::move (basic_symbol& s) + { + super_type::move (s); + switch (this->kind ()) + { + case symbol_kind::S_STRING: // STRING + value.move< InfString > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_CARAT: // CARAT + value.move< float > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_topLevelQuery: // topLevelQuery + case symbol_kind::S_query: // query + case symbol_kind::S_clause: // clause + case symbol_kind::S_term: // term + case symbol_kind::S_basic_filter_boost: // basic_filter_boost + case symbol_kind::S_basic_filter: // basic_filter + value.move< std::unique_ptr > (YY_MOVE (s.value)); + break; + + case symbol_kind::S_TILDE: // TILDE + value.move< unsigned long > (YY_MOVE (s.value)); + break; + + default: + break; } - location = YY_MOVE(s.location); -} + location = YY_MOVE (s.location); + } -// by_kind. -SearchParser::by_kind::by_kind() YY_NOEXCEPT : kind_(symbol_kind::S_YYEMPTY) {} + // by_kind. + SearchParser::by_kind::by_kind () YY_NOEXCEPT + : kind_ (symbol_kind::S_YYEMPTY) + {} #if 201103L <= YY_CPLUSPLUS -SearchParser::by_kind::by_kind(by_kind &&that) YY_NOEXCEPT : kind_(that.kind_) { that.clear(); } + SearchParser::by_kind::by_kind (by_kind&& that) YY_NOEXCEPT + : kind_ (that.kind_) + { + that.clear (); + } #endif -SearchParser::by_kind::by_kind(const by_kind &that) YY_NOEXCEPT : kind_(that.kind_) {} + SearchParser::by_kind::by_kind (const by_kind& that) YY_NOEXCEPT + : kind_ (that.kind_) + {} + + SearchParser::by_kind::by_kind (token_kind_type t) YY_NOEXCEPT + : kind_ (yytranslate_ (t)) + {} + -SearchParser::by_kind::by_kind(token_kind_type t) YY_NOEXCEPT : kind_(yytranslate_(t)) {} -void SearchParser::by_kind::clear() YY_NOEXCEPT { kind_ = symbol_kind::S_YYEMPTY; } + void + SearchParser::by_kind::clear () YY_NOEXCEPT + { + kind_ = symbol_kind::S_YYEMPTY; + } -void SearchParser::by_kind::move(by_kind &that) { + void + SearchParser::by_kind::move (by_kind& that) + { kind_ = that.kind_; - that.clear(); -} + that.clear (); + } + + SearchParser::symbol_kind_type + SearchParser::by_kind::kind () const YY_NOEXCEPT + { + return kind_; + } -SearchParser::symbol_kind_type SearchParser::by_kind::kind() const YY_NOEXCEPT { return kind_; } -SearchParser::symbol_kind_type SearchParser::by_kind::type_get() const YY_NOEXCEPT { return this->kind(); } + SearchParser::symbol_kind_type + SearchParser::by_kind::type_get () const YY_NOEXCEPT + { + return this->kind (); + } -// by_state. -SearchParser::by_state::by_state() YY_NOEXCEPT : state(empty_state) {} -SearchParser::by_state::by_state(const by_state &that) YY_NOEXCEPT : state(that.state) {} -void SearchParser::by_state::clear() YY_NOEXCEPT { state = empty_state; } + // by_state. + SearchParser::by_state::by_state () YY_NOEXCEPT + : state (empty_state) + {} -void SearchParser::by_state::move(by_state &that) { + SearchParser::by_state::by_state (const by_state& that) YY_NOEXCEPT + : state (that.state) + {} + + void + SearchParser::by_state::clear () YY_NOEXCEPT + { + state = empty_state; + } + + void + SearchParser::by_state::move (by_state& that) + { state = that.state; - that.clear(); -} + that.clear (); + } -SearchParser::by_state::by_state(state_type s) YY_NOEXCEPT : state(s) {} + SearchParser::by_state::by_state (state_type s) YY_NOEXCEPT + : state (s) + {} -SearchParser::symbol_kind_type SearchParser::by_state::kind() const YY_NOEXCEPT { + SearchParser::symbol_kind_type + SearchParser::by_state::kind () const YY_NOEXCEPT + { if (state == empty_state) - return symbol_kind::S_YYEMPTY; + return symbol_kind::S_YYEMPTY; else - return YY_CAST(symbol_kind_type, yystos_[+state]); -} + return YY_CAST (symbol_kind_type, yystos_[+state]); + } + + SearchParser::stack_symbol_type::stack_symbol_type () + {} -SearchParser::stack_symbol_type::stack_symbol_type() {} - -SearchParser::stack_symbol_type::stack_symbol_type(YY_RVREF(stack_symbol_type) that) : super_type(YY_MOVE(that.state), YY_MOVE(that.location)) { - switch (that.kind()) { - case symbol_kind::S_STRING: // STRING - value.YY_MOVE_OR_COPY(YY_MOVE(that.value)); - break; - - case symbol_kind::S_CARAT: // CARAT - value.YY_MOVE_OR_COPY(YY_MOVE(that.value)); - break; - - case symbol_kind::S_topLevelQuery: // topLevelQuery - case symbol_kind::S_query: // query - case symbol_kind::S_clause: // clause - case symbol_kind::S_term: // term - case symbol_kind::S_basic_filter_boost: // basic_filter_boost - case symbol_kind::S_basic_filter: // basic_filter - value.YY_MOVE_OR_COPY>(YY_MOVE(that.value)); - break; - - case symbol_kind::S_TILDE: // TILDE - value.YY_MOVE_OR_COPY(YY_MOVE(that.value)); - break; - - default: - break; + SearchParser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that) + : super_type (YY_MOVE (that.state), YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_STRING: // STRING + value.YY_MOVE_OR_COPY< InfString > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_CARAT: // CARAT + value.YY_MOVE_OR_COPY< float > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_topLevelQuery: // topLevelQuery + case symbol_kind::S_query: // query + case symbol_kind::S_clause: // clause + case symbol_kind::S_term: // term + case symbol_kind::S_basic_filter_boost: // basic_filter_boost + case symbol_kind::S_basic_filter: // basic_filter + value.YY_MOVE_OR_COPY< std::unique_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_TILDE: // TILDE + value.YY_MOVE_OR_COPY< unsigned long > (YY_MOVE (that.value)); + break; + + default: + break; } #if 201103L <= YY_CPLUSPLUS // that is emptied. that.state = empty_state; #endif -} + } -SearchParser::stack_symbol_type::stack_symbol_type(state_type s, YY_MOVE_REF(symbol_type) that) : super_type(s, YY_MOVE(that.location)) { - switch (that.kind()) { - case symbol_kind::S_STRING: // STRING - value.move(YY_MOVE(that.value)); - break; - - case symbol_kind::S_CARAT: // CARAT - value.move(YY_MOVE(that.value)); - break; - - case symbol_kind::S_topLevelQuery: // topLevelQuery - case symbol_kind::S_query: // query - case symbol_kind::S_clause: // clause - case symbol_kind::S_term: // term - case symbol_kind::S_basic_filter_boost: // basic_filter_boost - case symbol_kind::S_basic_filter: // basic_filter - value.move>(YY_MOVE(that.value)); - break; - - case symbol_kind::S_TILDE: // TILDE - value.move(YY_MOVE(that.value)); - break; - - default: - break; + SearchParser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that) + : super_type (s, YY_MOVE (that.location)) + { + switch (that.kind ()) + { + case symbol_kind::S_STRING: // STRING + value.move< InfString > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_CARAT: // CARAT + value.move< float > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_topLevelQuery: // topLevelQuery + case symbol_kind::S_query: // query + case symbol_kind::S_clause: // clause + case symbol_kind::S_term: // term + case symbol_kind::S_basic_filter_boost: // basic_filter_boost + case symbol_kind::S_basic_filter: // basic_filter + value.move< std::unique_ptr > (YY_MOVE (that.value)); + break; + + case symbol_kind::S_TILDE: // TILDE + value.move< unsigned long > (YY_MOVE (that.value)); + break; + + default: + break; } // that is emptied. that.kind_ = symbol_kind::S_YYEMPTY; -} + } #if YY_CPLUSPLUS < 201103L -SearchParser::stack_symbol_type &SearchParser::stack_symbol_type::operator=(const stack_symbol_type &that) { + SearchParser::stack_symbol_type& + SearchParser::stack_symbol_type::operator= (const stack_symbol_type& that) + { state = that.state; - switch (that.kind()) { - case symbol_kind::S_STRING: // STRING - value.copy(that.value); - break; - - case symbol_kind::S_CARAT: // CARAT - value.copy(that.value); - break; - - case symbol_kind::S_topLevelQuery: // topLevelQuery - case symbol_kind::S_query: // query - case symbol_kind::S_clause: // clause - case symbol_kind::S_term: // term - case symbol_kind::S_basic_filter_boost: // basic_filter_boost - case symbol_kind::S_basic_filter: // basic_filter - value.copy>(that.value); - break; - - case symbol_kind::S_TILDE: // TILDE - value.copy(that.value); - break; - - default: - break; + switch (that.kind ()) + { + case symbol_kind::S_STRING: // STRING + value.copy< InfString > (that.value); + break; + + case symbol_kind::S_CARAT: // CARAT + value.copy< float > (that.value); + break; + + case symbol_kind::S_topLevelQuery: // topLevelQuery + case symbol_kind::S_query: // query + case symbol_kind::S_clause: // clause + case symbol_kind::S_term: // term + case symbol_kind::S_basic_filter_boost: // basic_filter_boost + case symbol_kind::S_basic_filter: // basic_filter + value.copy< std::unique_ptr > (that.value); + break; + + case symbol_kind::S_TILDE: // TILDE + value.copy< unsigned long > (that.value); + break; + + default: + break; } location = that.location; return *this; -} + } -SearchParser::stack_symbol_type &SearchParser::stack_symbol_type::operator=(stack_symbol_type &that) { + SearchParser::stack_symbol_type& + SearchParser::stack_symbol_type::operator= (stack_symbol_type& that) + { state = that.state; - switch (that.kind()) { - case symbol_kind::S_STRING: // STRING - value.move(that.value); - break; - - case symbol_kind::S_CARAT: // CARAT - value.move(that.value); - break; - - case symbol_kind::S_topLevelQuery: // topLevelQuery - case symbol_kind::S_query: // query - case symbol_kind::S_clause: // clause - case symbol_kind::S_term: // term - case symbol_kind::S_basic_filter_boost: // basic_filter_boost - case symbol_kind::S_basic_filter: // basic_filter - value.move>(that.value); - break; - - case symbol_kind::S_TILDE: // TILDE - value.move(that.value); - break; - - default: - break; + switch (that.kind ()) + { + case symbol_kind::S_STRING: // STRING + value.move< InfString > (that.value); + break; + + case symbol_kind::S_CARAT: // CARAT + value.move< float > (that.value); + break; + + case symbol_kind::S_topLevelQuery: // topLevelQuery + case symbol_kind::S_query: // query + case symbol_kind::S_clause: // clause + case symbol_kind::S_term: // term + case symbol_kind::S_basic_filter_boost: // basic_filter_boost + case symbol_kind::S_basic_filter: // basic_filter + value.move< std::unique_ptr > (that.value); + break; + + case symbol_kind::S_TILDE: // TILDE + value.move< unsigned long > (that.value); + break; + + default: + break; } location = that.location; // that is emptied. that.state = empty_state; return *this; -} + } #endif -template -void SearchParser::yy_destroy_(const char *yymsg, basic_symbol &yysym) const { + template + void + SearchParser::yy_destroy_ (const char* yymsg, basic_symbol& yysym) const + { if (yymsg) - YY_SYMBOL_PRINT(yymsg, yysym); -} + YY_SYMBOL_PRINT (yymsg, yysym); + } #if YYDEBUG -template -void SearchParser::yy_print_(std::ostream &yyo, const basic_symbol &yysym) const { - std::ostream &yyoutput = yyo; - YY_USE(yyoutput); - if (yysym.empty()) - yyo << "empty symbol"; - else { - symbol_kind_type yykind = yysym.kind(); - yyo << (yykind < YYNTOKENS ? "token" : "nterm") << ' ' << yysym.name() << " (" << yysym.location << ": "; - YY_USE(yykind); + template + void + SearchParser::yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const + { + std::ostream& yyoutput = yyo; + YY_USE (yyoutput); + if (yysym.empty ()) + yyo << "empty symbol"; + else + { + symbol_kind_type yykind = yysym.kind (); + yyo << (yykind < YYNTOKENS ? "token" : "nterm") + << ' ' << yysym.name () << " (" + << yysym.location << ": "; + YY_USE (yykind); yyo << ')'; - } -} + } + } #endif -void SearchParser::yypush_(const char *m, YY_MOVE_REF(stack_symbol_type) sym) { + void + SearchParser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym) + { if (m) - YY_SYMBOL_PRINT(m, sym); - yystack_.push(YY_MOVE(sym)); -} + YY_SYMBOL_PRINT (m, sym); + yystack_.push (YY_MOVE (sym)); + } -void SearchParser::yypush_(const char *m, state_type s, YY_MOVE_REF(symbol_type) sym) { + void + SearchParser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym) + { #if 201103L <= YY_CPLUSPLUS - yypush_(m, stack_symbol_type(s, std::move(sym))); + yypush_ (m, stack_symbol_type (s, std::move (sym))); #else - stack_symbol_type ss(s, sym); - yypush_(m, ss); + stack_symbol_type ss (s, sym); + yypush_ (m, ss); #endif -} + } -void SearchParser::yypop_(int n) YY_NOEXCEPT { yystack_.pop(n); } + void + SearchParser::yypop_ (int n) YY_NOEXCEPT + { + yystack_.pop (n); + } #if YYDEBUG -std::ostream &SearchParser::debug_stream() const { return *yycdebug_; } - -void SearchParser::set_debug_stream(std::ostream &o) { yycdebug_ = &o; } - -SearchParser::debug_level_type SearchParser::debug_level() const { return yydebug_; } - -void SearchParser::set_debug_level(debug_level_type l) { yydebug_ = l; } + std::ostream& + SearchParser::debug_stream () const + { + return *yycdebug_; + } + + void + SearchParser::set_debug_stream (std::ostream& o) + { + yycdebug_ = &o; + } + + + SearchParser::debug_level_type + SearchParser::debug_level () const + { + return yydebug_; + } + + void + SearchParser::set_debug_level (debug_level_type l) + { + yydebug_ = l; + } #endif // YYDEBUG -SearchParser::state_type SearchParser::yy_lr_goto_state_(state_type yystate, int yysym) { + SearchParser::state_type + SearchParser::yy_lr_goto_state_ (state_type yystate, int yysym) + { int yyr = yypgoto_[yysym - YYNTOKENS] + yystate; if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) - return yytable_[yyr]; + return yytable_[yyr]; else - return yydefgoto_[yysym - YYNTOKENS]; -} - -bool SearchParser::yy_pact_value_is_default_(int yyvalue) YY_NOEXCEPT { return yyvalue == yypact_ninf_; } - -bool SearchParser::yy_table_value_is_error_(int yyvalue) YY_NOEXCEPT { return yyvalue == yytable_ninf_; } - -int SearchParser::operator()() { return parse(); } - -int SearchParser::parse() { + return yydefgoto_[yysym - YYNTOKENS]; + } + + bool + SearchParser::yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT + { + return yyvalue == yypact_ninf_; + } + + bool + SearchParser::yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT + { + return yyvalue == yytable_ninf_; + } + + int + SearchParser::operator() () + { + return parse (); + } + + int + SearchParser::parse () + { int yyn; /// Length of the RHS of the rule being reduced. int yylen = 0; @@ -502,545 +634,580 @@ int SearchParser::parse() { #if YY_EXCEPTIONS try #endif // YY_EXCEPTIONS - { - YYCDEBUG << "Starting parse\n"; - - /* Initialize the stack. The initial state will be set in - yynewstate, since the latter expects the semantical and the - location values to have been already stored, initialize these - stacks with a primary value. */ - yystack_.clear(); - yypush_(YY_NULLPTR, 0, YY_MOVE(yyla)); - - /*-----------------------------------------------. - | yynewstate -- push a new symbol on the stack. | - `-----------------------------------------------*/ - yynewstate: - YYCDEBUG << "Entering state " << int(yystack_[0].state) << '\n'; - YY_STACK_PRINT(); - - // Accept? - if (yystack_[0].state == yyfinal_) - YYACCEPT; - - goto yybackup; - - /*-----------. - | yybackup. | - `-----------*/ - yybackup: - // Try to take a decision without lookahead. - yyn = yypact_[+yystack_[0].state]; - if (yy_pact_value_is_default_(yyn)) - goto yydefault; - - // Read a lookahead token. - if (yyla.empty()) { - YYCDEBUG << "Reading a token\n"; + { + YYCDEBUG << "Starting parse\n"; + + + /* Initialize the stack. The initial state will be set in + yynewstate, since the latter expects the semantical and the + location values to have been already stored, initialize these + stacks with a primary value. */ + yystack_.clear (); + yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla)); + + /*-----------------------------------------------. + | yynewstate -- push a new symbol on the stack. | + `-----------------------------------------------*/ + yynewstate: + YYCDEBUG << "Entering state " << int (yystack_[0].state) << '\n'; + YY_STACK_PRINT (); + + // Accept? + if (yystack_[0].state == yyfinal_) + YYACCEPT; + + goto yybackup; + + + /*-----------. + | yybackup. | + `-----------*/ + yybackup: + // Try to take a decision without lookahead. + yyn = yypact_[+yystack_[0].state]; + if (yy_pact_value_is_default_ (yyn)) + goto yydefault; + + // Read a lookahead token. + if (yyla.empty ()) + { + YYCDEBUG << "Reading a token\n"; #if YY_EXCEPTIONS - try + try #endif // YY_EXCEPTIONS - { - yyla.kind_ = yytranslate_(yylex(&yyla.value, &yyla.location)); - } + { + yyla.kind_ = yytranslate_ (yylex (&yyla.value, &yyla.location)); + } #if YY_EXCEPTIONS - catch (const syntax_error &yyexc) { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error(yyexc); - goto yyerrlab1; - } -#endif // YY_EXCEPTIONS - } - YY_SYMBOL_PRINT("Next token is", yyla); - - if (yyla.kind() == symbol_kind::S_YYerror) { - // The scanner already issued an error message, process directly - // to error recovery. But do not keep the error token as - // lookahead, it is too special and may lead us to an endless - // loop in error recovery. */ - yyla.kind_ = symbol_kind::S_YYUNDEF; + catch (const syntax_error& yyexc) + { + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); goto yyerrlab1; - } - - /* If the proper action on seeing token YYLA.TYPE is to reduce or - to detect an error, take that action. */ - yyn += yyla.kind(); - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind()) { - goto yydefault; - } + } +#endif // YY_EXCEPTIONS + } + YY_SYMBOL_PRINT ("Next token is", yyla); - // Reduce or error. - yyn = yytable_[yyn]; - if (yyn <= 0) { - if (yy_table_value_is_error_(yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } + if (yyla.kind () == symbol_kind::S_YYerror) + { + // The scanner already issued an error message, process directly + // to error recovery. But do not keep the error token as + // lookahead, it is too special and may lead us to an endless + // loop in error recovery. */ + yyla.kind_ = symbol_kind::S_YYUNDEF; + goto yyerrlab1; + } - // Count tokens shifted since error; after three, turn off error status. - if (yyerrstatus_) - --yyerrstatus_; - - // Shift the lookahead token. - yypush_("Shifting", state_type(yyn), YY_MOVE(yyla)); - goto yynewstate; - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - yydefault: - yyn = yydefact_[+yystack_[0].state]; - if (yyn == 0) - goto yyerrlab; + /* If the proper action on seeing token YYLA.TYPE is to reduce or + to detect an error, take that action. */ + yyn += yyla.kind (); + if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind ()) + { + goto yydefault; + } + + // Reduce or error. + yyn = yytable_[yyn]; + if (yyn <= 0) + { + if (yy_table_value_is_error_ (yyn)) + goto yyerrlab; + yyn = -yyn; goto yyreduce; + } - /*-----------------------------. - | yyreduce -- do a reduction. | - `-----------------------------*/ - yyreduce: - yylen = yyr2_[yyn]; - { - stack_symbol_type yylhs; - yylhs.state = yy_lr_goto_state_(yystack_[yylen].state, yyr1_[yyn]); - /* Variants are always initialized to an empty instance of the - correct type. The default '$$ = $1' action is NOT applied - when using variants. */ - switch (yyr1_[yyn]) { - case symbol_kind::S_STRING: // STRING - yylhs.value.emplace(); - break; - - case symbol_kind::S_CARAT: // CARAT - yylhs.value.emplace(); - break; - - case symbol_kind::S_topLevelQuery: // topLevelQuery - case symbol_kind::S_query: // query - case symbol_kind::S_clause: // clause - case symbol_kind::S_term: // term - case symbol_kind::S_basic_filter_boost: // basic_filter_boost - case symbol_kind::S_basic_filter: // basic_filter - yylhs.value.emplace>(); - break; - - case symbol_kind::S_TILDE: // TILDE - yylhs.value.emplace(); - break; - - default: - break; - } + // Count tokens shifted since error; after three, turn off error status. + if (yyerrstatus_) + --yyerrstatus_; - // Default location. - { - stack_type::slice range(yystack_, yylen); - YYLLOC_DEFAULT(yylhs.location, range, yylen); - yyerror_range[1].location = yylhs.location; - } + // Shift the lookahead token. + yypush_ ("Shifting", state_type (yyn), YY_MOVE (yyla)); + goto yynewstate; + + + /*-----------------------------------------------------------. + | yydefault -- do the default action for the current state. | + `-----------------------------------------------------------*/ + yydefault: + yyn = yydefact_[+yystack_[0].state]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + + /*-----------------------------. + | yyreduce -- do a reduction. | + `-----------------------------*/ + yyreduce: + yylen = yyr2_[yyn]; + { + stack_symbol_type yylhs; + yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]); + /* Variants are always initialized to an empty instance of the + correct type. The default '$$ = $1' action is NOT applied + when using variants. */ + switch (yyr1_[yyn]) + { + case symbol_kind::S_STRING: // STRING + yylhs.value.emplace< InfString > (); + break; + + case symbol_kind::S_CARAT: // CARAT + yylhs.value.emplace< float > (); + break; + + case symbol_kind::S_topLevelQuery: // topLevelQuery + case symbol_kind::S_query: // query + case symbol_kind::S_clause: // clause + case symbol_kind::S_term: // term + case symbol_kind::S_basic_filter_boost: // basic_filter_boost + case symbol_kind::S_basic_filter: // basic_filter + yylhs.value.emplace< std::unique_ptr > (); + break; + + case symbol_kind::S_TILDE: // TILDE + yylhs.value.emplace< unsigned long > (); + break; + + default: + break; + } + + + // Default location. + { + stack_type::slice range (yystack_, yylen); + YYLLOC_DEFAULT (yylhs.location, range, yylen); + yyerror_range[1].location = yylhs.location; + } - // Perform the reduction. - YY_REDUCE_PRINT(yyn); + // Perform the reduction. + YY_REDUCE_PRINT (yyn); #if YY_EXCEPTIONS - try + try #endif // YY_EXCEPTIONS + { + switch (yyn) { - switch (yyn) { - case 2: // topLevelQuery: query "end of file" + case 2: // topLevelQuery: query "end of file" #line 85 "search_parser.y" - { - parse_result = std::move(yystack_[1].value.as>()); - } + { + parse_result = std::move(yystack_[1].value.as < std::unique_ptr > ()); +} #line 799 "search_parser.cpp" - break; + break; - case 3: // query: clause + case 3: // query: clause #line 90 "search_parser.y" - { - yylhs.value.as>() = std::move(yystack_[0].value.as>()); - } + { yylhs.value.as < std::unique_ptr > () = std::move(yystack_[0].value.as < std::unique_ptr > ()); } #line 805 "search_parser.cpp" - break; + break; - case 4: // query: query clause + case 4: // query: query clause #line 91 "search_parser.y" - { - assert(driver.operator_option_ == FulltextQueryOperatorOption::kInfinitySyntax); - if (!(yystack_[1].value.as>())) { - yylhs.value.as>() = std::move(yystack_[0].value.as>()); - } else if (!(yystack_[0].value.as>())) { - yylhs.value.as>() = std::move(yystack_[1].value.as>()); - } else { - auto q = std::make_unique(); - q->Add(std::move(yystack_[1].value.as>())); - q->Add(std::move(yystack_[0].value.as>())); - yylhs.value.as>() = std::move(q); - } - } + { + assert(driver.operator_option_ == FulltextQueryOperatorOption::kInfinitySyntax); + if (!(yystack_[1].value.as < std::unique_ptr > ())) { + yylhs.value.as < std::unique_ptr > () = std::move(yystack_[0].value.as < std::unique_ptr > ()); + } else if (!(yystack_[0].value.as < std::unique_ptr > ())) { + yylhs.value.as < std::unique_ptr > () = std::move(yystack_[1].value.as < std::unique_ptr > ()); + } else { + auto q = std::make_unique(); + q->Add(std::move(yystack_[1].value.as < std::unique_ptr > ())); + q->Add(std::move(yystack_[0].value.as < std::unique_ptr > ())); + yylhs.value.as < std::unique_ptr > () = std::move(q); + } +} #line 823 "search_parser.cpp" - break; + break; - case 5: // query: query OR clause + case 5: // query: query OR clause #line 104 "search_parser.y" - { - if (!(yystack_[2].value.as>())) { - yylhs.value.as>() = std::move(yystack_[0].value.as>()); - } else if (!(yystack_[0].value.as>())) { - yylhs.value.as>() = std::move(yystack_[2].value.as>()); - } else { - auto q = std::make_unique(); - q->Add(std::move(yystack_[2].value.as>())); - q->Add(std::move(yystack_[0].value.as>())); - yylhs.value.as>() = std::move(q); - } - } + { + if (!(yystack_[2].value.as < std::unique_ptr > ())) { + yylhs.value.as < std::unique_ptr > () = std::move(yystack_[0].value.as < std::unique_ptr > ()); + } else if (!(yystack_[0].value.as < std::unique_ptr > ())) { + yylhs.value.as < std::unique_ptr > () = std::move(yystack_[2].value.as < std::unique_ptr > ()); + } else { + auto q = std::make_unique(); + q->Add(std::move(yystack_[2].value.as < std::unique_ptr > ())); + q->Add(std::move(yystack_[0].value.as < std::unique_ptr > ())); + yylhs.value.as < std::unique_ptr > () = std::move(q); + } +} #line 840 "search_parser.cpp" - break; + break; - case 6: // clause: term + case 6: // clause: term #line 118 "search_parser.y" - { - yylhs.value.as>() = std::move(yystack_[0].value.as>()); - } + { yylhs.value.as < std::unique_ptr > () = std::move(yystack_[0].value.as < std::unique_ptr > ()); } #line 846 "search_parser.cpp" - break; + break; - case 7: // clause: clause AND term + case 7: // clause: clause AND term #line 119 "search_parser.y" - { - if (!(yystack_[2].value.as>())) { - yylhs.value.as>() = std::move(yystack_[0].value.as>()); - } else if (!(yystack_[0].value.as>())) { - yylhs.value.as>() = std::move(yystack_[2].value.as>()); - } else { - auto query = std::make_unique(); - query->Add(std::move(yystack_[2].value.as>())); - query->Add(std::move(yystack_[0].value.as>())); - yylhs.value.as>() = std::move(query); - } - } + { + if (!(yystack_[2].value.as < std::unique_ptr > ())) { + yylhs.value.as < std::unique_ptr > () = std::move(yystack_[0].value.as < std::unique_ptr > ()); + } else if (!(yystack_[0].value.as < std::unique_ptr > ())) { + yylhs.value.as < std::unique_ptr > () = std::move(yystack_[2].value.as < std::unique_ptr > ()); + } else { + auto query = std::make_unique(); + query->Add(std::move(yystack_[2].value.as < std::unique_ptr > ())); + query->Add(std::move(yystack_[0].value.as < std::unique_ptr > ())); + yylhs.value.as < std::unique_ptr > () = std::move(query); + } +} #line 863 "search_parser.cpp" - break; + break; - case 8: // term: basic_filter_boost + case 8: // term: basic_filter_boost #line 133 "search_parser.y" - { - yylhs.value.as>() = std::move(yystack_[0].value.as>()); - } + { yylhs.value.as < std::unique_ptr > () = std::move(yystack_[0].value.as < std::unique_ptr > ()); } #line 869 "search_parser.cpp" - break; + break; - case 9: // term: NOT term + case 9: // term: NOT term #line 134 "search_parser.y" - { - if (!(yystack_[0].value.as>())) { - yylhs.value.as>() = nullptr; - } else { - auto query = std::make_unique(); - query->Add(std::move(yystack_[0].value.as>())); - yylhs.value.as>() = std::move(query); - } - } + { + if (!(yystack_[0].value.as < std::unique_ptr > ())) { + yylhs.value.as < std::unique_ptr > () = nullptr; + } else { + auto query = std::make_unique(); + query->Add(std::move(yystack_[0].value.as < std::unique_ptr > ())); + yylhs.value.as < std::unique_ptr > () = std::move(query); + } +} #line 883 "search_parser.cpp" - break; + break; - case 10: // term: LPAREN query RPAREN + case 10: // term: LPAREN query RPAREN #line 143 "search_parser.y" - { - yylhs.value.as>() = std::move(yystack_[1].value.as>()); - } + { yylhs.value.as < std::unique_ptr > () = std::move(yystack_[1].value.as < std::unique_ptr > ()); } #line 889 "search_parser.cpp" - break; + break; - case 11: // term: LPAREN query RPAREN CARAT + case 11: // term: LPAREN query RPAREN CARAT #line 144 "search_parser.y" - { - yylhs.value.as>() = std::move(yystack_[2].value.as>()); - if (yylhs.value.as>()) { - yylhs.value.as>()->MultiplyWeight(yystack_[0].value.as()); - } - } + { + yylhs.value.as < std::unique_ptr > () = std::move(yystack_[2].value.as < std::unique_ptr > ()); + if (yylhs.value.as < std::unique_ptr > ()) { + yylhs.value.as < std::unique_ptr > ()->MultiplyWeight(yystack_[0].value.as < float > ()); + } +} #line 900 "search_parser.cpp" - break; + break; - case 12: // basic_filter_boost: basic_filter + case 12: // basic_filter_boost: basic_filter #line 152 "search_parser.y" - { - yylhs.value.as>() = std::move(yystack_[0].value.as>()); - } + { + yylhs.value.as < std::unique_ptr > () = std::move(yystack_[0].value.as < std::unique_ptr > ()); +} #line 908 "search_parser.cpp" - break; + break; - case 13: // basic_filter_boost: basic_filter CARAT + case 13: // basic_filter_boost: basic_filter CARAT #line 155 "search_parser.y" - { - yylhs.value.as>() = std::move(yystack_[1].value.as>()); - if (yylhs.value.as>()) { - yylhs.value.as>()->MultiplyWeight(yystack_[0].value.as()); - } - } + { + yylhs.value.as < std::unique_ptr > () = std::move(yystack_[1].value.as < std::unique_ptr > ()); + if (yylhs.value.as < std::unique_ptr > ()) { + yylhs.value.as < std::unique_ptr > ()->MultiplyWeight(yystack_[0].value.as < float > ()); + } +} #line 919 "search_parser.cpp" - break; + break; - case 14: // basic_filter: STRING + case 14: // basic_filter: STRING #line 163 "search_parser.y" - { - const std::string &field = default_field; - if (field.empty()) { - error(yystack_[0].location, "default_field is empty"); - YYERROR; - } - std::string text = SearchDriver::Unescape(yystack_[0].value.as().text_); - yylhs.value.as>() = - driver.AnalyzeAndBuildQueryNode(field, text, yystack_[0].value.as().from_quoted_); - } + { + const std::string &field = default_field; + if(field.empty()){ + error(yystack_[0].location, "default_field is empty"); + YYERROR; + } + std::string text = SearchDriver::Unescape(yystack_[0].value.as < InfString > ().text_); + yylhs.value.as < std::unique_ptr > () = driver.AnalyzeAndBuildQueryNode(field, text, yystack_[0].value.as < InfString > ().from_quoted_); +} #line 933 "search_parser.cpp" - break; + break; - case 15: // basic_filter: STRING OP_COLON STRING + case 15: // basic_filter: STRING OP_COLON STRING #line 172 "search_parser.y" - { - std::string field = SearchDriver::Unescape(yystack_[2].value.as().text_); - std::string text = SearchDriver::Unescape(yystack_[0].value.as().text_); - yylhs.value.as>() = - driver.AnalyzeAndBuildQueryNode(field, text, yystack_[0].value.as().from_quoted_); - } + { + std::string field = SearchDriver::Unescape(yystack_[2].value.as < InfString > ().text_); + std::string text = SearchDriver::Unescape(yystack_[0].value.as < InfString > ().text_); + yylhs.value.as < std::unique_ptr > () = driver.AnalyzeAndBuildQueryNode(field, text, yystack_[0].value.as < InfString > ().from_quoted_); +} #line 943 "search_parser.cpp" - break; + break; - case 16: // basic_filter: STRING TILDE + case 16: // basic_filter: STRING TILDE #line 177 "search_parser.y" - { - const std::string &field = default_field; - if (field.empty()) { - error(yystack_[1].location, "default_field is empty"); - YYERROR; - } - std::string text = SearchDriver::Unescape(yystack_[1].value.as().text_); - yylhs.value.as>() = driver.AnalyzeAndBuildQueryNode(field, - text, - yystack_[1].value.as().from_quoted_, - yystack_[0].value.as()); - } + { + const std::string &field = default_field; + if(field.empty()){ + error(yystack_[1].location, "default_field is empty"); + YYERROR; + } + std::string text = SearchDriver::Unescape(yystack_[1].value.as < InfString > ().text_); + yylhs.value.as < std::unique_ptr > () = driver.AnalyzeAndBuildQueryNode(field, text, yystack_[1].value.as < InfString > ().from_quoted_, yystack_[0].value.as < unsigned long > ()); +} #line 957 "search_parser.cpp" - break; + break; - case 17: // basic_filter: STRING OP_COLON STRING TILDE + case 17: // basic_filter: STRING OP_COLON STRING TILDE #line 186 "search_parser.y" - { - std::string field = SearchDriver::Unescape(yystack_[3].value.as().text_); - std::string text = SearchDriver::Unescape(yystack_[1].value.as().text_); - yylhs.value.as>() = driver.AnalyzeAndBuildQueryNode(field, - text, - yystack_[1].value.as().from_quoted_, - yystack_[0].value.as()); - } + { + std::string field = SearchDriver::Unescape(yystack_[3].value.as < InfString > ().text_); + std::string text = SearchDriver::Unescape(yystack_[1].value.as < InfString > ().text_); + yylhs.value.as < std::unique_ptr > () = driver.AnalyzeAndBuildQueryNode(field, text, yystack_[1].value.as < InfString > ().from_quoted_, yystack_[0].value.as < unsigned long > ()); +} #line 967 "search_parser.cpp" - break; + break; -#line 971 "search_parser.cpp" - - default: - break; - } - } -#if YY_EXCEPTIONS - catch (const syntax_error &yyexc) { - YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; - error(yyexc); - YYERROR; - } -#endif // YY_EXCEPTIONS - YY_SYMBOL_PRINT("-> $$ =", yylhs); - yypop_(yylen); - yylen = 0; - // Shift the result of the reduction. - yypush_(YY_NULLPTR, YY_MOVE(yylhs)); - } - goto yynewstate; - - /*--------------------------------------. - | yyerrlab -- here on detecting error. | - `--------------------------------------*/ - yyerrlab: - // If not already recovering from an error, report this error. - if (!yyerrstatus_) { - ++yynerrs_; - context yyctx(*this, yyla); - std::string msg = yysyntax_error_(yyctx); - error(yyla.location, YY_MOVE(msg)); - } - - yyerror_range[1].location = yyla.location; - if (yyerrstatus_ == 3) { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - // Return failure if at end of input. - if (yyla.kind() == symbol_kind::S_YYEOF) - YYABORT; - else if (!yyla.empty()) { - yy_destroy_("Error: discarding", yyla); - yyla.clear(); - } - } +#line 971 "search_parser.cpp" - // Else will try to reuse lookahead token after shifting the error token. - goto yyerrlab1; - - /*---------------------------------------------------. - | yyerrorlab -- error raised explicitly by YYERROR. | - `---------------------------------------------------*/ - yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and - the label yyerrorlab therefore never appears in user code. */ - if (false) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - yypop_(yylen); - yylen = 0; - YY_STACK_PRINT(); - goto yyerrlab1; - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - yyerrlab1: - yyerrstatus_ = 3; // Each real token shifted decrements this. - // Pop stack until we find a state that shifts the error token. - for (;;) { - yyn = yypact_[+yystack_[0].state]; - if (!yy_pact_value_is_default_(yyn)) { - yyn += symbol_kind::S_YYerror; - if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == symbol_kind::S_YYerror) { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } + default: + break; } - - // Pop the current state because it cannot handle the error token. - if (yystack_.size() == 1) - YYABORT; - - yyerror_range[1].location = yystack_[0].location; - yy_destroy_("Error: popping", yystack_[0]); - yypop_(); - YY_STACK_PRINT(); } +#if YY_EXCEPTIONS + catch (const syntax_error& yyexc) { - stack_symbol_type error_token; + YYCDEBUG << "Caught exception: " << yyexc.what() << '\n'; + error (yyexc); + YYERROR; + } +#endif // YY_EXCEPTIONS + YY_SYMBOL_PRINT ("-> $$ =", yylhs); + yypop_ (yylen); + yylen = 0; - yyerror_range[2].location = yyla.location; - YYLLOC_DEFAULT(error_token.location, yyerror_range, 2); + // Shift the result of the reduction. + yypush_ (YY_NULLPTR, YY_MOVE (yylhs)); + } + goto yynewstate; + + + /*--------------------------------------. + | yyerrlab -- here on detecting error. | + `--------------------------------------*/ + yyerrlab: + // If not already recovering from an error, report this error. + if (!yyerrstatus_) + { + ++yynerrs_; + context yyctx (*this, yyla); + std::string msg = yysyntax_error_ (yyctx); + error (yyla.location, YY_MOVE (msg)); + } + + + yyerror_range[1].location = yyla.location; + if (yyerrstatus_ == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + // Return failure if at end of input. + if (yyla.kind () == symbol_kind::S_YYEOF) + YYABORT; + else if (!yyla.empty ()) + { + yy_destroy_ ("Error: discarding", yyla); + yyla.clear (); + } + } + + // Else will try to reuse lookahead token after shifting the error token. + goto yyerrlab1; + + + /*---------------------------------------------------. + | yyerrorlab -- error raised explicitly by YYERROR. | + `---------------------------------------------------*/ + yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and + the label yyerrorlab therefore never appears in user code. */ + if (false) + YYERROR; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + yypop_ (yylen); + yylen = 0; + YY_STACK_PRINT (); + goto yyerrlab1; + + + /*-------------------------------------------------------------. + | yyerrlab1 -- common code for both syntax error and YYERROR. | + `-------------------------------------------------------------*/ + yyerrlab1: + yyerrstatus_ = 3; // Each real token shifted decrements this. + // Pop stack until we find a state that shifts the error token. + for (;;) + { + yyn = yypact_[+yystack_[0].state]; + if (!yy_pact_value_is_default_ (yyn)) + { + yyn += symbol_kind::S_YYerror; + if (0 <= yyn && yyn <= yylast_ + && yycheck_[yyn] == symbol_kind::S_YYerror) + { + yyn = yytable_[yyn]; + if (0 < yyn) + break; + } + } + + // Pop the current state because it cannot handle the error token. + if (yystack_.size () == 1) + YYABORT; + + yyerror_range[1].location = yystack_[0].location; + yy_destroy_ ("Error: popping", yystack_[0]); + yypop_ (); + YY_STACK_PRINT (); + } + { + stack_symbol_type error_token; - // Shift the error token. - error_token.state = state_type(yyn); - yypush_("Shifting", YY_MOVE(error_token)); - } - goto yynewstate; - - /*-------------------------------------. - | yyacceptlab -- YYACCEPT comes here. | - `-------------------------------------*/ - yyacceptlab: - yyresult = 0; - goto yyreturn; - - /*-----------------------------------. - | yyabortlab -- YYABORT comes here. | - `-----------------------------------*/ - yyabortlab: - yyresult = 1; - goto yyreturn; - - /*-----------------------------------------------------. - | yyreturn -- parsing is finished, return the result. | - `-----------------------------------------------------*/ - yyreturn: - if (!yyla.empty()) - yy_destroy_("Cleanup: discarding lookahead", yyla); - - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - yypop_(yylen); - YY_STACK_PRINT(); - while (1 < yystack_.size()) { - yy_destroy_("Cleanup: popping", yystack_[0]); - yypop_(); - } + yyerror_range[2].location = yyla.location; + YYLLOC_DEFAULT (error_token.location, yyerror_range, 2); - return yyresult; + // Shift the error token. + error_token.state = state_type (yyn); + yypush_ ("Shifting", YY_MOVE (error_token)); } + goto yynewstate; + + + /*-------------------------------------. + | yyacceptlab -- YYACCEPT comes here. | + `-------------------------------------*/ + yyacceptlab: + yyresult = 0; + goto yyreturn; + + + /*-----------------------------------. + | yyabortlab -- YYABORT comes here. | + `-----------------------------------*/ + yyabortlab: + yyresult = 1; + goto yyreturn; + + + /*-----------------------------------------------------. + | yyreturn -- parsing is finished, return the result. | + `-----------------------------------------------------*/ + yyreturn: + if (!yyla.empty ()) + yy_destroy_ ("Cleanup: discarding lookahead", yyla); + + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + yypop_ (yylen); + YY_STACK_PRINT (); + while (1 < yystack_.size ()) + { + yy_destroy_ ("Cleanup: popping", yystack_[0]); + yypop_ (); + } + + return yyresult; + } #if YY_EXCEPTIONS - catch (...) { + catch (...) + { YYCDEBUG << "Exception caught: cleaning lookahead and stack\n"; // Do not try to display the values of the reclaimed symbols, // as their printers might throw an exception. - if (!yyla.empty()) - yy_destroy_(YY_NULLPTR, yyla); - - while (1 < yystack_.size()) { - yy_destroy_(YY_NULLPTR, yystack_[0]); - yypop_(); - } + if (!yyla.empty ()) + yy_destroy_ (YY_NULLPTR, yyla); + + while (1 < yystack_.size ()) + { + yy_destroy_ (YY_NULLPTR, yystack_[0]); + yypop_ (); + } throw; - } + } #endif // YY_EXCEPTIONS -} - -void SearchParser::error(const syntax_error &yyexc) { error(yyexc.location, yyexc.what()); } - -/* Return YYSTR after stripping away unnecessary quotes and - backslashes, so that it's suitable for yyerror. The heuristic is - that double-quoting is unnecessary unless the string contains an - apostrophe, a comma, or backslash (other than backslash-backslash). - YYSTR is taken from yytname. */ -std::string SearchParser::yytnamerr_(const char *yystr) { - if (*yystr == '"') { + } + + void + SearchParser::error (const syntax_error& yyexc) + { + error (yyexc.location, yyexc.what ()); + } + + /* Return YYSTR after stripping away unnecessary quotes and + backslashes, so that it's suitable for yyerror. The heuristic is + that double-quoting is unnecessary unless the string contains an + apostrophe, a comma, or backslash (other than backslash-backslash). + YYSTR is taken from yytname. */ + std::string + SearchParser::yytnamerr_ (const char *yystr) + { + if (*yystr == '"') + { std::string yyr; char const *yyp = yystr; for (;;) - switch (*++yyp) { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - yyr += *yyp; - break; - - case '"': - return yyr; + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + else + goto append; + + append: + default: + yyr += *yyp; + break; + + case '"': + return yyr; } - do_not_strip_quotes:; - } + do_not_strip_quotes: ; + } return yystr; -} + } + + std::string + SearchParser::symbol_name (symbol_kind_type yysymbol) + { + return yytnamerr_ (yytname_[yysymbol]); + } + -std::string SearchParser::symbol_name(symbol_kind_type yysymbol) { return yytnamerr_(yytname_[yysymbol]); } -// SearchParser::context. -SearchParser::context::context(const SearchParser &yyparser, const symbol_type &yyla) : yyparser_(yyparser), yyla_(yyla) {} + // SearchParser::context. + SearchParser::context::context (const SearchParser& yyparser, const symbol_type& yyla) + : yyparser_ (yyparser) + , yyla_ (yyla) + {} -int SearchParser::context::expected_tokens(symbol_kind_type yyarg[], int yyargn) const { + int + SearchParser::context::expected_tokens (symbol_kind_type yyarg[], int yyargn) const + { // Actual number of expected tokens int yycount = 0; const int yyn = yypact_[+yyparser_.yystack_[0].state]; - if (!yy_pact_value_is_default_(yyn)) { + if (!yy_pact_value_is_default_ (yyn)) + { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ @@ -1049,22 +1216,32 @@ int SearchParser::context::expected_tokens(symbol_kind_type yyarg[], int yyargn) const int yychecklim = yylast_ - yyn + 1; const int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; for (int yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror && !yy_table_value_is_error_(yytable_[yyx + yyn])) { - if (!yyarg) - ++yycount; - else if (yycount == yyargn) - return 0; - else - yyarg[yycount++] = YY_CAST(symbol_kind_type, yyx); + if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror + && !yy_table_value_is_error_ (yytable_[yyx + yyn])) + { + if (!yyarg) + ++yycount; + else if (yycount == yyargn) + return 0; + else + yyarg[yycount++] = YY_CAST (symbol_kind_type, yyx); } - } + } if (yyarg && yycount == 0 && 0 < yyargn) - yyarg[0] = symbol_kind::S_YYEMPTY; + yyarg[0] = symbol_kind::S_YYEMPTY; return yycount; -} + } + + + -int SearchParser::yy_syntax_error_arguments_(const context &yyctx, symbol_kind_type yyarg[], int yyargn) const { + + + int + SearchParser::yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const + { /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action @@ -1090,127 +1267,193 @@ int SearchParser::yy_syntax_error_arguments_(const context &yyctx, symbol_kind_t accepted due to an error action in a later state. */ - if (!yyctx.lookahead().empty()) { + if (!yyctx.lookahead ().empty ()) + { if (yyarg) - yyarg[0] = yyctx.token(); - int yyn = yyctx.expected_tokens(yyarg ? yyarg + 1 : yyarg, yyargn - 1); + yyarg[0] = yyctx.token (); + int yyn = yyctx.expected_tokens (yyarg ? yyarg + 1 : yyarg, yyargn - 1); return yyn + 1; - } + } return 0; -} + } -// Generate an error message. -std::string SearchParser::yysyntax_error_(const context &yyctx) const { + // Generate an error message. + std::string + SearchParser::yysyntax_error_ (const context& yyctx) const + { // Its maximum. enum { YYARGS_MAX = 5 }; // Arguments of yyformat. symbol_kind_type yyarg[YYARGS_MAX]; - int yycount = yy_syntax_error_arguments_(yyctx, yyarg, YYARGS_MAX); - - char const *yyformat = YY_NULLPTR; - switch (yycount) { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ + int yycount = yy_syntax_error_arguments_ (yyctx, yyarg, YYARGS_MAX); + + char const* yyformat = YY_NULLPTR; + switch (yycount) + { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ break - default: // Avoid compiler warnings. - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); + default: // Avoid compiler warnings. + YYCASE_ (0, YY_("syntax error")); + YYCASE_ (1, YY_("syntax error, unexpected %s")); + YYCASE_ (2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_ (3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_ (4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_ (5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); #undef YYCASE_ - } + } std::string yyres; // Argument number. std::ptrdiff_t yyi = 0; - for (char const *yyp = yyformat; *yyp; ++yyp) - if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) { - yyres += symbol_name(yyarg[yyi++]); - ++yyp; - } else - yyres += *yyp; + for (char const* yyp = yyformat; *yyp; ++yyp) + if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) + { + yyres += symbol_name (yyarg[yyi++]); + ++yyp; + } + else + yyres += *yyp; return yyres; -} - -const signed char SearchParser::yypact_ninf_ = -4; - -const signed char SearchParser::yytable_ninf_ = -1; - -const signed char SearchParser::yypact_[] = {-2, -2, -2, 2, 15, 1, 11, -4, -4, 6, -4, 14, 12, -4, -4, -4, -2, 11, -2, -4, 16, 13, 11, -4, -4, -4}; - -const signed char SearchParser::yydefact_[] = {0, 0, 0, 14, 0, 0, 3, 6, 8, 12, 9, 0, 0, 16, 1, 2, 0, 4, 0, 13, 10, 15, 5, 7, 11, 17}; - -const signed char SearchParser::yypgoto_[] = {-4, -4, 22, -3, -1, -4, -4}; - -const signed char SearchParser::yydefgoto_[] = {0, 4, 5, 6, 7, 8, 9}; - -const signed char SearchParser::yytable_[] = {10, 15, 17, 1, 2, 16, 1, 2, 17, 3, 12, 13, 3, 22, 18, 14, 19, 23, 16, 1, 2, 20, 25, 21, 11, 3, 24}; + } + + + const signed char SearchParser::yypact_ninf_ = -4; + + const signed char SearchParser::yytable_ninf_ = -1; + + const signed char + SearchParser::yypact_[] = + { + -2, -2, -2, 2, 15, 1, 11, -4, -4, 6, + -4, 14, 12, -4, -4, -4, -2, 11, -2, -4, + 16, 13, 11, -4, -4, -4 + }; + + const signed char + SearchParser::yydefact_[] = + { + 0, 0, 0, 14, 0, 0, 3, 6, 8, 12, + 9, 0, 0, 16, 1, 2, 0, 4, 0, 13, + 10, 15, 5, 7, 11, 17 + }; + + const signed char + SearchParser::yypgoto_[] = + { + -4, -4, 22, -3, -1, -4, -4 + }; + + const signed char + SearchParser::yydefgoto_[] = + { + 0, 4, 5, 6, 7, 8, 9 + }; + + const signed char + SearchParser::yytable_[] = + { + 10, 15, 17, 1, 2, 16, 1, 2, 17, 3, + 12, 13, 3, 22, 18, 14, 19, 23, 16, 1, + 2, 20, 25, 21, 11, 3, 24 + }; + + const signed char + SearchParser::yycheck_[] = + { + 1, 0, 5, 5, 6, 4, 5, 6, 11, 11, + 8, 9, 11, 16, 3, 0, 10, 18, 4, 5, + 6, 7, 9, 11, 2, 11, 10 + }; + + const signed char + SearchParser::yystos_[] = + { + 0, 5, 6, 11, 13, 14, 15, 16, 17, 18, + 16, 14, 8, 9, 0, 0, 4, 15, 3, 10, + 7, 11, 15, 16, 10, 9 + }; + + const signed char + SearchParser::yyr1_[] = + { + 0, 12, 13, 14, 14, 14, 15, 15, 16, 16, + 16, 16, 17, 17, 18, 18, 18, 18 + }; + + const signed char + SearchParser::yyr2_[] = + { + 0, 2, 2, 1, 2, 3, 1, 3, 1, 2, + 3, 4, 1, 2, 1, 3, 2, 4 + }; -const signed char SearchParser::yycheck_[] = {1, 0, 5, 5, 6, 4, 5, 6, 11, 11, 8, 9, 11, 16, 3, 0, 10, 18, 4, 5, 6, 7, 9, 11, 2, 11, 10}; - -const signed char SearchParser::yystos_[] = {0, 5, 6, 11, 13, 14, 15, 16, 17, 18, 16, 14, 8, 9, 0, 0, 4, 15, 3, 10, 7, 11, 15, 16, 10, 9}; - -const signed char SearchParser::yyr1_[] = {0, 12, 13, 14, 14, 14, 15, 15, 16, 16, 16, 16, 17, 17, 18, 18, 18, 18}; - -const signed char SearchParser::yyr2_[] = {0, 2, 2, 1, 2, 3, 1, 3, 1, 2, 3, 4, 1, 2, 1, 3, 2, 4}; #if YYDEBUG || 1 -// YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. -// First, the terminals, then, starting at \a YYNTOKENS, nonterminals. -const char *const SearchParser::yytname_[] = {"\"end of file\"", - "error", - "\"invalid token\"", - "AND", - "OR", - "NOT", - "LPAREN", - "RPAREN", - "OP_COLON", - "TILDE", - "CARAT", - "STRING", - "$accept", - "topLevelQuery", - "query", - "clause", - "term", - "basic_filter_boost", - "basic_filter", - YY_NULLPTR}; + // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + // First, the terminals, then, starting at \a YYNTOKENS, nonterminals. + const char* + const SearchParser::yytname_[] = + { + "\"end of file\"", "error", "\"invalid token\"", "AND", "OR", "NOT", + "LPAREN", "RPAREN", "OP_COLON", "TILDE", "CARAT", "STRING", "$accept", + "topLevelQuery", "query", "clause", "term", "basic_filter_boost", + "basic_filter", YY_NULLPTR + }; #endif -#if YYDEBUG -const unsigned char SearchParser::yyrline_[] = {0, 85, 85, 90, 91, 104, 118, 119, 133, 134, 143, 144, 152, 155, 163, 172, 177, 186}; -void SearchParser::yy_stack_print_() const { +#if YYDEBUG + const unsigned char + SearchParser::yyrline_[] = + { + 0, 85, 85, 90, 91, 104, 118, 119, 133, 134, + 143, 144, 152, 155, 163, 172, 177, 186 + }; + + void + SearchParser::yy_stack_print_ () const + { *yycdebug_ << "Stack now"; - for (stack_type::const_iterator i = yystack_.begin(), i_end = yystack_.end(); i != i_end; ++i) - *yycdebug_ << ' ' << int(i->state); + for (stack_type::const_iterator + i = yystack_.begin (), + i_end = yystack_.end (); + i != i_end; ++i) + *yycdebug_ << ' ' << int (i->state); *yycdebug_ << '\n'; -} + } -void SearchParser::yy_reduce_print_(int yyrule) const { + void + SearchParser::yy_reduce_print_ (int yyrule) const + { int yylno = yyrline_[yyrule]; int yynrhs = yyr2_[yyrule]; // Print the symbols being reduced, and their result. - *yycdebug_ << "Reducing stack by rule " << yyrule - 1 << " (line " << yylno << "):\n"; + *yycdebug_ << "Reducing stack by rule " << yyrule - 1 + << " (line " << yylno << "):\n"; // The symbols being reduced. for (int yyi = 0; yyi < yynrhs; yyi++) - YY_SYMBOL_PRINT(" $" << yyi + 1 << " =", yystack_[(yynrhs) - (yyi + 1)]); -} + YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", + yystack_[(yynrhs) - (yyi + 1)]); + } #endif // YYDEBUG -SearchParser::symbol_kind_type SearchParser::yytranslate_(int t) YY_NOEXCEPT { return static_cast(t); } + SearchParser::symbol_kind_type + SearchParser::yytranslate_ (int t) YY_NOEXCEPT + { + return static_cast (t); + } #line 10 "search_parser.y" -} // namespace infinity +} // infinity #line 1451 "search_parser.cpp" #line 192 "search_parser.y" -namespace infinity { -void SearchParser::error(const location_type &l, const std::string &err_message) { std::cerr << "Error: " << err_message << " at " << l << "\n"; } -} // namespace infinity + +namespace infinity{ +void SearchParser::error(const location_type &l, const std::string &err_message) { + std::cerr << "Error: " << err_message << " at " << l << "\n"; +} +} //namespace infinity diff --git a/src/parser/search_parser.h b/src/parser/search_parser.h index 1806293caf..b0c511675f 100644 --- a/src/parser/search_parser.h +++ b/src/parser/search_parser.h @@ -30,6 +30,7 @@ // This special exception was added by the Free Software Foundation in // version 2.2 of Bison. + /** ** \file search_parser.h ** Define the infinity::parser class. @@ -42,371 +43,423 @@ // private implementation details that can be changed or removed. #ifndef YY_YY_SEARCH_PARSER_H_INCLUDED -#define YY_YY_SEARCH_PARSER_H_INCLUDED +# define YY_YY_SEARCH_PARSER_H_INCLUDED // "%code requires" blocks. #line 18 "search_parser.y" -// unique_ptr requires sizeof(QueryNode) -#ifndef QUERY_NODE_H -#include "query_node.h" -#endif + // unique_ptr requires sizeof(QueryNode) + #ifndef QUERY_NODE_H + #include "query_node.h" + #endif -namespace infinity { -class SearchDriver; -class SearchScanner; - -class InfString { -public: - // Bison requires default constructor for inplace new - InfString() = default; - InfString(std::string text, bool from_quoted) : text_{std::move(text)}, from_quoted_{from_quoted} {} - std::string text_{}; - bool from_quoted_{}; -}; -} // namespace infinity + namespace infinity { + class SearchDriver; + class SearchScanner; + + class InfString { + public: + // Bison requires default constructor for inplace new + InfString() = default; + InfString(std::string text, bool from_quoted) : text_{std::move(text)}, from_quoted_{from_quoted} {} + std::string text_{}; + bool from_quoted_{}; + }; + } #line 70 "search_parser.h" -#include -#include // std::abort -#include -#include -#include -#include +# include +# include // std::abort +# include +# include +# include +# include #if defined __cplusplus -#define YY_CPLUSPLUS __cplusplus +# define YY_CPLUSPLUS __cplusplus #else -#define YY_CPLUSPLUS 199711L +# define YY_CPLUSPLUS 199711L #endif // Support move semantics when possible. #if 201103L <= YY_CPLUSPLUS -#define YY_MOVE std::move -#define YY_MOVE_OR_COPY move -#define YY_MOVE_REF(Type) Type && -#define YY_RVREF(Type) Type && -#define YY_COPY(Type) Type +# define YY_MOVE std::move +# define YY_MOVE_OR_COPY move +# define YY_MOVE_REF(Type) Type&& +# define YY_RVREF(Type) Type&& +# define YY_COPY(Type) Type #else -#define YY_MOVE -#define YY_MOVE_OR_COPY copy -#define YY_MOVE_REF(Type) Type & -#define YY_RVREF(Type) const Type & -#define YY_COPY(Type) const Type & +# define YY_MOVE +# define YY_MOVE_OR_COPY copy +# define YY_MOVE_REF(Type) Type& +# define YY_RVREF(Type) const Type& +# define YY_COPY(Type) const Type& #endif // Support noexcept when possible. #if 201103L <= YY_CPLUSPLUS -#define YY_NOEXCEPT noexcept -#define YY_NOTHROW +# define YY_NOEXCEPT noexcept +# define YY_NOTHROW #else -#define YY_NOEXCEPT -#define YY_NOTHROW throw() +# define YY_NOEXCEPT +# define YY_NOTHROW throw () #endif // Support constexpr when possible. #if 201703 <= YY_CPLUSPLUS -#define YY_CONSTEXPR constexpr +# define YY_CONSTEXPR constexpr #else -#define YY_CONSTEXPR +# define YY_CONSTEXPR #endif -#include "location.hh" +# include "location.hh" #include #ifndef YY_ASSERT -#include -#define YY_ASSERT assert +# include +# define YY_ASSERT assert #endif + #ifndef YY_ATTRIBUTE_PURE -#if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) -#define YY_ATTRIBUTE_PURE __attribute__((__pure__)) -#else -#define YY_ATTRIBUTE_PURE -#endif +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif #endif #ifndef YY_ATTRIBUTE_UNUSED -#if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) -#define YY_ATTRIBUTE_UNUSED __attribute__((__unused__)) -#else -#define YY_ATTRIBUTE_UNUSED -#endif +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif #endif /* Suppress unused-variable warnings by "using" E. */ -#if !defined lint || defined __GNUC__ -#define YY_USE(E) ((void)(E)) +#if ! defined lint || defined __GNUC__ +# define YY_USE(E) ((void) (E)) #else -#define YY_USE(E) /* empty */ +# define YY_USE(E) /* empty */ #endif /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -#if defined __GNUC__ && !defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ -#if __GNUC__ * 100 + __GNUC_MINOR__ < 407 -#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wuninitialized\"") -#else -#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wuninitialized\"") _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -#endif -#define YY_IGNORE_MAYBE_UNINITIALIZED_END _Pragma("GCC diagnostic pop") +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -#define YY_INITIAL_VALUE(Value) Value +# define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -#define YY_IGNORE_MAYBE_UNINITIALIZED_END +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE -#define YY_INITIAL_VALUE(Value) /* Nothing. */ +# define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif -#if defined __cplusplus && defined __GNUC__ && !defined __ICC && 6 <= __GNUC__ -#define YY_IGNORE_USELESS_CAST_BEGIN _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wuseless-cast\"") -#define YY_IGNORE_USELESS_CAST_END _Pragma("GCC diagnostic pop") +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") #endif #ifndef YY_IGNORE_USELESS_CAST_BEGIN -#define YY_IGNORE_USELESS_CAST_BEGIN -#define YY_IGNORE_USELESS_CAST_END -#endif - -#ifndef YY_CAST -#ifdef __cplusplus -#define YY_CAST(Type, Val) static_cast(Val) -#define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast(Val) -#else -#define YY_CAST(Type, Val) ((Type)(Val)) -#define YY_REINTERPRET_CAST(Type, Val) ((Type)(Val)) -#endif -#endif -#ifndef YY_NULLPTR -#if defined __cplusplus -#if 201103L <= __cplusplus -#define YY_NULLPTR nullptr -#else -#define YY_NULLPTR 0 -#endif -#else -#define YY_NULLPTR ((void *)0) -#endif -#endif +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif /* Debug traces. */ #ifndef YYDEBUG -#define YYDEBUG 1 +# define YYDEBUG 1 #endif #line 10 "search_parser.y" namespace infinity { #line 211 "search_parser.h" -/// A Bison parser. -class SearchParser { -public: -#ifdef YYSTYPE -#ifdef __GNUC__ -#pragma GCC message "bison: do not #define YYSTYPE in C++, use %define api.value.type" -#endif - typedef YYSTYPE value_type; -#else - /// A buffer to store and retrieve objects. - /// - /// Sort of a variant, but does not keep track of the nature - /// of the stored data, since that knowledge is available - /// via the current parser state. - class value_type { - public: - /// Type of *this. - typedef value_type self_type; - - /// Empty construction. - value_type() YY_NOEXCEPT : yyraw_(), yytypeid_(YY_NULLPTR) {} - - /// Construct and fill. - template - value_type(YY_RVREF(T) t) : yytypeid_(&typeid(T)) { - YY_ASSERT(sizeof(T) <= size); - new (yyas_()) T(YY_MOVE(t)); - } - -#if 201103L <= YY_CPLUSPLUS - /// Non copyable. - value_type(const self_type &) = delete; - /// Non copyable. - self_type &operator=(const self_type &) = delete; -#endif - - /// Destruction, allowed only if empty. - ~value_type() YY_NOEXCEPT { YY_ASSERT(!yytypeid_); } - -#if 201103L <= YY_CPLUSPLUS - /// Instantiate a \a T in here from \a t. - template - T &emplace(U &&...u) { - YY_ASSERT(!yytypeid_); - YY_ASSERT(sizeof(T) <= size); - yytypeid_ = &typeid(T); - return *new (yyas_()) T(std::forward(u)...); - } -#else - /// Instantiate an empty \a T in here. - template - T &emplace() { - YY_ASSERT(!yytypeid_); - YY_ASSERT(sizeof(T) <= size); - yytypeid_ = &typeid(T); - return *new (yyas_()) T(); - } - - /// Instantiate a \a T in here from \a t. - template - T &emplace(const T &t) { - YY_ASSERT(!yytypeid_); - YY_ASSERT(sizeof(T) <= size); - yytypeid_ = &typeid(T); - return *new (yyas_()) T(t); - } -#endif - - /// Instantiate an empty \a T in here. - /// Obsolete, use emplace. - template - T &build() { - return emplace(); - } - - /// Instantiate a \a T in here from \a t. - /// Obsolete, use emplace. - template - T &build(const T &t) { - return emplace(t); - } - - /// Accessor to a built \a T. - template - T &as() YY_NOEXCEPT { - YY_ASSERT(yytypeid_); - YY_ASSERT(*yytypeid_ == typeid(T)); - YY_ASSERT(sizeof(T) <= size); - return *yyas_(); - } - /// Const accessor to a built \a T (for %printer). - template - const T &as() const YY_NOEXCEPT { - YY_ASSERT(yytypeid_); - YY_ASSERT(*yytypeid_ == typeid(T)); - YY_ASSERT(sizeof(T) <= size); - return *yyas_(); - } - /// Swap the content with \a that, of same type. - /// - /// Both variants must be built beforehand, because swapping the actual - /// data requires reading it (with as()), and this is not possible on - /// unconstructed variants: it would require some dynamic testing, which - /// should not be the variant's responsibility. - /// Swapping between built and (possibly) non-built is done with - /// self_type::move (). - template - void swap(self_type &that) YY_NOEXCEPT { - YY_ASSERT(yytypeid_); - YY_ASSERT(*yytypeid_ == *that.yytypeid_); - std::swap(as(), that.as()); - } - /// Move the content of \a that to this. - /// - /// Destroys \a that. - template - void move(self_type &that) { -#if 201103L <= YY_CPLUSPLUS - emplace(std::move(that.as())); + /// A Bison parser. + class SearchParser + { + public: +#ifdef YYSTYPE +# ifdef __GNUC__ +# pragma GCC message "bison: do not #define YYSTYPE in C++, use %define api.value.type" +# endif + typedef YYSTYPE value_type; #else - emplace(); - swap(that); -#endif - that.destroy(); - } + /// A buffer to store and retrieve objects. + /// + /// Sort of a variant, but does not keep track of the nature + /// of the stored data, since that knowledge is available + /// via the current parser state. + class value_type + { + public: + /// Type of *this. + typedef value_type self_type; + + /// Empty construction. + value_type () YY_NOEXCEPT + : yyraw_ () + , yytypeid_ (YY_NULLPTR) + {} + + /// Construct and fill. + template + value_type (YY_RVREF (T) t) + : yytypeid_ (&typeid (T)) + { + YY_ASSERT (sizeof (T) <= size); + new (yyas_ ()) T (YY_MOVE (t)); + } #if 201103L <= YY_CPLUSPLUS - /// Move the content of \a that to this. - template - void move(self_type &&that) { - emplace(std::move(that.as())); - that.destroy(); - } -#endif - - /// Copy the content of \a that to this. - template - void copy(const self_type &that) { - emplace(that.as()); - } - - /// Destroy the stored \a T. - template - void destroy() { - as().~T(); - yytypeid_ = YY_NULLPTR; - } - - private: + /// Non copyable. + value_type (const self_type&) = delete; + /// Non copyable. + self_type& operator= (const self_type&) = delete; +#endif + + /// Destruction, allowed only if empty. + ~value_type () YY_NOEXCEPT + { + YY_ASSERT (!yytypeid_); + } + +# if 201103L <= YY_CPLUSPLUS + /// Instantiate a \a T in here from \a t. + template + T& + emplace (U&&... u) + { + YY_ASSERT (!yytypeid_); + YY_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (std::forward (u)...); + } +# else + /// Instantiate an empty \a T in here. + template + T& + emplace () + { + YY_ASSERT (!yytypeid_); + YY_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (); + } + + /// Instantiate a \a T in here from \a t. + template + T& + emplace (const T& t) + { + YY_ASSERT (!yytypeid_); + YY_ASSERT (sizeof (T) <= size); + yytypeid_ = & typeid (T); + return *new (yyas_ ()) T (t); + } +# endif + + /// Instantiate an empty \a T in here. + /// Obsolete, use emplace. + template + T& + build () + { + return emplace (); + } + + /// Instantiate a \a T in here from \a t. + /// Obsolete, use emplace. + template + T& + build (const T& t) + { + return emplace (t); + } + + /// Accessor to a built \a T. + template + T& + as () YY_NOEXCEPT + { + YY_ASSERT (yytypeid_); + YY_ASSERT (*yytypeid_ == typeid (T)); + YY_ASSERT (sizeof (T) <= size); + return *yyas_ (); + } + + /// Const accessor to a built \a T (for %printer). + template + const T& + as () const YY_NOEXCEPT + { + YY_ASSERT (yytypeid_); + YY_ASSERT (*yytypeid_ == typeid (T)); + YY_ASSERT (sizeof (T) <= size); + return *yyas_ (); + } + + /// Swap the content with \a that, of same type. + /// + /// Both variants must be built beforehand, because swapping the actual + /// data requires reading it (with as()), and this is not possible on + /// unconstructed variants: it would require some dynamic testing, which + /// should not be the variant's responsibility. + /// Swapping between built and (possibly) non-built is done with + /// self_type::move (). + template + void + swap (self_type& that) YY_NOEXCEPT + { + YY_ASSERT (yytypeid_); + YY_ASSERT (*yytypeid_ == *that.yytypeid_); + std::swap (as (), that.as ()); + } + + /// Move the content of \a that to this. + /// + /// Destroys \a that. + template + void + move (self_type& that) + { +# if 201103L <= YY_CPLUSPLUS + emplace (std::move (that.as ())); +# else + emplace (); + swap (that); +# endif + that.destroy (); + } + +# if 201103L <= YY_CPLUSPLUS + /// Move the content of \a that to this. + template + void + move (self_type&& that) + { + emplace (std::move (that.as ())); + that.destroy (); + } +#endif + + /// Copy the content of \a that to this. + template + void + copy (const self_type& that) + { + emplace (that.as ()); + } + + /// Destroy the stored \a T. + template + void + destroy () + { + as ().~T (); + yytypeid_ = YY_NULLPTR; + } + + private: #if YY_CPLUSPLUS < 201103L - /// Non copyable. - value_type(const self_type &); - /// Non copyable. - self_type &operator=(const self_type &); -#endif - - /// Accessor to raw memory as \a T. - template - T *yyas_() YY_NOEXCEPT { - void *yyp = yyraw_; - return static_cast(yyp); - } - - /// Const accessor to raw memory as \a T. - template - const T *yyas_() const YY_NOEXCEPT { - const void *yyp = yyraw_; - return static_cast(yyp); - } - - /// An auxiliary type to compute the largest semantic type. - union union_type { - // STRING - char dummy1[sizeof(InfString)]; - - // CARAT - char dummy2[sizeof(float)]; - - // topLevelQuery - // query - // clause - // term - // basic_filter_boost - // basic_filter - char dummy3[sizeof(std::unique_ptr)]; - - // TILDE - char dummy4[sizeof(unsigned long)]; - }; - - /// The size of the largest semantic type. - enum { size = sizeof(union_type) }; + /// Non copyable. + value_type (const self_type&); + /// Non copyable. + self_type& operator= (const self_type&); +#endif + + /// Accessor to raw memory as \a T. + template + T* + yyas_ () YY_NOEXCEPT + { + void *yyp = yyraw_; + return static_cast (yyp); + } + + /// Const accessor to raw memory as \a T. + template + const T* + yyas_ () const YY_NOEXCEPT + { + const void *yyp = yyraw_; + return static_cast (yyp); + } + + /// An auxiliary type to compute the largest semantic type. + union union_type + { + // STRING + char dummy1[sizeof (InfString)]; + + // CARAT + char dummy2[sizeof (float)]; + + // topLevelQuery + // query + // clause + // term + // basic_filter_boost + // basic_filter + char dummy3[sizeof (std::unique_ptr)]; + + // TILDE + char dummy4[sizeof (unsigned long)]; + }; - /// A buffer to store semantic values. - union { - /// Strongest alignment constraints. - long double yyalign_me_; - /// A buffer large enough to store any of the semantic values. - char yyraw_[size]; - }; + /// The size of the largest semantic type. + enum { size = sizeof (union_type) }; - /// Whether the content is built: if defined, the name of the stored type. - const std::type_info *yytypeid_; + /// A buffer to store semantic values. + union + { + /// Strongest alignment constraints. + long double yyalign_me_; + /// A buffer large enough to store any of the semantic values. + char yyraw_[size]; }; + /// Whether the content is built: if defined, the name of the stored type. + const std::type_info *yytypeid_; + }; + #endif /// Backward compatibility (Bison 3.8). typedef value_type semantic_type; @@ -415,35 +468,44 @@ class SearchParser { typedef location location_type; /// Syntax errors thrown from user actions. - struct syntax_error : std::runtime_error { - syntax_error(const location_type &l, const std::string &m) : std::runtime_error(m), location(l) {} + struct syntax_error : std::runtime_error + { + syntax_error (const location_type& l, const std::string& m) + : std::runtime_error (m) + , location (l) + {} - syntax_error(const syntax_error &s) : std::runtime_error(s.what()), location(s.location) {} + syntax_error (const syntax_error& s) + : std::runtime_error (s.what ()) + , location (s.location) + {} - ~syntax_error() YY_NOEXCEPT YY_NOTHROW; + ~syntax_error () YY_NOEXCEPT YY_NOTHROW; - location_type location; + location_type location; }; /// Token kinds. - struct token { - enum token_kind_type { - YYEMPTY = -2, - END = 0, // "end of file" - YYerror = 1, // error - YYUNDEF = 2, // "invalid token" - AND = 3, // AND - OR = 4, // OR - NOT = 5, // NOT - LPAREN = 6, // LPAREN - RPAREN = 7, // RPAREN - OP_COLON = 8, // OP_COLON - TILDE = 9, // TILDE - CARAT = 10, // CARAT - STRING = 11 // STRING - }; - /// Backward compatibility alias (Bison 3.6). - typedef token_kind_type yytokentype; + struct token + { + enum token_kind_type + { + YYEMPTY = -2, + END = 0, // "end of file" + YYerror = 1, // error + YYUNDEF = 2, // "invalid token" + AND = 3, // AND + OR = 4, // OR + NOT = 5, // NOT + LPAREN = 6, // LPAREN + RPAREN = 7, // RPAREN + OP_COLON = 8, // OP_COLON + TILDE = 9, // TILDE + CARAT = 10, // CARAT + STRING = 11 // STRING + }; + /// Backward compatibility alias (Bison 3.6). + typedef token_kind_type yytokentype; }; /// Token kind, as returned by yylex. @@ -453,30 +515,32 @@ class SearchParser { typedef token_kind_type token_type; /// Symbol kinds. - struct symbol_kind { - enum symbol_kind_type { - YYNTOKENS = 12, ///< Number of tokens. - S_YYEMPTY = -2, - S_YYEOF = 0, // "end of file" - S_YYerror = 1, // error - S_YYUNDEF = 2, // "invalid token" - S_AND = 3, // AND - S_OR = 4, // OR - S_NOT = 5, // NOT - S_LPAREN = 6, // LPAREN - S_RPAREN = 7, // RPAREN - S_OP_COLON = 8, // OP_COLON - S_TILDE = 9, // TILDE - S_CARAT = 10, // CARAT - S_STRING = 11, // STRING - S_YYACCEPT = 12, // $accept - S_topLevelQuery = 13, // topLevelQuery - S_query = 14, // query - S_clause = 15, // clause - S_term = 16, // term - S_basic_filter_boost = 17, // basic_filter_boost - S_basic_filter = 18 // basic_filter - }; + struct symbol_kind + { + enum symbol_kind_type + { + YYNTOKENS = 12, ///< Number of tokens. + S_YYEMPTY = -2, + S_YYEOF = 0, // "end of file" + S_YYerror = 1, // error + S_YYUNDEF = 2, // "invalid token" + S_AND = 3, // AND + S_OR = 4, // OR + S_NOT = 5, // NOT + S_LPAREN = 6, // LPAREN + S_RPAREN = 7, // RPAREN + S_OP_COLON = 8, // OP_COLON + S_TILDE = 9, // TILDE + S_CARAT = 10, // CARAT + S_STRING = 11, // STRING + S_YYACCEPT = 12, // $accept + S_topLevelQuery = 13, // topLevelQuery + S_query = 14, // query + S_clause = 15, // clause + S_term = 16, // term + S_basic_filter_boost = 17, // basic_filter_boost + S_basic_filter = 18 // basic_filter + }; }; /// (Internal) symbol kind. @@ -492,403 +556,587 @@ class SearchParser { /// /// Provide access to semantic value and location. template - struct basic_symbol : Base { - /// Alias to Base. - typedef Base super_type; + struct basic_symbol : Base + { + /// Alias to Base. + typedef Base super_type; - /// Default constructor. - basic_symbol() YY_NOEXCEPT : value(), location() {} + /// Default constructor. + basic_symbol () YY_NOEXCEPT + : value () + , location () + {} #if 201103L <= YY_CPLUSPLUS - /// Move constructor. - basic_symbol(basic_symbol &&that) : Base(std::move(that)), value(), location(std::move(that.location)) { - switch (this->kind()) { - case symbol_kind::S_STRING: // STRING - value.move(std::move(that.value)); - break; - - case symbol_kind::S_CARAT: // CARAT - value.move(std::move(that.value)); - break; - - case symbol_kind::S_topLevelQuery: // topLevelQuery - case symbol_kind::S_query: // query - case symbol_kind::S_clause: // clause - case symbol_kind::S_term: // term - case symbol_kind::S_basic_filter_boost: // basic_filter_boost - case symbol_kind::S_basic_filter: // basic_filter - value.move>(std::move(that.value)); - break; - - case symbol_kind::S_TILDE: // TILDE - value.move(std::move(that.value)); - break; - - default: - break; - } - } -#endif - - /// Copy constructor. - basic_symbol(const basic_symbol &that); - - /// Constructors for typed symbols. + /// Move constructor. + basic_symbol (basic_symbol&& that) + : Base (std::move (that)) + , value () + , location (std::move (that.location)) + { + switch (this->kind ()) + { + case symbol_kind::S_STRING: // STRING + value.move< InfString > (std::move (that.value)); + break; + + case symbol_kind::S_CARAT: // CARAT + value.move< float > (std::move (that.value)); + break; + + case symbol_kind::S_topLevelQuery: // topLevelQuery + case symbol_kind::S_query: // query + case symbol_kind::S_clause: // clause + case symbol_kind::S_term: // term + case symbol_kind::S_basic_filter_boost: // basic_filter_boost + case symbol_kind::S_basic_filter: // basic_filter + value.move< std::unique_ptr > (std::move (that.value)); + break; + + case symbol_kind::S_TILDE: // TILDE + value.move< unsigned long > (std::move (that.value)); + break; + + default: + break; + } + + } +#endif + + /// Copy constructor. + basic_symbol (const basic_symbol& that); + + /// Constructors for typed symbols. #if 201103L <= YY_CPLUSPLUS - basic_symbol(typename Base::kind_type t, location_type &&l) : Base(t), location(std::move(l)) {} + basic_symbol (typename Base::kind_type t, location_type&& l) + : Base (t) + , location (std::move (l)) + {} #else - basic_symbol(typename Base::kind_type t, const location_type &l) : Base(t), location(l) {} + basic_symbol (typename Base::kind_type t, const location_type& l) + : Base (t) + , location (l) + {} #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol(typename Base::kind_type t, InfString &&v, location_type &&l) : Base(t), value(std::move(v)), location(std::move(l)) {} + basic_symbol (typename Base::kind_type t, InfString&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} #else - basic_symbol(typename Base::kind_type t, const InfString &v, const location_type &l) : Base(t), value(v), location(l) {} + basic_symbol (typename Base::kind_type t, const InfString& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol(typename Base::kind_type t, float &&v, location_type &&l) : Base(t), value(std::move(v)), location(std::move(l)) {} + basic_symbol (typename Base::kind_type t, float&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} #else - basic_symbol(typename Base::kind_type t, const float &v, const location_type &l) : Base(t), value(v), location(l) {} + basic_symbol (typename Base::kind_type t, const float& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol(typename Base::kind_type t, std::unique_ptr &&v, location_type &&l) - : Base(t), value(std::move(v)), location(std::move(l)) {} + basic_symbol (typename Base::kind_type t, std::unique_ptr&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} #else - basic_symbol(typename Base::kind_type t, const std::unique_ptr &v, const location_type &l) : Base(t), value(v), location(l) {} + basic_symbol (typename Base::kind_type t, const std::unique_ptr& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol(typename Base::kind_type t, unsigned long &&v, location_type &&l) : Base(t), value(std::move(v)), location(std::move(l)) {} + basic_symbol (typename Base::kind_type t, unsigned long&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} #else - basic_symbol(typename Base::kind_type t, const unsigned long &v, const location_type &l) : Base(t), value(v), location(l) {} + basic_symbol (typename Base::kind_type t, const unsigned long& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} #endif - /// Destroy the symbol. - ~basic_symbol() { clear(); } - - /// Destroy contents, and record that is empty. - void clear() YY_NOEXCEPT { - // User destructor. - symbol_kind_type yykind = this->kind(); - basic_symbol &yysym = *this; - (void)yysym; - switch (yykind) { - default: - break; - } - - // Value type destructor. - switch (yykind) { - case symbol_kind::S_STRING: // STRING - value.template destroy(); - break; - - case symbol_kind::S_CARAT: // CARAT - value.template destroy(); - break; - - case symbol_kind::S_topLevelQuery: // topLevelQuery - case symbol_kind::S_query: // query - case symbol_kind::S_clause: // clause - case symbol_kind::S_term: // term - case symbol_kind::S_basic_filter_boost: // basic_filter_boost - case symbol_kind::S_basic_filter: // basic_filter - value.template destroy>(); - break; - - case symbol_kind::S_TILDE: // TILDE - value.template destroy(); - break; - - default: - break; - } - - Base::clear(); + /// Destroy the symbol. + ~basic_symbol () + { + clear (); + } + + + + /// Destroy contents, and record that is empty. + void clear () YY_NOEXCEPT + { + // User destructor. + symbol_kind_type yykind = this->kind (); + basic_symbol& yysym = *this; + (void) yysym; + switch (yykind) + { + default: + break; } - /// The user-facing name of this symbol. - std::string name() const YY_NOEXCEPT { return SearchParser::symbol_name(this->kind()); } + // Value type destructor. +switch (yykind) + { + case symbol_kind::S_STRING: // STRING + value.template destroy< InfString > (); + break; + + case symbol_kind::S_CARAT: // CARAT + value.template destroy< float > (); + break; + + case symbol_kind::S_topLevelQuery: // topLevelQuery + case symbol_kind::S_query: // query + case symbol_kind::S_clause: // clause + case symbol_kind::S_term: // term + case symbol_kind::S_basic_filter_boost: // basic_filter_boost + case symbol_kind::S_basic_filter: // basic_filter + value.template destroy< std::unique_ptr > (); + break; + + case symbol_kind::S_TILDE: // TILDE + value.template destroy< unsigned long > (); + break; + + default: + break; + } + + Base::clear (); + } + + /// The user-facing name of this symbol. + std::string name () const YY_NOEXCEPT + { + return SearchParser::symbol_name (this->kind ()); + } - /// Backward compatibility (Bison 3.6). - symbol_kind_type type_get() const YY_NOEXCEPT; + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; - /// Whether empty. - bool empty() const YY_NOEXCEPT; + /// Whether empty. + bool empty () const YY_NOEXCEPT; - /// Destructive move, \a s is emptied into this. - void move(basic_symbol &s); + /// Destructive move, \a s is emptied into this. + void move (basic_symbol& s); - /// The semantic value. - value_type value; + /// The semantic value. + value_type value; - /// The location. - location_type location; + /// The location. + location_type location; private: #if YY_CPLUSPLUS < 201103L - /// Assignment operator. - basic_symbol &operator=(const basic_symbol &that); + /// Assignment operator. + basic_symbol& operator= (const basic_symbol& that); #endif }; /// Type access provider for token (enum) based symbols. - struct by_kind { - /// The symbol kind as needed by the constructor. - typedef token_kind_type kind_type; + struct by_kind + { + /// The symbol kind as needed by the constructor. + typedef token_kind_type kind_type; - /// Default constructor. - by_kind() YY_NOEXCEPT; + /// Default constructor. + by_kind () YY_NOEXCEPT; #if 201103L <= YY_CPLUSPLUS - /// Move constructor. - by_kind(by_kind &&that) YY_NOEXCEPT; + /// Move constructor. + by_kind (by_kind&& that) YY_NOEXCEPT; #endif - /// Copy constructor. - by_kind(const by_kind &that) YY_NOEXCEPT; + /// Copy constructor. + by_kind (const by_kind& that) YY_NOEXCEPT; - /// Constructor from (external) token numbers. - by_kind(kind_type t) YY_NOEXCEPT; + /// Constructor from (external) token numbers. + by_kind (kind_type t) YY_NOEXCEPT; - /// Record that this symbol is empty. - void clear() YY_NOEXCEPT; - /// Steal the symbol kind from \a that. - void move(by_kind &that); - /// The (internal) type number (corresponding to \a type). - /// \a empty when empty. - symbol_kind_type kind() const YY_NOEXCEPT; + /// Record that this symbol is empty. + void clear () YY_NOEXCEPT; - /// Backward compatibility (Bison 3.6). - symbol_kind_type type_get() const YY_NOEXCEPT; + /// Steal the symbol kind from \a that. + void move (by_kind& that); - /// The symbol kind. - /// \a S_YYEMPTY when empty. - symbol_kind_type kind_; + /// The (internal) type number (corresponding to \a type). + /// \a empty when empty. + symbol_kind_type kind () const YY_NOEXCEPT; + + /// Backward compatibility (Bison 3.6). + symbol_kind_type type_get () const YY_NOEXCEPT; + + /// The symbol kind. + /// \a S_YYEMPTY when empty. + symbol_kind_type kind_; }; /// Backward compatibility for a private implementation detail (Bison 3.6). typedef by_kind by_type; /// "External" symbols: returned by the scanner. - struct symbol_type : basic_symbol { - /// Superclass. - typedef basic_symbol super_type; + struct symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; - /// Empty symbol. - symbol_type() YY_NOEXCEPT {} + /// Empty symbol. + symbol_type () YY_NOEXCEPT {} - /// Constructor for valueless symbols, and symbols from each type. + /// Constructor for valueless symbols, and symbols from each type. #if 201103L <= YY_CPLUSPLUS - symbol_type(int tok, location_type l) - : super_type(token_kind_type(tok), std::move(l)) + symbol_type (int tok, location_type l) + : super_type (token_kind_type (tok), std::move (l)) #else - symbol_type(int tok, const location_type &l) - : super_type(token_kind_type(tok), l) + symbol_type (int tok, const location_type& l) + : super_type (token_kind_type (tok), l) #endif - { + { #if !defined _MSC_VER || defined __clang__ - YY_ASSERT(tok == token::END || (token::YYerror <= tok && tok <= token::OP_COLON)); + YY_ASSERT (tok == token::END + || (token::YYerror <= tok && tok <= token::OP_COLON)); #endif - } + } #if 201103L <= YY_CPLUSPLUS - symbol_type(int tok, InfString v, location_type l) - : super_type(token_kind_type(tok), std::move(v), std::move(l)) + symbol_type (int tok, InfString v, location_type l) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else - symbol_type(int tok, const InfString &v, const location_type &l) - : super_type(token_kind_type(tok), v, l) + symbol_type (int tok, const InfString& v, const location_type& l) + : super_type (token_kind_type (tok), v, l) #endif - { + { #if !defined _MSC_VER || defined __clang__ - YY_ASSERT(tok == token::STRING); + YY_ASSERT (tok == token::STRING); #endif - } + } #if 201103L <= YY_CPLUSPLUS - symbol_type(int tok, float v, location_type l) - : super_type(token_kind_type(tok), std::move(v), std::move(l)) + symbol_type (int tok, float v, location_type l) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else - symbol_type(int tok, const float &v, const location_type &l) - : super_type(token_kind_type(tok), v, l) + symbol_type (int tok, const float& v, const location_type& l) + : super_type (token_kind_type (tok), v, l) #endif - { + { #if !defined _MSC_VER || defined __clang__ - YY_ASSERT(tok == token::CARAT); + YY_ASSERT (tok == token::CARAT); #endif - } + } #if 201103L <= YY_CPLUSPLUS - symbol_type(int tok, unsigned long v, location_type l) - : super_type(token_kind_type(tok), std::move(v), std::move(l)) + symbol_type (int tok, unsigned long v, location_type l) + : super_type (token_kind_type (tok), std::move (v), std::move (l)) #else - symbol_type(int tok, const unsigned long &v, const location_type &l) - : super_type(token_kind_type(tok), v, l) + symbol_type (int tok, const unsigned long& v, const location_type& l) + : super_type (token_kind_type (tok), v, l) #endif - { + { #if !defined _MSC_VER || defined __clang__ - YY_ASSERT(tok == token::TILDE); + YY_ASSERT (tok == token::TILDE); #endif - } + } }; /// Build a parser object. - SearchParser(SearchScanner &scanner_yyarg, - const SearchDriver &driver_yyarg, - const std::string &default_field_yyarg, - std::unique_ptr &parse_result_yyarg); - virtual ~SearchParser(); + SearchParser (SearchScanner &scanner_yyarg, const SearchDriver &driver_yyarg, const std::string &default_field_yyarg, std::unique_ptr &parse_result_yyarg); + virtual ~SearchParser (); #if 201103L <= YY_CPLUSPLUS /// Non copyable. - SearchParser(const SearchParser &) = delete; + SearchParser (const SearchParser&) = delete; /// Non copyable. - SearchParser &operator=(const SearchParser &) = delete; + SearchParser& operator= (const SearchParser&) = delete; #endif /// Parse. An alias for parse (). /// \returns 0 iff parsing succeeded. - int operator()(); + int operator() (); /// Parse. /// \returns 0 iff parsing succeeded. - virtual int parse(); + virtual int parse (); #if YYDEBUG /// The current debugging stream. - std::ostream &debug_stream() const YY_ATTRIBUTE_PURE; + std::ostream& debug_stream () const YY_ATTRIBUTE_PURE; /// Set the current debugging stream. - void set_debug_stream(std::ostream &); + void set_debug_stream (std::ostream &); /// Type for debugging levels. typedef int debug_level_type; /// The current debugging level. - debug_level_type debug_level() const YY_ATTRIBUTE_PURE; + debug_level_type debug_level () const YY_ATTRIBUTE_PURE; /// Set the current debugging level. - void set_debug_level(debug_level_type l); + void set_debug_level (debug_level_type l); #endif /// Report a syntax error. /// \param loc where the syntax error is found. /// \param msg a description of the syntax error. - virtual void error(const location_type &loc, const std::string &msg); + virtual void error (const location_type& loc, const std::string& msg); /// Report a syntax error. - void error(const syntax_error &err); + void error (const syntax_error& err); /// The user-facing name of the symbol whose (internal) number is /// YYSYMBOL. No bounds checking. - static std::string symbol_name(symbol_kind_type yysymbol); + static std::string symbol_name (symbol_kind_type yysymbol); // Implementation of make_symbol for each token kind. #if 201103L <= YY_CPLUSPLUS - static symbol_type make_END(location_type l) { return symbol_type(token::END, std::move(l)); } + static + symbol_type + make_END (location_type l) + { + return symbol_type (token::END, std::move (l)); + } #else - static symbol_type make_END(const location_type &l) { return symbol_type(token::END, l); } + static + symbol_type + make_END (const location_type& l) + { + return symbol_type (token::END, l); + } #endif #if 201103L <= YY_CPLUSPLUS - static symbol_type make_YYerror(location_type l) { return symbol_type(token::YYerror, std::move(l)); } + static + symbol_type + make_YYerror (location_type l) + { + return symbol_type (token::YYerror, std::move (l)); + } #else - static symbol_type make_YYerror(const location_type &l) { return symbol_type(token::YYerror, l); } + static + symbol_type + make_YYerror (const location_type& l) + { + return symbol_type (token::YYerror, l); + } #endif #if 201103L <= YY_CPLUSPLUS - static symbol_type make_YYUNDEF(location_type l) { return symbol_type(token::YYUNDEF, std::move(l)); } + static + symbol_type + make_YYUNDEF (location_type l) + { + return symbol_type (token::YYUNDEF, std::move (l)); + } #else - static symbol_type make_YYUNDEF(const location_type &l) { return symbol_type(token::YYUNDEF, l); } + static + symbol_type + make_YYUNDEF (const location_type& l) + { + return symbol_type (token::YYUNDEF, l); + } #endif #if 201103L <= YY_CPLUSPLUS - static symbol_type make_AND(location_type l) { return symbol_type(token::AND, std::move(l)); } + static + symbol_type + make_AND (location_type l) + { + return symbol_type (token::AND, std::move (l)); + } #else - static symbol_type make_AND(const location_type &l) { return symbol_type(token::AND, l); } + static + symbol_type + make_AND (const location_type& l) + { + return symbol_type (token::AND, l); + } #endif #if 201103L <= YY_CPLUSPLUS - static symbol_type make_OR(location_type l) { return symbol_type(token::OR, std::move(l)); } + static + symbol_type + make_OR (location_type l) + { + return symbol_type (token::OR, std::move (l)); + } #else - static symbol_type make_OR(const location_type &l) { return symbol_type(token::OR, l); } + static + symbol_type + make_OR (const location_type& l) + { + return symbol_type (token::OR, l); + } #endif #if 201103L <= YY_CPLUSPLUS - static symbol_type make_NOT(location_type l) { return symbol_type(token::NOT, std::move(l)); } + static + symbol_type + make_NOT (location_type l) + { + return symbol_type (token::NOT, std::move (l)); + } #else - static symbol_type make_NOT(const location_type &l) { return symbol_type(token::NOT, l); } + static + symbol_type + make_NOT (const location_type& l) + { + return symbol_type (token::NOT, l); + } #endif #if 201103L <= YY_CPLUSPLUS - static symbol_type make_LPAREN(location_type l) { return symbol_type(token::LPAREN, std::move(l)); } + static + symbol_type + make_LPAREN (location_type l) + { + return symbol_type (token::LPAREN, std::move (l)); + } #else - static symbol_type make_LPAREN(const location_type &l) { return symbol_type(token::LPAREN, l); } + static + symbol_type + make_LPAREN (const location_type& l) + { + return symbol_type (token::LPAREN, l); + } #endif #if 201103L <= YY_CPLUSPLUS - static symbol_type make_RPAREN(location_type l) { return symbol_type(token::RPAREN, std::move(l)); } + static + symbol_type + make_RPAREN (location_type l) + { + return symbol_type (token::RPAREN, std::move (l)); + } #else - static symbol_type make_RPAREN(const location_type &l) { return symbol_type(token::RPAREN, l); } + static + symbol_type + make_RPAREN (const location_type& l) + { + return symbol_type (token::RPAREN, l); + } #endif #if 201103L <= YY_CPLUSPLUS - static symbol_type make_OP_COLON(location_type l) { return symbol_type(token::OP_COLON, std::move(l)); } + static + symbol_type + make_OP_COLON (location_type l) + { + return symbol_type (token::OP_COLON, std::move (l)); + } #else - static symbol_type make_OP_COLON(const location_type &l) { return symbol_type(token::OP_COLON, l); } + static + symbol_type + make_OP_COLON (const location_type& l) + { + return symbol_type (token::OP_COLON, l); + } #endif #if 201103L <= YY_CPLUSPLUS - static symbol_type make_TILDE(unsigned long v, location_type l) { return symbol_type(token::TILDE, std::move(v), std::move(l)); } + static + symbol_type + make_TILDE (unsigned long v, location_type l) + { + return symbol_type (token::TILDE, std::move (v), std::move (l)); + } #else - static symbol_type make_TILDE(const unsigned long &v, const location_type &l) { return symbol_type(token::TILDE, v, l); } + static + symbol_type + make_TILDE (const unsigned long& v, const location_type& l) + { + return symbol_type (token::TILDE, v, l); + } #endif #if 201103L <= YY_CPLUSPLUS - static symbol_type make_CARAT(float v, location_type l) { return symbol_type(token::CARAT, std::move(v), std::move(l)); } + static + symbol_type + make_CARAT (float v, location_type l) + { + return symbol_type (token::CARAT, std::move (v), std::move (l)); + } #else - static symbol_type make_CARAT(const float &v, const location_type &l) { return symbol_type(token::CARAT, v, l); } + static + symbol_type + make_CARAT (const float& v, const location_type& l) + { + return symbol_type (token::CARAT, v, l); + } #endif #if 201103L <= YY_CPLUSPLUS - static symbol_type make_STRING(InfString v, location_type l) { return symbol_type(token::STRING, std::move(v), std::move(l)); } + static + symbol_type + make_STRING (InfString v, location_type l) + { + return symbol_type (token::STRING, std::move (v), std::move (l)); + } #else - static symbol_type make_STRING(const InfString &v, const location_type &l) { return symbol_type(token::STRING, v, l); } + static + symbol_type + make_STRING (const InfString& v, const location_type& l) + { + return symbol_type (token::STRING, v, l); + } #endif - class context { + + class context + { public: - context(const SearchParser &yyparser, const symbol_type &yyla); - const symbol_type &lookahead() const YY_NOEXCEPT { return yyla_; } - symbol_kind_type token() const YY_NOEXCEPT { return yyla_.kind(); } - const location_type &location() const YY_NOEXCEPT { return yyla_.location; } + context (const SearchParser& yyparser, const symbol_type& yyla); + const symbol_type& lookahead () const YY_NOEXCEPT { return yyla_; } + symbol_kind_type token () const YY_NOEXCEPT { return yyla_.kind (); } + const location_type& location () const YY_NOEXCEPT { return yyla_.location; } - /// Put in YYARG at most YYARGN of the expected tokens, and return the - /// number of tokens stored in YYARG. If YYARG is null, return the - /// number of expected tokens (guaranteed to be less than YYNTOKENS). - int expected_tokens(symbol_kind_type yyarg[], int yyargn) const; + /// Put in YYARG at most YYARGN of the expected tokens, and return the + /// number of tokens stored in YYARG. If YYARG is null, return the + /// number of expected tokens (guaranteed to be less than YYNTOKENS). + int expected_tokens (symbol_kind_type yyarg[], int yyargn) const; private: - const SearchParser &yyparser_; - const symbol_type &yyla_; + const SearchParser& yyparser_; + const symbol_type& yyla_; }; -private: + private: #if YY_CPLUSPLUS < 201103L /// Non copyable. - SearchParser(const SearchParser &); + SearchParser (const SearchParser&); /// Non copyable. - SearchParser &operator=(const SearchParser &); + SearchParser& operator= (const SearchParser&); #endif + /// Stored state numbers (used for stacks). typedef signed char state_type; /// The arguments of the error message. - int yy_syntax_error_arguments_(const context &yyctx, symbol_kind_type yyarg[], int yyargn) const; + int yy_syntax_error_arguments_ (const context& yyctx, + symbol_kind_type yyarg[], int yyargn) const; /// Generate an error message. /// \param yyctx the context in which the error occurred. - virtual std::string yysyntax_error_(const context &yyctx) const; + virtual std::string yysyntax_error_ (const context& yyctx) const; /// Compute post-reduction state. /// \param yystate the current state /// \param yysym the nonterminal to push on the stack - static state_type yy_lr_goto_state_(state_type yystate, int yysym); + static state_type yy_lr_goto_state_ (state_type yystate, int yysym); /// Whether the given \c yypact_ value indicates a defaulted state. /// \param yyvalue the value to check - static bool yy_pact_value_is_default_(int yyvalue) YY_NOEXCEPT; + static bool yy_pact_value_is_default_ (int yyvalue) YY_NOEXCEPT; /// Whether the given \c yytable_ value indicates a syntax error. /// \param yyvalue the value to check - static bool yy_table_value_is_error_(int yyvalue) YY_NOEXCEPT; + static bool yy_table_value_is_error_ (int yyvalue) YY_NOEXCEPT; static const signed char yypact_ninf_; static const signed char yytable_ninf_; @@ -896,13 +1144,14 @@ class SearchParser { /// Convert a scanner token kind \a t to a symbol kind. /// In theory \a t should be a token_kind_type, but character literals /// are valid, yet not members of the token_kind_type enum. - static symbol_kind_type yytranslate_(int t) YY_NOEXCEPT; + static symbol_kind_type yytranslate_ (int t) YY_NOEXCEPT; /// Convert the symbol name \a n to a form suitable for a diagnostic. - static std::string yytnamerr_(const char *yystr); + static std::string yytnamerr_ (const char *yystr); /// For a symbol, its name in clear. - static const char *const yytname_[]; + static const char* const yytname_[]; + // Tables. // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing @@ -937,24 +1186,25 @@ class SearchParser { // YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. static const signed char yyr2_[]; + #if YYDEBUG // YYRLINE[YYN] -- Source line where rule number YYN was defined. static const unsigned char yyrline_[]; /// Report on the debug stream that the rule \a r is going to be reduced. - virtual void yy_reduce_print_(int r) const; + virtual void yy_reduce_print_ (int r) const; /// Print the state stack on the debug stream. - virtual void yy_stack_print_() const; + virtual void yy_stack_print_ () const; /// Debugging level. int yydebug_; /// Debug stream. - std::ostream *yycdebug_; + std::ostream* yycdebug_; /// \brief Display a symbol kind, value and location. /// \param yyo The output stream. /// \param yysym The symbol. template - void yy_print_(std::ostream &yyo, const basic_symbol &yysym) const; + void yy_print_ (std::ostream& yyo, const basic_symbol& yysym) const; #endif /// \brief Reclaim the memory associated to a symbol. @@ -962,141 +1212,183 @@ class SearchParser { /// If null, print nothing. /// \param yysym The symbol. template - void yy_destroy_(const char *yymsg, basic_symbol &yysym) const; + void yy_destroy_ (const char* yymsg, basic_symbol& yysym) const; -private: + private: /// Type access provider for state based symbols. - struct by_state { - /// Default constructor. - by_state() YY_NOEXCEPT; + struct by_state + { + /// Default constructor. + by_state () YY_NOEXCEPT; - /// The symbol kind as needed by the constructor. - typedef state_type kind_type; + /// The symbol kind as needed by the constructor. + typedef state_type kind_type; - /// Constructor. - by_state(kind_type s) YY_NOEXCEPT; + /// Constructor. + by_state (kind_type s) YY_NOEXCEPT; - /// Copy constructor. - by_state(const by_state &that) YY_NOEXCEPT; + /// Copy constructor. + by_state (const by_state& that) YY_NOEXCEPT; - /// Record that this symbol is empty. - void clear() YY_NOEXCEPT; + /// Record that this symbol is empty. + void clear () YY_NOEXCEPT; - /// Steal the symbol kind from \a that. - void move(by_state &that); + /// Steal the symbol kind from \a that. + void move (by_state& that); - /// The symbol kind (corresponding to \a state). - /// \a symbol_kind::S_YYEMPTY when empty. - symbol_kind_type kind() const YY_NOEXCEPT; + /// The symbol kind (corresponding to \a state). + /// \a symbol_kind::S_YYEMPTY when empty. + symbol_kind_type kind () const YY_NOEXCEPT; - /// The state number used to denote an empty symbol. - /// We use the initial state, as it does not have a value. - enum { empty_state = 0 }; + /// The state number used to denote an empty symbol. + /// We use the initial state, as it does not have a value. + enum { empty_state = 0 }; - /// The state. - /// \a empty when empty. - state_type state; + /// The state. + /// \a empty when empty. + state_type state; }; /// "Internal" symbol: element of the stack. - struct stack_symbol_type : basic_symbol { - /// Superclass. - typedef basic_symbol super_type; - /// Construct an empty symbol. - stack_symbol_type(); - /// Move or copy construction. - stack_symbol_type(YY_RVREF(stack_symbol_type) that); - /// Steal the contents from \a sym to build this. - stack_symbol_type(state_type s, YY_MOVE_REF(symbol_type) sym); + struct stack_symbol_type : basic_symbol + { + /// Superclass. + typedef basic_symbol super_type; + /// Construct an empty symbol. + stack_symbol_type (); + /// Move or copy construction. + stack_symbol_type (YY_RVREF (stack_symbol_type) that); + /// Steal the contents from \a sym to build this. + stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym); #if YY_CPLUSPLUS < 201103L - /// Assignment, needed by push_back by some old implementations. - /// Moves the contents of that. - stack_symbol_type &operator=(stack_symbol_type &that); + /// Assignment, needed by push_back by some old implementations. + /// Moves the contents of that. + stack_symbol_type& operator= (stack_symbol_type& that); - /// Assignment, needed by push_back by other implementations. - /// Needed by some other old implementations. - stack_symbol_type &operator=(const stack_symbol_type &that); + /// Assignment, needed by push_back by other implementations. + /// Needed by some other old implementations. + stack_symbol_type& operator= (const stack_symbol_type& that); #endif }; /// A stack with random access from its top. - template > - class stack { + template > + class stack + { public: - // Hide our reversed order. - typedef typename S::iterator iterator; - typedef typename S::const_iterator const_iterator; - typedef typename S::size_type size_type; - typedef typename std::ptrdiff_t index_type; + // Hide our reversed order. + typedef typename S::iterator iterator; + typedef typename S::const_iterator const_iterator; + typedef typename S::size_type size_type; + typedef typename std::ptrdiff_t index_type; - stack(size_type n = 200) YY_NOEXCEPT : seq_(n) {} + stack (size_type n = 200) YY_NOEXCEPT + : seq_ (n) + {} #if 201103L <= YY_CPLUSPLUS - /// Non copyable. - stack(const stack &) = delete; - /// Non copyable. - stack &operator=(const stack &) = delete; -#endif - - /// Random access. - /// - /// Index 0 returns the topmost element. - const T &operator[](index_type i) const { return seq_[size_type(size() - 1 - i)]; } - - /// Random access. - /// - /// Index 0 returns the topmost element. - T &operator[](index_type i) { return seq_[size_type(size() - 1 - i)]; } - - /// Steal the contents of \a t. - /// - /// Close to move-semantics. - void push(YY_MOVE_REF(T) t) { - seq_.push_back(T()); - operator[](0).move(t); - } - - /// Pop elements from the stack. - void pop(std::ptrdiff_t n = 1) YY_NOEXCEPT { - for (; 0 < n; --n) - seq_.pop_back(); + /// Non copyable. + stack (const stack&) = delete; + /// Non copyable. + stack& operator= (const stack&) = delete; +#endif + + /// Random access. + /// + /// Index 0 returns the topmost element. + const T& + operator[] (index_type i) const + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Random access. + /// + /// Index 0 returns the topmost element. + T& + operator[] (index_type i) + { + return seq_[size_type (size () - 1 - i)]; + } + + /// Steal the contents of \a t. + /// + /// Close to move-semantics. + void + push (YY_MOVE_REF (T) t) + { + seq_.push_back (T ()); + operator[] (0).move (t); + } + + /// Pop elements from the stack. + void + pop (std::ptrdiff_t n = 1) YY_NOEXCEPT + { + for (; 0 < n; --n) + seq_.pop_back (); + } + + /// Pop all elements from the stack. + void + clear () YY_NOEXCEPT + { + seq_.clear (); + } + + /// Number of elements on the stack. + index_type + size () const YY_NOEXCEPT + { + return index_type (seq_.size ()); + } + + /// Iterator on top of the stack (going downwards). + const_iterator + begin () const YY_NOEXCEPT + { + return seq_.begin (); + } + + /// Bottom of the stack. + const_iterator + end () const YY_NOEXCEPT + { + return seq_.end (); + } + + /// Present a slice of the top of a stack. + class slice + { + public: + slice (const stack& stack, index_type range) YY_NOEXCEPT + : stack_ (stack) + , range_ (range) + {} + + const T& + operator[] (index_type i) const + { + return stack_[range_ - i]; } - /// Pop all elements from the stack. - void clear() YY_NOEXCEPT { seq_.clear(); } - - /// Number of elements on the stack. - index_type size() const YY_NOEXCEPT { return index_type(seq_.size()); } - - /// Iterator on top of the stack (going downwards). - const_iterator begin() const YY_NOEXCEPT { return seq_.begin(); } - - /// Bottom of the stack. - const_iterator end() const YY_NOEXCEPT { return seq_.end(); } - - /// Present a slice of the top of a stack. - class slice { - public: - slice(const stack &stack, index_type range) YY_NOEXCEPT : stack_(stack), range_(range) {} - - const T &operator[](index_type i) const { return stack_[range_ - i]; } - - private: - const stack &stack_; - index_type range_; - }; + private: + const stack& stack_; + index_type range_; + }; private: #if YY_CPLUSPLUS < 201103L - /// Non copyable. - stack(const stack &); - /// Non copyable. - stack &operator=(const stack &); + /// Non copyable. + stack (const stack&); + /// Non copyable. + stack& operator= (const stack&); #endif - /// The wrapped container. - S seq_; + /// The wrapped container. + S seq_; }; + /// Stack type. typedef stack stack_type; @@ -1108,7 +1400,7 @@ class SearchParser { /// if null, no trace is output. /// \param sym the symbol /// \warning the contents of \a s.value is stolen. - void yypush_(const char *m, YY_MOVE_REF(stack_symbol_type) sym); + void yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym); /// Push a new look ahead token on the state on the stack. /// \param m a debug message to display @@ -1116,27 +1408,34 @@ class SearchParser { /// \param s the state /// \param sym the symbol (for its value and location). /// \warning the contents of \a sym.value is stolen. - void yypush_(const char *m, state_type s, YY_MOVE_REF(symbol_type) sym); + void yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym); /// Pop \a n symbols from the stack. - void yypop_(int n = 1) YY_NOEXCEPT; + void yypop_ (int n = 1) YY_NOEXCEPT; /// Constants. - enum { - yylast_ = 26, ///< Last index in yytable_. - yynnts_ = 7, ///< Number of nonterminal symbols. - yyfinal_ = 14 ///< Termination state number. + enum + { + yylast_ = 26, ///< Last index in yytable_. + yynnts_ = 7, ///< Number of nonterminal symbols. + yyfinal_ = 14 ///< Termination state number. }; + // User arguments. SearchScanner &scanner; const SearchDriver &driver; const std::string &default_field; std::unique_ptr &parse_result; -}; + + }; + #line 10 "search_parser.y" -} // namespace infinity +} // infinity #line 1437 "search_parser.h" + + + #endif // !YY_YY_SEARCH_PARSER_H_INCLUDED diff --git a/src/parser/statement/admin_statement.h b/src/parser/statement/admin_statement.h index 3d71a36853..c17e499e22 100644 --- a/src/parser/statement/admin_statement.h +++ b/src/parser/statement/admin_statement.h @@ -45,11 +45,11 @@ enum class AdminStmtType { kListNodes, kShowNode, kShowCurrentNode, + kListSnapshots, + kShowSnapshot, kRemoveNode, kSetRole, kCreateSnapshot, - kListSnapshots, - kShowSnapshot, kDeleteSnapshot, kExportSnapshot, kRecoverFromSnapshot, @@ -89,4 +89,5 @@ class AdminStatement : public BaseStatement { std::optional export_path_{}; }; -} // namespace infinity +} +// namespace infinity diff --git a/src/parser/statement/command_statement.cpp b/src/parser/statement/command_statement.cpp index 74e758383b..8dac6e37f5 100644 --- a/src/parser/statement/command_statement.cpp +++ b/src/parser/statement/command_statement.cpp @@ -25,5 +25,6 @@ std::string LockCmd::ToString() const { return "Lock Command"; } std::string UnlockCmd::ToString() const { return "Unlock Command"; } std::string CleanupCmd::ToString() const { return "Cleanup Command"; } std::string TestCmd::ToString() const { return "Test Command: " + command_content_; } +std::string SnapshotCmd::ToString() const { return "Snapshot command"; } } // namespace infinity \ No newline at end of file diff --git a/src/parser/statement/command_statement.cppm b/src/parser/statement/command_statement.cppm index b28310fe82..59b8992d52 100644 --- a/src/parser/statement/command_statement.cppm +++ b/src/parser/statement/command_statement.cppm @@ -34,4 +34,8 @@ export using infinity::LockCmd; export using infinity::UnlockCmd; export using infinity::CleanupCmd; export using infinity::TestCmd; +export using infinity::SnapshotCmd; +export using infinity::SnapshotOp; +export using infinity::SnapshotScope; + } // namespace infinity diff --git a/src/parser/statement/command_statement.h b/src/parser/statement/command_statement.h index 8ca2e15f83..c9284c2294 100644 --- a/src/parser/statement/command_statement.h +++ b/src/parser/statement/command_statement.h @@ -32,6 +32,7 @@ enum class CommandType { kUnlockTable, kCleanup, kTestCommand, + kSnapshot, }; class CommandInfo { @@ -236,7 +237,7 @@ class CommandStatement final : public BaseStatement { class TestCmd final : public CommandInfo { public: - TestCmd(std::string command_content) : CommandInfo(CommandType::kTestCommand), command_content_(command_content) {} + TestCmd(std::string command_content) : CommandInfo(CommandType::kTestCommand), command_content_(std::move(command_content)) {} [[nodiscard]] std::string ToString() const final; @@ -246,4 +247,25 @@ class TestCmd final : public CommandInfo { std::string command_content_{}; }; +enum class SnapshotOp { kCreate, kDrop, kRestore, kInvalid }; +enum class SnapshotScope { kTable, kDatabase, kSystem, kIgnore, kInvalid }; + +class SnapshotCmd final : public CommandInfo { +public: + SnapshotCmd(std::string name, SnapshotOp op, SnapshotScope scope, std::optional object_name = std::nullopt) + : CommandInfo(CommandType::kSnapshot), name_(std::move(name)), operation_(op), scope_(scope), object_name_(std::move(object_name)) {} + + [[nodiscard]] std::string ToString() const final; + + const std::string &name() { return name_; } + SnapshotOp operation() { return operation_; } + SnapshotScope &scope() { return scope_; } + +private: + std::string name_{}; + SnapshotOp operation_{SnapshotOp::kInvalid}; + SnapshotScope scope_{SnapshotScope::kInvalid}; + std::optional object_name_{std::nullopt}; +}; + } // namespace infinity diff --git a/src/parser/statement/show_statement.cpp b/src/parser/statement/show_statement.cpp index b01f408445..00f3db370f 100644 --- a/src/parser/statement/show_statement.cpp +++ b/src/parser/statement/show_statement.cpp @@ -180,6 +180,14 @@ std::string ShowStatement::ToString() const { ss << "Show function"; break; } + case ShowStmtType::kListSnapshots: { + ss << "List snapshots"; + break; + } + case ShowStmtType::kShowSnapshot: { + ss << "Show snapshot"; + break; + } } return ss.str(); } diff --git a/src/parser/statement/show_statement.h b/src/parser/statement/show_statement.h index 6fa5048f51..45413daa00 100644 --- a/src/parser/statement/show_statement.h +++ b/src/parser/statement/show_statement.h @@ -59,7 +59,9 @@ enum class ShowStmtType { kMemory, kMemoryObjects, kMemoryAllocation, - kFunction + kFunction, + kListSnapshots, + kShowSnapshot }; class ShowStatement : public BaseStatement { @@ -81,6 +83,7 @@ class ShowStatement : public BaseStatement { std::optional session_id_{}; std::optional txn_id_{}; std::string var_name_{}; + std::optional snapshot_name_{}; }; } // namespace infinity diff --git a/src/planner/explain_ast.cpp b/src/planner/explain_ast.cpp index d710853532..329a965a33 100644 --- a/src/planner/explain_ast.cpp +++ b/src/planner/explain_ast.cpp @@ -773,6 +773,14 @@ Status ExplainAST::BuildShow(const ShowStatement *show_statement, SharedPtremplace_back(MakeShared("SHOW FUNCTION")); break; } + case ShowStmtType::kListSnapshots: { + result->emplace_back(MakeShared("LIST SNAPSHOTS")); + break; + } + case ShowStmtType::kShowSnapshot: { + result->emplace_back(MakeShared("SHOW SNAPSHOT")); + break; + } case ShowStmtType::kInvalid: { String error_message = "Invalid show statement type"; UnrecoverableError(error_message); diff --git a/src/planner/explain_logical_plan.cpp b/src/planner/explain_logical_plan.cpp index e0b8272e19..14f2c9342c 100644 --- a/src/planner/explain_logical_plan.cpp +++ b/src/planner/explain_logical_plan.cpp @@ -2096,6 +2096,34 @@ Status ExplainLogicalPlan::Explain(const LogicalShow *show_node, SharedPtremplace_back(MakeShared(output_columns_str)); break; } + case ShowStmtType::kListSnapshots: { + String show_str; + if (intent_size != 0) { + show_str = String(intent_size - 2, ' '); + show_str += "-> SHOW SNAPSHOTS "; + } else { + show_str = "SHOW SNAPSHOTS "; + } + show_str += "("; + show_str += std::to_string(show_node->node_id()); + show_str += ")"; + result->emplace_back(MakeShared(show_str)); + break; + } + case ShowStmtType::kShowSnapshot: { + String show_str; + if (intent_size != 0) { + show_str = String(intent_size - 2, ' '); + show_str += "-> SHOW SNAPSHOT "; + } else { + show_str = "SHOW SNAPSHOT "; + } + show_str += "("; + show_str += std::to_string(show_node->node_id()); + show_str += ")"; + result->emplace_back(MakeShared(show_str)); + break; + } } return Status::OK(); } diff --git a/src/planner/logical_planner.cpp b/src/planner/logical_planner.cpp index f927e384c3..67cc68dc62 100644 --- a/src/planner/logical_planner.cpp +++ b/src/planner/logical_planner.cpp @@ -1328,6 +1328,16 @@ Status LogicalPlanner::BuildCommand(const CommandStatement *command_statement, S this->logical_plan_ = logical_command; break; } + case CommandType::kSnapshot: { + StorageMode storage_mode = InfinityContext::instance().storage()->GetStorageMode(); + if (storage_mode == StorageMode::kUnInitialized) { + UnrecoverableError("Uninitialized storage mode"); + } + + auto logical_command = MakeShared(bind_context_ptr->GetNewLogicalNodeId(), command_statement->command_info_); + this->logical_plan_ = logical_command; + break; + } default: { String error_message = "Invalid command type."; UnrecoverableError(error_message); @@ -1708,6 +1718,38 @@ Status LogicalPlanner::BuildShow(ShowStatement *statement, SharedPtrfunction_name_); break; } + case ShowStmtType::kListSnapshots: { + this->logical_plan_ = MakeShared(bind_context_ptr->GetNewLogicalNodeId(), + ShowStmtType::kListSnapshots, + "", + "", + bind_context_ptr->GenerateTableIndex(), + None, + None, + None, + None, + None, + None, + None, + statement->function_name_); + break; + } + case ShowStmtType::kShowSnapshot: { + this->logical_plan_ = MakeShared(bind_context_ptr->GetNewLogicalNodeId(), + ShowStmtType::kShowSnapshot, + "", + statement->snapshot_name_, + bind_context_ptr->GenerateTableIndex(), + None, + None, + None, + None, + None, + None, + None, + statement->function_name_); + break; + } default: { String error_message = "Unexpected show statement type."; UnrecoverableError(error_message); diff --git a/src/planner/node/logical_command.cpp b/src/planner/node/logical_command.cpp index 95f80028fc..292b1b5dcf 100644 --- a/src/planner/node/logical_command.cpp +++ b/src/planner/node/logical_command.cpp @@ -123,6 +123,53 @@ String LogicalCommand::ToString(i64 &space) const { ss << String(space, ' ') << arrow_str << "Test command: " << test_command_info->command_content(); break; } + case CommandType::kSnapshot: { + auto *snapshot_info = static_cast(command_info_.get()); + ss << String(space, ' ') << arrow_str << "Snapshot command: "; + switch(snapshot_info->operation()) { + case SnapshotOp::kCreate: { + ss << "CREATE "; + break; + } + case SnapshotOp::kDrop: { + ss << "DROP "; + break; + } + case SnapshotOp::kRestore: { + ss << "RESTORE "; + break; + } + case SnapshotOp::kInvalid: { + String error_message = "Invalid snapshot operation type."; + UnrecoverableError(error_message); + } + } + + switch(snapshot_info->scope()) { + case SnapshotScope::kSystem: { + ss << "SYSTEM "; + break; + } + case SnapshotScope::kDatabase: { + ss << "DATABASE "; + break; + } + case SnapshotScope::kTable: { + ss << "TABLE "; + break; + } + case SnapshotScope::kIgnore: { + break; + } + case SnapshotScope::kInvalid: { + String error_message = "Invalid snapshot scope."; + UnrecoverableError(error_message); + } + } + + ss << snapshot_info->name(); + break; + } case CommandType::kInvalid: { String error_message = "Invalid command type."; UnrecoverableError(error_message); diff --git a/src/planner/node/logical_show.cpp b/src/planner/node/logical_show.cpp index db7f73e9f3..51fa10b9ec 100644 --- a/src/planner/node/logical_show.cpp +++ b/src/planner/node/logical_show.cpp @@ -106,6 +106,10 @@ String ToString(ShowStmtType type) { return "Show function"; case ShowStmtType::kCollections: return "Show collection"; + case ShowStmtType::kListSnapshots: + return "List snapshots"; + case ShowStmtType::kShowSnapshot: + return "Show snapshot"; case ShowStmtType::kInvalid: { String error_message = "Invalid chunk scan type"; UnrecoverableError(error_message); diff --git a/src/storage/common/snapshot_info.cppm b/src/storage/common/snapshot_info.cppm new file mode 100644 index 0000000000..0cae732816 --- /dev/null +++ b/src/storage/common/snapshot_info.cppm @@ -0,0 +1,74 @@ +// Copyright(C) 2024 InfiniFlow, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module; + +export module snapshot_info; + +import stl; +import status; +import command_statement; +import index_base; + +namespace infinity { + +export struct SnapshotInfo { + // structure to represent the snapshot + String snapshot_name_; + String filename_; + SnapshotScope scope_; +}; + +export struct OutlineSnapshotInfo { + String filename_; +}; + +export struct BlockColumnSnapshotInfo { + ColumnID column_id_; + String filename_; + Vector outline_snapshots_; +}; + +export struct BlockSnapshotInfo { + BlockID block_id_; + Vector column_block_snapshots_; +}; + +export struct SegmentSnapshotInfo { + SegmentID segment_id_; + Vector block_snapshots_; +}; + +export struct ChunkIndexSnapshot { + ChunkID chunk_id_; + String filename_; +}; + +export struct SegmentIndexSnapshotInfo { + Vector chunk_index_snapshots_{}; +}; + +export struct TableIndexSnapshotInfo { + String table_index_name_; + const SharedPtr index_base_{}; + const SharedPtr index_dir_{}; + Map> index_by_segment_{}; +}; + +export struct TableSnapshotInfo : public SnapshotInfo { + String db_name_; + String table_name_; +}; + +} // namespace infinity diff --git a/src/storage/meta/catalog.cpp b/src/storage/meta/catalog.cpp index 9c0eea66e2..3fc1d2f62b 100644 --- a/src/storage/meta/catalog.cpp +++ b/src/storage/meta/catalog.cpp @@ -63,6 +63,7 @@ import persist_result_handler; import local_file_handle; import admin_statement; import global_resource_usage; +import snapshot_info; namespace infinity { @@ -308,6 +309,16 @@ Tuple Catalog::GetTableByName(const String &db_name, const return db_entry->GetTableCollection(table_name, txn_id, begin_ts); } +Tuple, Status> Catalog::GetTableSnapshot(const String &db_name, const String &table_name, TransactionID txn_id, TxnTimeStamp begin_ts) { + auto [table_entry, table_status] = this->GetTableByName(db_name, table_name, txn_id, begin_ts); + if (!table_status.ok()) { + // Error + LOG_ERROR(fmt::format("Fail to get table {} from database: {}, error message: {}.", table_name, db_name, table_status.message())); + return {nullptr, table_status}; + } + return table_entry->GetSnapshotInfo(begin_ts); +} + Tuple, Status> Catalog::GetTableInfo(const String &db_name, const String &table_name, Txn *txn) { TransactionID txn_id = txn->TxnID(); TxnTimeStamp begin_ts = txn->BeginTS(); diff --git a/src/storage/meta/catalog.cppm b/src/storage/meta/catalog.cppm index 6b1eb821ac..85ce490e8c 100644 --- a/src/storage/meta/catalog.cppm +++ b/src/storage/meta/catalog.cppm @@ -42,6 +42,7 @@ import base_entry; import column_def; import cleanup_scanner; import log_file; +import snapshot_info; namespace infinity { @@ -151,6 +152,8 @@ public: Tuple GetTableByName(const String &db_name, const String &table_name, TransactionID txn_id, TxnTimeStamp begin_ts); + Tuple, Status> GetTableSnapshot(const String &db_name, const String &table_name, TransactionID txn_id, TxnTimeStamp begin_ts); + Tuple, Status> GetTableInfo(const String &db_name, const String &table_name, Txn *txn); static Status RemoveTableEntry(TableEntry *table_entry, TransactionID txn_id); diff --git a/src/storage/meta/entry/block_column_entry.cpp b/src/storage/meta/entry/block_column_entry.cpp index 6b39b6edae..1833b3366d 100644 --- a/src/storage/meta/entry/block_column_entry.cpp +++ b/src/storage/meta/entry/block_column_entry.cpp @@ -171,6 +171,8 @@ ColumnVector BlockColumnEntry::GetConstColumnVector(BufferManager *buffer_mgr, S return GetColumnVectorInner(buffer_mgr, ColumnVectorTipe::kReadOnly, row_count); } +SharedPtr BlockColumnEntry::GetSnapshotInfo() { return nullptr; } + ColumnVector BlockColumnEntry::GetColumnVectorInner(BufferManager *buffer_mgr, const ColumnVectorTipe tipe, SizeT row_count) { if (this->buffer_ == nullptr) { // Get buffer handle from buffer manager diff --git a/src/storage/meta/entry/block_column_entry.cppm b/src/storage/meta/entry/block_column_entry.cppm index e4f7e0c78b..43a54e5a06 100644 --- a/src/storage/meta/entry/block_column_entry.cppm +++ b/src/storage/meta/entry/block_column_entry.cppm @@ -29,6 +29,7 @@ import base_entry; import column_def; import value; import cleanup_scanner; +import snapshot_info; namespace infinity { @@ -93,6 +94,7 @@ public: ColumnVector GetConstColumnVector(BufferManager *buffer_mgr, SizeT row_count); + SharedPtr GetSnapshotInfo(); private: ColumnVector GetColumnVectorInner(BufferManager *buffer_mgr, const ColumnVectorTipe tipe, SizeT row_count); diff --git a/src/storage/meta/entry/table_entry.cpp b/src/storage/meta/entry/table_entry.cpp index 883d80cba0..ddcdac7117 100644 --- a/src/storage/meta/entry/table_entry.cpp +++ b/src/storage/meta/entry/table_entry.cpp @@ -264,6 +264,8 @@ Tuple, Status> TableEntry::GetTableIndexInfo(const Str return index_meta->GetTableIndexInfo(std::move(r_lock), txn_id, begin_ts); } +Tuple, Status> TableEntry::GetSnapshotInfo(TxnTimeStamp begin_ts) { return {nullptr, Status::OK()}; } + void TableEntry::RemoveIndexEntry(const String &index_name, TransactionID txn_id) { auto [index_meta, status] = index_meta_map_.GetExistMetaNoLock(index_name, ConflictType::kError); if (!status.ok()) { diff --git a/src/storage/meta/entry/table_entry.cppm b/src/storage/meta/entry/table_entry.cppm index 5d10f7cbb2..91198454cd 100644 --- a/src/storage/meta/entry/table_entry.cppm +++ b/src/storage/meta/entry/table_entry.cppm @@ -35,6 +35,7 @@ import block_entry; import table_index_meta; import compaction_alg; import meta_map; +import snapshot_info; import cleanup_scanner; import random; @@ -124,6 +125,8 @@ public: Tuple, Status> GetTableIndexInfo(const String &index_name, TransactionID txn_id, TxnTimeStamp begin_ts); + Tuple, Status> GetSnapshotInfo(TxnTimeStamp begin_ts); + void RemoveIndexEntry(const String &index_name, TransactionID txn_id); MetaMap::MapGuard IndexMetaMap() const { return index_meta_map_.GetMetaMap(); } diff --git a/src/storage/txn/txn.cpp b/src/storage/txn/txn.cpp index e1e40f2366..ecac6ff998 100644 --- a/src/storage/txn/txn.cpp +++ b/src/storage/txn/txn.cpp @@ -56,6 +56,7 @@ import admin_statement; import global_resource_usage; import wal_manager; import defer_op; +import snapshot_info; namespace infinity { @@ -444,6 +445,12 @@ Tuple, Status> Txn::GetTableInfo(const String &db_name, con return catalog_->GetTableInfo(db_name, table_name, this); } +Tuple, Status> Txn::GetTableSnapshot(const String &db_name, const String &table_name) { + this->CheckTxn(db_name); + TxnTimeStamp begin_ts = this->BeginTS(); + return catalog_->GetTableSnapshot(db_name, table_name, TxnID(), begin_ts); +} + Status Txn::CreateCollection(const String &, const String &, ConflictType, BaseEntry *&) { return {ErrorCode::kNotSupported, "Not Implemented Txn Operation: CreateCollection"}; } diff --git a/src/storage/txn/txn.cppm b/src/storage/txn/txn.cppm index 74ea9541a0..ea035da3e7 100644 --- a/src/storage/txn/txn.cppm +++ b/src/storage/txn/txn.cppm @@ -32,6 +32,7 @@ import extra_ddl_info; import internal_types; import column_def; import value; +import snapshot_info; namespace infinity { @@ -131,6 +132,8 @@ public: Status GetCollectionByName(const String &db_name, const String &table_name, BaseEntry *&collection_entry); + Tuple, Status> GetTableSnapshot(const String &db_name, const String &table_name); + // Index OPs // If `prepare` is false, the index will be created in single thread. (called by `FsPhysicalCreateIndex`) // Else, only data is stored in index (Called by `PhysicalCreateIndexPrepare`). And the index will be created by multiple threads in next diff --git a/src/unit_test/main/config.cpp b/src/unit_test/main/config.cpp index 36eb37b1b3..bb22670ecc 100644 --- a/src/unit_test/main/config.cpp +++ b/src/unit_test/main/config.cpp @@ -243,6 +243,7 @@ TEST_F(ConfigTest, TestValidValues) { EXPECT_EQ(config.CleanupInterval(), 60); EXPECT_EQ(config.CompactInterval(), 120); EXPECT_EQ(config.MemIndexCapacity(), 1048576); + EXPECT_EQ(config.SnapshotDir(), "/var/infinity/snapshot"); // buffer EXPECT_EQ(config.BufferManagerSize(), 4 * 1024l * 1024l * 1024l); From e295d00fe99f9a442f11df88c177019f81966964 Mon Sep 17 00:00:00 2001 From: Jin Hai Date: Tue, 31 Dec 2024 20:27:34 +0800 Subject: [PATCH 2/9] Update readme (#2417) ### What problem does this PR solve? Fix readme bug ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) - [x] Documentation Update Signed-off-by: Jin Hai --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0244bc01b2..e53597d285 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,8 @@ Infinity supports two working modes, embedded mode and client-server mode. Infin print(res) ``` +> 💡 For more information about Infinity's Python API, see the [Python API Reference](https://infiniflow.org/docs/dev/pysdk_api_reference). + #### 🔧 Deploy Infinity in client-server mode If you wish to deploy Infinity with the server and client as separate processes, see the [Deploy infinity server](https://infiniflow.org/docs/dev/deploy_infinity_server) guide. @@ -90,8 +92,6 @@ If you wish to deploy Infinity with the server and client as separate processes, See the [Build from Source](https://infiniflow.org/docs/dev/build_from_source) guide. -> 💡 For more information about Infinity's Python API, see the [Python API Reference](https://infiniflow.org/docs/dev/pysdk_api_reference). - ## 📚 Document - [Quickstart](https://infiniflow.org/docs/dev/) From d48860a391ae5454d0c2ff06a4dbd84212c0be92 Mon Sep 17 00:00:00 2001 From: yangzq50 Date: Thu, 2 Jan 2025 16:08:32 +0800 Subject: [PATCH 3/9] Fix UnrecoverableError: Invalid MergeFlag: 1 (#2416) ### What problem does this PR solve? Fix `bool TxnTableStore::CheckConflict(const TxnTableStore *other_table_store) const` Issue link:#2388 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) - [x] Refactoring --- .../meta/entry/segment_index_entry.cpp | 19 +++--- .../meta/entry/segment_index_entry.cppm | 2 +- src/storage/meta/entry/table_entry.cpp | 5 +- src/storage/txn/txn.cpp | 8 +-- src/storage/txn/txn.cppm | 2 +- src/storage/txn/txn_manager.cpp | 12 ++-- src/storage/txn/txn_manager.cppm | 2 +- src/storage/txn/txn_store.cpp | 60 +++++++++++++++---- src/storage/txn/txn_store.cppm | 4 +- 9 files changed, 76 insertions(+), 38 deletions(-) diff --git a/src/storage/meta/entry/segment_index_entry.cpp b/src/storage/meta/entry/segment_index_entry.cpp index 1e5f2b48e9..cfa01e5281 100644 --- a/src/storage/meta/entry/segment_index_entry.cpp +++ b/src/storage/meta/entry/segment_index_entry.cpp @@ -865,7 +865,8 @@ void SegmentIndexEntry::ReplaceChunkIndexEntries(TxnTableStore *txn_table_store, ChunkIndexEntry *SegmentIndexEntry::RebuildChunkIndexEntries(TxnTableStore *txn_table_store, SegmentEntry *segment_entry) { const auto &index_name = *table_index_entry_->GetIndexName(); Txn *txn = txn_table_store->GetTxn(); - if (!TrySetOptimizing(txn)) { + const auto [result_b, add_segment_optimizing] = TrySetOptimizing(txn); + if (!result_b) { LOG_INFO(fmt::format("Index {} segment {} is optimizing, skip optimize.", index_name, segment_id_)); return nullptr; } @@ -899,6 +900,7 @@ ChunkIndexEntry *SegmentIndexEntry::RebuildChunkIndexEntries(TxnTableStore *txn_ return nullptr; } } + add_segment_optimizing(); RowID base_rowid(segment_id_, 0); SharedPtr merged_chunk_index_entry = nullptr; switch (index_base->index_type_) { @@ -1225,17 +1227,18 @@ UniquePtr SegmentIndexEntry::Deserialize(const nlohmann::json return segment_index_entry; } -bool SegmentIndexEntry::TrySetOptimizing(Txn *txn) { +Pair> SegmentIndexEntry::TrySetOptimizing(Txn *txn) { bool expected = false; bool success = optimizing_.compare_exchange_strong(expected, true); if (!success) { - return false; + return {false, nullptr}; } - TableEntry *table_entry = table_index_entry_->table_index_meta()->GetTableEntry(); - TxnTableStore *txn_table_store = txn->txn_store()->GetTxnTableStore(table_entry); - TxnIndexStore *txn_index_store = txn_table_store->GetIndexStore(table_index_entry_); - txn_index_store->AddSegmentOptimizing(this); - return true; + return {true, [this, txn] { + TableEntry *table_entry = table_index_entry_->table_index_meta()->GetTableEntry(); + TxnTableStore *txn_table_store = txn->txn_store()->GetTxnTableStore(table_entry); + TxnIndexStore *txn_index_store = txn_table_store->GetIndexStore(table_index_entry_); + txn_index_store->AddSegmentOptimizing(this); + }}; } void SegmentIndexEntry::ResetOptimizing() { optimizing_.store(false); } diff --git a/src/storage/meta/entry/segment_index_entry.cppm b/src/storage/meta/entry/segment_index_entry.cppm index 88242b9270..10bc288b81 100644 --- a/src/storage/meta/entry/segment_index_entry.cppm +++ b/src/storage/meta/entry/segment_index_entry.cppm @@ -277,7 +277,7 @@ private: Atomic deprecate_ts_ = UNCOMMIT_TS; public: - bool TrySetOptimizing(Txn *txn); + Pair> TrySetOptimizing(Txn *txn); void ResetOptimizing(); diff --git a/src/storage/meta/entry/table_entry.cpp b/src/storage/meta/entry/table_entry.cpp index ddcdac7117..c8384f26c7 100644 --- a/src/storage/meta/entry/table_entry.cpp +++ b/src/storage/meta/entry/table_entry.cpp @@ -918,7 +918,8 @@ void TableEntry::OptimizeIndex(Txn *txn) { const IndexFullText *index_fulltext = static_cast(index_base); Map> index_by_segment = table_index_entry->GetIndexBySegmentSnapshot(this, txn); for (auto &[segment_id, segment_index_entry] : index_by_segment) { - if (!segment_index_entry->TrySetOptimizing(txn)) { + const auto [result_b, add_segment_optimizing] = segment_index_entry->TrySetOptimizing(txn); + if (!result_b) { LOG_INFO(fmt::format("Index {} segment {} is optimizing, skip optimize.", index_name, segment_id)); continue; } @@ -937,7 +938,7 @@ void TableEntry::OptimizeIndex(Txn *txn) { opt_success = true; continue; } - + add_segment_optimizing(); String msg = fmt::format("merging {}", index_name); Vector base_names; Vector base_rowids; diff --git a/src/storage/txn/txn.cpp b/src/storage/txn/txn.cpp index ecac6ff998..798181c1df 100644 --- a/src/storage/txn/txn.cpp +++ b/src/storage/txn/txn.cpp @@ -568,11 +568,11 @@ TxnTimeStamp Txn::Commit() { txn_store_.PrepareCommit1(); // Only for import and compact, pre-commit segment // LOG_INFO(fmt::format("Txn {} commit ts: {}", txn_id_, commit_ts)); - if (txn_mgr_->CheckTxnConflict(this)) { - LOG_ERROR(fmt::format("Txn: {} is rolled back. rollback ts: {}", txn_id_, commit_ts)); + if (const auto conflict_reason = txn_mgr_->CheckTxnConflict(this); conflict_reason) { + LOG_ERROR(fmt::format("Txn: {} is rolled back. rollback ts: {}. Txn conflict reason: {}.", txn_id_, commit_ts, *conflict_reason)); wal_entry_ = nullptr; txn_mgr_->SendToWAL(this); - RecoverableError(Status::TxnConflict(txn_id_, "Txn conflict reason.")); + RecoverableError(Status::TxnConflict(txn_id_, fmt::format("Txn conflict reason: {}.", *conflict_reason))); } // Put wal entry to the manager in the same order as commit_ts. @@ -595,7 +595,7 @@ TxnTimeStamp Txn::Commit() { bool Txn::CheckConflict() { return txn_store_.CheckConflict(catalog_); } -bool Txn::CheckConflict(Txn *other_txn) { +Optional Txn::CheckConflict(Txn *other_txn) { LOG_TRACE(fmt::format("Txn {} check conflict with {}.", txn_id_, other_txn->txn_id_)); return txn_store_.CheckConflict(other_txn->txn_store_); diff --git a/src/storage/txn/txn.cppm b/src/storage/txn/txn.cppm index ea035da3e7..6179517531 100644 --- a/src/storage/txn/txn.cppm +++ b/src/storage/txn/txn.cppm @@ -92,7 +92,7 @@ public: bool CheckConflict(); - bool CheckConflict(Txn *txn); + Optional CheckConflict(Txn *txn); void CommitBottom(); diff --git a/src/storage/txn/txn_manager.cpp b/src/storage/txn/txn_manager.cpp index e81863ac3d..a2bad7f40c 100644 --- a/src/storage/txn/txn_manager.cpp +++ b/src/storage/txn/txn_manager.cpp @@ -136,7 +136,7 @@ TxnTimeStamp TxnManager::GetWriteCommitTS(Txn *txn) { return commit_ts; } -bool TxnManager::CheckTxnConflict(Txn *txn) { +Optional TxnManager::CheckTxnConflict(Txn *txn) { TxnTimeStamp commit_ts = txn->CommitTS(); Vector> candidate_txns; TxnTimeStamp min_checking_ts = UNCOMMIT_TS; @@ -160,19 +160,19 @@ bool TxnManager::CheckTxnConflict(Txn *txn) { } }); if (txn->CheckConflict()) { - return true; + return "Conflict in txn->CheckConflict()"; } - for (SharedPtr &candidate_txn : candidate_txns) { + for (const auto &candidate_txn : candidate_txns) { // LOG_INFO(fmt::format("Txn {}(commit_ts: {}) check conflict with txn {}(commit_ts: {})", // txn->TxnID(), // txn->CommitTS(), // candidate_txn->TxnID(), // candidate_txn->CommitTS())); - if (txn->CheckConflict(candidate_txn.get())) { - return true; + if (const auto conflict_reason = txn->CheckConflict(candidate_txn.get()); conflict_reason) { + return fmt::format("Conflict with candidate_txn {}: {}", candidate_txn->TxnID(), *conflict_reason); } } - return false; + return None; } void TxnManager::SendToWAL(Txn *txn) { diff --git a/src/storage/txn/txn_manager.cppm b/src/storage/txn/txn_manager.cppm index 45469902e3..4acf0ee236 100644 --- a/src/storage/txn/txn_manager.cppm +++ b/src/storage/txn/txn_manager.cppm @@ -58,7 +58,7 @@ public: TxnTimeStamp GetWriteCommitTS(Txn *txn); - bool CheckTxnConflict(Txn *txn); + Optional CheckTxnConflict(Txn *txn); void SendToWAL(Txn *txn); diff --git a/src/storage/txn/txn_store.cpp b/src/storage/txn/txn_store.cpp index 4ef4fdb462..f32c784053 100644 --- a/src/storage/txn/txn_store.cpp +++ b/src/storage/txn/txn_store.cpp @@ -14,6 +14,7 @@ module; +#include #include #include @@ -357,11 +358,42 @@ bool TxnTableStore::CheckConflict(Catalog *catalog, Txn *txn) const { return false; } -bool TxnTableStore::CheckConflict(const TxnTableStore *other_table_store) const { - for (const auto &[index_name, _] : txn_indexes_store_) { - for (const auto [index_entry, _] : other_table_store->txn_indexes_) { - if (index_name == *index_entry->GetIndexName()) { - return true; +Optional TxnTableStore::CheckConflict(const TxnTableStore *other_table_store) const { + { + Set other_txn_indexes_set; + Map> other_txn_indexes_store_map; + for (const auto &index_entry : std::views::keys(other_table_store->txn_indexes_)) { + other_txn_indexes_set.insert(*index_entry->GetIndexName()); + } + for (const auto &[index_name, index_store] : other_table_store->txn_indexes_store_) { + auto &segment_set = other_txn_indexes_store_map[index_name]; + for (const auto segment_id : std::views::keys(index_store->index_entry_map_)) { + segment_set.insert(segment_id); + } + } + for (const auto &index_entry : std::views::keys(txn_indexes_)) { + if (const auto &index_name = *index_entry->GetIndexName(); other_txn_indexes_set.contains(index_name)) { + return fmt::format("{}: txn_indexes_ containing Index {} conflict with other_table_store->txn_indexes_", + __func__, + index_name); + } + } + for (const auto &[index_name, index_store] : txn_indexes_store_) { + if (other_txn_indexes_set.contains(index_name)) { + return fmt::format("{}: txn_indexes_store_ containing Index {} conflict with other_table_store->txn_indexes_", + __func__, + index_name); + } + if (const auto iter = other_txn_indexes_store_map.find(index_name); iter != other_txn_indexes_store_map.end()) { + for (const auto &other_segment_set = iter->second; const auto segment_id : std::views::keys(index_store->index_entry_map_)) { + if (other_segment_set.contains(segment_id)) { + return fmt::format( + "{}: txn_indexes_store_ containing Index {} Segment {} conflict with other_table_store->txn_indexes_store_", + __func__, + index_name, + segment_id); + } + } } } } @@ -369,7 +401,7 @@ bool TxnTableStore::CheckConflict(const TxnTableStore *other_table_store) const const auto &delete_state = delete_state_; const auto &other_delete_state = other_table_store->delete_state_; if (delete_state.rows_.empty() || other_delete_state.rows_.empty()) { - return false; + return None; } for (const auto &[segment_id, block_map] : delete_state.rows_) { auto other_iter = other_delete_state.rows_.find(segment_id); @@ -391,12 +423,12 @@ bool TxnTableStore::CheckConflict(const TxnTableStore *other_table_store) const break; } if (other_block_offsets[j] == block_offset) { - return true; + return fmt::format("Delete conflict: segment_id: {}, block_id: {}, block_offset: {}", segment_id, block_id, block_offset); } } } } - return false; + return None; } void TxnTableStore::PrepareCommit1(const Vector &segment_infos) const { @@ -635,11 +667,11 @@ bool TxnStore::CheckConflict(Catalog *catalog) { return false; } -bool TxnStore::CheckConflict(const TxnStore &other_txn_store) { +Optional TxnStore::CheckConflict(const TxnStore &other_txn_store) { for (const auto &[table_name, table_store] : txn_tables_store_) { for (const auto [table_entry, _] : other_txn_store.txn_tables_) { if (table_name == *table_entry->GetTableName()) { - return true; + return fmt::format("txn_tables_store_ containing table_name {} conflict with other_txn_store.txn_tables_", table_name); } } @@ -649,11 +681,13 @@ bool TxnStore::CheckConflict(const TxnStore &other_txn_store) { } const TxnTableStore *other_table_store = other_iter->second.get(); - if (table_store->CheckConflict(other_table_store)) { - return true; + if (const auto conflict_reason = table_store->CheckConflict(other_table_store); conflict_reason) { + return fmt::format("txn_tables_store_ containing table_name {} conflict with other_txn_store.txn_tables_store_: {}", + table_name, + *conflict_reason); } } - return false; + return None; } void TxnStore::PrepareCommit1() { diff --git a/src/storage/txn/txn_store.cppm b/src/storage/txn/txn_store.cppm index 3b6d860e5c..c06acd4e22 100644 --- a/src/storage/txn/txn_store.cppm +++ b/src/storage/txn/txn_store.cppm @@ -140,7 +140,7 @@ public: bool CheckConflict(Catalog *catalog, Txn *txn) const; - bool CheckConflict(const TxnTableStore *txn_table_store) const; + Optional CheckConflict(const TxnTableStore *txn_table_store) const; void PrepareCommit1(const Vector &segment_infos) const; @@ -241,7 +241,7 @@ public: bool CheckConflict(Catalog *catalog); - bool CheckConflict(const TxnStore &txn_store); + Optional CheckConflict(const TxnStore &txn_store); void PrepareCommit1(); From 73187156f742976ce9e712f39d5bcef23fa519c6 Mon Sep 17 00:00:00 2001 From: Jin Hai Date: Fri, 3 Jan 2025 12:57:06 +0800 Subject: [PATCH 4/9] Add transaction history and show txn history (#2418) ### What problem does this PR solve? To help debug 1. Add transaction history 2. Show transaction history command ### Type of change - [x] New Feature (non-breaking change which adds functionality) --------- Signed-off-by: Jin Hai --- src/bin/infinity_main.cpp | 2 + src/common/default_values.cppm | 2 + src/common/utility/exception.cpp | 22 +- src/common/utility/exception.cppm | 1 + src/executor/explain_physical_plan.cpp | 18 + src/executor/operator/physical_show.cpp | 187 +- src/executor/operator/physical_show.cppm | 2 + src/parser/lexer.cpp | 1416 +++--- src/parser/lexer.h | 2 +- src/parser/lexer.l | 1 + src/parser/parser.cpp | 4048 +++++++++-------- src/parser/parser.h | 5 +- src/parser/parser.y | 6 +- src/parser/statement/show_statement.cpp | 4 + src/parser/statement/show_statement.h | 1 + src/planner/explain_ast.cpp | 4 + src/planner/explain_logical_plan.cpp | 18 + src/planner/logical_planner.cpp | 8 + src/planner/node/logical_show.cpp | 2 + src/storage/storage.cpp | 1 + src/storage/txn/txn.cpp | 187 +- src/storage/txn/txn.cppm | 15 +- src/storage/txn/txn_context.cpp | 34 + src/storage/txn/txn_context.cppm | 41 + src/storage/txn/txn_manager.cpp | 28 +- src/storage/txn/txn_manager.cppm | 5 + src/storage/txn/txn_state.cppm | 16 +- src/unit_test/storage/txn/constants.cpp | 2 +- .../dql/result_cache/cached_index_scan.slt | 24 +- 29 files changed, 3245 insertions(+), 2857 deletions(-) create mode 100644 src/storage/txn/txn_context.cpp create mode 100644 src/storage/txn/txn_context.cppm diff --git a/src/bin/infinity_main.cpp b/src/bin/infinity_main.cpp index 6b453e6c6f..d0bf32af1a 100644 --- a/src/bin/infinity_main.cpp +++ b/src/bin/infinity_main.cpp @@ -162,6 +162,7 @@ void SignalHandler(int signal_number, siginfo_t *, void *) { } case SIGSEGV: { // Print back strace + infinity::PrintTransactionHistory(); infinity::PrintStacktrace("SEGMENT FAULTS"); exit(-1); break; @@ -212,6 +213,7 @@ void TerminateHandler() { } catch (...) { message += "Unknown Unhandled Exception"; } + infinity::PrintTransactionHistory(); infinity::PrintStacktrace(message); std::abort(); } diff --git a/src/common/default_values.cppm b/src/common/default_values.cppm index 5cb99000c6..98e152e68b 100644 --- a/src/common/default_values.cppm +++ b/src/common/default_values.cppm @@ -140,6 +140,8 @@ export { constexpr std::string_view SYSTEM_CONFIG_TABLE_NAME = "config"; constexpr SizeT DEFAULT_PROFILER_HISTORY_SIZE = 128; + constexpr SizeT DEFAULT_TXN_HISTORY_SIZE = 128; + // default emvb parameter constexpr u32 EMVB_CENTROID_NPROBE = 3; constexpr f32 EMVB_THRESHOLD_FIRST = 0.0f; diff --git a/src/common/utility/exception.cpp b/src/common/utility/exception.cpp index da525d55af..4ae6fbea18 100644 --- a/src/common/utility/exception.cpp +++ b/src/common/utility/exception.cpp @@ -25,9 +25,23 @@ import logger; import third_party; import infinity_context; import cleanup_scanner; +import txn_manager; +import txn_context; namespace infinity { +void PrintTransactionHistory() { + TxnManager *txn_manager = InfinityContext::instance().storage()->txn_manager(); + + Vector> txn_contexts = txn_manager->GetTxnContextHistories(); + + SizeT history_count = txn_contexts.size(); + for (SizeT idx = 0; idx < history_count; ++idx) { + SharedPtr txn_history = txn_contexts[idx]; + LOG_CRITICAL(txn_history->ToString()); + } +} + void PrintStacktrace(const String &err_msg) { int trace_stack_depth = 256; void *array[256]; @@ -60,7 +74,12 @@ std::string_view GetErrorMsg(const String &message) { } void UnrecoverableError(const String &message, const char *file_name, u32 line) { - // auto *storage = InfinityContext::instance().storage(); + auto *storage = InfinityContext::instance().storage(); + if (storage != nullptr) { + if (storage->txn_manager() != nullptr) { + infinity::PrintTransactionHistory(); + } + } // if (storage != nullptr) { // CleanupInfoTracer *cleanup_tracer = storage->cleanup_info_tracer(); // String error_msg = cleanup_tracer->GetCleanupInfo(); @@ -68,6 +87,7 @@ void UnrecoverableError(const String &message, const char *file_name, u32 line) // } String location_message = fmt::format("{}@{}:{}", message, infinity::TrimPath(file_name), line); if (IS_LOGGER_INITIALIZED()) { + PrintStacktrace(location_message); } Logger::Flush(); diff --git a/src/common/utility/exception.cppm b/src/common/utility/exception.cppm index 6112e9019a..3fa6e857e5 100644 --- a/src/common/utility/exception.cppm +++ b/src/common/utility/exception.cppm @@ -21,6 +21,7 @@ import status; namespace infinity { export void PrintStacktrace(const String &err_msg); +export void PrintTransactionHistory(); export class RecoverableException : public std::exception { public: diff --git a/src/executor/explain_physical_plan.cpp b/src/executor/explain_physical_plan.cpp index e1662df0e8..4b02ca3677 100644 --- a/src/executor/explain_physical_plan.cpp +++ b/src/executor/explain_physical_plan.cpp @@ -1481,6 +1481,24 @@ void ExplainPhysicalPlan::Explain(const PhysicalShow *show_node, SharedPtremplace_back(MakeShared(output_columns_str)); break; } + case ShowStmtType::kTransactionHistory: { + String show_str; + if (intent_size != 0) { + show_str = String(intent_size - 2, ' '); + show_str += "-> SHOW TRANSACTION HISTORY"; + } else { + show_str = "SHOW TRANSACTION HISTORY"; + } + show_str += "("; + show_str += std::to_string(show_node->node_id()); + show_str += ")"; + result->emplace_back(MakeShared(show_str)); + + String output_columns_str = String(intent_size, ' '); + output_columns_str += " - output columns: [transactions]"; + result->emplace_back(MakeShared(output_columns_str)); + break; + } case ShowStmtType::kSegments: { String show_str; if (intent_size != 0) { diff --git a/src/executor/operator/physical_show.cpp b/src/executor/operator/physical_show.cpp index f27b3894b5..7cb289b9da 100644 --- a/src/executor/operator/physical_show.cpp +++ b/src/executor/operator/physical_show.cpp @@ -83,6 +83,8 @@ import admin_statement; import result_cache_manager; import peer_task; import node_info; +import txn_context; +import txn_state; namespace infinity { @@ -444,6 +446,23 @@ void PhysicalShow::Init() { output_types_->emplace_back(varchar_type); break; } + case ShowStmtType::kTransactionHistory: { + output_names_->reserve(6); + output_types_->reserve(6); + output_names_->emplace_back("txn_id"); + output_names_->emplace_back("begin_ts"); + output_names_->emplace_back("commit_ts"); + output_names_->emplace_back("state"); + output_names_->emplace_back("type"); + output_names_->emplace_back("operations"); + output_types_->emplace_back(varchar_type); + output_types_->emplace_back(bigint_type); + output_types_->emplace_back(bigint_type); + output_types_->emplace_back(varchar_type); + output_types_->emplace_back(varchar_type); + output_types_->emplace_back(varchar_type); + break; + } case ShowStmtType::kLogs: { output_names_->reserve(4); output_types_->reserve(4); @@ -696,6 +715,10 @@ bool PhysicalShow::Execute(QueryContext *query_context, OperatorState *operator_ ExecuteShowTransactions(query_context, show_operator_state); break; } + case ShowStmtType::kTransactionHistory: { + ExecuteShowTransactionHistory(query_context, show_operator_state); + break; + } case ShowStmtType::kTransaction: { ExecuteShowTransaction(query_context, show_operator_state); break; @@ -5843,6 +5866,100 @@ void PhysicalShow::ExecuteShowTransaction(QueryContext *query_context, ShowOpera return; } +void PhysicalShow::ExecuteShowTransactionHistory(QueryContext *query_context, ShowOperatorState *operator_state) { + Txn* txn = query_context->GetTxn(); +// txn->AddOperation(MakeShared("ShowTransactionHistory")); + TransactionID this_txn_id = txn->TxnID(); + TxnManager *txn_manager = query_context->storage()->txn_manager(); + Vector> txn_context_histories = txn_manager->GetTxnContextHistories(); + + auto bigint_type = MakeShared(LogicalType::kBigInt); + auto varchar_type = MakeShared(LogicalType::kVarchar); + UniquePtr output_block_ptr = DataBlock::MakeUniquePtr(); + Vector> column_types{ + varchar_type, + bigint_type, + bigint_type, + varchar_type, + varchar_type, + varchar_type, + }; + output_block_ptr->Init(column_types); + SizeT row_count = 0; + + for (const auto &txn_context : txn_context_histories) { + if (output_block_ptr.get() == nullptr) { + output_block_ptr = DataBlock::MakeUniquePtr(); + output_block_ptr->Init(column_types); + } + + { + // txn id + String txn_id_str; + if (this_txn_id == txn_context->txn_id_) { + txn_id_str = fmt::format("{}(this txn)", this_txn_id); + } else { + txn_id_str = fmt::format("{}", txn_context->txn_id_); + } + Value value = Value::MakeVarchar(txn_id_str); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[0]); + } + + { + // txn begin_ts + Value value = Value::MakeBigInt(txn_context->begin_ts_); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[1]); + } + + { + // txn commit_ts + Value value = Value::MakeBigInt(txn_context->commit_ts_); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[2]); + } + + { + // txn state + Value value = Value::MakeVarchar(TxnState2Str(txn_context->state_)); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[3]); + } + + { + // txn type + Value value = Value::MakeVarchar(TxnType2Str(txn_context->type_)); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[4]); + } + + { + // txn operations + std::stringstream ss; + Vector> operations; + for (const auto &ops : txn_context->operations_) { + ss << *ops << std::endl; + } + Value value = Value::MakeVarchar(ss.str()); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[5]); + } + + ++row_count; + if (row_count == output_block_ptr->capacity()) { + output_block_ptr->Finalize(); + operator_state->output_.emplace_back(std::move(output_block_ptr)); + output_block_ptr = nullptr; + row_count = 0; + } + } + + output_block_ptr->Finalize(); + operator_state->output_.emplace_back(std::move(output_block_ptr)); + return; +} + void PhysicalShow::ExecuteShowLogs(QueryContext *query_context, ShowOperatorState *operator_state) { auto varchar_type = MakeShared(LogicalType::kVarchar); @@ -6464,13 +6581,7 @@ void PhysicalShow::ExecuteListSnapshots(QueryContext *query_context, ShowOperato auto varchar_type = MakeShared(LogicalType::kVarchar); auto bigint_type = MakeShared(LogicalType::kBigInt); UniquePtr output_block_ptr = DataBlock::MakeUniquePtr(); - Vector> column_types{ - varchar_type, - varchar_type, - varchar_type, - bigint_type, - bigint_type - }; + Vector> column_types{varchar_type, varchar_type, varchar_type, bigint_type, bigint_type}; output_block_ptr->Init(column_types); output_block_ptr->Finalize(); @@ -6488,37 +6599,37 @@ void PhysicalShow::ExecuteShowSnapshot(QueryContext *query_context, ShowOperator output_block_ptr->Init(column_types); -// { -// SizeT column_id = 0; -// { -// Value value = Value::MakeVarchar("memory_objects"); -// ValueExpression value_expr(value); -// value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); -// } -// -// ++column_id; -// { -// Value value = Value::MakeVarchar(GlobalResourceUsage::GetObjectCountInfo()); -// ValueExpression value_expr(value); -// value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); -// } -// } -// -// { -// SizeT column_id = 0; -// { -// Value value = Value::MakeVarchar("memory_allocation"); -// ValueExpression value_expr(value); -// value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); -// } -// -// ++column_id; -// { -// Value value = Value::MakeVarchar(GlobalResourceUsage::GetRawMemoryInfo()); -// ValueExpression value_expr(value); -// value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); -// } -// } + // { + // SizeT column_id = 0; + // { + // Value value = Value::MakeVarchar("memory_objects"); + // ValueExpression value_expr(value); + // value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); + // } + // + // ++column_id; + // { + // Value value = Value::MakeVarchar(GlobalResourceUsage::GetObjectCountInfo()); + // ValueExpression value_expr(value); + // value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); + // } + // } + // + // { + // SizeT column_id = 0; + // { + // Value value = Value::MakeVarchar("memory_allocation"); + // ValueExpression value_expr(value); + // value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); + // } + // + // ++column_id; + // { + // Value value = Value::MakeVarchar(GlobalResourceUsage::GetRawMemoryInfo()); + // ValueExpression value_expr(value); + // value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); + // } + // } output_block_ptr->Finalize(); operator_state->output_.emplace_back(std::move(output_block_ptr)); diff --git a/src/executor/operator/physical_show.cppm b/src/executor/operator/physical_show.cppm index c30ad4db68..1ff4c763f8 100644 --- a/src/executor/operator/physical_show.cppm +++ b/src/executor/operator/physical_show.cppm @@ -139,6 +139,8 @@ private: void ExecuteShowTransaction(QueryContext *query_context, ShowOperatorState *operator_state); + void ExecuteShowTransactionHistory(QueryContext *query_context, ShowOperatorState *operator_state); + void ExecuteShowLogs(QueryContext *query_context, ShowOperatorState *operator_state); void ExecuteShowDeltaLogs(QueryContext *query_context, ShowOperatorState *operator_state); diff --git a/src/parser/lexer.cpp b/src/parser/lexer.cpp index 2a79ce1e1b..47ec17477e 100644 --- a/src/parser/lexer.cpp +++ b/src/parser/lexer.cpp @@ -653,8 +653,8 @@ static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\ yyg->yy_c_buf_p = yy_cp; /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */ -#define YY_NUM_RULES 212 -#define YY_END_OF_BUFFER 213 +#define YY_NUM_RULES 213 +#define YY_END_OF_BUFFER 214 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -662,92 +662,93 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static const flex_int16_t yy_accept[769] = +static const flex_int16_t yy_accept[774] = { 0, - 0, 0, 209, 209, 213, 211, 1, 1, 211, 211, - 201, 207, 201, 201, 204, 201, 201, 201, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 209, 210, 1, 197, 0, 204, 203, - 202, 199, 198, 196, 200, 206, 206, 206, 206, 8, - 206, 206, 206, 206, 206, 206, 21, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 82, 206, 84, 94, 206, 206, - - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 125, 206, 127, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 171, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 209, - 208, 205, 202, 0, 2, 206, 4, 206, 7, 9, - 206, 206, 206, 13, 206, 206, 16, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 44, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 57, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 90, 206, 96, 206, 206, - 206, 206, 206, 206, 104, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 120, 206, 206, 123, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 152, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 183, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 0, 202, 206, 206, 206, 206, 206, 206, 206, - - 17, 206, 206, 206, 22, 23, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 36, 206, 206, 39, 42, - 45, 206, 206, 206, 206, 206, 53, 206, 206, 54, - 55, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 71, 72, 206, 206, 206, 206, - 206, 206, 79, 206, 206, 206, 206, 206, 206, 93, - 95, 206, 206, 99, 100, 206, 102, 103, 105, 106, - 206, 206, 206, 206, 206, 206, 206, 206, 118, 117, - 206, 206, 206, 206, 206, 130, 206, 206, 206, 206, - 206, 206, 206, 206, 140, 206, 206, 206, 206, 206, - - 206, 206, 206, 206, 206, 206, 155, 206, 206, 206, - 206, 206, 206, 206, 166, 167, 168, 206, 206, 174, - 206, 206, 206, 206, 206, 206, 206, 182, 206, 206, - 206, 206, 189, 191, 206, 193, 194, 3, 206, 6, - 206, 206, 206, 206, 18, 206, 206, 206, 26, 206, - 206, 206, 206, 206, 206, 206, 206, 38, 206, 206, - 206, 206, 206, 206, 52, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 64, 65, 66, 68, 206, 206, - 206, 206, 75, 206, 206, 206, 80, 206, 206, 85, - 87, 206, 206, 206, 206, 206, 101, 107, 206, 206, - - 206, 206, 113, 206, 206, 119, 206, 206, 206, 128, - 129, 206, 132, 206, 206, 206, 206, 206, 206, 139, - 206, 206, 206, 206, 145, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 162, 206, 206, 206, - 206, 175, 206, 206, 206, 206, 206, 180, 206, 206, - 206, 206, 190, 192, 195, 206, 206, 206, 12, 14, - 19, 206, 20, 206, 27, 206, 29, 206, 206, 34, - 206, 37, 206, 206, 206, 206, 50, 206, 206, 47, - 206, 58, 206, 61, 206, 63, 206, 206, 206, 70, - 73, 74, 76, 77, 206, 206, 83, 206, 88, 206, - - 206, 206, 97, 206, 108, 206, 109, 111, 114, 206, - 206, 121, 124, 206, 206, 206, 206, 206, 206, 206, - 206, 206, 144, 143, 206, 206, 147, 148, 206, 150, - 206, 206, 206, 159, 206, 161, 163, 164, 206, 206, - 206, 176, 177, 178, 206, 181, 184, 206, 206, 188, - 206, 10, 206, 15, 24, 206, 30, 31, 32, 33, - 35, 206, 206, 48, 49, 206, 206, 206, 60, 62, - 59, 67, 206, 206, 81, 86, 89, 206, 206, 98, - 206, 112, 206, 116, 122, 206, 206, 133, 134, 135, - 206, 206, 138, 141, 142, 206, 149, 153, 151, 206, - - 206, 206, 206, 206, 170, 206, 206, 187, 206, 206, - 11, 25, 206, 40, 43, 206, 46, 206, 69, 206, - 206, 92, 110, 206, 126, 206, 136, 206, 146, 154, - 156, 157, 206, 206, 206, 206, 179, 185, 206, 206, - 41, 51, 56, 78, 91, 206, 206, 206, 158, 206, - 206, 169, 206, 186, 5, 28, 206, 206, 137, 160, - 206, 206, 115, 131, 165, 172, 173, 0 + 0, 0, 210, 210, 214, 212, 1, 1, 212, 212, + 202, 208, 202, 202, 205, 202, 202, 202, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 210, 211, 1, 198, 0, 205, 204, + 203, 200, 199, 197, 201, 207, 207, 207, 207, 8, + 207, 207, 207, 207, 207, 207, 21, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 83, 207, 85, 95, 207, 207, + + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 126, 207, 128, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 172, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 210, + 209, 206, 203, 0, 2, 207, 4, 207, 7, 9, + 207, 207, 207, 13, 207, 207, 16, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 44, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 57, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 91, 207, 97, 207, + 207, 207, 207, 207, 207, 105, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 121, 207, 207, 124, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 153, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 184, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 0, 203, 207, 207, 207, 207, 207, 207, + + 207, 17, 207, 207, 207, 22, 23, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 36, 207, 207, 39, + 42, 45, 207, 207, 207, 207, 207, 53, 207, 207, + 54, 55, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 71, 72, 207, 207, 207, + 207, 207, 207, 207, 80, 207, 207, 207, 207, 207, + 207, 94, 96, 207, 207, 100, 101, 207, 103, 104, + 106, 107, 207, 207, 207, 207, 207, 207, 207, 207, + 119, 118, 207, 207, 207, 207, 207, 131, 207, 207, + 207, 207, 207, 207, 207, 207, 141, 207, 207, 207, + + 207, 207, 207, 207, 207, 207, 207, 207, 156, 207, + 207, 207, 207, 207, 207, 207, 167, 168, 169, 207, + 207, 175, 207, 207, 207, 207, 207, 207, 207, 183, + 207, 207, 207, 207, 190, 192, 207, 194, 195, 3, + 207, 6, 207, 207, 207, 207, 18, 207, 207, 207, + 26, 207, 207, 207, 207, 207, 207, 207, 207, 38, + 207, 207, 207, 207, 207, 207, 52, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 64, 65, 66, 68, + 207, 207, 207, 207, 75, 207, 207, 207, 207, 81, + 207, 207, 86, 88, 207, 207, 207, 207, 207, 102, + + 108, 207, 207, 207, 207, 114, 207, 207, 120, 207, + 207, 207, 129, 130, 207, 133, 207, 207, 207, 207, + 207, 207, 140, 207, 207, 207, 207, 146, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 163, + 207, 207, 207, 207, 176, 207, 207, 207, 207, 207, + 181, 207, 207, 207, 207, 191, 193, 196, 207, 207, + 207, 12, 14, 19, 207, 20, 207, 27, 207, 29, + 207, 207, 34, 207, 37, 207, 207, 207, 207, 50, + 207, 207, 47, 207, 58, 207, 61, 207, 63, 207, + 207, 207, 70, 73, 74, 76, 77, 207, 207, 207, + + 84, 207, 89, 207, 207, 207, 98, 207, 109, 207, + 110, 112, 115, 207, 207, 122, 125, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 145, 144, 207, 207, + 148, 149, 207, 151, 207, 207, 207, 160, 207, 162, + 164, 165, 207, 207, 207, 177, 178, 179, 207, 182, + 185, 207, 207, 189, 207, 10, 207, 15, 24, 207, + 30, 31, 32, 33, 35, 207, 207, 48, 49, 207, + 207, 207, 60, 62, 59, 67, 207, 207, 79, 82, + 87, 90, 207, 207, 99, 207, 113, 207, 117, 123, + 207, 207, 134, 135, 136, 207, 207, 139, 142, 143, + + 207, 150, 154, 152, 207, 207, 207, 207, 207, 171, + 207, 207, 188, 207, 207, 11, 25, 207, 40, 43, + 207, 46, 207, 69, 207, 207, 93, 111, 207, 127, + 207, 137, 207, 147, 155, 157, 158, 207, 207, 207, + 207, 180, 186, 207, 207, 41, 51, 56, 78, 92, + 207, 207, 207, 159, 207, 207, 170, 207, 187, 5, + 28, 207, 207, 138, 161, 207, 207, 116, 132, 166, + 173, 174, 0 } ; static const YY_CHAR yy_ec[256] = @@ -793,185 +794,185 @@ static const YY_CHAR yy_meta[69] = 4, 4, 4, 4, 4, 4, 4, 4 } ; -static const flex_int16_t yy_base[773] = +static const flex_int16_t yy_base[778] = { 0, - 0, 0, 265, 237, 241, 1576, 67, 69, 219, 0, - 1576, 1576, 63, 66, 70, 69, 178, 149, 66, 108, + 0, 0, 265, 237, 241, 1580, 67, 69, 219, 0, + 1580, 1580, 63, 66, 70, 69, 178, 149, 66, 108, 73, 74, 112, 163, 59, 134, 173, 57, 68, 181, 188, 173, 235, 227, 55, 229, 279, 331, 275, 129, - 86, 0, 79, 0, 153, 99, 1576, 152, 306, 172, - 310, 1576, 1576, 1576, 1576, 0, 191, 213, 123, 128, + 86, 0, 79, 0, 153, 99, 1580, 152, 306, 172, + 310, 1580, 1580, 1580, 1580, 0, 191, 213, 123, 128, 112, 134, 228, 156, 239, 177, 0, 220, 164, 225, 321, 312, 304, 362, 227, 226, 235, 239, 280, 282, 366, 286, 316, 337, 360, 315, 331, 338, 368, 362, - 386, 381, 368, 383, 0, 377, 408, 0, 384, 369, - - 418, 393, 422, 398, 412, 410, 412, 421, 425, 418, - 437, 428, 432, 437, 0, 424, 441, 427, 428, 440, - 464, 472, 456, 477, 459, 456, 523, 467, 482, 485, - 488, 491, 475, 493, 487, 493, 518, 0, 519, 525, - 498, 536, 518, 534, 530, 531, 543, 529, 549, 0, - 1576, 1576, 585, 590, 0, 556, 559, 573, 0, 0, - 561, 573, 580, 578, 591, 583, 0, 590, 592, 597, - 585, 597, 592, 590, 596, 582, 607, 590, 627, 595, - 610, 637, 638, 639, 624, 643, 632, 644, 645, 0, - 646, 649, 634, 642, 638, 641, 656, 661, 644, 652, - - 653, 654, 656, 664, 680, 665, 683, 692, 689, 680, - 694, 686, 697, 698, 699, 700, 692, 0, 703, 688, - 705, 702, 707, 703, 697, 710, 715, 701, 731, 701, - 707, 716, 729, 746, 0, 740, 748, 736, 747, 752, - 753, 751, 741, 747, 737, 748, 752, 760, 750, 757, - 755, 756, 771, 754, 767, 769, 772, 779, 787, 799, - 786, 0, 783, 795, 793, 792, 797, 792, 801, 795, - 795, 802, 813, 794, 806, 817, 808, 809, 821, 819, - 828, 0, 816, 831, 823, 845, 838, 836, 846, 853, - 845, 870, 873, 858, 870, 856, 871, 876, 864, 878, - - 0, 869, 877, 878, 0, 0, 872, 878, 880, 888, - 881, 890, 895, 888, 893, 0, 882, 889, 910, 893, - 0, 901, 894, 897, 905, 925, 0, 918, 916, 0, - 0, 926, 915, 911, 913, 933, 918, 936, 933, 924, - 926, 939, 933, 948, 0, 0, 935, 950, 936, 942, - 957, 954, 948, 959, 951, 947, 954, 962, 974, 0, - 0, 977, 970, 0, 0, 965, 0, 0, 0, 0, - 978, 978, 974, 972, 971, 989, 991, 983, 983, 0, - 1000, 999, 992, 988, 992, 0, 1007, 1000, 1014, 1021, - 1022, 1016, 1021, 1026, 0, 1012, 1014, 1025, 1024, 1020, - - 1032, 1039, 1030, 1040, 1043, 1045, 0, 1043, 1037, 1038, - 1054, 1054, 1055, 1049, 0, 0, 1051, 1065, 1056, 0, - 1062, 1056, 1076, 1061, 1081, 1069, 1083, 0, 1087, 1085, - 1093, 1080, 1077, 0, 1093, 0, 1080, 0, 1099, 0, - 1100, 1088, 1089, 1094, 1092, 1111, 1095, 1099, 0, 1113, - 1121, 1114, 1115, 1127, 1124, 1130, 1129, 0, 1141, 1134, - 1143, 1134, 1142, 1139, 0, 1135, 1145, 1148, 1133, 1134, - 1140, 1153, 1143, 1161, 0, 0, 141, 0, 1142, 1146, - 1153, 1156, 0, 1165, 1160, 1173, 0, 1169, 1179, 1180, - 0, 1167, 1183, 1178, 1178, 1193, 0, 0, 1188, 1198, - - 1178, 1199, 1187, 1185, 1207, 0, 1193, 1196, 1208, 0, - 0, 1199, 0, 1204, 1202, 1203, 1210, 1208, 1227, 0, - 1231, 1232, 1233, 1221, 0, 1228, 1234, 1246, 1237, 1232, - 1239, 1246, 1248, 1252, 1257, 1247, 1242, 1244, 1247, 1256, - 1270, 0, 1267, 1262, 1254, 1261, 1271, 0, 1261, 1285, - 1288, 1273, 0, 0, 0, 1272, 1279, 132, 0, 0, - 0, 1281, 0, 1289, 0, 1284, 1286, 1286, 1288, 1290, - 1290, 0, 1292, 1299, 1302, 1295, 0, 1296, 1318, 0, - 1315, 0, 1320, 0, 1312, 0, 1307, 99, 1323, 0, - 0, 0, 0, 0, 1322, 1310, 0, 1315, 0, 1322, - - 1339, 1344, 0, 1328, 0, 1342, 0, 1330, 0, 1345, - 1346, 1340, 0, 1334, 1342, 1349, 1359, 1340, 1361, 1348, - 1350, 1352, 0, 0, 1370, 1369, 0, 1360, 1360, 0, - 1367, 1368, 1368, 0, 1372, 0, 0, 1387, 1393, 1378, - 1396, 0, 0, 0, 1395, 0, 0, 1383, 1391, 0, - 1395, 0, 96, 0, 1393, 1404, 0, 0, 0, 0, - 0, 1409, 1411, 0, 0, 1412, 1398, 1405, 0, 0, - 0, 0, 1402, 1414, 0, 0, 0, 1420, 1412, 0, - 1405, 0, 1429, 0, 0, 1428, 1429, 0, 0, 0, - 1416, 1427, 0, 0, 0, 1417, 0, 1419, 0, 1422, - - 1428, 1437, 1435, 1441, 0, 1435, 1453, 0, 1453, 1451, - 0, 0, 1452, 1449, 0, 1452, 0, 1464, 0, 1452, - 1453, 0, 0, 1454, 0, 1462, 0, 1472, 0, 0, - 0, 1459, 1469, 1468, 1471, 1479, 0, 1470, 1476, 1477, - 0, 0, 0, 0, 0, 1477, 1493, 1483, 0, 1501, - 1506, 0, 1493, 0, 0, 0, 1491, 1506, 0, 0, - 1487, 1506, 0, 0, 0, 1502, 0, 1576, 1563, 1567, - 101, 1571 + 386, 381, 368, 383, 0, 377, 415, 0, 384, 369, + + 422, 411, 423, 399, 412, 393, 398, 423, 426, 420, + 438, 429, 433, 438, 0, 425, 443, 428, 434, 442, + 464, 473, 461, 476, 473, 460, 522, 469, 485, 490, + 491, 493, 478, 497, 506, 496, 518, 0, 532, 526, + 508, 539, 518, 525, 533, 541, 544, 531, 554, 0, + 1580, 1580, 588, 593, 0, 565, 562, 574, 0, 0, + 558, 572, 582, 579, 592, 584, 0, 591, 593, 598, + 586, 599, 591, 594, 603, 580, 610, 596, 630, 597, + 619, 632, 636, 643, 627, 646, 633, 645, 646, 0, + 647, 650, 635, 649, 639, 640, 658, 664, 647, 655, + + 656, 657, 659, 673, 683, 666, 680, 691, 691, 680, + 683, 697, 688, 699, 700, 701, 702, 694, 0, 706, + 691, 708, 706, 713, 708, 701, 714, 720, 706, 734, + 715, 719, 721, 732, 749, 0, 743, 751, 738, 749, + 754, 755, 753, 743, 750, 740, 751, 756, 784, 753, + 760, 759, 760, 776, 758, 771, 781, 777, 782, 790, + 802, 789, 0, 786, 798, 795, 794, 799, 794, 803, + 797, 798, 805, 816, 798, 811, 821, 814, 813, 827, + 824, 843, 0, 833, 845, 830, 854, 834, 838, 848, + 856, 847, 872, 890, 856, 869, 855, 870, 876, 865, + + 879, 0, 871, 878, 889, 0, 0, 883, 885, 886, + 896, 890, 900, 907, 902, 907, 0, 893, 895, 913, + 896, 0, 904, 897, 899, 907, 923, 0, 917, 915, + 0, 0, 925, 915, 912, 914, 935, 919, 947, 944, + 931, 932, 947, 942, 958, 0, 0, 947, 964, 950, + 953, 963, 957, 955, 952, 963, 955, 950, 960, 962, + 984, 0, 0, 976, 969, 0, 0, 965, 0, 0, + 0, 0, 979, 979, 976, 985, 984, 998, 1000, 993, + 994, 0, 1013, 1014, 1007, 1003, 1004, 0, 1014, 1004, + 1018, 1025, 1026, 1019, 1027, 1032, 0, 1012, 1013, 1024, + + 1024, 1022, 1035, 1042, 1042, 1053, 1057, 1054, 0, 1053, + 1048, 1051, 1069, 1069, 1070, 1061, 0, 0, 1058, 1069, + 1060, 0, 1066, 1060, 1079, 1067, 1081, 1069, 1084, 0, + 1088, 1087, 1095, 1083, 1080, 0, 1105, 0, 1092, 0, + 1111, 0, 1109, 1097, 1099, 1105, 1105, 1126, 1110, 1114, + 0, 1125, 1128, 1118, 1119, 1131, 1128, 1133, 1135, 0, + 1141, 1134, 1144, 1135, 1144, 1141, 0, 1138, 1148, 1160, + 1145, 1146, 1149, 1162, 1153, 1172, 0, 0, 141, 0, + 1155, 1161, 1168, 1171, 0, 1177, 1167, 1177, 1169, 0, + 1174, 1184, 1185, 0, 1174, 1191, 1182, 1179, 1194, 0, + + 0, 1190, 1202, 1182, 1213, 1200, 1198, 1221, 0, 1205, + 1207, 1220, 0, 0, 1213, 0, 1220, 1218, 1219, 1226, + 1221, 1235, 0, 1236, 1237, 1238, 1226, 0, 1235, 1242, + 1247, 1239, 1235, 1242, 1249, 1252, 1256, 1271, 1260, 1255, + 1258, 1259, 1267, 1282, 0, 1281, 1278, 1270, 1277, 1287, + 0, 1274, 1293, 1293, 1278, 0, 0, 0, 1277, 1284, + 132, 0, 0, 0, 1288, 0, 1297, 0, 1285, 1288, + 1289, 1291, 1293, 1294, 0, 1296, 1313, 1315, 1308, 0, + 1310, 1330, 0, 1326, 0, 1332, 0, 1326, 0, 1323, + 99, 1339, 0, 0, 0, 0, 0, 1338, 1321, 1327, + + 0, 1329, 0, 1331, 1345, 1350, 0, 1334, 0, 1351, + 0, 1339, 0, 1354, 1349, 1344, 0, 1339, 1346, 1354, + 1364, 1355, 1376, 1362, 1365, 1369, 0, 0, 1384, 1382, + 0, 1375, 1377, 0, 1384, 1385, 1385, 0, 1389, 0, + 0, 1401, 1402, 1384, 1402, 0, 0, 0, 1401, 0, + 0, 1392, 1400, 0, 1404, 0, 96, 0, 1396, 1408, + 0, 0, 0, 0, 0, 1414, 1415, 0, 0, 1417, + 1403, 1420, 0, 0, 0, 0, 1417, 1428, 0, 0, + 0, 0, 1435, 1429, 0, 1419, 0, 1442, 0, 0, + 1443, 1446, 0, 0, 0, 1433, 1444, 0, 0, 0, + + 1434, 0, 1436, 0, 1436, 1437, 1443, 1441, 1447, 0, + 1444, 1462, 0, 1462, 1454, 0, 0, 1456, 1454, 0, + 1456, 0, 1469, 0, 1457, 1468, 0, 0, 1469, 0, + 1476, 0, 1487, 0, 0, 0, 1476, 1483, 1481, 1486, + 1496, 0, 1487, 1493, 1494, 0, 0, 0, 0, 0, + 1494, 1507, 1492, 0, 1507, 1512, 0, 1499, 0, 0, + 0, 1500, 1515, 0, 0, 1496, 1509, 0, 0, 0, + 1506, 0, 1580, 1567, 1571, 101, 1575 } ; -static const flex_int16_t yy_def[773] = +static const flex_int16_t yy_def[778] = { 0, - 768, 1, 769, 769, 768, 768, 768, 768, 768, 770, - 768, 768, 768, 768, 768, 768, 768, 768, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 772, 768, 768, 768, 770, 768, 768, - 768, 768, 768, 768, 768, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 772, - 768, 768, 768, 768, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 768, 768, 771, 771, 771, 771, 771, 771, 771, - - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 0, 768, 768, - 768, 768 + 773, 1, 774, 774, 773, 773, 773, 773, 773, 775, + 773, 773, 773, 773, 773, 773, 773, 773, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 777, 773, 773, 773, 775, 773, 773, + 773, 773, 773, 773, 773, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 777, + 773, 773, 773, 773, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 773, 773, 776, 776, 776, 776, 776, 776, + + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 0, 773, 773, 773, 773 } ; -static const flex_int16_t yy_nxt[1645] = +static const flex_int16_t yy_nxt[1649] = { 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15, 16, 17, 18, 19, 20, 21, 22, 23, @@ -984,12 +985,12 @@ static const flex_int16_t yy_nxt[1645] = 49, 49, 52, 53, 57, 88, 99, 100, 68, 73, 123, 89, 58, 74, 59, 69, 70, 75, 149, 60, - 46, 46, 71, 76, 56, 72, 77, 711, 147, 148, - 672, 57, 88, 99, 100, 68, 73, 123, 89, 58, + 46, 46, 71, 76, 56, 72, 77, 716, 147, 148, + 676, 57, 88, 99, 100, 68, 73, 123, 89, 58, 74, 59, 69, 70, 75, 149, 60, 61, 62, 71, 76, 63, 72, 77, 64, 147, 148, 65, 78, 79, - 80, 159, 653, 66, 144, 160, 161, 67, 145, 90, - 81, 588, 146, 91, 61, 62, 152, 92, 63, 151, + 80, 159, 657, 66, 144, 160, 161, 67, 145, 90, + 81, 591, 146, 91, 61, 62, 152, 92, 63, 151, 162, 64, 55, 93, 65, 78, 79, 80, 159, 94, 66, 144, 160, 161, 67, 145, 90, 81, 82, 146, 91, 50, 50, 50, 92, 165, 83, 162, 110, 84, @@ -999,164 +1000,164 @@ static const flex_int16_t yy_nxt[1645] = 103, 107, 165, 83, 104, 110, 84, 108, 156, 85, 95, 96, 86, 109, 168, 87, 171, 101, 97, 111, 105, 102, 47, 98, 106, 112, 155, 103, 107, 157, - 768, 104, 119, 45, 108, 156, 120, 158, 124, 163, + 773, 104, 119, 45, 108, 156, 120, 158, 124, 163, 109, 113, 125, 169, 170, 114, 121, 172, 126, 122, 185, 186, 164, 115, 187, 116, 157, 117, 166, 119, 118, 45, 188, 120, 158, 124, 163, 167, 113, 125, 169, 170, 114, 121, 172, 126, 122, 185, 186, 164, - 115, 187, 116, 768, 117, 166, 189, 118, 127, 188, + 115, 187, 116, 773, 117, 166, 189, 118, 127, 188, - 190, 128, 768, 140, 167, 141, 129, 130, 142, 131, - 143, 768, 196, 132, 51, 49, 49, 49, 133, 153, - 153, 153, 768, 189, 768, 127, 768, 190, 128, 154, + 190, 128, 773, 140, 167, 141, 129, 130, 142, 131, + 143, 773, 196, 132, 51, 49, 49, 49, 133, 153, + 153, 153, 773, 189, 773, 127, 773, 190, 128, 154, 140, 177, 141, 129, 130, 142, 131, 143, 179, 196, 132, 178, 197, 180, 202, 133, 134, 173, 174, 175, - 135, 176, 768, 136, 137, 768, 154, 203, 177, 768, - 138, 768, 768, 139, 204, 179, 198, 205, 178, 197, + 135, 176, 773, 136, 137, 773, 154, 203, 177, 773, + 138, 773, 773, 139, 204, 179, 198, 205, 178, 197, 180, 202, 199, 134, 173, 174, 175, 135, 176, 181, 136, 137, 182, 191, 203, 192, 200, 138, 183, 193, 139, 204, 201, 198, 205, 184, 194, 206, 207, 199, - 195, 208, 209, 210, 211, 212, 181, 217, 218, 182, - 191, 768, 192, 200, 768, 183, 193, 226, 221, 201, - 222, 223, 184, 194, 206, 207, 213, 195, 208, 209, - 210, 211, 212, 219, 217, 218, 214, 229, 220, 224, - 230, 215, 216, 225, 226, 221, 227, 222, 223, 231, - 228, 232, 233, 213, 236, 234, 237, 238, 239, 240, - 219, 241, 242, 214, 229, 220, 224, 230, 215, 216, - 225, 235, 243, 227, 768, 249, 231, 228, 232, 233, - 255, 236, 234, 237, 238, 239, 240, 244, 241, 242, - 245, 246, 250, 256, 251, 247, 263, 264, 235, 243, - - 265, 248, 249, 266, 252, 253, 267, 255, 268, 269, - 254, 768, 272, 768, 244, 270, 281, 245, 246, 250, - 256, 251, 247, 263, 264, 271, 768, 265, 248, 768, - 266, 252, 253, 267, 275, 268, 269, 254, 257, 272, - 258, 284, 270, 281, 259, 273, 274, 287, 277, 260, - 288, 278, 271, 279, 276, 282, 261, 262, 280, 283, - 285, 275, 289, 290, 291, 257, 286, 258, 284, 768, - 768, 259, 273, 274, 287, 277, 260, 288, 278, 294, - 279, 276, 282, 261, 262, 280, 283, 285, 295, 289, - 290, 291, 296, 286, 153, 153, 153, 292, 297, 293, - - 293, 293, 298, 299, 154, 300, 294, 301, 302, 303, - 304, 305, 307, 308, 309, 295, 314, 312, 310, 296, - 313, 316, 317, 318, 315, 297, 306, 311, 321, 298, - 299, 154, 300, 322, 301, 302, 303, 304, 305, 307, - 308, 309, 319, 314, 312, 310, 320, 313, 316, 317, - 318, 315, 323, 306, 311, 321, 327, 324, 328, 329, - 322, 325, 330, 331, 332, 333, 334, 335, 336, 319, - 338, 337, 326, 320, 339, 340, 341, 342, 343, 323, - 344, 345, 346, 327, 324, 328, 329, 347, 325, 330, - 331, 332, 333, 334, 335, 336, 348, 338, 337, 326, - - 349, 339, 340, 341, 342, 343, 350, 344, 345, 346, - 351, 352, 353, 354, 347, 355, 356, 357, 358, 359, - 361, 362, 364, 348, 365, 366, 367, 349, 368, 360, - 369, 370, 371, 350, 372, 363, 375, 351, 352, 353, - 354, 376, 355, 356, 357, 358, 359, 361, 362, 364, - 377, 365, 366, 367, 373, 368, 360, 369, 370, 371, - 374, 372, 363, 375, 378, 379, 380, 381, 376, 382, + 195, 208, 209, 211, 212, 213, 181, 218, 219, 182, + 191, 773, 192, 200, 210, 183, 193, 773, 227, 201, + 230, 773, 184, 194, 206, 207, 231, 195, 208, 209, + 211, 212, 213, 214, 218, 219, 222, 220, 223, 224, + 225, 210, 221, 215, 226, 227, 228, 230, 216, 217, + 229, 232, 233, 231, 234, 237, 235, 238, 239, 240, + 214, 241, 242, 222, 220, 223, 224, 225, 243, 221, + 215, 226, 236, 228, 244, 216, 217, 229, 232, 233, + 250, 234, 237, 235, 238, 239, 240, 245, 241, 242, + 246, 251, 247, 252, 256, 243, 248, 257, 264, 236, + + 265, 244, 249, 253, 254, 266, 267, 250, 268, 255, + 773, 269, 773, 270, 245, 273, 773, 246, 251, 247, + 252, 256, 773, 248, 257, 264, 282, 265, 773, 249, + 253, 254, 266, 267, 271, 268, 255, 258, 269, 259, + 270, 285, 273, 260, 272, 274, 275, 276, 261, 278, + 288, 286, 279, 282, 280, 262, 263, 287, 283, 281, + 289, 271, 284, 290, 258, 291, 259, 277, 285, 292, + 260, 272, 274, 275, 276, 261, 278, 288, 286, 279, + 773, 280, 262, 263, 287, 283, 281, 289, 295, 284, + 290, 296, 291, 297, 277, 298, 292, 153, 153, 153, + + 293, 299, 294, 294, 294, 300, 301, 154, 302, 303, + 304, 305, 306, 308, 309, 295, 310, 311, 296, 317, + 297, 313, 298, 315, 314, 318, 312, 307, 299, 319, + 322, 316, 300, 301, 154, 302, 303, 304, 305, 306, + 308, 309, 323, 310, 311, 320, 317, 324, 313, 321, + 315, 314, 318, 312, 307, 325, 319, 322, 316, 326, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 323, + 327, 339, 320, 340, 324, 337, 321, 341, 338, 342, + 343, 344, 325, 345, 346, 347, 326, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 348, 327, 339, 349, + + 340, 350, 337, 351, 341, 338, 342, 343, 344, 352, + 345, 346, 347, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 363, 348, 364, 366, 349, 367, 350, 368, + 351, 362, 369, 370, 371, 372, 352, 373, 365, 374, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 363, + 377, 364, 366, 378, 367, 379, 368, 375, 362, 369, + 370, 371, 372, 376, 373, 365, 374, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 377, 390, 391, - 392, 373, 394, 395, 396, 397, 398, 374, 399, 400, - 393, 378, 379, 380, 381, 401, 382, 383, 384, 385, - - 386, 387, 388, 389, 402, 390, 391, 392, 403, 394, - 395, 396, 397, 398, 404, 399, 400, 393, 405, 406, - 407, 408, 401, 409, 410, 411, 412, 413, 414, 415, - 416, 402, 417, 418, 419, 403, 420, 421, 423, 422, - 424, 404, 425, 426, 427, 405, 406, 407, 408, 428, - 409, 410, 411, 412, 413, 414, 415, 416, 429, 417, - 418, 419, 430, 420, 421, 423, 422, 424, 431, 425, - 426, 427, 432, 433, 434, 436, 428, 437, 435, 293, - 293, 293, 293, 293, 293, 429, 438, 439, 440, 430, - 441, 442, 443, 444, 445, 431, 446, 447, 448, 432, - - 433, 434, 436, 449, 437, 435, 450, 451, 452, 453, - 454, 455, 456, 438, 439, 440, 457, 441, 442, 443, - 444, 445, 458, 446, 447, 448, 459, 460, 461, 462, - 449, 463, 464, 450, 451, 452, 453, 454, 455, 456, - 465, 466, 467, 457, 468, 469, 470, 471, 472, 458, - 473, 474, 475, 459, 460, 461, 462, 476, 463, 464, - 477, 478, 479, 480, 481, 482, 483, 465, 466, 467, - 484, 468, 469, 470, 471, 472, 485, 473, 474, 475, - 486, 487, 488, 489, 476, 490, 491, 477, 478, 479, - 480, 481, 482, 483, 492, 493, 495, 484, 496, 497, - - 498, 499, 500, 485, 501, 502, 494, 486, 487, 488, - 489, 503, 490, 491, 504, 505, 506, 507, 508, 509, - 510, 492, 493, 495, 511, 496, 497, 498, 499, 500, - 512, 501, 502, 494, 513, 514, 515, 516, 503, 517, - 518, 504, 505, 506, 507, 508, 509, 510, 521, 519, - 522, 511, 523, 524, 525, 526, 527, 512, 528, 529, - 530, 513, 514, 515, 516, 520, 517, 518, 531, 532, - 533, 534, 535, 536, 537, 521, 519, 522, 538, 523, - 524, 525, 526, 527, 539, 528, 529, 530, 540, 541, - 542, 543, 520, 544, 545, 531, 532, 533, 534, 535, - - 536, 537, 546, 547, 548, 538, 549, 550, 551, 552, - 553, 539, 554, 555, 556, 540, 541, 542, 543, 557, - 544, 545, 558, 559, 560, 561, 562, 563, 564, 546, - 547, 548, 565, 549, 550, 551, 552, 553, 566, 554, - 555, 556, 567, 568, 569, 570, 557, 571, 572, 558, - 559, 560, 561, 562, 563, 564, 573, 574, 575, 565, - 576, 577, 578, 579, 580, 566, 581, 582, 583, 567, - 568, 569, 570, 584, 571, 572, 585, 586, 587, 589, - 590, 591, 592, 573, 574, 575, 593, 576, 577, 578, - 579, 580, 594, 581, 582, 583, 595, 596, 597, 598, - - 584, 599, 600, 585, 586, 587, 589, 590, 591, 592, - 603, 601, 604, 593, 602, 605, 606, 607, 608, 594, - 609, 610, 611, 595, 596, 597, 598, 612, 599, 600, - 613, 614, 615, 616, 617, 618, 619, 603, 601, 604, - 620, 602, 605, 606, 607, 608, 621, 609, 610, 611, - 622, 623, 624, 625, 612, 626, 627, 613, 614, 615, - 616, 617, 618, 619, 628, 629, 630, 620, 631, 632, - 633, 634, 635, 621, 636, 637, 638, 622, 623, 624, - 625, 639, 626, 627, 640, 641, 642, 643, 644, 645, - 646, 628, 629, 630, 647, 631, 632, 633, 634, 635, - - 648, 636, 637, 638, 649, 650, 651, 652, 639, 654, - 655, 640, 641, 642, 643, 644, 645, 646, 656, 657, - 658, 647, 659, 660, 661, 662, 663, 648, 664, 665, - 666, 649, 650, 651, 652, 667, 654, 655, 668, 669, - 670, 671, 673, 674, 675, 656, 657, 658, 676, 659, - 660, 661, 662, 663, 677, 664, 665, 666, 678, 679, - 680, 681, 667, 682, 683, 668, 669, 670, 671, 673, - 674, 675, 684, 685, 686, 676, 687, 688, 689, 690, - 691, 677, 692, 693, 694, 678, 679, 680, 681, 695, - 682, 683, 696, 697, 698, 699, 700, 701, 702, 684, - - 685, 686, 703, 687, 688, 689, 690, 691, 704, 692, - 693, 694, 705, 706, 707, 708, 695, 709, 710, 696, - 697, 698, 699, 700, 701, 702, 712, 713, 714, 703, - 715, 716, 717, 718, 719, 704, 720, 721, 722, 705, - 706, 707, 708, 723, 709, 710, 724, 725, 726, 727, - 728, 729, 730, 712, 713, 714, 731, 715, 716, 717, - 718, 719, 732, 720, 721, 722, 733, 734, 735, 736, - 723, 737, 738, 724, 725, 726, 727, 728, 729, 730, - 739, 740, 741, 731, 742, 743, 744, 745, 746, 732, - 747, 748, 749, 733, 734, 735, 736, 750, 737, 738, - - 751, 752, 753, 754, 755, 756, 757, 739, 740, 741, - 758, 742, 743, 744, 745, 746, 759, 747, 748, 749, - 760, 761, 762, 763, 750, 764, 765, 751, 752, 753, - 754, 755, 756, 757, 766, 767, 768, 758, 768, 768, - 768, 768, 768, 759, 768, 768, 768, 760, 761, 762, - 763, 768, 764, 765, 768, 768, 768, 768, 768, 768, - 768, 766, 767, 44, 44, 44, 44, 48, 768, 48, - 48, 150, 150, 768, 150, 5, 768, 768, 768, 768, - 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, - 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, - - 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, - 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, - 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, - 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, - 768, 768, 768, 768 + 378, 392, 379, 393, 375, 396, 397, 773, 398, 399, + 376, 400, 401, 402, 380, 381, 382, 383, 384, 385, + + 386, 387, 388, 389, 394, 390, 391, 403, 392, 404, + 393, 405, 396, 397, 395, 398, 399, 406, 400, 401, + 402, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 394, 417, 418, 403, 419, 404, 420, 405, 421, + 422, 395, 425, 423, 406, 424, 426, 427, 407, 408, + 409, 410, 411, 412, 413, 414, 415, 416, 428, 417, + 418, 429, 419, 430, 420, 431, 421, 422, 434, 425, + 423, 432, 424, 426, 427, 435, 436, 433, 438, 439, + 437, 294, 294, 294, 440, 428, 441, 442, 429, 443, + 430, 444, 431, 445, 446, 434, 447, 448, 432, 294, + + 294, 294, 435, 436, 433, 438, 439, 437, 449, 450, + 451, 440, 452, 441, 442, 453, 443, 454, 444, 455, + 445, 446, 456, 447, 448, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 466, 449, 450, 451, 467, 452, + 468, 469, 453, 470, 454, 471, 455, 472, 473, 456, + 474, 475, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 476, 477, 478, 467, 479, 468, 469, 480, + 470, 481, 471, 482, 472, 473, 483, 474, 475, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 476, + 477, 478, 494, 479, 495, 498, 480, 499, 481, 500, + + 482, 501, 502, 483, 503, 496, 484, 485, 486, 487, + 488, 489, 490, 491, 492, 493, 497, 504, 505, 494, + 506, 495, 498, 507, 499, 508, 500, 509, 501, 502, + 510, 503, 496, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 497, 504, 505, 521, 506, 524, 525, + 507, 526, 508, 527, 509, 522, 528, 510, 529, 530, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, + 531, 523, 532, 521, 533, 524, 525, 534, 526, 535, + 527, 536, 522, 528, 537, 529, 530, 538, 539, 540, + 541, 542, 543, 544, 545, 546, 547, 531, 523, 532, + + 548, 533, 549, 550, 534, 551, 535, 552, 536, 553, + 554, 537, 555, 556, 538, 539, 540, 541, 542, 543, + 544, 545, 546, 547, 557, 558, 559, 548, 560, 549, + 550, 561, 551, 562, 552, 563, 553, 554, 564, 555, + 556, 565, 566, 567, 568, 569, 570, 571, 572, 573, + 574, 557, 558, 559, 575, 560, 576, 577, 561, 578, + 562, 579, 563, 580, 581, 564, 582, 583, 565, 566, + 567, 568, 569, 570, 571, 572, 573, 574, 584, 585, + 586, 575, 587, 576, 577, 588, 578, 589, 579, 590, + 580, 581, 592, 582, 583, 593, 594, 595, 596, 597, + + 598, 599, 600, 601, 602, 584, 585, 586, 603, 587, + 604, 607, 588, 608, 589, 605, 590, 609, 606, 592, + 610, 611, 593, 594, 595, 596, 597, 598, 599, 600, + 601, 602, 612, 613, 614, 603, 615, 604, 607, 616, + 608, 617, 605, 618, 609, 606, 619, 610, 611, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 612, + 613, 614, 630, 615, 631, 632, 616, 633, 617, 634, + 618, 635, 636, 619, 637, 638, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 639, 640, 641, 630, + 642, 631, 632, 643, 633, 644, 634, 645, 635, 636, + + 646, 637, 638, 647, 648, 649, 650, 651, 652, 653, + 654, 655, 656, 639, 640, 641, 658, 642, 659, 660, + 643, 661, 644, 662, 645, 663, 664, 646, 665, 666, + 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 667, 668, 669, 658, 670, 659, 660, 671, 661, 672, + 662, 673, 663, 664, 674, 665, 666, 675, 677, 678, + 679, 680, 681, 682, 683, 684, 685, 667, 668, 669, + 686, 670, 687, 688, 671, 689, 672, 690, 673, 691, + 692, 674, 693, 694, 675, 677, 678, 679, 680, 681, + 682, 683, 684, 685, 695, 696, 697, 686, 698, 687, + + 688, 699, 689, 700, 690, 701, 691, 692, 702, 693, + 694, 703, 704, 705, 706, 707, 708, 709, 710, 711, + 712, 695, 696, 697, 713, 698, 714, 715, 699, 717, + 700, 718, 701, 719, 720, 702, 721, 722, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 723, 724, + 725, 713, 726, 714, 715, 727, 717, 728, 718, 729, + 719, 720, 730, 721, 722, 731, 732, 733, 734, 735, + 736, 737, 738, 739, 740, 723, 724, 725, 741, 726, + 742, 743, 727, 744, 728, 745, 729, 746, 747, 730, + 748, 749, 731, 732, 733, 734, 735, 736, 737, 738, + + 739, 740, 750, 751, 752, 741, 753, 742, 743, 754, + 744, 755, 745, 756, 746, 747, 757, 748, 749, 758, + 759, 760, 761, 762, 763, 764, 765, 766, 767, 750, + 751, 752, 768, 753, 769, 770, 754, 771, 755, 772, + 756, 773, 773, 757, 773, 773, 758, 759, 760, 761, + 762, 763, 764, 765, 766, 767, 773, 773, 773, 768, + 773, 769, 770, 773, 771, 773, 772, 44, 44, 44, + 44, 48, 773, 48, 48, 150, 150, 773, 150, 5, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773 } ; -static const flex_int16_t yy_chk[1645] = +static const flex_int16_t yy_chk[1649] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -1169,12 +1170,12 @@ static const flex_int16_t yy_chk[1645] = 15, 15, 16, 16, 19, 25, 28, 29, 21, 22, 35, 25, 19, 22, 19, 21, 21, 22, 43, 19, - 46, 46, 21, 22, 771, 21, 22, 653, 41, 41, - 588, 19, 25, 28, 29, 21, 22, 35, 25, 19, + 46, 46, 21, 22, 776, 21, 22, 657, 41, 41, + 591, 19, 25, 28, 29, 21, 22, 35, 25, 19, 22, 19, 21, 21, 22, 43, 19, 20, 20, 21, 22, 20, 21, 22, 20, 41, 41, 20, 23, 23, - 23, 59, 558, 20, 40, 60, 61, 20, 40, 26, - 23, 477, 40, 26, 20, 20, 48, 26, 20, 45, + 23, 59, 561, 20, 40, 60, 61, 20, 40, 26, + 23, 479, 40, 26, 20, 20, 48, 26, 20, 45, 62, 20, 18, 26, 20, 23, 23, 23, 59, 26, 20, 40, 60, 61, 20, 40, 26, 23, 24, 40, 26, 50, 50, 50, 26, 64, 24, 62, 32, 24, @@ -1203,145 +1204,145 @@ static const flex_int16_t yy_chk[1645] = 38, 87, 85, 84, 88, 74, 81, 89, 90, 84, 81, 91, 92, 93, 94, 96, 74, 99, 100, 74, - 81, 0, 81, 85, 0, 74, 81, 104, 102, 85, - 102, 102, 74, 81, 89, 90, 97, 81, 91, 92, - 93, 94, 96, 101, 99, 100, 97, 106, 101, 103, - 107, 97, 97, 103, 104, 102, 105, 102, 102, 108, - 105, 109, 110, 97, 112, 111, 113, 114, 116, 117, - 101, 118, 119, 97, 106, 101, 103, 107, 97, 97, - 103, 111, 120, 105, 0, 123, 108, 105, 109, 110, - 125, 112, 111, 113, 114, 116, 117, 121, 118, 119, - 121, 122, 124, 126, 124, 122, 128, 129, 111, 120, - - 130, 122, 123, 131, 124, 124, 132, 125, 133, 134, - 124, 0, 136, 0, 121, 135, 141, 121, 122, 124, - 126, 124, 122, 128, 129, 135, 0, 130, 122, 0, - 131, 124, 124, 132, 139, 133, 134, 124, 127, 136, - 127, 143, 135, 141, 127, 137, 137, 145, 140, 127, - 146, 140, 135, 140, 139, 142, 127, 127, 140, 142, - 144, 139, 147, 148, 149, 127, 144, 127, 143, 0, - 0, 127, 137, 137, 145, 140, 127, 146, 140, 156, - 140, 139, 142, 127, 127, 140, 142, 144, 157, 147, - 148, 149, 158, 144, 153, 153, 153, 154, 161, 154, - - 154, 154, 162, 163, 153, 164, 156, 165, 165, 166, - 168, 169, 170, 171, 172, 157, 175, 174, 173, 158, - 174, 176, 177, 178, 175, 161, 169, 173, 180, 162, - 163, 153, 164, 181, 165, 165, 166, 168, 169, 170, - 171, 172, 179, 175, 174, 173, 179, 174, 176, 177, - 178, 175, 182, 169, 173, 180, 184, 183, 185, 186, - 181, 183, 187, 188, 189, 191, 192, 193, 194, 179, - 195, 194, 183, 179, 196, 197, 198, 199, 200, 182, - 201, 202, 203, 184, 183, 185, 186, 204, 183, 187, - 188, 189, 191, 192, 193, 194, 205, 195, 194, 183, - - 206, 196, 197, 198, 199, 200, 207, 201, 202, 203, - 208, 209, 210, 211, 204, 212, 213, 214, 215, 216, - 217, 219, 220, 205, 221, 222, 223, 206, 224, 216, - 225, 226, 227, 207, 228, 219, 230, 208, 209, 210, - 211, 231, 212, 213, 214, 215, 216, 217, 219, 220, - 232, 221, 222, 223, 229, 224, 216, 225, 226, 227, - 229, 228, 219, 230, 233, 234, 236, 237, 231, 238, - 239, 240, 241, 242, 243, 244, 245, 232, 246, 247, - 248, 229, 249, 250, 251, 252, 253, 229, 254, 255, - 248, 233, 234, 236, 237, 256, 238, 239, 240, 241, - - 242, 243, 244, 245, 257, 246, 247, 248, 258, 249, - 250, 251, 252, 253, 259, 254, 255, 248, 260, 261, - 263, 264, 256, 265, 266, 267, 268, 269, 270, 271, - 272, 257, 273, 274, 275, 258, 276, 277, 278, 277, - 279, 259, 280, 281, 283, 260, 261, 263, 264, 284, - 265, 266, 267, 268, 269, 270, 271, 272, 285, 273, - 274, 275, 286, 276, 277, 278, 277, 279, 286, 280, - 281, 283, 287, 288, 289, 290, 284, 291, 289, 292, - 292, 292, 293, 293, 293, 285, 294, 295, 296, 286, - 297, 298, 299, 300, 302, 286, 303, 304, 307, 287, - - 288, 289, 290, 308, 291, 289, 309, 310, 311, 312, - 313, 314, 315, 294, 295, 296, 317, 297, 298, 299, - 300, 302, 318, 303, 304, 307, 319, 320, 322, 323, - 308, 324, 325, 309, 310, 311, 312, 313, 314, 315, - 326, 328, 329, 317, 332, 333, 334, 335, 336, 318, - 337, 338, 339, 319, 320, 322, 323, 340, 324, 325, - 341, 342, 343, 344, 347, 348, 349, 326, 328, 329, - 350, 332, 333, 334, 335, 336, 351, 337, 338, 339, - 352, 353, 354, 355, 340, 356, 357, 341, 342, 343, - 344, 347, 348, 349, 358, 359, 362, 350, 363, 366, - - 371, 372, 373, 351, 374, 375, 359, 352, 353, 354, - 355, 376, 356, 357, 377, 378, 379, 381, 382, 383, - 384, 358, 359, 362, 385, 363, 366, 371, 372, 373, - 387, 374, 375, 359, 388, 389, 390, 391, 376, 392, - 393, 377, 378, 379, 381, 382, 383, 384, 396, 394, - 397, 385, 398, 399, 400, 401, 402, 387, 403, 404, - 405, 388, 389, 390, 391, 394, 392, 393, 406, 408, - 409, 410, 411, 412, 413, 396, 394, 397, 414, 398, - 399, 400, 401, 402, 417, 403, 404, 405, 418, 419, - 421, 422, 394, 423, 424, 406, 408, 409, 410, 411, - - 412, 413, 425, 426, 427, 414, 429, 430, 431, 432, - 433, 417, 435, 437, 439, 418, 419, 421, 422, 441, - 423, 424, 442, 443, 444, 445, 446, 447, 448, 425, - 426, 427, 450, 429, 430, 431, 432, 433, 451, 435, - 437, 439, 452, 453, 454, 455, 441, 456, 457, 442, - 443, 444, 445, 446, 447, 448, 459, 460, 461, 450, - 462, 463, 464, 466, 467, 451, 468, 469, 470, 452, - 453, 454, 455, 471, 456, 457, 472, 473, 474, 479, - 480, 481, 482, 459, 460, 461, 484, 462, 463, 464, - 466, 467, 485, 468, 469, 470, 486, 488, 489, 490, - - 471, 492, 493, 472, 473, 474, 479, 480, 481, 482, - 495, 494, 496, 484, 494, 499, 500, 501, 502, 485, - 503, 504, 505, 486, 488, 489, 490, 507, 492, 493, - 508, 509, 512, 514, 515, 516, 517, 495, 494, 496, - 518, 494, 499, 500, 501, 502, 519, 503, 504, 505, - 521, 522, 523, 524, 507, 526, 527, 508, 509, 512, - 514, 515, 516, 517, 528, 529, 530, 518, 531, 532, - 533, 534, 535, 519, 536, 537, 538, 521, 522, 523, - 524, 539, 526, 527, 540, 541, 543, 544, 545, 546, - 547, 528, 529, 530, 549, 531, 532, 533, 534, 535, - - 550, 536, 537, 538, 551, 552, 556, 557, 539, 562, - 564, 540, 541, 543, 544, 545, 546, 547, 566, 567, - 568, 549, 569, 570, 571, 573, 574, 550, 575, 576, - 578, 551, 552, 556, 557, 579, 562, 564, 581, 583, - 585, 587, 589, 595, 596, 566, 567, 568, 598, 569, - 570, 571, 573, 574, 600, 575, 576, 578, 601, 602, - 604, 606, 579, 608, 610, 581, 583, 585, 587, 589, - 595, 596, 611, 612, 614, 598, 615, 616, 617, 618, - 619, 600, 620, 621, 622, 601, 602, 604, 606, 625, - 608, 610, 626, 628, 629, 631, 632, 633, 635, 611, - - 612, 614, 638, 615, 616, 617, 618, 619, 639, 620, - 621, 622, 640, 641, 645, 648, 625, 649, 651, 626, - 628, 629, 631, 632, 633, 635, 655, 656, 662, 638, - 663, 666, 667, 668, 673, 639, 674, 678, 679, 640, - 641, 645, 648, 681, 649, 651, 683, 686, 687, 691, - 692, 696, 698, 655, 656, 662, 700, 663, 666, 667, - 668, 673, 701, 674, 678, 679, 702, 703, 704, 706, - 681, 707, 709, 683, 686, 687, 691, 692, 696, 698, - 710, 713, 714, 700, 716, 718, 720, 721, 724, 701, - 726, 728, 732, 702, 703, 704, 706, 733, 707, 709, - - 734, 735, 736, 738, 739, 740, 746, 710, 713, 714, - 747, 716, 718, 720, 721, 724, 748, 726, 728, 732, - 750, 751, 753, 757, 733, 758, 761, 734, 735, 736, - 738, 739, 740, 746, 762, 766, 0, 747, 0, 0, - 0, 0, 0, 748, 0, 0, 0, 750, 751, 753, - 757, 0, 758, 761, 0, 0, 0, 0, 0, 0, - 0, 762, 766, 769, 769, 769, 769, 770, 0, 770, - 770, 772, 772, 0, 772, 768, 768, 768, 768, 768, - 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, - 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, - - 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, - 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, - 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, - 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, - 768, 768, 768, 768 + 81, 0, 81, 85, 92, 74, 81, 0, 104, 85, + 106, 0, 74, 81, 89, 90, 107, 81, 91, 92, + 93, 94, 96, 97, 99, 100, 102, 101, 102, 102, + 103, 92, 101, 97, 103, 104, 105, 106, 97, 97, + 105, 108, 109, 107, 110, 112, 111, 113, 114, 116, + 97, 117, 118, 102, 101, 102, 102, 103, 119, 101, + 97, 103, 111, 105, 120, 97, 97, 105, 108, 109, + 123, 110, 112, 111, 113, 114, 116, 121, 117, 118, + 121, 124, 122, 124, 125, 119, 122, 126, 128, 111, + + 129, 120, 122, 124, 124, 130, 131, 123, 132, 124, + 0, 133, 0, 134, 121, 136, 0, 121, 124, 122, + 124, 125, 0, 122, 126, 128, 141, 129, 0, 122, + 124, 124, 130, 131, 135, 132, 124, 127, 133, 127, + 134, 143, 136, 127, 135, 137, 137, 139, 127, 140, + 145, 144, 140, 141, 140, 127, 127, 144, 142, 140, + 146, 135, 142, 147, 127, 148, 127, 139, 143, 149, + 127, 135, 137, 137, 139, 127, 140, 145, 144, 140, + 0, 140, 127, 127, 144, 142, 140, 146, 156, 142, + 147, 157, 148, 158, 139, 161, 149, 153, 153, 153, + + 154, 162, 154, 154, 154, 163, 164, 153, 165, 165, + 166, 168, 169, 170, 171, 156, 172, 173, 157, 176, + 158, 174, 161, 175, 174, 177, 173, 169, 162, 178, + 180, 175, 163, 164, 153, 165, 165, 166, 168, 169, + 170, 171, 181, 172, 173, 179, 176, 182, 174, 179, + 175, 174, 177, 173, 169, 183, 178, 180, 175, 183, + 184, 185, 186, 187, 188, 189, 191, 192, 193, 181, + 183, 195, 179, 196, 182, 194, 179, 197, 194, 198, + 199, 200, 183, 201, 202, 203, 183, 184, 185, 186, + 187, 188, 189, 191, 192, 193, 204, 183, 195, 205, + + 196, 206, 194, 207, 197, 194, 198, 199, 200, 208, + 201, 202, 203, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 204, 220, 221, 205, 222, 206, 223, + 207, 217, 224, 225, 226, 227, 208, 228, 220, 229, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 231, 220, 221, 232, 222, 233, 223, 230, 217, 224, + 225, 226, 227, 230, 228, 220, 229, 234, 235, 237, + 238, 239, 240, 241, 242, 243, 244, 231, 245, 246, + 232, 247, 233, 248, 230, 250, 251, 0, 252, 253, + 230, 254, 255, 256, 234, 235, 237, 238, 239, 240, + + 241, 242, 243, 244, 249, 245, 246, 257, 247, 258, + 248, 259, 250, 251, 249, 252, 253, 260, 254, 255, + 256, 261, 262, 264, 265, 266, 267, 268, 269, 270, + 271, 249, 272, 273, 257, 274, 258, 275, 259, 276, + 277, 249, 279, 278, 260, 278, 280, 281, 261, 262, + 264, 265, 266, 267, 268, 269, 270, 271, 282, 272, + 273, 284, 274, 285, 275, 286, 276, 277, 288, 279, + 278, 287, 278, 280, 281, 289, 290, 287, 291, 292, + 290, 293, 293, 293, 295, 282, 296, 297, 284, 298, + 285, 299, 286, 300, 301, 288, 303, 304, 287, 294, + + 294, 294, 289, 290, 287, 291, 292, 290, 305, 308, + 309, 295, 310, 296, 297, 311, 298, 312, 299, 313, + 300, 301, 314, 303, 304, 315, 316, 318, 319, 320, + 321, 323, 324, 325, 326, 305, 308, 309, 327, 310, + 329, 330, 311, 333, 312, 334, 313, 335, 336, 314, + 337, 338, 315, 316, 318, 319, 320, 321, 323, 324, + 325, 326, 339, 340, 341, 327, 342, 329, 330, 343, + 333, 344, 334, 345, 335, 336, 348, 337, 338, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 339, + 340, 341, 359, 342, 360, 364, 343, 365, 344, 368, + + 345, 373, 374, 348, 375, 361, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 361, 376, 377, 359, + 378, 360, 364, 379, 365, 380, 368, 381, 373, 374, + 383, 375, 361, 384, 385, 386, 387, 389, 390, 391, + 392, 393, 394, 361, 376, 377, 395, 378, 398, 399, + 379, 400, 380, 401, 381, 396, 402, 383, 403, 404, + 384, 385, 386, 387, 389, 390, 391, 392, 393, 394, + 405, 396, 406, 395, 407, 398, 399, 408, 400, 410, + 401, 411, 396, 402, 412, 403, 404, 413, 414, 415, + 416, 419, 420, 421, 423, 424, 425, 405, 396, 406, + + 426, 407, 427, 428, 408, 429, 410, 431, 411, 432, + 433, 412, 434, 435, 413, 414, 415, 416, 419, 420, + 421, 423, 424, 425, 437, 439, 441, 426, 443, 427, + 428, 444, 429, 445, 431, 446, 432, 433, 447, 434, + 435, 448, 449, 450, 452, 453, 454, 455, 456, 457, + 458, 437, 439, 441, 459, 443, 461, 462, 444, 463, + 445, 464, 446, 465, 466, 447, 468, 469, 448, 449, + 450, 452, 453, 454, 455, 456, 457, 458, 470, 471, + 472, 459, 473, 461, 462, 474, 463, 475, 464, 476, + 465, 466, 481, 468, 469, 482, 483, 484, 486, 487, + + 488, 489, 491, 492, 493, 470, 471, 472, 495, 473, + 496, 498, 474, 499, 475, 497, 476, 502, 497, 481, + 503, 504, 482, 483, 484, 486, 487, 488, 489, 491, + 492, 493, 505, 506, 507, 495, 508, 496, 498, 510, + 499, 511, 497, 512, 502, 497, 515, 503, 504, 517, + 518, 519, 520, 521, 522, 524, 525, 526, 527, 505, + 506, 507, 529, 508, 530, 531, 510, 532, 511, 533, + 512, 534, 535, 515, 536, 537, 517, 518, 519, 520, + 521, 522, 524, 525, 526, 527, 538, 539, 540, 529, + 541, 530, 531, 542, 532, 543, 533, 544, 534, 535, + + 546, 536, 537, 547, 548, 549, 550, 552, 553, 554, + 555, 559, 560, 538, 539, 540, 565, 541, 567, 569, + 542, 570, 543, 571, 544, 572, 573, 546, 574, 576, + 547, 548, 549, 550, 552, 553, 554, 555, 559, 560, + 577, 578, 579, 565, 581, 567, 569, 582, 570, 584, + 571, 586, 572, 573, 588, 574, 576, 590, 592, 598, + 599, 600, 602, 604, 605, 606, 608, 577, 578, 579, + 610, 581, 612, 614, 582, 615, 584, 616, 586, 618, + 619, 588, 620, 621, 590, 592, 598, 599, 600, 602, + 604, 605, 606, 608, 622, 623, 624, 610, 625, 612, + + 614, 626, 615, 629, 616, 630, 618, 619, 632, 620, + 621, 633, 635, 636, 637, 639, 642, 643, 644, 645, + 649, 622, 623, 624, 652, 625, 653, 655, 626, 659, + 629, 660, 630, 666, 667, 632, 670, 671, 633, 635, + 636, 637, 639, 642, 643, 644, 645, 649, 672, 677, + 678, 652, 683, 653, 655, 684, 659, 686, 660, 688, + 666, 667, 691, 670, 671, 692, 696, 697, 701, 703, + 705, 706, 707, 708, 709, 672, 677, 678, 711, 683, + 712, 714, 684, 715, 686, 718, 688, 719, 721, 691, + 723, 725, 692, 696, 697, 701, 703, 705, 706, 707, + + 708, 709, 726, 729, 731, 711, 733, 712, 714, 737, + 715, 738, 718, 739, 719, 721, 740, 723, 725, 741, + 743, 744, 745, 751, 752, 753, 755, 756, 758, 726, + 729, 731, 762, 733, 763, 766, 737, 767, 738, 771, + 739, 0, 0, 740, 0, 0, 741, 743, 744, 745, + 751, 752, 753, 755, 756, 758, 0, 0, 0, 762, + 0, 763, 766, 0, 767, 0, 771, 774, 774, 774, + 774, 775, 0, 775, 775, 777, 777, 0, 777, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773 } ; -static const flex_int16_t yy_rule_linenum[212] = +static const flex_int16_t yy_rule_linenum[213] = { 0, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, @@ -1363,10 +1364,10 @@ static const flex_int16_t yy_rule_linenum[212] = 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 226, 227, 228, 229, 230, + 220, 221, 222, 223, 224, 225, 227, 228, 229, 230, - 232, 234, 235, 240, 250, 259, 264, 265, 266, 267, - 270 + 231, 233, 235, 236, 241, 251, 260, 265, 266, 267, + 268, 271 } ; /* The intent behind this definition is that it'll catch @@ -1385,10 +1386,10 @@ static const flex_int16_t yy_rule_linenum[212] = static thread_local std::stringstream string_buffer; -#line 1389 "lexer.cpp" +#line 1390 "lexer.cpp" #define YY_NO_INPUT 1 -#line 1392 "lexer.cpp" +#line 1393 "lexer.cpp" #define INITIAL 0 #define SINGLE_QUOTED_STRING 1 @@ -1742,7 +1743,7 @@ YY_DECL #line 27 "lexer.l" -#line 1746 "lexer.cpp" +#line 1747 "lexer.cpp" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -1771,13 +1772,13 @@ YY_DECL while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 769 ) + if ( yy_current_state >= 774 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } - while ( yy_current_state != 768 ); + while ( yy_current_state != 773 ); yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; @@ -1796,13 +1797,13 @@ YY_DECL { if ( yy_act == 0 ) fprintf( stderr, "--scanner backing up\n" ); - else if ( yy_act < 212 ) + else if ( yy_act < 213 ) fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n", (long)yy_rule_linenum[yy_act], yytext ); - else if ( yy_act == 212 ) + else if ( yy_act == 213 ) fprintf( stderr, "--accepting default rule (\"%s\")\n", yytext ); - else if ( yy_act == 213 ) + else if ( yy_act == 214 ) fprintf( stderr, "--(end of buffer or a NUL)\n" ); else fprintf( stderr, "--EOF (start condition %d)\n", YY_START ); @@ -2212,597 +2213,597 @@ YY_RULE_SETUP case 79: YY_RULE_SETUP #line 108 "lexer.l" -{ return HOUR; } +{ return HISTORY; } YY_BREAK case 80: YY_RULE_SETUP #line 109 "lexer.l" -{ return HOURS; } +{ return HOUR; } YY_BREAK case 81: YY_RULE_SETUP #line 110 "lexer.l" -{ return HUGEINT; } +{ return HOURS; } YY_BREAK case 82: YY_RULE_SETUP #line 111 "lexer.l" -{ return IF; } +{ return HUGEINT; } YY_BREAK case 83: YY_RULE_SETUP #line 112 "lexer.l" -{ return IGNORE; } +{ return IF; } YY_BREAK case 84: YY_RULE_SETUP #line 113 "lexer.l" -{ return IN; } +{ return IGNORE; } YY_BREAK case 85: YY_RULE_SETUP #line 114 "lexer.l" -{ return INDEX; } +{ return IN; } YY_BREAK case 86: YY_RULE_SETUP #line 115 "lexer.l" -{ return INDEXES; } +{ return INDEX; } YY_BREAK case 87: YY_RULE_SETUP #line 116 "lexer.l" -{ return INNER; } +{ return INDEXES; } YY_BREAK case 88: YY_RULE_SETUP #line 117 "lexer.l" -{ return INSERT; } +{ return INNER; } YY_BREAK case 89: YY_RULE_SETUP #line 118 "lexer.l" -{ return INTEGER; } +{ return INSERT; } YY_BREAK case 90: YY_RULE_SETUP #line 119 "lexer.l" -{ return INT; } +{ return INTEGER; } YY_BREAK case 91: YY_RULE_SETUP #line 120 "lexer.l" -{ return INTERSECT; } +{ return INT; } YY_BREAK case 92: YY_RULE_SETUP #line 121 "lexer.l" -{ return INTERVAL; } +{ return INTERSECT; } YY_BREAK case 93: YY_RULE_SETUP #line 122 "lexer.l" -{ return INTO; } +{ return INTERVAL; } YY_BREAK case 94: YY_RULE_SETUP #line 123 "lexer.l" -{ return IS; } +{ return INTO; } YY_BREAK case 95: YY_RULE_SETUP #line 124 "lexer.l" -{ return JOIN; } +{ return IS; } YY_BREAK case 96: YY_RULE_SETUP #line 125 "lexer.l" -{ return KEY; } +{ return JOIN; } YY_BREAK case 97: YY_RULE_SETUP #line 126 "lexer.l" -{ return LEADER; } +{ return KEY; } YY_BREAK case 98: YY_RULE_SETUP #line 127 "lexer.l" -{ return LEARNER; } +{ return LEADER; } YY_BREAK case 99: YY_RULE_SETUP #line 128 "lexer.l" -{ return LEFT; } +{ return LEARNER; } YY_BREAK case 100: YY_RULE_SETUP #line 129 "lexer.l" -{ return LIKE; } +{ return LEFT; } YY_BREAK case 101: YY_RULE_SETUP #line 130 "lexer.l" -{ return LIMIT; } +{ return LIKE; } YY_BREAK case 102: YY_RULE_SETUP #line 131 "lexer.l" -{ return LINE; } +{ return LIMIT; } YY_BREAK case 103: YY_RULE_SETUP #line 132 "lexer.l" -{ return LOCK; } +{ return LINE; } YY_BREAK case 104: YY_RULE_SETUP #line 133 "lexer.l" -{ return LOG; } +{ return LOCK; } YY_BREAK case 105: YY_RULE_SETUP #line 134 "lexer.l" -{ return LOGS; } +{ return LOG; } YY_BREAK case 106: YY_RULE_SETUP #line 135 "lexer.l" -{ return LSEG; } +{ return LOGS; } YY_BREAK case 107: YY_RULE_SETUP #line 136 "lexer.l" -{ return MATCH; } +{ return LSEG; } YY_BREAK case 108: YY_RULE_SETUP #line 137 "lexer.l" -{ return MAXSIM; } +{ return MATCH; } YY_BREAK case 109: YY_RULE_SETUP #line 138 "lexer.l" -{ return MEMORY; } +{ return MAXSIM; } YY_BREAK case 110: YY_RULE_SETUP #line 139 "lexer.l" -{ return MEMINDEX; } +{ return MEMORY; } YY_BREAK case 111: YY_RULE_SETUP #line 140 "lexer.l" -{ return MINUTE; } +{ return MEMINDEX; } YY_BREAK case 112: YY_RULE_SETUP #line 141 "lexer.l" -{ return MINUTES; } +{ return MINUTE; } YY_BREAK case 113: YY_RULE_SETUP #line 142 "lexer.l" -{ return MONTH; } +{ return MINUTES; } YY_BREAK case 114: YY_RULE_SETUP #line 143 "lexer.l" -{ return MONTHS; } +{ return MONTH; } YY_BREAK case 115: YY_RULE_SETUP #line 144 "lexer.l" -{ return MULTIVECTOR; } +{ return MONTHS; } YY_BREAK case 116: YY_RULE_SETUP #line 145 "lexer.l" -{ return NATURAL; } +{ return MULTIVECTOR; } YY_BREAK case 117: YY_RULE_SETUP #line 146 "lexer.l" -{ return NULLABLE; } +{ return NATURAL; } YY_BREAK case 118: YY_RULE_SETUP #line 147 "lexer.l" -{ return NODE; } +{ return NULLABLE; } YY_BREAK case 119: YY_RULE_SETUP #line 148 "lexer.l" -{ return NODES; } +{ return NODE; } YY_BREAK case 120: YY_RULE_SETUP #line 149 "lexer.l" -{ return NOT; } +{ return NODES; } YY_BREAK case 121: YY_RULE_SETUP #line 150 "lexer.l" -{ return OBJECT; } +{ return NOT; } YY_BREAK case 122: YY_RULE_SETUP #line 151 "lexer.l" -{ return OBJECTS; } +{ return OBJECT; } YY_BREAK case 123: YY_RULE_SETUP #line 152 "lexer.l" -{ return OFF; } +{ return OBJECTS; } YY_BREAK case 124: YY_RULE_SETUP #line 153 "lexer.l" -{ return OFFSET; } +{ return OFF; } YY_BREAK case 125: YY_RULE_SETUP #line 154 "lexer.l" -{ return ON; } +{ return OFFSET; } YY_BREAK case 126: YY_RULE_SETUP #line 155 "lexer.l" -{ return OPTIMIZE; } +{ return ON; } YY_BREAK case 127: YY_RULE_SETUP #line 156 "lexer.l" -{ return OR; } +{ return OPTIMIZE; } YY_BREAK case 128: YY_RULE_SETUP #line 157 "lexer.l" -{ return ORDER; } +{ return OR; } YY_BREAK case 129: YY_RULE_SETUP #line 158 "lexer.l" -{ return OUTER; } +{ return ORDER; } YY_BREAK case 130: YY_RULE_SETUP #line 159 "lexer.l" -{ return PATH; } +{ return OUTER; } YY_BREAK case 131: YY_RULE_SETUP #line 160 "lexer.l" -{ return PERSISTENCE; } +{ return PATH; } YY_BREAK case 132: YY_RULE_SETUP #line 161 "lexer.l" -{ return POINT; } +{ return PERSISTENCE; } YY_BREAK case 133: YY_RULE_SETUP #line 162 "lexer.l" -{ return POLYGON; } +{ return POINT; } YY_BREAK case 134: YY_RULE_SETUP #line 163 "lexer.l" -{ return PREPARE; } +{ return POLYGON; } YY_BREAK case 135: YY_RULE_SETUP #line 164 "lexer.l" -{ return PRIMARY; } +{ return PREPARE; } YY_BREAK case 136: YY_RULE_SETUP #line 165 "lexer.l" -{ return PROFILES; } +{ return PRIMARY; } YY_BREAK case 137: YY_RULE_SETUP #line 166 "lexer.l" -{ return PROPERTIES; } +{ return PROFILES; } YY_BREAK case 138: YY_RULE_SETUP #line 167 "lexer.l" -{ return QUERIES; } +{ return PROPERTIES; } YY_BREAK case 139: YY_RULE_SETUP #line 168 "lexer.l" -{ return QUERY; } +{ return QUERIES; } YY_BREAK case 140: YY_RULE_SETUP #line 169 "lexer.l" -{ return REAL; } +{ return QUERY; } YY_BREAK case 141: YY_RULE_SETUP #line 170 "lexer.l" -{ return RECOVER; } +{ return REAL; } YY_BREAK case 142: YY_RULE_SETUP #line 171 "lexer.l" -{ return RESTORE; } +{ return RECOVER; } YY_BREAK case 143: YY_RULE_SETUP #line 172 "lexer.l" -{ return RENAME; } +{ return RESTORE; } YY_BREAK case 144: YY_RULE_SETUP #line 173 "lexer.l" -{ return REMOVE; } +{ return RENAME; } YY_BREAK case 145: YY_RULE_SETUP #line 174 "lexer.l" -{ return RIGHT; } +{ return REMOVE; } YY_BREAK case 146: YY_RULE_SETUP #line 175 "lexer.l" -{ return ROWLIMIT; } +{ return RIGHT; } YY_BREAK case 147: YY_RULE_SETUP #line 176 "lexer.l" -{ return SEARCH; } +{ return ROWLIMIT; } YY_BREAK case 148: YY_RULE_SETUP #line 177 "lexer.l" -{ return SECOND; } +{ return SEARCH; } YY_BREAK case 149: YY_RULE_SETUP #line 178 "lexer.l" -{ return SECONDS; } +{ return SECOND; } YY_BREAK case 150: YY_RULE_SETUP #line 179 "lexer.l" -{ return SELECT; } +{ return SECONDS; } YY_BREAK case 151: YY_RULE_SETUP #line 180 "lexer.l" -{ return SESSION; } +{ return SELECT; } YY_BREAK case 152: YY_RULE_SETUP #line 181 "lexer.l" -{ return SET; } +{ return SESSION; } YY_BREAK case 153: YY_RULE_SETUP #line 182 "lexer.l" -{ return SEGMENT; } +{ return SET; } YY_BREAK case 154: YY_RULE_SETUP #line 183 "lexer.l" -{ return SEGMENTS; } +{ return SEGMENT; } YY_BREAK case 155: YY_RULE_SETUP #line 184 "lexer.l" -{ return SHOW; } +{ return SEGMENTS; } YY_BREAK case 156: YY_RULE_SETUP #line 185 "lexer.l" -{ return SMALLINT; } +{ return SHOW; } YY_BREAK case 157: YY_RULE_SETUP #line 186 "lexer.l" -{ return SNAPSHOT; } +{ return SMALLINT; } YY_BREAK case 158: YY_RULE_SETUP #line 187 "lexer.l" -{ return SNAPSHOTS; } +{ return SNAPSHOT; } YY_BREAK case 159: YY_RULE_SETUP #line 188 "lexer.l" -{ return SPARSE; } +{ return SNAPSHOTS; } YY_BREAK case 160: YY_RULE_SETUP #line 189 "lexer.l" -{ return STANDALONE; } +{ return SPARSE; } YY_BREAK case 161: YY_RULE_SETUP #line 190 "lexer.l" -{ return SYSTEM; } +{ return STANDALONE; } YY_BREAK case 162: YY_RULE_SETUP #line 191 "lexer.l" -{ return TABLE; } +{ return SYSTEM; } YY_BREAK case 163: YY_RULE_SETUP #line 192 "lexer.l" -{ return TABLES; } +{ return TABLE; } YY_BREAK case 164: YY_RULE_SETUP #line 193 "lexer.l" -{ return TENSOR; } +{ return TABLES; } YY_BREAK case 165: YY_RULE_SETUP #line 194 "lexer.l" -{ return TENSORARRAY; } +{ return TENSOR; } YY_BREAK case 166: YY_RULE_SETUP #line 195 "lexer.l" -{ return TEXT; } +{ return TENSORARRAY; } YY_BREAK case 167: YY_RULE_SETUP #line 196 "lexer.l" -{ return THEN; } +{ return TEXT; } YY_BREAK case 168: YY_RULE_SETUP #line 197 "lexer.l" -{ return TIME; } +{ return THEN; } YY_BREAK case 169: YY_RULE_SETUP #line 198 "lexer.l" -{ return TIMESTAMP; } +{ return TIME; } YY_BREAK case 170: YY_RULE_SETUP #line 199 "lexer.l" -{ return TINYINT; } +{ return TIMESTAMP; } YY_BREAK case 171: YY_RULE_SETUP #line 200 "lexer.l" -{ return TO; } +{ return TINYINT; } YY_BREAK case 172: YY_RULE_SETUP #line 201 "lexer.l" -{ return TRANSACTION; } +{ return TO; } YY_BREAK case 173: YY_RULE_SETUP #line 202 "lexer.l" -{ return TRANSACTIONS; } +{ return TRANSACTION; } YY_BREAK case 174: YY_RULE_SETUP #line 203 "lexer.l" -{ return TRUE; } +{ return TRANSACTIONS; } YY_BREAK case 175: YY_RULE_SETUP #line 204 "lexer.l" -{ return UNION; } +{ return TRUE; } YY_BREAK case 176: YY_RULE_SETUP #line 205 "lexer.l" -{ return UNIQUE; } +{ return UNION; } YY_BREAK case 177: YY_RULE_SETUP #line 206 "lexer.l" -{ return UNLOCK; } +{ return UNIQUE; } YY_BREAK case 178: YY_RULE_SETUP #line 207 "lexer.l" -{ return UNNEST; } +{ return UNLOCK; } YY_BREAK case 179: YY_RULE_SETUP #line 208 "lexer.l" -{ return UNSIGNED; } +{ return UNNEST; } YY_BREAK case 180: YY_RULE_SETUP #line 209 "lexer.l" -{ return USING; } +{ return UNSIGNED; } YY_BREAK case 181: YY_RULE_SETUP #line 210 "lexer.l" -{ return UPDATE; } +{ return USING; } YY_BREAK case 182: YY_RULE_SETUP #line 211 "lexer.l" -{ return UUID; } +{ return UPDATE; } YY_BREAK case 183: YY_RULE_SETUP #line 212 "lexer.l" -{ return USE; } +{ return UUID; } YY_BREAK case 184: YY_RULE_SETUP #line 213 "lexer.l" -{ return VALUES; } +{ return USE; } YY_BREAK case 185: YY_RULE_SETUP #line 214 "lexer.l" -{ return VARIABLE; } +{ return VALUES; } YY_BREAK case 186: YY_RULE_SETUP #line 215 "lexer.l" -{ return VARIABLES; } +{ return VARIABLE; } YY_BREAK case 187: YY_RULE_SETUP #line 216 "lexer.l" -{ return VARCHAR; } +{ return VARIABLES; } YY_BREAK case 188: YY_RULE_SETUP #line 217 "lexer.l" -{ return VECTOR; } +{ return VARCHAR; } YY_BREAK case 189: YY_RULE_SETUP #line 218 "lexer.l" -{ return VIEW; } +{ return VECTOR; } YY_BREAK case 190: YY_RULE_SETUP #line 219 "lexer.l" -{ return VIEWS; } +{ return VIEW; } YY_BREAK case 191: YY_RULE_SETUP #line 220 "lexer.l" -{ return WHEN; } +{ return VIEWS; } YY_BREAK case 192: YY_RULE_SETUP #line 221 "lexer.l" -{ return WHERE; } +{ return WHEN; } YY_BREAK case 193: YY_RULE_SETUP #line 222 "lexer.l" -{ return WITH; } +{ return WHERE; } YY_BREAK case 194: YY_RULE_SETUP #line 223 "lexer.l" -{ return YEAR; } +{ return WITH; } YY_BREAK case 195: YY_RULE_SETUP #line 224 "lexer.l" -{ return YEARS; } +{ return YEAR; } YY_BREAK case 196: YY_RULE_SETUP -#line 226 "lexer.l" -{ return EQUAL; } +#line 225 "lexer.l" +{ return YEARS; } YY_BREAK case 197: YY_RULE_SETUP #line 227 "lexer.l" -{ return NOT_EQ; } +{ return EQUAL; } YY_BREAK case 198: YY_RULE_SETUP @@ -2812,31 +2813,36 @@ YY_RULE_SETUP case 199: YY_RULE_SETUP #line 229 "lexer.l" -{ return LESS_EQ; } +{ return NOT_EQ; } YY_BREAK case 200: YY_RULE_SETUP #line 230 "lexer.l" -{ return GREATER_EQ; } +{ return LESS_EQ; } YY_BREAK case 201: YY_RULE_SETUP -#line 232 "lexer.l" -{ return yytext[0]; } +#line 231 "lexer.l" +{ return GREATER_EQ; } YY_BREAK case 202: -#line 235 "lexer.l" +YY_RULE_SETUP +#line 233 "lexer.l" +{ return yytext[0]; } + YY_BREAK case 203: +#line 236 "lexer.l" +case 204: YY_RULE_SETUP -#line 235 "lexer.l" +#line 236 "lexer.l" { yylval->double_value = atof(yytext); return DOUBLE_VALUE; } YY_BREAK -case 204: +case 205: YY_RULE_SETUP -#line 240 "lexer.l" +#line 241 "lexer.l" { errno = 0; yylval->long_value = strtoll(yytext, nullptr, 0); @@ -2847,9 +2853,9 @@ YY_RULE_SETUP return LONG_VALUE; } YY_BREAK -case 205: +case 206: YY_RULE_SETUP -#line 250 "lexer.l" +#line 251 "lexer.l" { // total length - 2 of quota + 1 null char long str_len = strlen(yytext) - 1; @@ -2859,50 +2865,50 @@ YY_RULE_SETUP return IDENTIFIER; } YY_BREAK -case 206: +case 207: YY_RULE_SETUP -#line 259 "lexer.l" +#line 260 "lexer.l" { yylval->str_value = strdup(yytext); return IDENTIFIER; } YY_BREAK -case 207: -YY_RULE_SETUP -#line 264 "lexer.l" -{ BEGIN SINGLE_QUOTED_STRING; string_buffer.clear(); string_buffer.str(""); } // Clear strbuf manually, see #170 - YY_BREAK case 208: YY_RULE_SETUP #line 265 "lexer.l" -{ string_buffer << '\''; } +{ BEGIN SINGLE_QUOTED_STRING; string_buffer.clear(); string_buffer.str(""); } // Clear strbuf manually, see #170 YY_BREAK case 209: -/* rule 209 can match eol */ YY_RULE_SETUP #line 266 "lexer.l" -{ string_buffer << yytext; } +{ string_buffer << '\''; } YY_BREAK case 210: +/* rule 210 can match eol */ YY_RULE_SETUP #line 267 "lexer.l" +{ string_buffer << yytext; } + YY_BREAK +case 211: +YY_RULE_SETUP +#line 268 "lexer.l" { BEGIN INITIAL; yylval->str_value = strdup(string_buffer.str().c_str()); return STRING; } YY_BREAK case YY_STATE_EOF(SINGLE_QUOTED_STRING): -#line 268 "lexer.l" +#line 269 "lexer.l" { fprintf(stderr, "[SQL-Lexer-Error] Unterminated string\n"); return 0; } YY_BREAK -case 211: +case 212: YY_RULE_SETUP -#line 270 "lexer.l" +#line 271 "lexer.l" { fprintf(stderr, "[SQL-Lexer-Error] Unknown Character: %c\n", yytext[0]); return 0; } YY_BREAK -case 212: +case 213: YY_RULE_SETUP -#line 272 "lexer.l" +#line 273 "lexer.l" ECHO; YY_BREAK -#line 2906 "lexer.cpp" +#line 2912 "lexer.cpp" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -3225,7 +3231,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 769 ) + if ( yy_current_state >= 774 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; @@ -3259,11 +3265,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 769 ) + if ( yy_current_state >= 774 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 768); + yy_is_jam = (yy_current_state == 773); (void)yyg; return yy_is_jam ? 0 : yy_current_state; @@ -4200,7 +4206,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) /* %ok-for-header */ -#line 272 "lexer.l" +#line 273 "lexer.l" int yyerror(const char *msg) { diff --git a/src/parser/lexer.h b/src/parser/lexer.h index 5c1e2b622f..ffb1d801a8 100644 --- a/src/parser/lexer.h +++ b/src/parser/lexer.h @@ -846,7 +846,7 @@ extern int yylex \ #undef yyTABLES_NAME #endif -#line 272 "lexer.l" +#line 273 "lexer.l" #line 853 "lexer.h" diff --git a/src/parser/lexer.l b/src/parser/lexer.l index 697cb48819..c0067ddea9 100644 --- a/src/parser/lexer.l +++ b/src/parser/lexer.l @@ -105,6 +105,7 @@ GROUP { return GROUP; } HAVING { return HAVING; } HEADER { return HEADER; } HIGHLIGHT { return HIGHLIGHT; } +HISTORY { return HISTORY; } HOUR { return HOUR; } HOURS { return HOURS; } HUGEINT { return HUGEINT; } diff --git a/src/parser/parser.cpp b/src/parser/parser.cpp index b27dbe086f..7f6b4c1972 100644 --- a/src/parser/parser.cpp +++ b/src/parser/parser.cpp @@ -316,140 +316,141 @@ enum yysymbol_kind_t YYSYMBOL_FILES = 202, /* FILES */ YYSYMBOL_MEMORY = 203, /* MEMORY */ YYSYMBOL_ALLOCATION = 204, /* ALLOCATION */ - YYSYMBOL_NUMBER = 205, /* NUMBER */ - YYSYMBOL_206_ = 206, /* '=' */ - YYSYMBOL_207_ = 207, /* '<' */ - YYSYMBOL_208_ = 208, /* '>' */ - YYSYMBOL_209_ = 209, /* '+' */ - YYSYMBOL_210_ = 210, /* '-' */ - YYSYMBOL_211_ = 211, /* '*' */ - YYSYMBOL_212_ = 212, /* '/' */ - YYSYMBOL_213_ = 213, /* '%' */ - YYSYMBOL_214_ = 214, /* '[' */ - YYSYMBOL_215_ = 215, /* ']' */ - YYSYMBOL_216_ = 216, /* '(' */ - YYSYMBOL_217_ = 217, /* ')' */ - YYSYMBOL_218_ = 218, /* '.' */ - YYSYMBOL_219_ = 219, /* ';' */ - YYSYMBOL_220_ = 220, /* ',' */ - YYSYMBOL_221_ = 221, /* ':' */ - YYSYMBOL_YYACCEPT = 222, /* $accept */ - YYSYMBOL_input_pattern = 223, /* input_pattern */ - YYSYMBOL_statement_list = 224, /* statement_list */ - YYSYMBOL_statement = 225, /* statement */ - YYSYMBOL_explainable_statement = 226, /* explainable_statement */ - YYSYMBOL_create_statement = 227, /* create_statement */ - YYSYMBOL_table_element_array = 228, /* table_element_array */ - YYSYMBOL_column_def_array = 229, /* column_def_array */ - YYSYMBOL_table_element = 230, /* table_element */ - YYSYMBOL_table_column = 231, /* table_column */ - YYSYMBOL_column_type = 232, /* column_type */ - YYSYMBOL_column_constraints = 233, /* column_constraints */ - YYSYMBOL_column_constraint = 234, /* column_constraint */ - YYSYMBOL_default_expr = 235, /* default_expr */ - YYSYMBOL_table_constraint = 236, /* table_constraint */ - YYSYMBOL_identifier_array = 237, /* identifier_array */ - YYSYMBOL_delete_statement = 238, /* delete_statement */ - YYSYMBOL_insert_statement = 239, /* insert_statement */ - YYSYMBOL_optional_identifier_array = 240, /* optional_identifier_array */ - YYSYMBOL_explain_statement = 241, /* explain_statement */ - YYSYMBOL_update_statement = 242, /* update_statement */ - YYSYMBOL_update_expr_array = 243, /* update_expr_array */ - YYSYMBOL_update_expr = 244, /* update_expr */ - YYSYMBOL_drop_statement = 245, /* drop_statement */ - YYSYMBOL_copy_statement = 246, /* copy_statement */ - YYSYMBOL_select_statement = 247, /* select_statement */ - YYSYMBOL_select_with_paren = 248, /* select_with_paren */ - YYSYMBOL_select_without_paren = 249, /* select_without_paren */ - YYSYMBOL_select_clause_with_modifier = 250, /* select_clause_with_modifier */ - YYSYMBOL_select_clause_without_modifier_paren = 251, /* select_clause_without_modifier_paren */ - YYSYMBOL_select_clause_without_modifier = 252, /* select_clause_without_modifier */ - YYSYMBOL_order_by_clause = 253, /* order_by_clause */ - YYSYMBOL_order_by_expr_list = 254, /* order_by_expr_list */ - YYSYMBOL_order_by_expr = 255, /* order_by_expr */ - YYSYMBOL_order_by_type = 256, /* order_by_type */ - YYSYMBOL_limit_expr = 257, /* limit_expr */ - YYSYMBOL_offset_expr = 258, /* offset_expr */ - YYSYMBOL_distinct = 259, /* distinct */ - YYSYMBOL_unnest_clause = 260, /* unnest_clause */ - YYSYMBOL_highlight_clause = 261, /* highlight_clause */ - YYSYMBOL_from_clause = 262, /* from_clause */ - YYSYMBOL_search_clause = 263, /* search_clause */ - YYSYMBOL_optional_search_filter_expr = 264, /* optional_search_filter_expr */ - YYSYMBOL_where_clause = 265, /* where_clause */ - YYSYMBOL_having_clause = 266, /* having_clause */ - YYSYMBOL_group_by_clause = 267, /* group_by_clause */ - YYSYMBOL_set_operator = 268, /* set_operator */ - YYSYMBOL_table_reference = 269, /* table_reference */ - YYSYMBOL_table_reference_unit = 270, /* table_reference_unit */ - YYSYMBOL_table_reference_name = 271, /* table_reference_name */ - YYSYMBOL_table_name = 272, /* table_name */ - YYSYMBOL_table_alias = 273, /* table_alias */ - YYSYMBOL_with_clause = 274, /* with_clause */ - YYSYMBOL_with_expr_list = 275, /* with_expr_list */ - YYSYMBOL_with_expr = 276, /* with_expr */ - YYSYMBOL_join_clause = 277, /* join_clause */ - YYSYMBOL_join_type = 278, /* join_type */ - YYSYMBOL_show_statement = 279, /* show_statement */ - YYSYMBOL_flush_statement = 280, /* flush_statement */ - YYSYMBOL_optimize_statement = 281, /* optimize_statement */ - YYSYMBOL_command_statement = 282, /* command_statement */ - YYSYMBOL_compact_statement = 283, /* compact_statement */ - YYSYMBOL_admin_statement = 284, /* admin_statement */ - YYSYMBOL_alter_statement = 285, /* alter_statement */ - YYSYMBOL_expr_array = 286, /* expr_array */ - YYSYMBOL_insert_row_list = 287, /* insert_row_list */ - YYSYMBOL_expr_alias = 288, /* expr_alias */ - YYSYMBOL_expr = 289, /* expr */ - YYSYMBOL_operand = 290, /* operand */ - YYSYMBOL_match_tensor_expr = 291, /* match_tensor_expr */ - YYSYMBOL_match_vector_expr = 292, /* match_vector_expr */ - YYSYMBOL_match_sparse_expr = 293, /* match_sparse_expr */ - YYSYMBOL_match_text_expr = 294, /* match_text_expr */ - YYSYMBOL_query_expr = 295, /* query_expr */ - YYSYMBOL_fusion_expr = 296, /* fusion_expr */ - YYSYMBOL_sub_search = 297, /* sub_search */ - YYSYMBOL_sub_search_array = 298, /* sub_search_array */ - YYSYMBOL_function_expr = 299, /* function_expr */ - YYSYMBOL_conjunction_expr = 300, /* conjunction_expr */ - YYSYMBOL_between_expr = 301, /* between_expr */ - YYSYMBOL_in_expr = 302, /* in_expr */ - YYSYMBOL_case_expr = 303, /* case_expr */ - YYSYMBOL_case_check_array = 304, /* case_check_array */ - YYSYMBOL_cast_expr = 305, /* cast_expr */ - YYSYMBOL_subquery_expr = 306, /* subquery_expr */ - YYSYMBOL_column_expr = 307, /* column_expr */ - YYSYMBOL_constant_expr = 308, /* constant_expr */ - YYSYMBOL_common_array_expr = 309, /* common_array_expr */ - YYSYMBOL_common_sparse_array_expr = 310, /* common_sparse_array_expr */ - YYSYMBOL_subarray_array_expr = 311, /* subarray_array_expr */ - YYSYMBOL_unclosed_subarray_array_expr = 312, /* unclosed_subarray_array_expr */ - YYSYMBOL_sparse_array_expr = 313, /* sparse_array_expr */ - YYSYMBOL_long_sparse_array_expr = 314, /* long_sparse_array_expr */ - YYSYMBOL_unclosed_long_sparse_array_expr = 315, /* unclosed_long_sparse_array_expr */ - YYSYMBOL_double_sparse_array_expr = 316, /* double_sparse_array_expr */ - YYSYMBOL_unclosed_double_sparse_array_expr = 317, /* unclosed_double_sparse_array_expr */ - YYSYMBOL_empty_array_expr = 318, /* empty_array_expr */ - YYSYMBOL_int_sparse_ele = 319, /* int_sparse_ele */ - YYSYMBOL_float_sparse_ele = 320, /* float_sparse_ele */ - YYSYMBOL_array_expr = 321, /* array_expr */ - YYSYMBOL_long_array_expr = 322, /* long_array_expr */ - YYSYMBOL_unclosed_long_array_expr = 323, /* unclosed_long_array_expr */ - YYSYMBOL_double_array_expr = 324, /* double_array_expr */ - YYSYMBOL_unclosed_double_array_expr = 325, /* unclosed_double_array_expr */ - YYSYMBOL_interval_expr = 326, /* interval_expr */ - YYSYMBOL_copy_option_list = 327, /* copy_option_list */ - YYSYMBOL_copy_option = 328, /* copy_option */ - YYSYMBOL_file_path = 329, /* file_path */ - YYSYMBOL_if_exists = 330, /* if_exists */ - YYSYMBOL_if_not_exists = 331, /* if_not_exists */ - YYSYMBOL_semicolon = 332, /* semicolon */ - YYSYMBOL_if_not_exists_info = 333, /* if_not_exists_info */ - YYSYMBOL_with_index_param_list = 334, /* with_index_param_list */ - YYSYMBOL_optional_table_properties_list = 335, /* optional_table_properties_list */ - YYSYMBOL_index_param_list = 336, /* index_param_list */ - YYSYMBOL_index_param = 337, /* index_param */ - YYSYMBOL_index_info = 338 /* index_info */ + YYSYMBOL_HISTORY = 205, /* HISTORY */ + YYSYMBOL_NUMBER = 206, /* NUMBER */ + YYSYMBOL_207_ = 207, /* '=' */ + YYSYMBOL_208_ = 208, /* '<' */ + YYSYMBOL_209_ = 209, /* '>' */ + YYSYMBOL_210_ = 210, /* '+' */ + YYSYMBOL_211_ = 211, /* '-' */ + YYSYMBOL_212_ = 212, /* '*' */ + YYSYMBOL_213_ = 213, /* '/' */ + YYSYMBOL_214_ = 214, /* '%' */ + YYSYMBOL_215_ = 215, /* '[' */ + YYSYMBOL_216_ = 216, /* ']' */ + YYSYMBOL_217_ = 217, /* '(' */ + YYSYMBOL_218_ = 218, /* ')' */ + YYSYMBOL_219_ = 219, /* '.' */ + YYSYMBOL_220_ = 220, /* ';' */ + YYSYMBOL_221_ = 221, /* ',' */ + YYSYMBOL_222_ = 222, /* ':' */ + YYSYMBOL_YYACCEPT = 223, /* $accept */ + YYSYMBOL_input_pattern = 224, /* input_pattern */ + YYSYMBOL_statement_list = 225, /* statement_list */ + YYSYMBOL_statement = 226, /* statement */ + YYSYMBOL_explainable_statement = 227, /* explainable_statement */ + YYSYMBOL_create_statement = 228, /* create_statement */ + YYSYMBOL_table_element_array = 229, /* table_element_array */ + YYSYMBOL_column_def_array = 230, /* column_def_array */ + YYSYMBOL_table_element = 231, /* table_element */ + YYSYMBOL_table_column = 232, /* table_column */ + YYSYMBOL_column_type = 233, /* column_type */ + YYSYMBOL_column_constraints = 234, /* column_constraints */ + YYSYMBOL_column_constraint = 235, /* column_constraint */ + YYSYMBOL_default_expr = 236, /* default_expr */ + YYSYMBOL_table_constraint = 237, /* table_constraint */ + YYSYMBOL_identifier_array = 238, /* identifier_array */ + YYSYMBOL_delete_statement = 239, /* delete_statement */ + YYSYMBOL_insert_statement = 240, /* insert_statement */ + YYSYMBOL_optional_identifier_array = 241, /* optional_identifier_array */ + YYSYMBOL_explain_statement = 242, /* explain_statement */ + YYSYMBOL_update_statement = 243, /* update_statement */ + YYSYMBOL_update_expr_array = 244, /* update_expr_array */ + YYSYMBOL_update_expr = 245, /* update_expr */ + YYSYMBOL_drop_statement = 246, /* drop_statement */ + YYSYMBOL_copy_statement = 247, /* copy_statement */ + YYSYMBOL_select_statement = 248, /* select_statement */ + YYSYMBOL_select_with_paren = 249, /* select_with_paren */ + YYSYMBOL_select_without_paren = 250, /* select_without_paren */ + YYSYMBOL_select_clause_with_modifier = 251, /* select_clause_with_modifier */ + YYSYMBOL_select_clause_without_modifier_paren = 252, /* select_clause_without_modifier_paren */ + YYSYMBOL_select_clause_without_modifier = 253, /* select_clause_without_modifier */ + YYSYMBOL_order_by_clause = 254, /* order_by_clause */ + YYSYMBOL_order_by_expr_list = 255, /* order_by_expr_list */ + YYSYMBOL_order_by_expr = 256, /* order_by_expr */ + YYSYMBOL_order_by_type = 257, /* order_by_type */ + YYSYMBOL_limit_expr = 258, /* limit_expr */ + YYSYMBOL_offset_expr = 259, /* offset_expr */ + YYSYMBOL_distinct = 260, /* distinct */ + YYSYMBOL_unnest_clause = 261, /* unnest_clause */ + YYSYMBOL_highlight_clause = 262, /* highlight_clause */ + YYSYMBOL_from_clause = 263, /* from_clause */ + YYSYMBOL_search_clause = 264, /* search_clause */ + YYSYMBOL_optional_search_filter_expr = 265, /* optional_search_filter_expr */ + YYSYMBOL_where_clause = 266, /* where_clause */ + YYSYMBOL_having_clause = 267, /* having_clause */ + YYSYMBOL_group_by_clause = 268, /* group_by_clause */ + YYSYMBOL_set_operator = 269, /* set_operator */ + YYSYMBOL_table_reference = 270, /* table_reference */ + YYSYMBOL_table_reference_unit = 271, /* table_reference_unit */ + YYSYMBOL_table_reference_name = 272, /* table_reference_name */ + YYSYMBOL_table_name = 273, /* table_name */ + YYSYMBOL_table_alias = 274, /* table_alias */ + YYSYMBOL_with_clause = 275, /* with_clause */ + YYSYMBOL_with_expr_list = 276, /* with_expr_list */ + YYSYMBOL_with_expr = 277, /* with_expr */ + YYSYMBOL_join_clause = 278, /* join_clause */ + YYSYMBOL_join_type = 279, /* join_type */ + YYSYMBOL_show_statement = 280, /* show_statement */ + YYSYMBOL_flush_statement = 281, /* flush_statement */ + YYSYMBOL_optimize_statement = 282, /* optimize_statement */ + YYSYMBOL_command_statement = 283, /* command_statement */ + YYSYMBOL_compact_statement = 284, /* compact_statement */ + YYSYMBOL_admin_statement = 285, /* admin_statement */ + YYSYMBOL_alter_statement = 286, /* alter_statement */ + YYSYMBOL_expr_array = 287, /* expr_array */ + YYSYMBOL_insert_row_list = 288, /* insert_row_list */ + YYSYMBOL_expr_alias = 289, /* expr_alias */ + YYSYMBOL_expr = 290, /* expr */ + YYSYMBOL_operand = 291, /* operand */ + YYSYMBOL_match_tensor_expr = 292, /* match_tensor_expr */ + YYSYMBOL_match_vector_expr = 293, /* match_vector_expr */ + YYSYMBOL_match_sparse_expr = 294, /* match_sparse_expr */ + YYSYMBOL_match_text_expr = 295, /* match_text_expr */ + YYSYMBOL_query_expr = 296, /* query_expr */ + YYSYMBOL_fusion_expr = 297, /* fusion_expr */ + YYSYMBOL_sub_search = 298, /* sub_search */ + YYSYMBOL_sub_search_array = 299, /* sub_search_array */ + YYSYMBOL_function_expr = 300, /* function_expr */ + YYSYMBOL_conjunction_expr = 301, /* conjunction_expr */ + YYSYMBOL_between_expr = 302, /* between_expr */ + YYSYMBOL_in_expr = 303, /* in_expr */ + YYSYMBOL_case_expr = 304, /* case_expr */ + YYSYMBOL_case_check_array = 305, /* case_check_array */ + YYSYMBOL_cast_expr = 306, /* cast_expr */ + YYSYMBOL_subquery_expr = 307, /* subquery_expr */ + YYSYMBOL_column_expr = 308, /* column_expr */ + YYSYMBOL_constant_expr = 309, /* constant_expr */ + YYSYMBOL_common_array_expr = 310, /* common_array_expr */ + YYSYMBOL_common_sparse_array_expr = 311, /* common_sparse_array_expr */ + YYSYMBOL_subarray_array_expr = 312, /* subarray_array_expr */ + YYSYMBOL_unclosed_subarray_array_expr = 313, /* unclosed_subarray_array_expr */ + YYSYMBOL_sparse_array_expr = 314, /* sparse_array_expr */ + YYSYMBOL_long_sparse_array_expr = 315, /* long_sparse_array_expr */ + YYSYMBOL_unclosed_long_sparse_array_expr = 316, /* unclosed_long_sparse_array_expr */ + YYSYMBOL_double_sparse_array_expr = 317, /* double_sparse_array_expr */ + YYSYMBOL_unclosed_double_sparse_array_expr = 318, /* unclosed_double_sparse_array_expr */ + YYSYMBOL_empty_array_expr = 319, /* empty_array_expr */ + YYSYMBOL_int_sparse_ele = 320, /* int_sparse_ele */ + YYSYMBOL_float_sparse_ele = 321, /* float_sparse_ele */ + YYSYMBOL_array_expr = 322, /* array_expr */ + YYSYMBOL_long_array_expr = 323, /* long_array_expr */ + YYSYMBOL_unclosed_long_array_expr = 324, /* unclosed_long_array_expr */ + YYSYMBOL_double_array_expr = 325, /* double_array_expr */ + YYSYMBOL_unclosed_double_array_expr = 326, /* unclosed_double_array_expr */ + YYSYMBOL_interval_expr = 327, /* interval_expr */ + YYSYMBOL_copy_option_list = 328, /* copy_option_list */ + YYSYMBOL_copy_option = 329, /* copy_option */ + YYSYMBOL_file_path = 330, /* file_path */ + YYSYMBOL_if_exists = 331, /* if_exists */ + YYSYMBOL_if_not_exists = 332, /* if_not_exists */ + YYSYMBOL_semicolon = 333, /* semicolon */ + YYSYMBOL_if_not_exists_info = 334, /* if_not_exists_info */ + YYSYMBOL_with_index_param_list = 335, /* with_index_param_list */ + YYSYMBOL_optional_table_properties_list = 336, /* optional_table_properties_list */ + YYSYMBOL_index_param_list = 337, /* index_param_list */ + YYSYMBOL_index_param = 338, /* index_param */ + YYSYMBOL_index_info = 339 /* index_info */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; @@ -463,7 +464,7 @@ typedef enum yysymbol_kind_t yysymbol_kind_t; #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #endif -#line 467 "parser.cpp" +#line 468 "parser.cpp" #ifdef short # undef short @@ -789,19 +790,19 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 127 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1465 +#define YYLAST 1481 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 222 +#define YYNTOKENS 223 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 117 /* YYNRULES -- Number of rules. */ -#define YYNRULES 534 +#define YYNRULES 535 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 1209 +#define YYNSTATES 1210 /* YYMAXUTOK -- Last valid token kind. */ -#define YYMAXUTOK 460 +#define YYMAXUTOK 461 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM @@ -818,13 +819,13 @@ static const yytype_uint8 yytranslate[] = 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 213, 2, 2, - 216, 217, 211, 209, 220, 210, 218, 212, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 221, 219, - 207, 206, 208, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 214, 2, 2, + 217, 218, 212, 210, 221, 211, 219, 213, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 222, 220, + 208, 207, 209, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 214, 2, 215, 2, 2, 2, 2, 2, 2, + 2, 215, 2, 216, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -861,7 +862,7 @@ static const yytype_uint8 yytranslate[] = 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205 + 205, 206 }; #if SQLDEBUG @@ -894,34 +895,34 @@ static const yytype_int16 yyrline[] = 1821, 1827, 1834, 1837, 1841, 1844, 1849, 1861, 1868, 1882, 1885, 1888, 1891, 1894, 1897, 1900, 1906, 1910, 1914, 1918, 1922, 1929, 1933, 1937, 1941, 1945, 1950, 1954, 1959, 1963, - 1967, 1973, 1979, 1985, 1996, 2007, 2018, 2030, 2042, 2055, - 2069, 2080, 2094, 2110, 2127, 2131, 2135, 2139, 2143, 2147, - 2153, 2157, 2161, 2165, 2171, 2175, 2185, 2189, 2193, 2201, - 2212, 2235, 2241, 2246, 2252, 2258, 2266, 2272, 2278, 2284, - 2290, 2298, 2304, 2310, 2316, 2322, 2330, 2336, 2342, 2351, - 2360, 2368, 2376, 2382, 2388, 2394, 2401, 2414, 2418, 2423, - 2429, 2436, 2444, 2453, 2463, 2473, 2484, 2495, 2507, 2519, - 2529, 2540, 2552, 2565, 2569, 2574, 2579, 2585, 2589, 2593, - 2599, 2603, 2607, 2613, 2619, 2627, 2633, 2637, 2643, 2647, - 2653, 2658, 2663, 2670, 2679, 2689, 2698, 2710, 2726, 2730, - 2735, 2745, 2767, 2773, 2777, 2778, 2779, 2780, 2781, 2783, - 2786, 2792, 2795, 2796, 2797, 2798, 2799, 2800, 2801, 2802, - 2803, 2804, 2808, 2824, 2841, 2859, 2905, 2944, 2987, 3034, - 3058, 3081, 3102, 3123, 3132, 3143, 3154, 3168, 3175, 3185, - 3191, 3203, 3206, 3209, 3212, 3215, 3218, 3222, 3226, 3231, - 3239, 3247, 3256, 3263, 3270, 3277, 3284, 3291, 3299, 3307, - 3315, 3323, 3331, 3339, 3347, 3355, 3363, 3371, 3379, 3387, - 3417, 3425, 3434, 3442, 3451, 3459, 3465, 3472, 3478, 3485, - 3490, 3497, 3504, 3512, 3539, 3545, 3551, 3558, 3566, 3573, - 3580, 3585, 3595, 3600, 3605, 3610, 3615, 3620, 3625, 3630, - 3635, 3640, 3643, 3646, 3650, 3653, 3656, 3659, 3663, 3666, - 3669, 3673, 3677, 3682, 3687, 3690, 3694, 3698, 3705, 3712, - 3716, 3723, 3730, 3734, 3738, 3742, 3745, 3749, 3753, 3758, - 3763, 3767, 3772, 3777, 3783, 3789, 3795, 3801, 3807, 3813, - 3819, 3825, 3831, 3837, 3843, 3854, 3858, 3863, 3894, 3904, - 3909, 3914, 3919, 3925, 3929, 3930, 3932, 3933, 3935, 3936, - 3948, 3956, 3960, 3963, 3967, 3970, 3974, 3978, 3983, 3989, - 3999, 4009, 4017, 4028, 4059 + 1967, 1971, 1977, 1983, 1989, 2000, 2011, 2022, 2034, 2046, + 2059, 2073, 2084, 2098, 2114, 2131, 2135, 2139, 2143, 2147, + 2151, 2157, 2161, 2165, 2169, 2175, 2179, 2189, 2193, 2197, + 2205, 2216, 2239, 2245, 2250, 2256, 2262, 2270, 2276, 2282, + 2288, 2294, 2302, 2308, 2314, 2320, 2326, 2334, 2340, 2346, + 2355, 2364, 2372, 2380, 2386, 2392, 2398, 2405, 2418, 2422, + 2427, 2433, 2440, 2448, 2457, 2467, 2477, 2488, 2499, 2511, + 2523, 2533, 2544, 2556, 2569, 2573, 2578, 2583, 2589, 2593, + 2597, 2603, 2607, 2611, 2617, 2623, 2631, 2637, 2641, 2647, + 2651, 2657, 2662, 2667, 2674, 2683, 2693, 2702, 2714, 2730, + 2734, 2739, 2749, 2771, 2777, 2781, 2782, 2783, 2784, 2785, + 2787, 2790, 2796, 2799, 2800, 2801, 2802, 2803, 2804, 2805, + 2806, 2807, 2808, 2812, 2828, 2845, 2863, 2909, 2948, 2991, + 3038, 3062, 3085, 3106, 3127, 3136, 3147, 3158, 3172, 3179, + 3189, 3195, 3207, 3210, 3213, 3216, 3219, 3222, 3226, 3230, + 3235, 3243, 3251, 3260, 3267, 3274, 3281, 3288, 3295, 3303, + 3311, 3319, 3327, 3335, 3343, 3351, 3359, 3367, 3375, 3383, + 3391, 3421, 3429, 3438, 3446, 3455, 3463, 3469, 3476, 3482, + 3489, 3494, 3501, 3508, 3516, 3543, 3549, 3555, 3562, 3570, + 3577, 3584, 3589, 3599, 3604, 3609, 3614, 3619, 3624, 3629, + 3634, 3639, 3644, 3647, 3650, 3654, 3657, 3660, 3663, 3667, + 3670, 3673, 3677, 3681, 3686, 3691, 3694, 3698, 3702, 3709, + 3716, 3720, 3727, 3734, 3738, 3742, 3746, 3749, 3753, 3757, + 3762, 3767, 3771, 3776, 3781, 3787, 3793, 3799, 3805, 3811, + 3817, 3823, 3829, 3835, 3841, 3847, 3858, 3862, 3867, 3898, + 3908, 3913, 3918, 3923, 3929, 3933, 3934, 3936, 3937, 3939, + 3940, 3952, 3960, 3964, 3967, 3971, 3974, 3978, 3982, 3987, + 3993, 4003, 4013, 4021, 4032, 4063 }; #endif @@ -966,9 +967,9 @@ static const char *const yytname[] = "ROWLIMIT", "ADMIN", "LEADER", "FOLLOWER", "LEARNER", "CONNECT", "STANDALONE", "NODES", "NODE", "REMOVE", "SNAPSHOT", "SNAPSHOTS", "RECOVER", "RESTORE", "PERSISTENCE", "OBJECT", "OBJECTS", "FILES", - "MEMORY", "ALLOCATION", "NUMBER", "'='", "'<'", "'>'", "'+'", "'-'", - "'*'", "'/'", "'%'", "'['", "']'", "'('", "')'", "'.'", "';'", "','", - "':'", "$accept", "input_pattern", "statement_list", "statement", + "MEMORY", "ALLOCATION", "HISTORY", "NUMBER", "'='", "'<'", "'>'", "'+'", + "'-'", "'*'", "'/'", "'%'", "'['", "']'", "'('", "')'", "'.'", "';'", + "','", "':'", "$accept", "input_pattern", "statement_list", "statement", "explainable_statement", "create_statement", "table_element_array", "column_def_array", "table_element", "table_column", "column_type", "column_constraints", "column_constraint", "default_expr", @@ -1014,12 +1015,12 @@ yysymbol_name (yysymbol_kind_t yysymbol) } #endif -#define YYPACT_NINF (-745) +#define YYPACT_NINF (-746) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF (-522) +#define YYTABLE_NINF (-523) #define yytable_value_is_error(Yyn) \ ((Yyn) == YYTABLE_NINF) @@ -1028,127 +1029,127 @@ yysymbol_name (yysymbol_kind_t yysymbol) STATE-NUM. */ static const yytype_int16 yypact[] = { - 881, 71, 0, 92, 52, 20, 52, 212, 835, 754, - 69, 89, 101, 115, 229, 173, 181, 202, 48, 165, - 236, -31, 160, 28, -745, -745, -745, -745, -745, -745, - -745, -745, 347, -745, -745, 246, -745, -745, -745, -745, - -745, -745, -745, 258, 258, 258, 258, -10, 353, 52, - 273, 273, 273, 273, 273, 371, 179, 417, 52, -12, - 403, 446, 450, 293, -745, -745, -745, -745, -745, -745, - -745, 347, -745, -745, -745, -745, -745, 239, 457, 52, - -745, -745, -745, -745, -745, 467, -745, 207, 250, -745, - 474, -745, 311, -745, -745, 483, -745, 491, -745, 427, - -138, 52, 52, 52, 52, -745, -745, -745, -745, -18, - -745, 441, 278, -745, 496, 309, 325, 226, 534, 340, - 535, 358, 477, 366, 372, 357, 363, -745, 70, -745, - 567, -745, -745, 25, 529, -745, 531, 537, 612, 52, - 52, 52, 614, 557, 562, 420, 559, 639, 52, 52, - 52, 646, -745, 650, 656, 595, 658, 658, 552, 40, - 55, 66, -745, 448, -745, 386, -745, -745, 661, -745, - 668, -745, -745, -745, -745, 671, -745, -745, -745, -745, - 334, -745, -745, -745, 52, 456, 202, 658, -745, 679, - -745, 519, -745, 680, -745, -745, 682, -745, -745, 686, - -745, 689, 692, -745, 693, 643, 695, 506, 700, 702, - -745, -745, -745, -745, 25, -745, -745, -745, 552, 653, - 645, 640, 581, -13, -745, 420, -745, 52, 191, 713, - 12, -745, -745, -745, -745, -745, 655, -745, 512, -45, - -745, 552, -745, -745, 644, 657, 507, -745, -745, 729, - 617, 508, 515, 434, 724, 733, 734, 735, -745, -745, - 727, 524, 341, 525, 527, 673, 673, -745, 23, 397, - 122, -745, -1, 828, -745, -745, -745, -745, -745, -745, - -745, -745, -745, -745, -745, -745, -745, 530, -745, -745, - -745, 116, -745, -745, 143, -745, 150, -745, -745, -745, - 157, -745, 184, -745, -745, -745, -745, -745, -745, -745, - -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, - 739, 738, -745, -745, -745, -745, -745, -745, 698, 703, - 670, 677, 246, -745, -745, -745, 745, 49, -745, 753, - -745, -745, 674, 280, -745, 756, -745, -745, 547, 548, - -14, 552, 552, 701, -745, 763, -31, 130, 714, 555, - 769, 770, -745, -745, 188, 563, -745, 52, 552, 656, - -745, 449, 564, 566, 211, -745, -745, -745, -745, -745, - -745, -745, -745, -745, -745, -745, -745, 673, 568, 895, - 705, 552, 552, 134, 388, -745, -745, -745, -745, 729, - -745, 774, 569, 570, 573, 576, 787, 789, 419, 419, - -745, 577, -745, -745, -745, -745, 583, 108, 717, 552, - 799, 552, 552, -44, 587, 15, 673, 673, 673, 673, + 835, 29, 51, 98, 95, 30, 95, 264, 346, 762, + 90, 105, 175, 195, 296, 288, 315, 326, 63, 111, + 374, -41, 365, 152, -746, -746, -746, -746, -746, -746, + -746, -746, 323, -746, -746, 250, -746, -746, -746, -746, + -746, -746, -746, 317, 317, 317, 317, 325, 424, 95, + 342, 342, 342, 342, 342, 469, 215, 462, 95, -5, + 490, 499, 517, 885, -746, -746, -746, -746, -746, -746, + -746, 323, -746, -746, -746, -746, -746, 251, 536, 95, + -746, -746, -746, -746, -746, 13, -746, 268, 309, -746, + 538, -746, 378, -746, -746, 546, -746, 557, -746, 328, + 162, 95, 95, 95, 95, -746, -746, -746, -746, -13, + -746, 509, 356, -746, 584, 415, 447, 258, 534, 453, + 601, 426, 541, 468, 470, 439, 479, -746, 70, -746, + 650, -746, -746, 27, 628, -746, 632, 630, 702, 95, + 95, 95, 703, 651, 652, 498, 642, 714, 95, 95, + 95, 715, -746, 719, 720, 658, 724, 724, 552, 42, + 52, 102, -746, 513, -746, 369, -746, -746, -746, 730, + -746, 732, -746, -746, -746, -746, 733, -746, -746, -746, + -746, 290, -746, -746, -746, 95, 522, 326, 724, -746, + 734, -746, 579, -746, 736, -746, -746, 737, -746, -746, + 739, -746, 743, 745, -746, 746, 694, 747, 560, 754, + 756, -746, -746, -746, -746, 27, -746, -746, -746, 552, + 707, 693, 692, 634, -15, -746, 498, -746, 95, 41, + 767, 147, -746, -746, -746, -746, -746, 709, -746, 565, + -20, -746, 552, -746, -746, 695, 700, 562, -746, -746, + 644, 617, 563, 585, 434, 790, 801, 802, 803, -746, + -746, 805, 595, 381, 597, 598, 673, 673, -746, 22, + 396, 292, -746, -1, 668, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, 604, -746, + -746, -746, -156, -746, -746, 76, -746, 194, -746, -746, + -746, 204, -746, 232, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, 813, 818, -746, -746, -746, -746, -746, -746, 778, + 784, 758, 755, 250, -746, -746, -746, 832, 255, -746, + 833, -746, -746, 761, 308, -746, 837, -746, -746, 622, + 625, -21, 552, 552, 785, -746, 852, -41, 49, 806, + 645, 860, 864, -746, -746, 300, 653, -746, 95, 552, + 720, -746, 379, 655, 656, 211, -746, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, 673, 657, + 827, 791, 552, 552, 169, 256, -746, -746, -746, -746, + 644, -746, 882, 670, 672, 674, 676, 898, 899, 354, + 354, -746, 646, -746, -746, -746, -746, 686, -53, 828, + 552, 903, 552, 552, -24, 690, 5, 673, 673, 673, 673, 673, 673, 673, 673, 673, 673, 673, 673, 673, - 32, -745, 590, -745, 800, -745, 801, -745, 805, -745, - 807, 762, 465, 598, 599, 813, 602, -745, 603, -745, - 815, -745, 259, 818, 654, 659, -745, -745, -745, 552, - 747, 605, -745, 94, 449, 552, -745, -745, 87, 1034, - 706, 613, 194, -745, -745, -745, -31, 829, 707, -745, - -745, -745, 831, 552, 616, -745, 449, -745, 82, 82, - 552, -745, 198, 705, 681, 623, 63, 54, 404, -745, - 552, 552, 767, 552, 846, 33, 552, 632, 286, 633, - -745, -745, 658, -745, -745, -745, 699, 663, 673, 397, - 725, -745, 910, 910, 234, 234, 812, 910, 910, 234, - 234, 419, 419, -745, -745, -745, -745, -745, -745, 641, - -745, 660, -745, -745, -745, 855, 874, -745, 713, 883, - -745, 896, -745, -745, 894, -745, -745, 898, 903, 688, - 24, 820, 552, -745, -745, -745, 449, 915, -745, -745, - -745, -745, -745, -745, -745, -745, -745, -745, -745, 711, - -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, - -745, -745, 712, 716, 718, 719, 722, 723, 279, 730, - 713, 882, 130, 347, 728, 919, -745, 301, 731, 927, - 945, 948, 951, -745, 949, 323, -745, 324, 328, -745, - 741, -745, 1034, 552, -745, 552, -11, 125, 673, -81, - 736, -745, 73, 106, 231, 744, -745, 962, -745, -745, - 891, 397, 910, 755, 330, -745, 673, 965, 968, 924, - 928, 332, 342, -745, 771, 346, -745, 970, -745, -745, - -31, 764, 526, -745, 171, -745, 552, 804, -745, -745, - 979, 575, 978, 1070, 1087, 1104, 1121, 856, 859, -745, - -745, 210, -745, 857, 713, 348, 773, 858, -745, 826, - -745, -745, 552, -745, -745, -745, -745, -745, -745, 82, - -745, -745, -745, 776, 449, 123, -745, 552, 790, 780, - 991, 590, 791, 786, 552, -745, 792, 794, 795, 355, - -745, -745, 895, 1002, 1005, -745, -745, 883, 510, -745, - 896, 447, 29, 24, 956, -745, -745, -745, -745, -745, - -745, 957, -745, 1012, -745, 688, 313, 595, 356, 796, - 797, 806, 808, 809, 810, 811, 823, 824, 939, 832, - 834, 836, 837, 838, 839, 844, 845, 854, 860, 973, - 861, 862, 866, 867, 868, 869, 870, 871, 872, 873, - 982, 875, 876, 878, 880, 889, 890, 892, 893, 921, - 929, 985, 931, 932, 935, 936, 946, 947, 950, 952, - 953, 954, 1001, 963, 964, 967, 969, 980, 981, 984, - 986, 987, 997, 1018, 998, -745, -745, 34, -745, 1014, - 1037, 375, -745, 896, 1045, 1052, 376, -745, -745, -745, - 449, -745, 635, 1003, 1004, 1009, 14, 1010, -745, -745, - -745, 1048, 971, 449, -745, 82, -745, -745, -745, -745, - -745, -745, -745, -745, -745, -745, 1109, -745, 171, 526, - 24, 24, 974, -745, -745, -745, -745, -745, -745, -745, - 1011, 1153, -745, 1215, 1216, 1226, 1227, 1228, 1229, 1230, - 1231, 1232, 1233, 1020, 1235, 1237, 1238, 1239, 1240, 1241, - 1242, 1243, 1244, 1245, 1032, 1247, 1248, 1249, 1250, 1251, - 1252, 1253, 1254, 1255, 1256, 1043, 1258, 1259, 1260, 1261, - 1262, 1263, 1264, 1265, 1266, 1267, 1054, 1269, 1270, 1271, - 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1065, 1280, 1281, - 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1076, 1291, - -745, 1294, 1295, -745, 382, -745, 677, -745, -745, 1296, - 255, 1084, 1298, 1299, -745, 383, 1300, -745, -745, 1246, - 713, 313, 1257, 1268, 1088, 1090, 1092, 1094, 1095, 1096, - 1097, 1098, 1099, 1100, 1312, 1102, 1103, 1106, 1107, 1108, - 1110, 1111, 1112, 1113, 1114, 1315, 1115, 1116, 1117, 1118, - 1119, 1120, 1122, 1123, 1124, 1125, 1320, 1126, 1127, 1128, - 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1332, 1136, 1137, - 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1357, 1147, - 1148, 1149, 1150, 1151, 1152, 1154, 1155, 1156, 1157, 1364, - 1158, -745, -745, -745, -745, 1159, 786, 1211, 1160, 1161, - -745, 408, 552, 392, -745, 552, 552, -745, -745, -745, - -745, -745, -745, -745, -745, -745, -745, -745, 1165, -745, - -745, -745, -745, -745, -745, -745, -745, -745, -745, 1166, - -745, -745, -745, -745, -745, -745, -745, -745, -745, -745, - 1167, -745, -745, -745, -745, -745, -745, -745, -745, -745, - -745, 1168, -745, -745, -745, -745, -745, -745, -745, -745, - -745, -745, 1169, -745, -745, -745, -745, -745, -745, -745, - -745, -745, -745, 1170, -745, 1373, 1171, 1329, 1385, 26, - 1173, 1386, 1387, -745, -745, -745, 449, -745, 688, 449, - -745, -745, -745, -745, -745, -745, 1174, 1234, 1175, 1176, - 786, 677, 1389, 601, 42, 1180, 1349, 1396, 1397, 1185, - -745, 608, 1398, -745, 786, 677, 1187, 1188, 786, 13, - 1400, -745, 1359, 1191, -745, 1405, -745, 1193, 1371, 1372, - -745, -745, -745, 46, 1196, -49, -745, 1198, 1375, 1376, - -745, -745, 1377, 1378, 1301, -745, 1203, -745, 1204, 1205, - 1418, 1420, 677, 1207, 1208, -745, 677, -745, -745 + 673, 33, -746, 696, -746, 906, -746, 911, -746, 912, + -746, 914, 877, 500, 704, 705, 924, 718, -746, 713, + -746, 930, -746, 279, 936, 776, 777, -746, -746, -746, + 552, 867, 725, -746, 99, 379, 552, -746, -746, 89, + 965, 823, 738, 322, -746, -746, -746, -41, 944, 820, + -746, -746, -746, 957, 552, 741, -746, 379, -746, 81, + 81, 552, -746, 341, 791, 808, 749, 108, 85, 304, + -746, 552, 552, 888, 552, 966, 35, 552, 748, 363, + 577, -746, -746, 724, -746, -746, -746, 816, 757, 673, + 396, 841, -746, 836, 836, 170, 170, 798, 836, 836, + 170, 170, 354, 354, -746, -746, -746, -746, -746, -746, + 751, -746, 753, -746, -746, -746, 970, 975, -746, 767, + 979, -746, 980, -746, -746, 978, -746, -746, 986, 987, + 771, 17, 904, 552, -746, -746, -746, 379, 991, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + 779, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, 780, 781, 782, 783, 786, 796, 200, + 797, 767, 969, 49, 323, 799, 998, -746, 376, 807, + 1009, 1010, 1014, 1016, -746, 1017, 391, -746, 406, 410, + -746, 804, -746, 965, 552, -746, 552, -11, 134, 673, + -40, 809, -746, 295, 106, 201, 810, -746, 1021, -746, + -746, 942, 396, 836, 811, 411, -746, 673, 1020, 1022, + 981, 985, 412, 418, -746, 844, 420, -746, 1036, -746, + -746, -41, 851, 431, -746, 205, -746, 552, 874, -746, + -746, 1073, 494, 575, 1001, 1018, 1035, 1052, 949, 953, + -746, -746, 206, -746, 954, 767, 422, 869, 963, -746, + 933, -746, -746, 552, -746, -746, -746, -746, -746, -746, + 81, -746, -746, -746, 883, 379, 94, -746, 552, 253, + 889, 1099, 696, 890, 893, 552, -746, 897, 901, 902, + 429, -746, -746, 827, 1113, 1115, -746, -746, 979, 521, + -746, 980, 475, 1, 17, 1074, -746, -746, -746, -746, + -746, -746, 1075, -746, 1132, -746, 771, 293, 658, 440, + 915, 916, 917, 927, 928, 931, 932, 934, 939, 1061, + 940, 941, 943, 945, 946, 947, 948, 950, 951, 955, + 1070, 956, 958, 959, 960, 961, 962, 964, 967, 968, + 971, 1072, 972, 973, 974, 976, 977, 982, 983, 984, + 988, 989, 1077, 990, 992, 993, 994, 995, 996, 997, + 999, 1000, 1002, 1081, 1003, 1004, 1005, 1006, 1007, 1008, + 1011, 1012, 1013, 1015, 1082, 1019, -746, -746, 38, -746, + 1044, 1050, 441, -746, 980, 1182, 1184, 454, -746, -746, + -746, 379, -746, 590, 1023, 1024, 1025, 26, 1026, -746, + -746, -746, 1124, 1030, 379, -746, 81, -746, -746, -746, + -746, -746, -746, -746, -746, -746, -746, 1185, -746, 205, + 431, 17, 17, 1032, -746, -746, -746, -746, -746, -746, + -746, 1029, 1144, -746, 1193, 1194, 1195, 1196, 1200, 1201, + 1202, 1206, 1213, 1216, 1031, 1224, 1225, 1229, 1231, 1232, + 1233, 1235, 1236, 1237, 1245, 1033, 1247, 1249, 1250, 1251, + 1252, 1253, 1254, 1255, 1256, 1257, 1043, 1259, 1260, 1261, + 1262, 1263, 1264, 1265, 1266, 1267, 1268, 1054, 1270, 1271, + 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1065, 1281, + 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1076, + 1292, -746, 1295, 1296, -746, 465, -746, 755, -746, -746, + 1297, 203, 1084, 1299, 1300, -746, 474, 1301, -746, -746, + 1243, 767, 293, 1258, 1269, 1088, 1090, 1091, 1092, 1094, + 1095, 1096, 1097, 1098, 1100, 1311, 1101, 1102, 1103, 1104, + 1106, 1107, 1108, 1109, 1110, 1111, 1324, 1114, 1116, 1117, + 1118, 1119, 1120, 1121, 1122, 1123, 1125, 1325, 1126, 1127, + 1128, 1129, 1130, 1131, 1133, 1134, 1135, 1136, 1327, 1137, + 1138, 1139, 1140, 1141, 1142, 1143, 1145, 1146, 1147, 1336, + 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, + 1344, 1158, -746, -746, -746, -746, 1159, 893, 1197, 1160, + 1161, -746, 403, 552, 480, -746, 552, 552, -746, -746, + -746, -746, -746, -746, -746, -746, -746, -746, -746, 1165, + -746, -746, -746, -746, -746, -746, -746, -746, -746, -746, + 1166, -746, -746, -746, -746, -746, -746, -746, -746, -746, + -746, 1167, -746, -746, -746, -746, -746, -746, -746, -746, + -746, -746, 1168, -746, -746, -746, -746, -746, -746, -746, + -746, -746, -746, 1169, -746, -746, -746, -746, -746, -746, + -746, -746, -746, -746, 1170, -746, 1373, 1171, 1329, 1375, + 44, 1172, 1385, 1386, -746, -746, -746, 379, -746, 771, + 379, -746, -746, -746, -746, -746, -746, 1173, 1228, 1178, + 1175, 893, 755, 1391, 558, 60, 1180, 1350, 1396, 1397, + 1186, -746, 609, 1399, -746, 893, 755, 1189, 1190, 893, + -37, 1401, -746, 1354, 1191, -746, 1406, -746, 1198, 1363, + 1371, -746, -746, -746, 57, 1199, -74, -746, 1203, 1372, + 1374, -746, -746, 1378, 1379, 1410, -746, 1204, -746, 1205, + 1207, 1412, 1420, 755, 1208, 1209, -746, 755, -746, -746 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1158,159 +1159,159 @@ static const yytype_int16 yydefact[] = { 233, 0, 0, 0, 0, 0, 0, 0, 233, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 233, 0, 519, 3, 5, 10, 12, 13, 11, + 0, 233, 0, 520, 3, 5, 10, 12, 13, 11, 6, 7, 9, 176, 175, 0, 8, 14, 15, 16, - 17, 18, 19, 517, 517, 517, 517, 517, 0, 0, - 515, 515, 515, 515, 515, 0, 226, 0, 0, 0, + 17, 18, 19, 518, 518, 518, 518, 518, 0, 0, + 516, 516, 516, 516, 516, 0, 226, 0, 0, 0, 0, 0, 0, 233, 162, 20, 25, 27, 26, 21, 22, 24, 23, 28, 29, 30, 31, 0, 0, 0, 247, 248, 246, 252, 256, 0, 253, 0, 0, 249, - 0, 251, 0, 274, 276, 0, 254, 0, 284, 0, - 280, 0, 0, 0, 0, 286, 287, 288, 291, 226, - 289, 0, 232, 234, 0, 0, 0, 0, 0, 0, + 0, 251, 0, 275, 277, 0, 254, 0, 285, 0, + 281, 0, 0, 0, 0, 287, 288, 289, 292, 226, + 290, 0, 232, 234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 233, 2, 216, 218, 219, 0, 199, 181, 187, 0, 0, 0, 0, 0, 0, 0, 0, 160, 0, 0, 0, 0, - 0, 0, 313, 0, 0, 211, 0, 0, 0, 0, - 0, 0, 161, 0, 262, 263, 257, 258, 0, 259, - 0, 250, 275, 255, 285, 0, 278, 277, 281, 282, - 0, 316, 308, 309, 0, 0, 0, 0, 340, 0, - 350, 0, 351, 0, 337, 338, 0, 333, 317, 0, - 346, 348, 0, 341, 0, 0, 0, 0, 0, 0, - 180, 179, 4, 217, 0, 177, 178, 198, 0, 0, - 195, 0, 33, 0, 34, 160, 520, 0, 0, 0, - 233, 514, 167, 169, 168, 170, 0, 227, 0, 211, - 164, 0, 156, 513, 0, 0, 448, 452, 455, 456, - 0, 0, 0, 0, 0, 0, 0, 0, 453, 454, - 0, 0, 0, 0, 0, 0, 0, 450, 0, 233, - 0, 358, 363, 364, 378, 376, 379, 377, 380, 381, - 373, 368, 367, 366, 374, 375, 365, 372, 371, 463, - 465, 0, 466, 474, 0, 475, 0, 467, 464, 485, - 0, 486, 0, 462, 295, 297, 296, 293, 294, 300, - 302, 301, 298, 299, 305, 307, 306, 303, 304, 283, - 0, 0, 265, 264, 270, 260, 261, 279, 0, 0, - 0, 523, 0, 235, 292, 343, 0, 334, 339, 318, - 347, 342, 0, 0, 349, 0, 314, 315, 0, 0, - 203, 0, 0, 197, 516, 0, 233, 0, 0, 0, - 0, 0, 312, 154, 0, 0, 158, 0, 0, 0, - 163, 210, 0, 0, 0, 494, 493, 496, 495, 498, - 497, 500, 499, 502, 501, 504, 503, 0, 0, 414, - 233, 0, 0, 0, 0, 457, 458, 459, 460, 0, - 461, 0, 0, 0, 0, 0, 0, 0, 416, 415, - 491, 488, 482, 472, 477, 480, 0, 0, 0, 0, + 0, 0, 314, 0, 0, 211, 0, 0, 0, 0, + 0, 0, 161, 0, 263, 264, 257, 258, 259, 0, + 260, 0, 250, 276, 255, 286, 0, 279, 278, 282, + 283, 0, 317, 309, 310, 0, 0, 0, 0, 341, + 0, 351, 0, 352, 0, 338, 339, 0, 334, 318, + 0, 347, 349, 0, 342, 0, 0, 0, 0, 0, + 0, 180, 179, 4, 217, 0, 177, 178, 198, 0, + 0, 195, 0, 33, 0, 34, 160, 521, 0, 0, + 0, 233, 515, 167, 169, 168, 170, 0, 227, 0, + 211, 164, 0, 156, 514, 0, 0, 449, 453, 456, + 457, 0, 0, 0, 0, 0, 0, 0, 0, 454, + 455, 0, 0, 0, 0, 0, 0, 0, 451, 0, + 233, 0, 359, 364, 365, 379, 377, 380, 378, 381, + 382, 374, 369, 368, 367, 375, 376, 366, 373, 372, + 464, 466, 0, 467, 475, 0, 476, 0, 468, 465, + 486, 0, 487, 0, 463, 296, 298, 297, 294, 295, + 301, 303, 302, 299, 300, 306, 308, 307, 304, 305, + 284, 0, 0, 266, 265, 271, 261, 262, 280, 0, + 0, 0, 524, 0, 235, 293, 344, 0, 335, 340, + 319, 348, 343, 0, 0, 350, 0, 315, 316, 0, + 0, 203, 0, 0, 197, 517, 0, 233, 0, 0, + 0, 0, 0, 313, 154, 0, 0, 158, 0, 0, + 0, 163, 210, 0, 0, 0, 495, 494, 497, 496, + 499, 498, 501, 500, 503, 502, 505, 504, 0, 0, + 415, 233, 0, 0, 0, 0, 458, 459, 460, 461, + 0, 462, 0, 0, 0, 0, 0, 0, 0, 417, + 416, 492, 489, 483, 473, 478, 481, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 471, 0, 476, 0, 479, 0, 487, 0, 490, - 0, 271, 266, 0, 0, 0, 0, 290, 0, 352, - 0, 335, 0, 0, 0, 0, 345, 184, 183, 0, - 205, 186, 188, 193, 194, 0, 182, 32, 36, 0, - 0, 0, 0, 42, 46, 47, 233, 0, 40, 311, - 310, 159, 0, 0, 157, 171, 166, 165, 0, 0, - 0, 409, 0, 233, 0, 0, 0, 0, 0, 439, - 0, 0, 0, 0, 0, 0, 0, 209, 0, 0, - 370, 369, 0, 359, 362, 432, 433, 0, 0, 233, - 0, 413, 423, 424, 427, 428, 0, 430, 422, 425, - 426, 418, 417, 419, 420, 421, 449, 451, 473, 0, - 478, 0, 481, 489, 492, 0, 0, 267, 0, 0, - 355, 0, 236, 336, 0, 319, 344, 0, 0, 202, - 0, 201, 0, 191, 192, 190, 196, 0, 52, 55, - 56, 53, 54, 57, 58, 74, 59, 61, 60, 77, - 64, 65, 66, 62, 63, 67, 68, 69, 70, 71, - 72, 73, 0, 0, 0, 0, 0, 0, 523, 0, - 0, 525, 0, 39, 0, 0, 155, 0, 0, 0, - 0, 0, 0, 509, 0, 0, 505, 0, 0, 410, - 0, 444, 0, 0, 437, 0, 0, 0, 0, 0, - 0, 448, 0, 0, 0, 0, 399, 0, 484, 483, - 0, 233, 431, 0, 0, 412, 0, 0, 0, 272, - 268, 0, 0, 44, 528, 0, 526, 320, 353, 354, - 233, 204, 220, 222, 231, 223, 0, 207, 189, 38, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 147, - 148, 151, 144, 151, 0, 0, 0, 35, 43, 534, - 41, 360, 0, 511, 510, 508, 507, 512, 174, 0, - 172, 411, 445, 0, 441, 0, 440, 0, 0, 0, - 0, 0, 0, 209, 0, 397, 0, 0, 0, 0, - 446, 435, 434, 0, 0, 357, 356, 0, 0, 522, - 0, 0, 0, 0, 0, 240, 241, 242, 243, 239, - 244, 0, 229, 0, 224, 200, 0, 211, 0, 0, + 0, 0, 472, 0, 477, 0, 480, 0, 488, 0, + 491, 0, 272, 267, 0, 0, 0, 0, 291, 0, + 353, 0, 336, 0, 0, 0, 0, 346, 184, 183, + 0, 205, 186, 188, 193, 194, 0, 182, 32, 36, + 0, 0, 0, 0, 42, 46, 47, 233, 0, 40, + 312, 311, 159, 0, 0, 157, 171, 166, 165, 0, + 0, 0, 410, 0, 233, 0, 0, 0, 0, 0, + 440, 0, 0, 0, 0, 0, 0, 0, 209, 0, + 0, 371, 370, 0, 360, 363, 433, 434, 0, 0, + 233, 0, 414, 424, 425, 428, 429, 0, 431, 423, + 426, 427, 419, 418, 420, 421, 422, 450, 452, 474, + 0, 479, 0, 482, 490, 493, 0, 0, 268, 0, + 0, 356, 0, 236, 337, 0, 320, 345, 0, 0, + 202, 0, 201, 0, 191, 192, 190, 196, 0, 52, + 55, 56, 53, 54, 57, 58, 74, 59, 61, 60, + 77, 64, 65, 66, 62, 63, 67, 68, 69, 70, + 71, 72, 73, 0, 0, 0, 0, 0, 0, 524, + 0, 0, 526, 0, 39, 0, 0, 155, 0, 0, + 0, 0, 0, 0, 510, 0, 0, 506, 0, 0, + 411, 0, 445, 0, 0, 438, 0, 0, 0, 0, + 0, 0, 449, 0, 0, 0, 0, 400, 0, 485, + 484, 0, 233, 432, 0, 0, 413, 0, 0, 0, + 273, 269, 0, 0, 44, 529, 0, 527, 321, 354, + 355, 233, 204, 220, 222, 231, 223, 0, 207, 189, + 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 147, 148, 151, 144, 151, 0, 0, 0, 35, 43, + 535, 41, 361, 0, 512, 511, 509, 508, 513, 174, + 0, 172, 412, 446, 0, 442, 0, 441, 0, 0, + 0, 0, 0, 0, 209, 0, 398, 0, 0, 0, + 0, 447, 436, 435, 0, 0, 358, 357, 0, 0, + 523, 0, 0, 0, 0, 0, 240, 241, 242, 243, + 239, 244, 0, 229, 0, 224, 200, 0, 211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 149, 146, 0, 145, 49, - 48, 0, 153, 0, 0, 0, 0, 506, 443, 438, - 442, 429, 0, 0, 209, 0, 0, 0, 468, 470, - 469, 0, 0, 208, 400, 0, 447, 436, 273, 269, - 45, 529, 530, 532, 531, 527, 0, 321, 231, 221, - 0, 0, 228, 403, 401, 404, 402, 405, 406, 407, - 206, 215, 76, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 149, 146, 0, 145, + 49, 48, 0, 153, 0, 0, 0, 0, 507, 444, + 439, 443, 430, 0, 0, 209, 0, 0, 0, 469, + 471, 470, 0, 0, 208, 401, 0, 448, 437, 274, + 270, 45, 530, 531, 533, 532, 528, 0, 322, 231, + 221, 0, 0, 228, 404, 402, 405, 403, 406, 407, + 408, 206, 215, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 150, 0, 0, 152, 0, 37, 523, 361, 488, 0, - 0, 0, 0, 0, 398, 0, 322, 225, 237, 0, - 0, 0, 0, 213, 0, 0, 0, 0, 0, 0, + 0, 150, 0, 0, 152, 0, 37, 524, 362, 489, + 0, 0, 0, 0, 0, 399, 0, 323, 225, 237, + 0, 0, 0, 0, 213, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 51, 50, 524, 533, 0, 209, 393, 0, 209, - 173, 0, 0, 0, 408, 0, 0, 185, 75, 81, - 82, 79, 80, 83, 84, 85, 86, 87, 0, 78, - 125, 126, 123, 124, 127, 128, 129, 130, 131, 0, - 122, 92, 93, 90, 91, 94, 95, 96, 97, 98, - 0, 89, 103, 104, 101, 102, 105, 106, 107, 108, - 109, 0, 100, 136, 137, 134, 135, 138, 139, 140, - 141, 142, 0, 133, 114, 115, 112, 113, 116, 117, - 118, 119, 120, 0, 111, 0, 0, 0, 0, 0, - 0, 0, 0, 324, 323, 329, 238, 230, 214, 212, - 88, 132, 99, 110, 143, 121, 209, 394, 0, 0, - 209, 523, 330, 325, 0, 0, 0, 0, 0, 0, - 392, 0, 0, 326, 209, 523, 0, 0, 209, 523, - 0, 331, 327, 0, 388, 0, 395, 0, 0, 0, - 391, 332, 328, 523, 0, 382, 390, 0, 0, 0, - 387, 396, 0, 0, 0, 386, 0, 384, 0, 0, - 0, 0, 523, 0, 0, 389, 523, 383, 385 + 0, 0, 51, 50, 525, 534, 0, 209, 394, 0, + 209, 173, 0, 0, 0, 409, 0, 0, 185, 75, + 81, 82, 79, 80, 83, 84, 85, 86, 87, 0, + 78, 125, 126, 123, 124, 127, 128, 129, 130, 131, + 0, 122, 92, 93, 90, 91, 94, 95, 96, 97, + 98, 0, 89, 103, 104, 101, 102, 105, 106, 107, + 108, 109, 0, 100, 136, 137, 134, 135, 138, 139, + 140, 141, 142, 0, 133, 114, 115, 112, 113, 116, + 117, 118, 119, 120, 0, 111, 0, 0, 0, 0, + 0, 0, 0, 0, 325, 324, 330, 238, 230, 214, + 212, 88, 132, 99, 110, 143, 121, 209, 395, 0, + 0, 209, 524, 331, 326, 0, 0, 0, 0, 0, + 0, 393, 0, 0, 327, 209, 524, 0, 0, 209, + 524, 0, 332, 328, 0, 389, 0, 396, 0, 0, + 0, 392, 333, 329, 524, 0, 383, 391, 0, 0, + 0, 388, 397, 0, 0, 0, 387, 0, 385, 0, + 0, 0, 0, 524, 0, 0, 390, 524, 384, 386 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -745, -745, -745, 1302, 1363, 245, -745, -745, 816, -536, - 802, -745, 740, 742, -745, -551, 247, 249, 1202, -745, - 257, -745, 1060, 265, 287, -7, 1411, -17, 1101, 1222, - -80, -745, -745, 865, -745, -745, -745, -745, -745, -745, - -745, -745, -714, -234, -745, -745, -745, -745, 696, -213, - 18, 572, -745, -745, 1279, -745, -745, 290, 291, 319, - 321, 329, -745, -745, -218, -745, 1019, -239, -240, -744, - -743, -741, -740, -739, -738, 470, -745, -745, -745, -745, - -745, -745, 1049, -745, -745, 930, 619, -262, -745, -745, - -745, 721, -745, -745, -745, -745, 726, 1000, 1006, -255, - -745, -745, -745, -745, 1189, -491, 746, -146, 473, 484, - -745, -745, -605, -745, 618, 710, -745 + -746, -746, -746, 1302, 1361, 88, -746, -746, 815, -527, + 800, -746, 740, 735, -746, -552, 196, 218, 1210, -746, + 235, -746, 1064, 240, 257, -7, 1414, -18, 1105, 1222, + -44, -746, -746, 858, -746, -746, -746, -746, -746, -746, + -746, -746, -715, -235, -746, -746, -746, -746, 697, -187, + 18, 570, -746, -746, 1280, -746, -746, 275, 278, 291, + 298, 301, -746, -746, -219, -746, 1027, -240, -241, -745, + -744, -742, -741, -740, -739, 471, -746, -746, -746, -746, + -746, -746, 1046, -746, -746, 926, 616, -263, -746, -746, + -746, 722, -746, -746, -746, -746, 723, 1028, 1034, -413, + -746, -746, -746, -746, 1187, -489, 742, -149, 497, 528, + -746, -746, -605, -746, 615, 710, -746 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - 0, 22, 23, 24, 64, 25, 482, 662, 483, 484, - 608, 691, 692, 829, 485, 364, 26, 27, 230, 28, - 29, 239, 240, 30, 31, 32, 33, 34, 135, 215, - 136, 220, 471, 472, 575, 353, 476, 218, 677, 470, - 571, 757, 645, 242, 1057, 973, 133, 671, 672, 673, - 674, 754, 35, 112, 113, 675, 751, 36, 37, 38, - 39, 40, 41, 42, 270, 494, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 879, 880, 280, 281, 282, - 283, 284, 394, 285, 286, 287, 288, 289, 847, 290, - 291, 292, 293, 294, 295, 296, 297, 414, 415, 298, - 299, 300, 301, 302, 303, 625, 626, 244, 147, 138, - 129, 143, 457, 697, 665, 666, 488 + 0, 22, 23, 24, 64, 25, 483, 663, 484, 485, + 609, 692, 693, 830, 486, 365, 26, 27, 231, 28, + 29, 240, 241, 30, 31, 32, 33, 34, 135, 216, + 136, 221, 472, 473, 576, 354, 477, 219, 678, 471, + 572, 758, 646, 243, 1058, 974, 133, 672, 673, 674, + 675, 755, 35, 112, 113, 676, 752, 36, 37, 38, + 39, 40, 41, 42, 271, 495, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 880, 881, 281, 282, 283, + 284, 285, 395, 286, 287, 288, 289, 290, 848, 291, + 292, 293, 294, 295, 296, 297, 298, 415, 416, 299, + 300, 301, 302, 303, 304, 626, 627, 245, 147, 138, + 129, 143, 458, 698, 666, 667, 489 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1318,304 +1319,308 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 350, 71, 371, 693, 126, 370, 413, 661, 627, 852, - 389, 245, 873, 874, 393, 875, 876, 877, 878, 410, - 411, 241, 57, 663, 59, 408, 409, 56, 410, 411, - 417, 527, 1150, 134, 110, 546, 641, 49, 247, 248, - 249, 334, 356, 304, 184, 305, 306, 17, 1164, 130, - 365, 131, -521, 216, 420, 56, 71, 132, 309, 695, - 310, 311, 137, 178, 156, 157, 179, 145, 469, 314, - -518, 315, 316, 716, 421, 422, 155, 1, 1192, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 530, 460, - 17, 456, 724, 11, 12, 13, 58, 165, 461, 14, - 15, 16, 307, 101, 43, 44, 45, 130, 724, 131, - 46, 47, 473, 474, 528, 132, 1193, 312, 632, 180, - 181, 182, 183, 102, 456, 50, 51, 52, 317, 496, - 961, 53, 54, 479, 349, 103, 254, 255, 256, 719, - 1178, 633, 257, 831, 421, 422, 531, 389, 17, 104, - 619, 620, 506, 507, 421, 422, 502, 223, 224, 225, - 127, 621, 622, 623, 573, 574, 233, 234, 235, 258, - 259, 260, 115, 1188, 752, 369, 108, 116, 1179, 117, - 548, 118, 525, 526, 109, 21, 532, 533, 534, 535, - 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, - 153, 860, 331, 357, 158, 111, 419, 839, 308, 421, - 422, 1189, 717, 366, 246, 247, 248, 249, 421, 422, - 114, 577, 392, 313, 360, 361, 753, 873, 874, 412, - 875, 876, 877, 878, 318, 723, 576, 268, 412, 18, - 670, 214, 362, 547, 267, 359, 868, 128, 268, 421, - 422, 569, 416, 65, 134, 66, 19, 67, 480, 1046, - 481, 421, 422, 421, 422, 68, 48, 624, 20, 123, - 124, 636, 637, 69, 639, 617, 500, 643, 421, 422, - 421, 422, 628, 687, 250, 251, 21, 55, 652, 421, - 422, 440, 564, 721, 252, 70, 253, 724, 72, 73, - 1, 565, 2, 3, 4, 5, 6, 7, 65, 9, - 66, 654, 67, 254, 255, 256, 11, 12, 13, 257, - 68, 724, 14, 15, 16, 521, 722, 74, 69, 75, - 137, 441, 1126, 473, 119, 1130, 442, 76, 688, 418, - 689, 690, 419, 827, 328, 146, 258, 259, 260, 478, - 70, 1044, 687, 72, 73, 120, 144, 456, 443, 121, - 329, 330, 122, 444, 965, 445, 425, 130, 261, 131, - 446, 17, 447, 505, 152, 132, 650, 448, 60, 61, - 167, 168, 74, 62, 75, 495, -522, -522, 105, 106, - 107, 262, 76, 263, 714, 264, 715, 153, 718, 449, - 246, 247, 248, 249, 450, 491, 159, 688, 492, 689, - 690, 611, 190, 191, 612, 629, 732, 192, 419, 1053, - 265, 266, 267, 169, 170, 268, 320, 269, 501, 321, - 322, 154, 1155, 729, 323, 324, 1159, 246, 247, 248, - 249, -522, -522, 435, 436, 437, 438, 439, 1131, 160, - 1173, 1132, 1133, 161, 1177, 163, 1134, 1135, 755, 845, - 164, 402, 18, 403, 843, 404, 405, 850, 464, 465, - 250, 251, 509, 166, 510, 17, 511, 171, 840, 613, - 252, 866, 253, 867, 836, 853, 630, 172, 634, 173, - 635, 20, 511, 262, 174, 263, 185, 264, 186, 254, - 255, 256, 187, 646, 188, 257, 647, 250, 251, 21, - 556, 557, 653, 861, 862, 863, 864, 252, 701, 253, - 189, 419, 392, 881, 148, 149, 150, 151, 139, 140, - 141, 142, 258, 259, 260, 204, 254, 255, 256, 205, - 708, 710, 257, 709, 709, 711, 1160, 731, 419, 735, - 419, 206, 492, 207, 261, 246, 247, 248, 249, 736, - 1174, 208, 737, 739, 1180, 832, 740, 209, 492, 258, - 259, 260, 857, 882, 210, 419, 883, 262, 1190, 263, - 211, 264, 744, -245, 745, 746, 747, 748, 213, 749, - 750, 261, 953, 957, 217, 492, 419, 1205, 219, 1043, - 1050, 1208, 740, 709, 421, 422, 265, 266, 267, 1137, - 221, 268, 492, 269, 262, 222, 263, 226, 264, 227, - 246, 247, 248, 249, 228, 250, 251, 175, 176, 177, - 437, 438, 439, 231, 728, 252, 229, 253, 648, 649, - 410, 958, 232, 265, 266, 267, 1162, 1163, 268, 236, - 269, 1170, 1171, 237, 254, 255, 256, 968, 969, 238, - 257, 241, 243, 742, 325, 319, 759, 760, 761, 762, - 763, 326, 332, 764, 765, 327, 246, 247, 248, 249, - 766, 767, 768, 335, 336, 338, 337, 258, 259, 260, - 387, 388, 339, 340, 193, 341, 769, 342, 343, 344, - 252, 345, 253, 346, 194, 347, 351, 195, 196, 261, - 197, 198, 199, 352, 354, 355, 363, 367, 368, 254, - 255, 256, 372, 374, 390, 257, 200, 201, 395, 202, - 203, 391, 262, 399, 263, 373, 264, 396, 397, 398, - 401, 406, 451, 407, 452, 453, 387, 455, 440, 459, - 454, 463, 258, 259, 260, 456, 252, 77, 253, 462, - 466, 265, 266, 267, 467, 468, 268, 477, 269, 486, - 475, 487, 489, 490, 261, 254, 255, 256, 512, 493, - 498, 257, 499, 17, 503, 513, 514, 78, 79, 515, - 80, 517, 516, 518, 522, 81, 82, 262, 519, 263, - 520, 264, 524, 529, 268, 555, 549, 551, 258, 259, - 260, 553, 554, 1136, 558, 559, 560, 1139, 561, 567, - 562, 563, 566, 570, 568, 572, 265, 266, 267, 610, - 261, 268, 614, 269, 616, 609, 618, 1138, 63, 528, - 631, 615, 1, 638, 2, 3, 4, 5, 6, 7, - 640, 9, 644, 262, 421, 263, 655, 264, 11, 12, - 13, 659, 657, 504, 14, 15, 16, 375, 376, 377, - 378, 379, 380, 381, 382, 383, 384, 385, 386, 651, - 660, 658, 265, 266, 267, 504, 479, 268, 1, 269, - 2, 3, 4, 5, 6, 7, 8, 9, 10, 664, - 667, 423, 668, 424, 11, 12, 13, 669, 419, 676, - 14, 15, 16, 17, 696, 83, 84, 85, 86, 679, - 87, 88, 425, 700, 89, 90, 91, 680, 681, 92, - 93, 94, 682, 703, 683, 684, 95, 96, 685, 686, - 426, 427, 428, 429, 425, 699, 694, 702, 431, 97, - 98, 704, 705, 99, 706, 707, 720, 100, 712, 17, - 425, 725, 426, 427, 428, 429, 726, 656, 504, 727, - 431, 649, 730, 648, 733, 734, 741, 738, 426, 427, - 428, 429, 430, 756, 743, 758, 431, 825, 826, 833, - 827, 835, 834, 838, 842, 844, 432, 433, 434, 435, - 436, 437, 438, 439, 18, 846, 851, 841, 858, 854, - 855, 859, 856, 870, 871, 872, 884, 885, 432, 433, - 434, 435, 436, 437, 438, 439, 886, 425, 887, 888, - 889, 890, 893, 20, 432, 433, 434, 435, 436, 437, - 438, 439, 425, 891, 892, 426, 427, 428, 429, 955, - 18, 21, 894, 431, 895, 956, 896, 897, 898, 899, - -522, -522, 428, 429, 900, 901, 904, 19, -522, 770, - 771, 772, 773, 774, 902, 915, 775, 776, 926, 20, - 903, 905, 906, 777, 778, 779, 907, 908, 909, 910, - 911, 912, 913, 914, 937, 916, 917, 21, 918, 780, - 919, 432, 433, 434, 435, 436, 437, 438, 439, 920, - 921, 948, 922, 923, 724, 966, -522, 433, 434, 435, - 436, 437, 438, 439, 578, 579, 580, 581, 582, 583, + 351, 71, 372, 126, 694, 371, 414, 662, 246, 853, + 390, 628, 874, 875, 394, 876, 877, 878, 879, 166, + 56, 130, 57, 131, 59, 409, 410, 411, 412, 132, + 418, 411, 412, 664, 110, 134, 547, 17, 642, 335, + 357, 457, 248, 249, 250, 305, 242, 306, 307, 185, + 1151, 528, 480, 1193, 421, 310, 71, 311, 312, 696, + 442, 470, 43, 44, 45, 443, 1165, 145, 46, 47, + -519, 156, 157, 717, 361, 362, 155, 1, 531, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 49, 217, + 1179, 1194, 363, 11, 12, 13, 65, 165, 56, 14, + 15, 16, 422, 423, 308, 315, 58, 316, 317, 130, + 725, 131, 474, 475, 313, 422, 423, 132, 115, 181, + 182, 183, 184, 116, 101, 117, 725, 118, 1180, 497, + 962, 50, 51, 52, 529, 457, 532, 53, 54, 102, + 255, 256, 257, 832, 422, 423, 258, 390, 17, 620, + 621, 65, 507, 508, 422, 423, 503, 224, 225, 226, + 622, 623, 624, 633, 318, 522, 234, 235, 236, 574, + 575, 350, 634, 259, 260, 261, 21, 481, 840, 482, + 549, 720, 526, 527, 1189, 366, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, + 420, 370, 358, 332, 66, 724, 153, 1047, 753, 103, + 309, 861, 158, 367, 247, 248, 249, 250, 167, 869, + 314, 718, 1190, 578, 48, 17, 67, 874, 875, 104, + 876, 877, 878, 879, 671, 114, 577, 269, 413, 18, + 422, 423, 413, 68, 215, 548, 360, 268, 69, 422, + 423, 570, 417, 269, 422, 423, 19, 393, 134, 66, + 754, 422, 423, 422, 423, 70, 625, 725, 20, 725, + 319, 637, 638, 688, 640, 618, 501, 644, 457, 688, + 119, 67, 629, 72, 251, 252, 73, 21, 653, 422, + 423, 108, 444, 55, 253, 461, 254, 445, 68, 74, + 329, 120, 426, 69, 462, 121, 75, 844, 122, 76, + 851, 655, 565, 255, 256, 257, 330, 331, 109, 258, + 70, 566, -523, -523, 422, 423, 505, 723, 689, 111, + 690, 691, 1127, 474, 689, 1131, 690, 691, 72, 828, + 510, 73, 511, 130, 512, 131, 259, 260, 261, 63, + 479, 132, 1045, 1, 74, 2, 3, 4, 5, 6, + 7, 75, 9, 179, 76, 127, 180, 966, 262, 11, + 12, 13, 128, 506, 651, 14, 15, 16, -523, -523, + 436, 437, 438, 439, 440, 426, 496, -522, 635, 137, + 636, 263, 512, 264, 715, 265, 716, 137, 719, 247, + 248, 249, 250, 427, 428, 429, 430, 123, 124, 321, + 446, 432, 322, 323, 146, 447, 733, 324, 325, 1054, + 448, 266, 267, 268, 17, 449, 269, 144, 270, 502, + 60, 61, 1156, 730, 153, 62, 1160, 247, 248, 249, + 250, 168, 169, 1132, 191, 192, 1133, 1134, 450, 193, + 1174, 1135, 1136, 451, 1178, 105, 106, 107, 756, 846, + 433, 434, 435, 436, 437, 438, 439, 440, 163, 251, + 252, 842, 152, 263, 17, 264, 154, 265, 841, 253, + 614, 254, 170, 171, 837, 854, 631, 745, -245, 746, + 747, 748, 749, 159, 750, 751, 465, 466, 255, 256, + 257, 403, 160, 404, 258, 405, 406, 251, 252, 867, + 419, 868, 654, 420, 441, 18, 722, 253, 492, 254, + 161, 493, 393, 882, 862, 863, 864, 865, 176, 177, + 178, 259, 260, 261, 422, 423, 255, 256, 257, 164, + 612, 172, 258, 613, 20, 557, 558, 1161, 148, 149, + 150, 151, 174, 262, 173, 247, 248, 249, 250, 630, + 175, 1175, 420, 21, 186, 1181, 438, 439, 440, 259, + 260, 261, 139, 140, 141, 142, 263, 187, 264, 1191, + 265, 647, 649, 650, 648, 760, 761, 762, 763, 764, + 188, 262, 765, 766, 702, 411, 959, 420, 1206, 767, + 768, 769, 1209, 1163, 1164, 206, 266, 267, 268, 709, + 189, 269, 710, 270, 263, 770, 264, 208, 265, 207, + 247, 248, 249, 250, 711, 251, 252, 710, 712, 732, + 736, 420, 420, 493, 729, 253, 737, 254, 740, 738, + 833, 741, 190, 493, 266, 267, 268, 858, 205, 269, + 420, 270, 1171, 1172, 255, 256, 257, 211, 883, 954, + 258, 884, 493, 209, 743, 210, 771, 772, 773, 774, + 775, 214, 958, 776, 777, 420, 247, 248, 249, 250, + 778, 779, 780, 1044, 969, 970, 741, 259, 260, 261, + 388, 389, 1051, 218, 194, 710, 781, 212, 1138, 220, + 253, 493, 254, 222, 195, 223, 227, 196, 197, 262, + 198, 199, 200, 228, 229, 230, 232, 233, 237, 255, + 256, 257, 238, 239, 242, 258, 201, 202, 244, 203, + 204, 320, 263, 326, 264, 327, 265, 328, 336, 333, + 339, 424, 338, 425, 337, 340, 388, 341, 342, 344, + 343, 345, 259, 260, 261, 346, 253, 347, 254, 348, + 352, 353, 266, 267, 268, 77, 355, 269, 356, 270, + 364, 368, 369, 373, 262, 255, 256, 257, 374, 375, + 391, 258, 376, 377, 378, 379, 380, 381, 382, 383, + 384, 385, 386, 387, 396, 78, 79, 263, 80, 264, + 426, 265, 392, 81, 82, 397, 398, 399, 259, 260, + 261, 400, 402, 1137, 407, 408, 452, 1140, 427, 428, + 429, 430, 431, 441, 453, 454, 432, 266, 267, 268, + 262, 455, 269, 457, 270, 456, 460, 1139, 464, 463, + 468, 467, 1, 469, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 263, 476, 264, 478, 265, 11, 12, + 13, 487, 488, 490, 14, 15, 16, 491, 520, 17, + 494, 505, 499, 500, 504, 433, 434, 435, 436, 437, + 438, 439, 440, 266, 267, 268, 513, 514, 269, 515, + 270, 516, 1, 517, 2, 3, 4, 5, 6, 7, + 505, 9, 518, 519, 521, 523, 525, 530, 11, 12, + 13, 269, 550, 17, 14, 15, 16, 552, 554, 555, + 556, 559, 560, 83, 84, 85, 86, 561, 87, 88, + 426, 563, 89, 90, 91, 562, 564, 92, 93, 94, + 567, 568, 569, 571, 95, 96, 573, 615, 427, 428, + 429, 430, 610, 657, 616, 611, 432, 97, 98, 426, + 617, 99, 619, 17, 639, 100, 529, 632, 426, 645, + 641, 422, 656, 658, 652, 659, 660, 427, 428, 429, + 430, 661, 480, 665, 668, 432, -523, -523, 429, 430, + 669, 670, 420, 677, -523, 680, 681, 682, 683, 684, + 685, 697, 701, 686, 18, 433, 434, 435, 436, 437, + 438, 439, 440, 687, 695, 704, 705, 700, 706, 707, + 728, 19, 713, 708, 703, 727, 650, 649, 726, 731, + 721, 734, 735, 20, 433, 434, 435, 436, 437, 438, + 439, 440, 742, -523, 434, 435, 436, 437, 438, 439, + 440, 739, 21, 757, 18, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, - 594, 924, 595, 596, 597, 598, 599, 600, 951, 925, - 601, 927, 928, 602, 603, 929, 930, 604, 605, 606, - 607, 781, 782, 783, 784, 785, 931, 932, 786, 787, - 933, 952, 934, 935, 936, 788, 789, 790, 792, 793, - 794, 795, 796, 938, 939, 797, 798, 940, 964, 941, - 970, 791, 799, 800, 801, 803, 804, 805, 806, 807, - 942, 943, 808, 809, 944, 972, 945, 946, 802, 810, - 811, 812, 814, 815, 816, 817, 818, 947, 949, 819, - 820, 974, 975, 959, 960, 813, 821, 822, 823, 962, - 963, 971, 976, 977, 978, 979, 980, 981, 982, 983, - 984, 985, 824, 986, 987, 988, 989, 990, 991, 992, - 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, + 594, 595, 744, 596, 597, 598, 599, 600, 601, 759, + 826, 602, 827, 20, 603, 604, 834, 828, 605, 606, + 607, 608, 782, 783, 784, 785, 786, 835, 836, 787, + 788, 839, 21, 845, 843, 847, 789, 790, 791, 793, + 794, 795, 796, 797, 852, 855, 798, 799, 856, 859, + 857, 860, 792, 800, 801, 802, 804, 805, 806, 807, + 808, 871, 872, 809, 810, 873, 885, 886, 887, 803, + 811, 812, 813, 815, 816, 817, 818, 819, 888, 889, + 820, 821, 890, 891, 894, 892, 814, 822, 823, 824, + 893, 895, 896, 905, 897, 916, 898, 899, 900, 901, + 927, 902, 903, 825, 938, 949, 904, 906, 952, 907, + 908, 909, 910, 911, 953, 912, 956, 957, 913, 914, + 725, 967, 915, 917, 918, 919, 973, 920, 921, 975, + 976, 977, 978, 922, 923, 924, 979, 980, 981, 925, + 926, 928, 982, 929, 930, 931, 932, 933, 934, 983, + 935, 936, 984, 937, 939, 940, 941, 942, 943, 944, + 986, 987, 945, 946, 947, 988, 948, 989, 990, 991, + 950, 992, 993, 994, 960, 961, 963, 964, 965, 971, + 972, 995, 985, 997, 996, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, - 1045, 1047, 1048, 1049, 1199, 1058, 1051, 1059, 1052, 1060, - 1055, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, - 1070, 1079, 1056, 1071, 1072, 1073, 1090, 1074, 1075, 1076, - 1077, 1078, 1080, 1081, 1082, 1083, 1084, 1085, 1101, 1086, - 1087, 1088, 1089, 1091, 1092, 1093, 1094, 1095, 1096, 1097, - 1098, 1099, 1100, 1102, 1103, 1104, 1105, 1106, 1107, 1108, - 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, - 1123, 1119, 1120, 1121, 1122, 1124, 1127, 1146, 1148, 1125, - 1128, 1129, 1140, 1141, 1142, 1143, 1144, 1145, 1147, 1149, - 1151, 1157, 1152, 1153, 1154, 1161, 1158, 1165, 1166, 1156, - 1167, 1168, 1169, 1175, 1172, 1176, 1181, 1182, 1183, 1184, - 1185, 1186, 1187, 1191, 1194, 1195, 1196, 1197, 1198, 1200, - 1201, 1203, 1202, 1204, 1206, 1207, 162, 358, 698, 497, - 212, 828, 125, 458, 713, 830, 348, 678, 523, 869, - 967, 1054, 508, 848, 550, 642, 950, 0, 849, 400, - 865, 954, 552, 0, 0, 837, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 333 + 1043, 1046, 1048, 1049, 1050, 1053, 1059, 1052, 1060, 1061, + 1062, 1056, 1063, 1064, 1065, 1066, 1067, 1069, 1068, 1070, + 1071, 1072, 1073, 1057, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1091, 1081, 1102, 1082, 1083, 1084, 1085, 1086, 1087, + 1088, 1089, 1113, 1090, 1092, 1093, 1094, 1095, 1096, 1097, + 1124, 1098, 1099, 1100, 1101, 1103, 1104, 1105, 1106, 1107, + 1108, 1109, 1128, 1110, 1111, 1112, 1114, 1115, 1116, 1117, + 1118, 1119, 1120, 1121, 1122, 1123, 1125, 1147, 1149, 1150, + 1126, 1129, 1130, 1141, 1142, 1143, 1144, 1145, 1146, 1148, + 1152, 1153, 1154, 1157, 1155, 1158, 1159, 1162, 1166, 1167, + 1168, 1169, 1183, 1187, 1170, 1173, 1176, 1182, 1177, 1184, + 1185, 1188, 1196, 1200, 1197, 1204, 1186, 1192, 1198, 1199, + 1195, 1201, 1202, 1205, 162, 1203, 1207, 1208, 699, 831, + 213, 679, 829, 714, 498, 125, 359, 349, 459, 968, + 509, 870, 643, 1055, 951, 849, 850, 524, 401, 955, + 0, 866, 838, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 334, 0, 0, + 0, 0, 0, 551, 0, 0, 0, 0, 0, 0, + 0, 553 }; static const yytype_int16 yycheck[] = { - 218, 8, 241, 608, 21, 239, 268, 558, 499, 723, - 250, 157, 756, 756, 253, 756, 756, 756, 756, 5, - 6, 66, 4, 559, 6, 265, 266, 3, 5, 6, - 269, 75, 6, 8, 16, 3, 3, 37, 4, 5, - 6, 187, 55, 3, 62, 5, 6, 78, 6, 20, - 38, 22, 62, 133, 55, 3, 63, 28, 3, 610, - 5, 6, 72, 201, 76, 77, 204, 49, 82, 3, - 0, 5, 6, 84, 155, 156, 58, 7, 127, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 73, 40, - 78, 78, 66, 23, 24, 25, 76, 79, 49, 29, - 30, 31, 62, 34, 33, 34, 35, 20, 66, 22, - 39, 40, 351, 352, 158, 28, 165, 62, 55, 101, - 102, 103, 104, 34, 78, 33, 34, 35, 62, 368, - 844, 39, 40, 3, 214, 34, 102, 103, 104, 220, - 127, 87, 108, 694, 155, 156, 131, 387, 78, 34, - 68, 69, 391, 392, 155, 156, 374, 139, 140, 141, - 0, 79, 80, 81, 70, 71, 148, 149, 150, 135, - 136, 137, 7, 127, 3, 220, 3, 12, 165, 14, - 442, 16, 421, 422, 3, 216, 426, 427, 428, 429, - 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 218, 737, 184, 216, 216, 3, 220, 84, 168, 155, - 156, 165, 87, 230, 3, 4, 5, 6, 155, 156, - 172, 134, 88, 168, 33, 34, 55, 971, 971, 215, - 971, 971, 971, 971, 168, 4, 475, 214, 215, 169, - 216, 216, 51, 211, 211, 227, 217, 219, 214, 155, - 156, 469, 269, 8, 8, 8, 186, 8, 128, 4, - 130, 155, 156, 155, 156, 8, 195, 185, 198, 33, - 34, 510, 511, 8, 513, 493, 65, 516, 155, 156, - 155, 156, 500, 73, 73, 74, 216, 195, 528, 155, - 156, 218, 33, 220, 83, 8, 85, 66, 8, 8, - 7, 42, 9, 10, 11, 12, 13, 14, 63, 16, - 63, 529, 63, 102, 103, 104, 23, 24, 25, 108, - 63, 66, 29, 30, 31, 217, 220, 8, 63, 8, - 72, 215, 1046, 572, 169, 1049, 220, 8, 128, 217, - 130, 131, 220, 133, 10, 72, 135, 136, 137, 356, - 63, 956, 73, 63, 63, 190, 3, 78, 215, 194, - 26, 27, 197, 220, 855, 215, 132, 20, 157, 22, - 220, 78, 215, 390, 3, 28, 522, 220, 166, 167, - 173, 174, 63, 171, 63, 367, 152, 153, 159, 160, - 161, 180, 63, 182, 633, 184, 635, 218, 638, 215, - 3, 4, 5, 6, 220, 217, 3, 128, 220, 130, - 131, 217, 186, 187, 220, 217, 656, 191, 220, 970, - 209, 210, 211, 173, 174, 214, 40, 216, 217, 43, - 44, 14, 1146, 651, 48, 49, 1150, 3, 4, 5, - 6, 207, 208, 209, 210, 211, 212, 213, 40, 3, - 1164, 43, 44, 3, 1168, 216, 48, 49, 676, 721, - 3, 120, 169, 122, 719, 124, 125, 722, 188, 189, - 73, 74, 84, 6, 86, 78, 88, 3, 717, 486, - 83, 34, 85, 36, 702, 724, 503, 176, 84, 6, - 86, 198, 88, 180, 3, 182, 55, 184, 220, 102, - 103, 104, 6, 217, 195, 108, 220, 73, 74, 216, - 45, 46, 529, 3, 4, 5, 6, 83, 217, 85, - 195, 220, 88, 757, 51, 52, 53, 54, 44, 45, - 46, 47, 135, 136, 137, 195, 102, 103, 104, 4, - 217, 217, 108, 220, 220, 217, 1151, 217, 220, 217, - 220, 193, 220, 76, 157, 3, 4, 5, 6, 217, - 1165, 195, 220, 217, 1169, 217, 220, 195, 220, 135, - 136, 137, 217, 217, 217, 220, 220, 180, 1183, 182, - 217, 184, 56, 57, 58, 59, 60, 61, 21, 63, - 64, 157, 217, 217, 65, 220, 220, 1202, 67, 217, - 217, 1206, 220, 220, 155, 156, 209, 210, 211, 217, - 73, 214, 220, 216, 180, 3, 182, 3, 184, 62, - 3, 4, 5, 6, 62, 73, 74, 200, 201, 202, - 211, 212, 213, 74, 651, 83, 216, 85, 5, 6, - 5, 6, 3, 209, 210, 211, 45, 46, 214, 3, - 216, 43, 44, 3, 102, 103, 104, 870, 871, 3, - 108, 66, 4, 670, 3, 217, 91, 92, 93, 94, - 95, 3, 216, 98, 99, 4, 3, 4, 5, 6, - 105, 106, 107, 4, 165, 3, 6, 135, 136, 137, - 73, 74, 6, 4, 160, 3, 121, 4, 55, 4, - 83, 195, 85, 3, 170, 3, 53, 173, 174, 157, - 176, 177, 178, 68, 74, 134, 3, 62, 206, 102, - 103, 104, 78, 216, 216, 108, 192, 193, 4, 195, - 196, 216, 180, 6, 182, 78, 184, 4, 4, 4, - 216, 216, 3, 216, 6, 47, 73, 77, 218, 4, - 47, 77, 135, 136, 137, 78, 83, 3, 85, 6, - 4, 209, 210, 211, 217, 217, 214, 4, 216, 55, - 69, 216, 3, 3, 157, 102, 103, 104, 4, 216, - 216, 108, 216, 78, 216, 216, 216, 33, 34, 216, - 36, 4, 216, 4, 77, 41, 42, 180, 221, 182, - 217, 184, 3, 216, 214, 43, 6, 6, 135, 136, - 137, 6, 5, 1052, 216, 216, 3, 1056, 216, 165, - 217, 6, 4, 76, 165, 220, 209, 210, 211, 216, - 157, 214, 3, 216, 3, 129, 220, 1055, 3, 158, - 217, 134, 7, 76, 9, 10, 11, 12, 13, 14, - 4, 16, 220, 180, 155, 182, 131, 184, 23, 24, - 25, 6, 221, 73, 29, 30, 31, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 216, - 6, 221, 209, 210, 211, 73, 3, 214, 7, 216, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 3, - 6, 73, 4, 75, 23, 24, 25, 4, 220, 89, - 29, 30, 31, 78, 32, 161, 162, 163, 164, 4, - 166, 167, 132, 4, 170, 171, 172, 216, 216, 175, - 176, 177, 216, 6, 216, 216, 182, 183, 216, 216, - 150, 151, 152, 153, 132, 217, 216, 216, 158, 195, - 196, 6, 4, 199, 3, 6, 220, 203, 217, 78, - 132, 217, 150, 151, 152, 153, 4, 155, 73, 78, - 158, 6, 217, 5, 50, 47, 6, 206, 150, 151, - 152, 153, 154, 179, 220, 6, 158, 131, 129, 216, - 133, 165, 134, 217, 214, 4, 206, 207, 208, 209, - 210, 211, 212, 213, 169, 214, 220, 217, 6, 217, - 216, 6, 217, 57, 57, 3, 220, 220, 206, 207, - 208, 209, 210, 211, 212, 213, 220, 132, 220, 220, - 220, 220, 93, 198, 206, 207, 208, 209, 210, 211, - 212, 213, 132, 220, 220, 150, 151, 152, 153, 4, - 169, 216, 220, 158, 220, 3, 220, 220, 220, 220, - 150, 151, 152, 153, 220, 220, 93, 186, 158, 91, - 92, 93, 94, 95, 220, 93, 98, 99, 93, 198, - 220, 220, 220, 105, 106, 107, 220, 220, 220, 220, - 220, 220, 220, 220, 93, 220, 220, 216, 220, 121, - 220, 206, 207, 208, 209, 210, 211, 212, 213, 220, - 220, 93, 220, 220, 66, 6, 206, 207, 208, 209, - 210, 211, 212, 213, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 220, 108, 109, 110, 111, 112, 113, 134, 220, - 116, 220, 220, 119, 120, 220, 220, 123, 124, 125, - 126, 91, 92, 93, 94, 95, 220, 220, 98, 99, - 220, 134, 220, 220, 220, 105, 106, 107, 91, 92, - 93, 94, 95, 220, 220, 98, 99, 220, 217, 220, - 216, 121, 105, 106, 107, 91, 92, 93, 94, 95, - 220, 220, 98, 99, 220, 52, 220, 220, 121, 105, - 106, 107, 91, 92, 93, 94, 95, 220, 220, 98, - 99, 6, 6, 220, 220, 121, 105, 106, 107, 220, - 220, 220, 6, 6, 6, 6, 6, 6, 6, 6, - 220, 6, 121, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 220, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 220, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 220, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 220, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 220, 6, 4, 4, - 4, 217, 4, 4, 3, 217, 6, 217, 62, 217, - 53, 217, 217, 217, 217, 217, 217, 217, 6, 217, - 217, 6, 54, 217, 217, 217, 6, 217, 217, 217, - 217, 217, 217, 217, 217, 217, 217, 217, 6, 217, - 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, - 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, - 217, 217, 217, 6, 217, 217, 217, 217, 217, 217, - 6, 217, 217, 217, 217, 217, 165, 4, 49, 220, - 220, 220, 217, 217, 217, 217, 217, 217, 217, 4, - 217, 216, 6, 6, 220, 6, 220, 217, 49, 165, - 4, 4, 217, 216, 6, 217, 6, 48, 217, 4, - 217, 40, 40, 217, 216, 40, 40, 40, 40, 216, - 216, 3, 217, 3, 217, 217, 63, 225, 612, 369, - 128, 691, 21, 332, 632, 693, 214, 572, 419, 743, - 868, 971, 393, 722, 444, 515, 827, -1, 722, 260, - 740, 833, 446, -1, -1, 709, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 186 + 219, 8, 242, 21, 609, 240, 269, 559, 157, 724, + 251, 500, 757, 757, 254, 757, 757, 757, 757, 6, + 3, 20, 4, 22, 6, 266, 267, 5, 6, 28, + 270, 5, 6, 560, 16, 8, 3, 78, 3, 188, + 55, 78, 4, 5, 6, 3, 66, 5, 6, 62, + 6, 75, 3, 127, 55, 3, 63, 5, 6, 611, + 216, 82, 33, 34, 35, 221, 6, 49, 39, 40, + 0, 76, 77, 84, 33, 34, 58, 7, 73, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 37, 133, + 127, 165, 51, 23, 24, 25, 8, 79, 3, 29, + 30, 31, 155, 156, 62, 3, 76, 5, 6, 20, + 66, 22, 352, 353, 62, 155, 156, 28, 7, 101, + 102, 103, 104, 12, 34, 14, 66, 16, 165, 369, + 845, 33, 34, 35, 158, 78, 131, 39, 40, 34, + 102, 103, 104, 695, 155, 156, 108, 388, 78, 68, + 69, 63, 392, 393, 155, 156, 375, 139, 140, 141, + 79, 80, 81, 55, 62, 218, 148, 149, 150, 70, + 71, 215, 87, 135, 136, 137, 217, 128, 84, 130, + 443, 221, 422, 423, 127, 38, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 221, 221, 217, 185, 8, 4, 219, 4, 3, 34, + 168, 738, 217, 231, 3, 4, 5, 6, 205, 218, + 168, 87, 165, 134, 195, 78, 8, 972, 972, 34, + 972, 972, 972, 972, 217, 172, 476, 215, 216, 169, + 155, 156, 216, 8, 217, 212, 228, 212, 8, 155, + 156, 470, 270, 215, 155, 156, 186, 88, 8, 63, + 55, 155, 156, 155, 156, 8, 185, 66, 198, 66, + 168, 511, 512, 73, 514, 494, 65, 517, 78, 73, + 169, 63, 501, 8, 73, 74, 8, 217, 529, 155, + 156, 3, 216, 195, 83, 40, 85, 221, 63, 8, + 10, 190, 132, 63, 49, 194, 8, 720, 197, 8, + 723, 530, 33, 102, 103, 104, 26, 27, 3, 108, + 63, 42, 152, 153, 155, 156, 73, 221, 128, 3, + 130, 131, 1047, 573, 128, 1050, 130, 131, 63, 133, + 84, 63, 86, 20, 88, 22, 135, 136, 137, 3, + 357, 28, 957, 7, 63, 9, 10, 11, 12, 13, + 14, 63, 16, 201, 63, 0, 204, 856, 157, 23, + 24, 25, 220, 391, 523, 29, 30, 31, 208, 209, + 210, 211, 212, 213, 214, 132, 368, 62, 84, 72, + 86, 180, 88, 182, 634, 184, 636, 72, 639, 3, + 4, 5, 6, 150, 151, 152, 153, 33, 34, 40, + 216, 158, 43, 44, 72, 221, 657, 48, 49, 971, + 216, 210, 211, 212, 78, 221, 215, 3, 217, 218, + 166, 167, 1147, 652, 219, 171, 1151, 3, 4, 5, + 6, 173, 174, 40, 186, 187, 43, 44, 216, 191, + 1165, 48, 49, 221, 1169, 159, 160, 161, 677, 722, + 207, 208, 209, 210, 211, 212, 213, 214, 217, 73, + 74, 218, 3, 180, 78, 182, 14, 184, 718, 83, + 487, 85, 173, 174, 703, 725, 504, 56, 57, 58, + 59, 60, 61, 3, 63, 64, 188, 189, 102, 103, + 104, 120, 3, 122, 108, 124, 125, 73, 74, 34, + 218, 36, 530, 221, 219, 169, 221, 83, 218, 85, + 3, 221, 88, 758, 3, 4, 5, 6, 200, 201, + 202, 135, 136, 137, 155, 156, 102, 103, 104, 3, + 218, 3, 108, 221, 198, 45, 46, 1152, 51, 52, + 53, 54, 6, 157, 176, 3, 4, 5, 6, 218, + 3, 1166, 221, 217, 55, 1170, 212, 213, 214, 135, + 136, 137, 44, 45, 46, 47, 180, 221, 182, 1184, + 184, 218, 5, 6, 221, 91, 92, 93, 94, 95, + 6, 157, 98, 99, 218, 5, 6, 221, 1203, 105, + 106, 107, 1207, 45, 46, 4, 210, 211, 212, 218, + 195, 215, 221, 217, 180, 121, 182, 76, 184, 193, + 3, 4, 5, 6, 218, 73, 74, 221, 218, 218, + 218, 221, 221, 221, 652, 83, 218, 85, 218, 221, + 218, 221, 195, 221, 210, 211, 212, 218, 195, 215, + 221, 217, 43, 44, 102, 103, 104, 218, 218, 218, + 108, 221, 221, 195, 671, 195, 91, 92, 93, 94, + 95, 21, 218, 98, 99, 221, 3, 4, 5, 6, + 105, 106, 107, 218, 871, 872, 221, 135, 136, 137, + 73, 74, 218, 65, 160, 221, 121, 218, 218, 67, + 83, 221, 85, 73, 170, 3, 3, 173, 174, 157, + 176, 177, 178, 62, 62, 217, 74, 3, 3, 102, + 103, 104, 3, 3, 66, 108, 192, 193, 4, 195, + 196, 218, 180, 3, 182, 3, 184, 4, 4, 217, + 3, 73, 6, 75, 165, 6, 73, 4, 3, 55, + 4, 4, 135, 136, 137, 195, 83, 3, 85, 3, + 53, 68, 210, 211, 212, 3, 74, 215, 134, 217, + 3, 62, 207, 78, 157, 102, 103, 104, 78, 217, + 217, 108, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 4, 33, 34, 180, 36, 182, + 132, 184, 217, 41, 42, 4, 4, 4, 135, 136, + 137, 6, 217, 1053, 217, 217, 3, 1057, 150, 151, + 152, 153, 154, 219, 6, 47, 158, 210, 211, 212, + 157, 47, 215, 78, 217, 77, 4, 1056, 77, 6, + 218, 4, 7, 218, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 180, 69, 182, 4, 184, 23, 24, + 25, 55, 217, 3, 29, 30, 31, 3, 222, 78, + 217, 73, 217, 217, 217, 207, 208, 209, 210, 211, + 212, 213, 214, 210, 211, 212, 4, 217, 215, 217, + 217, 217, 7, 217, 9, 10, 11, 12, 13, 14, + 73, 16, 4, 4, 218, 77, 3, 217, 23, 24, + 25, 215, 6, 78, 29, 30, 31, 6, 6, 5, + 43, 217, 217, 161, 162, 163, 164, 3, 166, 167, + 132, 218, 170, 171, 172, 217, 6, 175, 176, 177, + 4, 165, 165, 76, 182, 183, 221, 3, 150, 151, + 152, 153, 129, 155, 134, 217, 158, 195, 196, 132, + 3, 199, 221, 78, 76, 203, 158, 218, 132, 221, + 4, 155, 131, 222, 217, 222, 6, 150, 151, 152, + 153, 6, 3, 3, 6, 158, 150, 151, 152, 153, + 4, 4, 221, 89, 158, 4, 217, 217, 217, 217, + 217, 32, 4, 217, 169, 207, 208, 209, 210, 211, + 212, 213, 214, 217, 217, 6, 6, 218, 4, 3, + 78, 186, 218, 6, 217, 4, 6, 5, 218, 218, + 221, 50, 47, 198, 207, 208, 209, 210, 211, 212, + 213, 214, 6, 207, 208, 209, 210, 211, 212, 213, + 214, 207, 217, 179, 169, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 221, 108, 109, 110, 111, 112, 113, 6, + 131, 116, 129, 198, 119, 120, 217, 133, 123, 124, + 125, 126, 91, 92, 93, 94, 95, 134, 165, 98, + 99, 218, 217, 4, 215, 215, 105, 106, 107, 91, + 92, 93, 94, 95, 221, 218, 98, 99, 217, 6, + 218, 6, 121, 105, 106, 107, 91, 92, 93, 94, + 95, 57, 57, 98, 99, 3, 221, 221, 221, 121, + 105, 106, 107, 91, 92, 93, 94, 95, 221, 221, + 98, 99, 221, 221, 93, 221, 121, 105, 106, 107, + 221, 221, 221, 93, 221, 93, 221, 221, 221, 221, + 93, 221, 221, 121, 93, 93, 221, 221, 134, 221, + 221, 221, 221, 221, 134, 221, 4, 3, 221, 221, + 66, 6, 221, 221, 221, 221, 52, 221, 221, 6, + 6, 6, 6, 221, 221, 221, 6, 6, 6, 221, + 221, 221, 6, 221, 221, 221, 221, 221, 221, 6, + 221, 221, 6, 221, 221, 221, 221, 221, 221, 221, + 6, 6, 221, 221, 221, 6, 221, 6, 6, 6, + 221, 6, 6, 6, 221, 221, 221, 221, 218, 217, + 221, 6, 221, 6, 221, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 221, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 221, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 221, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 221, 6, 4, + 4, 4, 218, 4, 4, 62, 218, 6, 218, 218, + 218, 53, 218, 218, 218, 218, 218, 6, 218, 218, + 218, 218, 218, 54, 218, 218, 218, 218, 218, 218, + 6, 6, 218, 6, 218, 218, 218, 218, 218, 218, + 218, 218, 6, 218, 218, 218, 218, 218, 218, 218, + 6, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 165, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 218, 218, 4, 49, 4, + 221, 221, 221, 218, 218, 218, 218, 218, 218, 218, + 218, 6, 6, 165, 221, 217, 221, 6, 218, 49, + 4, 4, 48, 40, 218, 6, 217, 6, 218, 218, + 4, 40, 40, 3, 40, 3, 218, 218, 40, 40, + 217, 217, 217, 3, 63, 218, 218, 218, 613, 694, + 128, 573, 692, 633, 370, 21, 226, 215, 333, 869, + 394, 744, 516, 972, 828, 723, 723, 420, 261, 834, + -1, 741, 710, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 187, -1, -1, + -1, -1, -1, 445, -1, -1, -1, -1, -1, -1, + -1, 447 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of @@ -1624,184 +1629,184 @@ static const yytype_int16 yystos[] = { 0, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 23, 24, 25, 29, 30, 31, 78, 169, 186, - 198, 216, 223, 224, 225, 227, 238, 239, 241, 242, - 245, 246, 247, 248, 249, 274, 279, 280, 281, 282, - 283, 284, 285, 33, 34, 35, 39, 40, 195, 37, - 33, 34, 35, 39, 40, 195, 3, 272, 76, 272, - 166, 167, 171, 3, 226, 227, 238, 239, 242, 245, - 246, 247, 279, 280, 281, 282, 283, 3, 33, 34, + 198, 217, 224, 225, 226, 228, 239, 240, 242, 243, + 246, 247, 248, 249, 250, 275, 280, 281, 282, 283, + 284, 285, 286, 33, 34, 35, 39, 40, 195, 37, + 33, 34, 35, 39, 40, 195, 3, 273, 76, 273, + 166, 167, 171, 3, 227, 228, 239, 240, 243, 246, + 247, 248, 280, 281, 282, 283, 284, 3, 33, 34, 36, 41, 42, 161, 162, 163, 164, 166, 167, 170, 171, 172, 175, 176, 177, 182, 183, 195, 196, 199, 203, 34, 34, 34, 34, 159, 160, 161, 3, 3, - 272, 3, 275, 276, 172, 7, 12, 14, 16, 169, - 190, 194, 197, 33, 34, 248, 249, 0, 219, 332, - 20, 22, 28, 268, 8, 250, 252, 72, 331, 331, - 331, 331, 331, 333, 3, 272, 72, 330, 330, 330, - 330, 330, 3, 218, 14, 272, 76, 77, 216, 3, - 3, 3, 226, 216, 3, 272, 6, 173, 174, 173, - 174, 3, 176, 6, 3, 200, 201, 202, 201, 204, - 272, 272, 272, 272, 62, 55, 220, 6, 195, 195, - 186, 187, 191, 160, 170, 173, 174, 176, 177, 178, - 192, 193, 195, 196, 195, 4, 193, 76, 195, 195, - 217, 217, 225, 21, 216, 251, 252, 65, 259, 67, - 253, 73, 3, 272, 272, 272, 3, 62, 62, 216, - 240, 74, 3, 272, 272, 272, 3, 3, 3, 243, - 244, 66, 265, 4, 329, 329, 3, 4, 5, 6, - 73, 74, 83, 85, 102, 103, 104, 108, 135, 136, - 137, 157, 180, 182, 184, 209, 210, 211, 214, 216, - 286, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 299, 300, 301, 302, 303, 305, 306, 307, 308, 309, - 311, 312, 313, 314, 315, 316, 317, 318, 321, 322, - 323, 324, 325, 326, 3, 5, 6, 62, 168, 3, - 5, 6, 62, 168, 3, 5, 6, 62, 168, 217, - 40, 43, 44, 48, 49, 3, 3, 4, 10, 26, - 27, 272, 216, 276, 329, 4, 165, 6, 3, 6, - 4, 3, 4, 55, 4, 195, 3, 3, 251, 252, - 286, 53, 68, 257, 74, 134, 55, 216, 240, 272, - 33, 34, 51, 3, 237, 38, 249, 62, 206, 220, - 265, 289, 78, 78, 216, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 73, 74, 290, - 216, 216, 88, 289, 304, 4, 4, 4, 4, 6, - 326, 216, 120, 122, 124, 125, 216, 216, 290, 290, - 5, 6, 215, 309, 319, 320, 249, 289, 217, 220, - 55, 155, 156, 73, 75, 132, 150, 151, 152, 153, - 154, 158, 206, 207, 208, 209, 210, 211, 212, 213, - 218, 215, 220, 215, 220, 215, 220, 215, 220, 215, - 220, 3, 6, 47, 47, 77, 78, 334, 250, 4, - 40, 49, 6, 77, 188, 189, 4, 217, 217, 82, - 261, 254, 255, 289, 289, 69, 258, 4, 247, 3, - 128, 130, 228, 230, 231, 236, 55, 216, 338, 3, - 3, 217, 220, 216, 287, 272, 289, 244, 216, 216, - 65, 217, 286, 216, 73, 249, 289, 289, 304, 84, - 86, 88, 4, 216, 216, 216, 216, 4, 4, 221, - 217, 217, 77, 288, 3, 289, 289, 75, 158, 216, - 73, 131, 290, 290, 290, 290, 290, 290, 290, 290, - 290, 290, 290, 290, 290, 290, 3, 211, 309, 6, - 319, 6, 320, 6, 5, 43, 45, 46, 216, 216, - 3, 216, 217, 6, 33, 42, 4, 165, 165, 286, - 76, 262, 220, 70, 71, 256, 289, 134, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 108, 109, 110, 111, 112, - 113, 116, 119, 120, 123, 124, 125, 126, 232, 129, - 216, 217, 220, 247, 3, 134, 3, 286, 220, 68, - 69, 79, 80, 81, 185, 327, 328, 327, 286, 217, - 249, 217, 55, 87, 84, 86, 289, 289, 76, 289, - 4, 3, 307, 289, 220, 264, 217, 220, 5, 6, - 329, 216, 290, 249, 286, 131, 155, 221, 221, 6, - 6, 237, 229, 231, 3, 336, 337, 6, 4, 4, - 216, 269, 270, 271, 272, 277, 89, 260, 255, 4, - 216, 216, 216, 216, 216, 216, 216, 73, 128, 130, - 131, 233, 234, 334, 216, 237, 32, 335, 230, 217, - 4, 217, 216, 6, 6, 4, 3, 6, 217, 220, - 217, 217, 217, 232, 289, 289, 84, 87, 290, 220, - 220, 220, 220, 4, 66, 217, 4, 78, 249, 286, - 217, 217, 290, 50, 47, 217, 217, 220, 206, 217, - 220, 6, 247, 220, 56, 58, 59, 60, 61, 63, - 64, 278, 3, 55, 273, 286, 179, 263, 6, 91, - 92, 93, 94, 95, 98, 99, 105, 106, 107, 121, + 273, 3, 276, 277, 172, 7, 12, 14, 16, 169, + 190, 194, 197, 33, 34, 249, 250, 0, 220, 333, + 20, 22, 28, 269, 8, 251, 253, 72, 332, 332, + 332, 332, 332, 334, 3, 273, 72, 331, 331, 331, + 331, 331, 3, 219, 14, 273, 76, 77, 217, 3, + 3, 3, 227, 217, 3, 273, 6, 205, 173, 174, + 173, 174, 3, 176, 6, 3, 200, 201, 202, 201, + 204, 273, 273, 273, 273, 62, 55, 221, 6, 195, + 195, 186, 187, 191, 160, 170, 173, 174, 176, 177, + 178, 192, 193, 195, 196, 195, 4, 193, 76, 195, + 195, 218, 218, 226, 21, 217, 252, 253, 65, 260, + 67, 254, 73, 3, 273, 273, 273, 3, 62, 62, + 217, 241, 74, 3, 273, 273, 273, 3, 3, 3, + 244, 245, 66, 266, 4, 330, 330, 3, 4, 5, + 6, 73, 74, 83, 85, 102, 103, 104, 108, 135, + 136, 137, 157, 180, 182, 184, 210, 211, 212, 215, + 217, 287, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 300, 301, 302, 303, 304, 306, 307, 308, 309, + 310, 312, 313, 314, 315, 316, 317, 318, 319, 322, + 323, 324, 325, 326, 327, 3, 5, 6, 62, 168, + 3, 5, 6, 62, 168, 3, 5, 6, 62, 168, + 218, 40, 43, 44, 48, 49, 3, 3, 4, 10, + 26, 27, 273, 217, 277, 330, 4, 165, 6, 3, + 6, 4, 3, 4, 55, 4, 195, 3, 3, 252, + 253, 287, 53, 68, 258, 74, 134, 55, 217, 241, + 273, 33, 34, 51, 3, 238, 38, 250, 62, 207, + 221, 266, 290, 78, 78, 217, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 73, 74, + 291, 217, 217, 88, 290, 305, 4, 4, 4, 4, + 6, 327, 217, 120, 122, 124, 125, 217, 217, 291, + 291, 5, 6, 216, 310, 320, 321, 250, 290, 218, + 221, 55, 155, 156, 73, 75, 132, 150, 151, 152, + 153, 154, 158, 207, 208, 209, 210, 211, 212, 213, + 214, 219, 216, 221, 216, 221, 216, 221, 216, 221, + 216, 221, 3, 6, 47, 47, 77, 78, 335, 251, + 4, 40, 49, 6, 77, 188, 189, 4, 218, 218, + 82, 262, 255, 256, 290, 290, 69, 259, 4, 248, + 3, 128, 130, 229, 231, 232, 237, 55, 217, 339, + 3, 3, 218, 221, 217, 288, 273, 290, 245, 217, + 217, 65, 218, 287, 217, 73, 250, 290, 290, 305, + 84, 86, 88, 4, 217, 217, 217, 217, 4, 4, + 222, 218, 218, 77, 289, 3, 290, 290, 75, 158, + 217, 73, 131, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 3, 212, 310, + 6, 320, 6, 321, 6, 5, 43, 45, 46, 217, + 217, 3, 217, 218, 6, 33, 42, 4, 165, 165, + 287, 76, 263, 221, 70, 71, 257, 290, 134, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 108, 109, 110, 111, + 112, 113, 116, 119, 120, 123, 124, 125, 126, 233, + 129, 217, 218, 221, 248, 3, 134, 3, 287, 221, + 68, 69, 79, 80, 81, 185, 328, 329, 328, 287, + 218, 250, 218, 55, 87, 84, 86, 290, 290, 76, + 290, 4, 3, 308, 290, 221, 265, 218, 221, 5, + 6, 330, 217, 291, 250, 287, 131, 155, 222, 222, + 6, 6, 238, 230, 232, 3, 337, 338, 6, 4, + 4, 217, 270, 271, 272, 273, 278, 89, 261, 256, + 4, 217, 217, 217, 217, 217, 217, 217, 73, 128, + 130, 131, 234, 235, 335, 217, 238, 32, 336, 231, + 218, 4, 218, 217, 6, 6, 4, 3, 6, 218, + 221, 218, 218, 218, 233, 290, 290, 84, 87, 291, + 221, 221, 221, 221, 4, 66, 218, 4, 78, 250, + 287, 218, 218, 291, 50, 47, 218, 218, 221, 207, + 218, 221, 6, 248, 221, 56, 58, 59, 60, 61, + 63, 64, 279, 3, 55, 274, 287, 179, 264, 6, 91, 92, 93, 94, 95, 98, 99, 105, 106, 107, 121, 91, 92, 93, 94, 95, 98, 99, 105, 106, 107, 121, 91, 92, 93, 94, 95, 98, 99, 105, 106, 107, 121, 91, 92, 93, 94, 95, 98, 99, 105, 106, 107, 121, 91, 92, 93, 94, 95, 98, - 99, 105, 106, 107, 121, 131, 129, 133, 234, 235, - 235, 237, 217, 216, 134, 165, 286, 328, 217, 84, - 289, 217, 214, 321, 4, 309, 214, 310, 313, 318, - 321, 220, 264, 289, 217, 216, 217, 217, 6, 6, - 231, 3, 4, 5, 6, 337, 34, 36, 217, 270, - 57, 57, 3, 291, 292, 293, 294, 295, 296, 297, - 298, 265, 217, 220, 220, 220, 220, 220, 220, 220, - 220, 220, 220, 93, 220, 220, 220, 220, 220, 220, - 220, 220, 220, 220, 93, 220, 220, 220, 220, 220, - 220, 220, 220, 220, 220, 93, 220, 220, 220, 220, - 220, 220, 220, 220, 220, 220, 93, 220, 220, 220, - 220, 220, 220, 220, 220, 220, 220, 93, 220, 220, - 220, 220, 220, 220, 220, 220, 220, 220, 93, 220, - 308, 134, 134, 217, 336, 4, 3, 217, 6, 220, - 220, 264, 220, 220, 217, 327, 6, 273, 271, 271, - 216, 220, 52, 267, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 220, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 220, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 220, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 220, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 220, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 220, - 6, 4, 4, 217, 334, 4, 4, 217, 4, 4, - 217, 6, 62, 237, 297, 53, 54, 266, 217, 217, - 217, 217, 217, 217, 217, 217, 217, 217, 6, 217, - 217, 217, 217, 217, 217, 217, 217, 217, 217, 6, - 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, - 6, 217, 217, 217, 217, 217, 217, 217, 217, 217, - 217, 6, 217, 217, 217, 217, 217, 217, 217, 217, - 217, 217, 6, 217, 217, 217, 217, 217, 217, 217, - 217, 217, 217, 6, 217, 220, 264, 165, 220, 220, - 264, 40, 43, 44, 48, 49, 289, 217, 286, 289, - 217, 217, 217, 217, 217, 217, 4, 217, 49, 4, - 6, 217, 6, 6, 220, 264, 165, 216, 220, 264, - 334, 6, 45, 46, 6, 217, 49, 4, 4, 217, - 43, 44, 6, 264, 334, 216, 217, 264, 127, 165, - 334, 6, 48, 217, 4, 217, 40, 40, 127, 165, - 334, 217, 127, 165, 216, 40, 40, 40, 40, 3, - 216, 216, 217, 3, 3, 334, 217, 217, 334 + 99, 105, 106, 107, 121, 91, 92, 93, 94, 95, + 98, 99, 105, 106, 107, 121, 131, 129, 133, 235, + 236, 236, 238, 218, 217, 134, 165, 287, 329, 218, + 84, 290, 218, 215, 322, 4, 310, 215, 311, 314, + 319, 322, 221, 265, 290, 218, 217, 218, 218, 6, + 6, 232, 3, 4, 5, 6, 338, 34, 36, 218, + 271, 57, 57, 3, 292, 293, 294, 295, 296, 297, + 298, 299, 266, 218, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 93, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 93, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 93, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 93, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 93, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 93, + 221, 309, 134, 134, 218, 337, 4, 3, 218, 6, + 221, 221, 265, 221, 221, 218, 328, 6, 274, 272, + 272, 217, 221, 52, 268, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 221, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 221, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 221, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 221, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 221, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 221, 6, 4, 4, 218, 335, 4, 4, 218, 4, + 4, 218, 6, 62, 238, 298, 53, 54, 267, 218, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 6, + 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 6, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 6, 218, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 6, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 6, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 6, 218, 221, 265, 165, 221, + 221, 265, 40, 43, 44, 48, 49, 290, 218, 287, + 290, 218, 218, 218, 218, 218, 218, 4, 218, 49, + 4, 6, 218, 6, 6, 221, 265, 165, 217, 221, + 265, 335, 6, 45, 46, 6, 218, 49, 4, 4, + 218, 43, 44, 6, 265, 335, 217, 218, 265, 127, + 165, 335, 6, 48, 218, 4, 218, 40, 40, 127, + 165, 335, 218, 127, 165, 217, 40, 40, 40, 40, + 3, 217, 217, 218, 3, 3, 335, 218, 218, 335 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_int16 yyr1[] = { - 0, 222, 223, 224, 224, 225, 225, 225, 225, 225, - 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, + 0, 223, 224, 225, 225, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, - 226, 226, 227, 227, 227, 227, 227, 227, 227, 227, - 227, 227, 228, 228, 229, 229, 230, 230, 231, 231, - 231, 231, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 233, 233, 234, 234, 234, 234, - 235, 235, 236, 236, 237, 237, 238, 239, 239, 240, - 240, 241, 241, 242, 243, 243, 244, 245, 245, 245, - 245, 245, 246, 246, 246, 247, 247, 247, 247, 248, - 248, 249, 250, 251, 251, 252, 253, 253, 254, 254, - 255, 256, 256, 256, 257, 257, 258, 258, 259, 259, - 260, 260, 261, 261, 262, 262, 263, 263, 264, 264, - 265, 265, 266, 266, 267, 267, 268, 268, 268, 268, - 269, 269, 270, 270, 271, 271, 272, 272, 273, 273, - 273, 273, 274, 274, 275, 275, 276, 277, 277, 278, - 278, 278, 278, 278, 278, 278, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, - 279, 279, 279, 279, 279, 279, 280, 280, 280, 281, - 281, 282, 282, 282, 282, 282, 282, 282, 282, 282, - 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, - 282, 282, 282, 282, 282, 282, 283, 284, 284, 284, - 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, - 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, - 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, - 284, 284, 284, 284, 284, 285, 285, 285, 286, 286, - 287, 287, 288, 288, 289, 289, 289, 289, 289, 290, - 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, - 290, 290, 291, 291, 291, 292, 292, 292, 292, 293, - 293, 293, 293, 294, 294, 294, 294, 295, 295, 296, - 296, 297, 297, 297, 297, 297, 297, 298, 298, 299, - 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, - 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, - 299, 299, 300, 300, 301, 302, 302, 303, 303, 303, - 303, 304, 304, 305, 306, 306, 306, 306, 307, 307, - 307, 307, 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 309, 309, 309, 309, 310, 310, - 310, 311, 312, 312, 313, 313, 314, 315, 315, 316, - 317, 317, 318, 319, 320, 321, 321, 322, 323, 323, - 324, 325, 325, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 327, 327, 328, 328, 328, - 328, 328, 328, 329, 330, 330, 331, 331, 332, 332, - 333, 333, 334, 334, 335, 335, 336, 336, 337, 337, - 337, 337, 337, 338, 338 + 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, + 227, 227, 228, 228, 228, 228, 228, 228, 228, 228, + 228, 228, 229, 229, 230, 230, 231, 231, 232, 232, + 232, 232, 233, 233, 233, 233, 233, 233, 233, 233, + 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, + 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, + 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, + 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, + 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, + 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, + 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, + 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, + 233, 233, 233, 233, 234, 234, 235, 235, 235, 235, + 236, 236, 237, 237, 238, 238, 239, 240, 240, 241, + 241, 242, 242, 243, 244, 244, 245, 246, 246, 246, + 246, 246, 247, 247, 247, 248, 248, 248, 248, 249, + 249, 250, 251, 252, 252, 253, 254, 254, 255, 255, + 256, 257, 257, 257, 258, 258, 259, 259, 260, 260, + 261, 261, 262, 262, 263, 263, 264, 264, 265, 265, + 266, 266, 267, 267, 268, 268, 269, 269, 269, 269, + 270, 270, 271, 271, 272, 272, 273, 273, 274, 274, + 274, 274, 275, 275, 276, 276, 277, 278, 278, 279, + 279, 279, 279, 279, 279, 279, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 280, 281, 281, 281, + 282, 282, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 284, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, + 285, 285, 285, 285, 285, 285, 286, 286, 286, 287, + 287, 288, 288, 289, 289, 290, 290, 290, 290, 290, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 292, 292, 292, 293, 293, 293, 293, + 294, 294, 294, 294, 295, 295, 295, 295, 296, 296, + 297, 297, 298, 298, 298, 298, 298, 298, 299, 299, + 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, + 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, + 300, 300, 300, 301, 301, 302, 303, 303, 304, 304, + 304, 304, 305, 305, 306, 307, 307, 307, 307, 308, + 308, 308, 308, 309, 309, 309, 309, 309, 309, 309, + 309, 309, 309, 309, 309, 310, 310, 310, 310, 311, + 311, 311, 312, 313, 313, 314, 314, 315, 316, 316, + 317, 318, 318, 319, 320, 321, 322, 322, 323, 324, + 324, 325, 326, 326, 327, 327, 327, 327, 327, 327, + 327, 327, 327, 327, 327, 327, 328, 328, 329, 329, + 329, 329, 329, 329, 330, 331, 331, 332, 332, 333, + 333, 334, 334, 335, 335, 336, 336, 337, 337, 338, + 338, 338, 338, 338, 339, 339 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ @@ -1833,34 +1838,34 @@ static const yytype_int8 yyr2[] = 5, 0, 2, 0, 1, 3, 5, 4, 6, 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 2, 3, 2, 2, 2, 2, 3, 2, 3, 3, 3, - 4, 4, 3, 3, 4, 4, 5, 6, 7, 9, - 4, 5, 7, 9, 2, 3, 2, 3, 3, 4, - 2, 3, 3, 4, 2, 3, 2, 2, 2, 2, - 5, 2, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, - 6, 6, 5, 3, 4, 4, 3, 3, 4, 6, - 7, 9, 10, 12, 12, 13, 14, 15, 16, 12, - 13, 15, 16, 3, 4, 5, 6, 3, 3, 4, - 3, 3, 4, 4, 6, 5, 3, 4, 3, 4, - 3, 3, 5, 7, 7, 6, 8, 8, 1, 3, - 3, 5, 3, 1, 1, 1, 1, 1, 1, 3, - 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 14, 19, 16, 20, 16, 15, 13, 18, - 14, 13, 11, 8, 10, 13, 15, 5, 7, 4, - 6, 1, 1, 1, 1, 1, 1, 1, 3, 3, - 4, 5, 4, 3, 2, 2, 2, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 6, - 3, 4, 3, 3, 5, 5, 6, 4, 6, 3, - 5, 4, 5, 6, 4, 5, 5, 6, 1, 3, - 1, 3, 1, 1, 1, 1, 1, 2, 2, 2, - 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 3, 1, 1, 2, 2, 3, 2, - 2, 3, 2, 3, 3, 1, 1, 2, 2, 3, - 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 3, 2, 2, 1, - 2, 2, 2, 1, 2, 0, 3, 0, 1, 0, - 2, 0, 4, 0, 4, 0, 1, 3, 1, 3, - 3, 3, 3, 6, 3 + 3, 4, 4, 3, 3, 4, 4, 5, 6, 7, + 9, 4, 5, 7, 9, 2, 3, 2, 3, 3, + 4, 2, 3, 3, 4, 2, 3, 2, 2, 2, + 2, 5, 2, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, + 3, 6, 6, 5, 3, 4, 4, 3, 3, 4, + 6, 7, 9, 10, 12, 12, 13, 14, 15, 16, + 12, 13, 15, 16, 3, 4, 5, 6, 3, 3, + 4, 3, 3, 4, 4, 6, 5, 3, 4, 3, + 4, 3, 3, 5, 7, 7, 6, 8, 8, 1, + 3, 3, 5, 3, 1, 1, 1, 1, 1, 1, + 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 14, 19, 16, 20, 16, 15, 13, + 18, 14, 13, 11, 8, 10, 13, 15, 5, 7, + 4, 6, 1, 1, 1, 1, 1, 1, 1, 3, + 3, 4, 5, 4, 3, 2, 2, 2, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 6, 3, 4, 3, 3, 5, 5, 6, 4, 6, + 3, 5, 4, 5, 6, 4, 5, 5, 6, 1, + 3, 1, 3, 1, 1, 1, 1, 1, 2, 2, + 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 2, 3, 1, 1, 2, 2, 3, + 2, 2, 3, 2, 3, 3, 1, 1, 2, 2, + 3, 2, 2, 3, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 3, 2, 2, + 1, 2, 2, 2, 1, 2, 0, 3, 0, 1, + 0, 2, 0, 4, 0, 4, 0, 1, 3, 1, + 3, 3, 3, 3, 6, 3 }; @@ -2428,7 +2433,7 @@ yydestruct (const char *yymsg, { free(((*yyvaluep).str_value)); } -#line 2432 "parser.cpp" +#line 2437 "parser.cpp" break; case YYSYMBOL_STRING: /* STRING */ @@ -2436,7 +2441,7 @@ yydestruct (const char *yymsg, { free(((*yyvaluep).str_value)); } -#line 2440 "parser.cpp" +#line 2445 "parser.cpp" break; case YYSYMBOL_statement_list: /* statement_list */ @@ -2450,7 +2455,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).stmt_array)); } } -#line 2454 "parser.cpp" +#line 2459 "parser.cpp" break; case YYSYMBOL_table_element_array: /* table_element_array */ @@ -2464,7 +2469,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).table_element_array_t)); } } -#line 2468 "parser.cpp" +#line 2473 "parser.cpp" break; case YYSYMBOL_column_def_array: /* column_def_array */ @@ -2478,7 +2483,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).column_def_array_t)); } } -#line 2482 "parser.cpp" +#line 2487 "parser.cpp" break; case YYSYMBOL_column_constraints: /* column_constraints */ @@ -2489,7 +2494,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).column_constraints_t)); } } -#line 2493 "parser.cpp" +#line 2498 "parser.cpp" break; case YYSYMBOL_default_expr: /* default_expr */ @@ -2497,7 +2502,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).const_expr_t)); } -#line 2501 "parser.cpp" +#line 2506 "parser.cpp" break; case YYSYMBOL_identifier_array: /* identifier_array */ @@ -2506,7 +2511,7 @@ yydestruct (const char *yymsg, fprintf(stderr, "destroy identifier array\n"); delete (((*yyvaluep).identifier_array_t)); } -#line 2510 "parser.cpp" +#line 2515 "parser.cpp" break; case YYSYMBOL_optional_identifier_array: /* optional_identifier_array */ @@ -2515,7 +2520,7 @@ yydestruct (const char *yymsg, fprintf(stderr, "destroy identifier array\n"); delete (((*yyvaluep).identifier_array_t)); } -#line 2519 "parser.cpp" +#line 2524 "parser.cpp" break; case YYSYMBOL_update_expr_array: /* update_expr_array */ @@ -2529,7 +2534,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).update_expr_array_t)); } } -#line 2533 "parser.cpp" +#line 2538 "parser.cpp" break; case YYSYMBOL_update_expr: /* update_expr */ @@ -2540,7 +2545,7 @@ yydestruct (const char *yymsg, delete ((*yyvaluep).update_expr_t); } } -#line 2544 "parser.cpp" +#line 2549 "parser.cpp" break; case YYSYMBOL_select_statement: /* select_statement */ @@ -2550,7 +2555,7 @@ yydestruct (const char *yymsg, delete ((*yyvaluep).select_stmt); } } -#line 2554 "parser.cpp" +#line 2559 "parser.cpp" break; case YYSYMBOL_select_with_paren: /* select_with_paren */ @@ -2560,7 +2565,7 @@ yydestruct (const char *yymsg, delete ((*yyvaluep).select_stmt); } } -#line 2564 "parser.cpp" +#line 2569 "parser.cpp" break; case YYSYMBOL_select_without_paren: /* select_without_paren */ @@ -2570,7 +2575,7 @@ yydestruct (const char *yymsg, delete ((*yyvaluep).select_stmt); } } -#line 2574 "parser.cpp" +#line 2579 "parser.cpp" break; case YYSYMBOL_select_clause_with_modifier: /* select_clause_with_modifier */ @@ -2580,7 +2585,7 @@ yydestruct (const char *yymsg, delete ((*yyvaluep).select_stmt); } } -#line 2584 "parser.cpp" +#line 2589 "parser.cpp" break; case YYSYMBOL_select_clause_without_modifier_paren: /* select_clause_without_modifier_paren */ @@ -2590,7 +2595,7 @@ yydestruct (const char *yymsg, delete ((*yyvaluep).select_stmt); } } -#line 2594 "parser.cpp" +#line 2599 "parser.cpp" break; case YYSYMBOL_select_clause_without_modifier: /* select_clause_without_modifier */ @@ -2600,7 +2605,7 @@ yydestruct (const char *yymsg, delete ((*yyvaluep).select_stmt); } } -#line 2604 "parser.cpp" +#line 2609 "parser.cpp" break; case YYSYMBOL_order_by_clause: /* order_by_clause */ @@ -2614,7 +2619,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).order_by_expr_list_t)); } } -#line 2618 "parser.cpp" +#line 2623 "parser.cpp" break; case YYSYMBOL_order_by_expr_list: /* order_by_expr_list */ @@ -2628,7 +2633,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).order_by_expr_list_t)); } } -#line 2632 "parser.cpp" +#line 2637 "parser.cpp" break; case YYSYMBOL_order_by_expr: /* order_by_expr */ @@ -2638,7 +2643,7 @@ yydestruct (const char *yymsg, delete ((*yyvaluep).order_by_expr_t)->expr_; delete ((*yyvaluep).order_by_expr_t); } -#line 2642 "parser.cpp" +#line 2647 "parser.cpp" break; case YYSYMBOL_limit_expr: /* limit_expr */ @@ -2646,7 +2651,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2650 "parser.cpp" +#line 2655 "parser.cpp" break; case YYSYMBOL_offset_expr: /* offset_expr */ @@ -2654,7 +2659,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2658 "parser.cpp" +#line 2663 "parser.cpp" break; case YYSYMBOL_unnest_clause: /* unnest_clause */ @@ -2668,7 +2673,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).expr_array_t)); } } -#line 2672 "parser.cpp" +#line 2677 "parser.cpp" break; case YYSYMBOL_highlight_clause: /* highlight_clause */ @@ -2682,7 +2687,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).expr_array_t)); } } -#line 2686 "parser.cpp" +#line 2691 "parser.cpp" break; case YYSYMBOL_from_clause: /* from_clause */ @@ -2691,7 +2696,7 @@ yydestruct (const char *yymsg, fprintf(stderr, "destroy table reference\n"); delete (((*yyvaluep).table_reference_t)); } -#line 2695 "parser.cpp" +#line 2700 "parser.cpp" break; case YYSYMBOL_search_clause: /* search_clause */ @@ -2699,7 +2704,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2703 "parser.cpp" +#line 2708 "parser.cpp" break; case YYSYMBOL_optional_search_filter_expr: /* optional_search_filter_expr */ @@ -2707,7 +2712,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2711 "parser.cpp" +#line 2716 "parser.cpp" break; case YYSYMBOL_where_clause: /* where_clause */ @@ -2715,7 +2720,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2719 "parser.cpp" +#line 2724 "parser.cpp" break; case YYSYMBOL_having_clause: /* having_clause */ @@ -2723,7 +2728,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2727 "parser.cpp" +#line 2732 "parser.cpp" break; case YYSYMBOL_group_by_clause: /* group_by_clause */ @@ -2737,7 +2742,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).expr_array_t)); } } -#line 2741 "parser.cpp" +#line 2746 "parser.cpp" break; case YYSYMBOL_table_reference: /* table_reference */ @@ -2746,7 +2751,7 @@ yydestruct (const char *yymsg, fprintf(stderr, "destroy table reference\n"); delete (((*yyvaluep).table_reference_t)); } -#line 2750 "parser.cpp" +#line 2755 "parser.cpp" break; case YYSYMBOL_table_reference_unit: /* table_reference_unit */ @@ -2755,7 +2760,7 @@ yydestruct (const char *yymsg, fprintf(stderr, "destroy table reference\n"); delete (((*yyvaluep).table_reference_t)); } -#line 2759 "parser.cpp" +#line 2764 "parser.cpp" break; case YYSYMBOL_table_reference_name: /* table_reference_name */ @@ -2764,7 +2769,7 @@ yydestruct (const char *yymsg, fprintf(stderr, "destroy table reference\n"); delete (((*yyvaluep).table_reference_t)); } -#line 2768 "parser.cpp" +#line 2773 "parser.cpp" break; case YYSYMBOL_table_name: /* table_name */ @@ -2777,7 +2782,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).table_name_t)); } } -#line 2781 "parser.cpp" +#line 2786 "parser.cpp" break; case YYSYMBOL_table_alias: /* table_alias */ @@ -2786,7 +2791,7 @@ yydestruct (const char *yymsg, fprintf(stderr, "destroy table alias\n"); delete (((*yyvaluep).table_alias_t)); } -#line 2790 "parser.cpp" +#line 2795 "parser.cpp" break; case YYSYMBOL_with_clause: /* with_clause */ @@ -2800,7 +2805,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).with_expr_list_t)); } } -#line 2804 "parser.cpp" +#line 2809 "parser.cpp" break; case YYSYMBOL_with_expr_list: /* with_expr_list */ @@ -2814,7 +2819,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).with_expr_list_t)); } } -#line 2818 "parser.cpp" +#line 2823 "parser.cpp" break; case YYSYMBOL_with_expr: /* with_expr */ @@ -2824,7 +2829,7 @@ yydestruct (const char *yymsg, delete ((*yyvaluep).with_expr_t)->select_; delete ((*yyvaluep).with_expr_t); } -#line 2828 "parser.cpp" +#line 2833 "parser.cpp" break; case YYSYMBOL_join_clause: /* join_clause */ @@ -2833,7 +2838,7 @@ yydestruct (const char *yymsg, fprintf(stderr, "destroy table reference\n"); delete (((*yyvaluep).table_reference_t)); } -#line 2837 "parser.cpp" +#line 2842 "parser.cpp" break; case YYSYMBOL_expr_array: /* expr_array */ @@ -2847,7 +2852,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).expr_array_t)); } } -#line 2851 "parser.cpp" +#line 2856 "parser.cpp" break; case YYSYMBOL_insert_row_list: /* insert_row_list */ @@ -2861,7 +2866,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).insert_row_list_t)); } } -#line 2865 "parser.cpp" +#line 2870 "parser.cpp" break; case YYSYMBOL_expr_alias: /* expr_alias */ @@ -2869,7 +2874,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2873 "parser.cpp" +#line 2878 "parser.cpp" break; case YYSYMBOL_expr: /* expr */ @@ -2877,7 +2882,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2881 "parser.cpp" +#line 2886 "parser.cpp" break; case YYSYMBOL_operand: /* operand */ @@ -2885,7 +2890,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2889 "parser.cpp" +#line 2894 "parser.cpp" break; case YYSYMBOL_match_tensor_expr: /* match_tensor_expr */ @@ -2893,7 +2898,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2897 "parser.cpp" +#line 2902 "parser.cpp" break; case YYSYMBOL_match_vector_expr: /* match_vector_expr */ @@ -2901,7 +2906,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2905 "parser.cpp" +#line 2910 "parser.cpp" break; case YYSYMBOL_match_sparse_expr: /* match_sparse_expr */ @@ -2909,7 +2914,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2913 "parser.cpp" +#line 2918 "parser.cpp" break; case YYSYMBOL_match_text_expr: /* match_text_expr */ @@ -2917,7 +2922,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2921 "parser.cpp" +#line 2926 "parser.cpp" break; case YYSYMBOL_query_expr: /* query_expr */ @@ -2925,7 +2930,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2929 "parser.cpp" +#line 2934 "parser.cpp" break; case YYSYMBOL_fusion_expr: /* fusion_expr */ @@ -2933,7 +2938,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2937 "parser.cpp" +#line 2942 "parser.cpp" break; case YYSYMBOL_sub_search: /* sub_search */ @@ -2941,7 +2946,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2945 "parser.cpp" +#line 2950 "parser.cpp" break; case YYSYMBOL_sub_search_array: /* sub_search_array */ @@ -2955,7 +2960,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).expr_array_t)); } } -#line 2959 "parser.cpp" +#line 2964 "parser.cpp" break; case YYSYMBOL_function_expr: /* function_expr */ @@ -2963,7 +2968,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2967 "parser.cpp" +#line 2972 "parser.cpp" break; case YYSYMBOL_conjunction_expr: /* conjunction_expr */ @@ -2971,7 +2976,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2975 "parser.cpp" +#line 2980 "parser.cpp" break; case YYSYMBOL_between_expr: /* between_expr */ @@ -2979,7 +2984,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2983 "parser.cpp" +#line 2988 "parser.cpp" break; case YYSYMBOL_in_expr: /* in_expr */ @@ -2987,7 +2992,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2991 "parser.cpp" +#line 2996 "parser.cpp" break; case YYSYMBOL_case_expr: /* case_expr */ @@ -2995,7 +3000,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 2999 "parser.cpp" +#line 3004 "parser.cpp" break; case YYSYMBOL_case_check_array: /* case_check_array */ @@ -3008,7 +3013,7 @@ yydestruct (const char *yymsg, } } } -#line 3012 "parser.cpp" +#line 3017 "parser.cpp" break; case YYSYMBOL_cast_expr: /* cast_expr */ @@ -3016,7 +3021,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 3020 "parser.cpp" +#line 3025 "parser.cpp" break; case YYSYMBOL_subquery_expr: /* subquery_expr */ @@ -3024,7 +3029,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 3028 "parser.cpp" +#line 3033 "parser.cpp" break; case YYSYMBOL_column_expr: /* column_expr */ @@ -3032,7 +3037,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).expr_t)); } -#line 3036 "parser.cpp" +#line 3041 "parser.cpp" break; case YYSYMBOL_constant_expr: /* constant_expr */ @@ -3040,7 +3045,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).const_expr_t)); } -#line 3044 "parser.cpp" +#line 3049 "parser.cpp" break; case YYSYMBOL_common_array_expr: /* common_array_expr */ @@ -3048,7 +3053,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).const_expr_t)); } -#line 3052 "parser.cpp" +#line 3057 "parser.cpp" break; case YYSYMBOL_common_sparse_array_expr: /* common_sparse_array_expr */ @@ -3056,7 +3061,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).const_expr_t)); } -#line 3060 "parser.cpp" +#line 3065 "parser.cpp" break; case YYSYMBOL_subarray_array_expr: /* subarray_array_expr */ @@ -3064,7 +3069,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).const_expr_t)); } -#line 3068 "parser.cpp" +#line 3073 "parser.cpp" break; case YYSYMBOL_unclosed_subarray_array_expr: /* unclosed_subarray_array_expr */ @@ -3072,7 +3077,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).const_expr_t)); } -#line 3076 "parser.cpp" +#line 3081 "parser.cpp" break; case YYSYMBOL_sparse_array_expr: /* sparse_array_expr */ @@ -3080,7 +3085,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).const_expr_t)); } -#line 3084 "parser.cpp" +#line 3089 "parser.cpp" break; case YYSYMBOL_long_sparse_array_expr: /* long_sparse_array_expr */ @@ -3088,7 +3093,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).const_expr_t)); } -#line 3092 "parser.cpp" +#line 3097 "parser.cpp" break; case YYSYMBOL_unclosed_long_sparse_array_expr: /* unclosed_long_sparse_array_expr */ @@ -3096,7 +3101,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).const_expr_t)); } -#line 3100 "parser.cpp" +#line 3105 "parser.cpp" break; case YYSYMBOL_double_sparse_array_expr: /* double_sparse_array_expr */ @@ -3104,7 +3109,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).const_expr_t)); } -#line 3108 "parser.cpp" +#line 3113 "parser.cpp" break; case YYSYMBOL_unclosed_double_sparse_array_expr: /* unclosed_double_sparse_array_expr */ @@ -3112,7 +3117,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).const_expr_t)); } -#line 3116 "parser.cpp" +#line 3121 "parser.cpp" break; case YYSYMBOL_empty_array_expr: /* empty_array_expr */ @@ -3120,7 +3125,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).const_expr_t)); } -#line 3124 "parser.cpp" +#line 3129 "parser.cpp" break; case YYSYMBOL_int_sparse_ele: /* int_sparse_ele */ @@ -3128,7 +3133,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).int_sparse_ele_t)); } -#line 3132 "parser.cpp" +#line 3137 "parser.cpp" break; case YYSYMBOL_float_sparse_ele: /* float_sparse_ele */ @@ -3136,7 +3141,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).float_sparse_ele_t)); } -#line 3140 "parser.cpp" +#line 3145 "parser.cpp" break; case YYSYMBOL_array_expr: /* array_expr */ @@ -3144,7 +3149,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).const_expr_t)); } -#line 3148 "parser.cpp" +#line 3153 "parser.cpp" break; case YYSYMBOL_long_array_expr: /* long_array_expr */ @@ -3152,7 +3157,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).const_expr_t)); } -#line 3156 "parser.cpp" +#line 3161 "parser.cpp" break; case YYSYMBOL_unclosed_long_array_expr: /* unclosed_long_array_expr */ @@ -3160,7 +3165,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).const_expr_t)); } -#line 3164 "parser.cpp" +#line 3169 "parser.cpp" break; case YYSYMBOL_double_array_expr: /* double_array_expr */ @@ -3168,7 +3173,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).const_expr_t)); } -#line 3172 "parser.cpp" +#line 3177 "parser.cpp" break; case YYSYMBOL_unclosed_double_array_expr: /* unclosed_double_array_expr */ @@ -3176,7 +3181,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).const_expr_t)); } -#line 3180 "parser.cpp" +#line 3185 "parser.cpp" break; case YYSYMBOL_interval_expr: /* interval_expr */ @@ -3184,7 +3189,7 @@ yydestruct (const char *yymsg, { delete (((*yyvaluep).const_expr_t)); } -#line 3188 "parser.cpp" +#line 3193 "parser.cpp" break; case YYSYMBOL_file_path: /* file_path */ @@ -3192,7 +3197,7 @@ yydestruct (const char *yymsg, { free(((*yyvaluep).str_value)); } -#line 3196 "parser.cpp" +#line 3201 "parser.cpp" break; case YYSYMBOL_if_not_exists_info: /* if_not_exists_info */ @@ -3203,7 +3208,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).if_not_exists_info_t)); } } -#line 3207 "parser.cpp" +#line 3212 "parser.cpp" break; case YYSYMBOL_with_index_param_list: /* with_index_param_list */ @@ -3217,7 +3222,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).with_index_param_list_t)); } } -#line 3221 "parser.cpp" +#line 3226 "parser.cpp" break; case YYSYMBOL_optional_table_properties_list: /* optional_table_properties_list */ @@ -3231,7 +3236,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).with_index_param_list_t)); } } -#line 3235 "parser.cpp" +#line 3240 "parser.cpp" break; case YYSYMBOL_index_info: /* index_info */ @@ -3242,7 +3247,7 @@ yydestruct (const char *yymsg, delete (((*yyvaluep).index_info_t)); } } -#line 3246 "parser.cpp" +#line 3251 "parser.cpp" break; default: @@ -3350,7 +3355,7 @@ YYLTYPE yylloc = yyloc_default; yylloc.string_length = 0; } -#line 3354 "parser.cpp" +#line 3359 "parser.cpp" yylsp[0] = yylloc; goto yysetstate; @@ -3565,7 +3570,7 @@ YYLTYPE yylloc = yyloc_default; { result->statements_ptr_ = (yyvsp[-1].stmt_array); } -#line 3569 "parser.cpp" +#line 3574 "parser.cpp" break; case 3: /* statement_list: statement */ @@ -3576,7 +3581,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.stmt_array) = new std::vector(); (yyval.stmt_array)->push_back((yyvsp[0].base_stmt)); } -#line 3580 "parser.cpp" +#line 3585 "parser.cpp" break; case 4: /* statement_list: statement_list ';' statement */ @@ -3587,169 +3592,169 @@ YYLTYPE yylloc = yyloc_default; (yyvsp[-2].stmt_array)->push_back((yyvsp[0].base_stmt)); (yyval.stmt_array) = (yyvsp[-2].stmt_array); } -#line 3591 "parser.cpp" +#line 3596 "parser.cpp" break; case 5: /* statement: create_statement */ #line 520 "parser.y" { (yyval.base_stmt) = (yyvsp[0].create_stmt); } -#line 3597 "parser.cpp" +#line 3602 "parser.cpp" break; case 6: /* statement: drop_statement */ #line 521 "parser.y" { (yyval.base_stmt) = (yyvsp[0].drop_stmt); } -#line 3603 "parser.cpp" +#line 3608 "parser.cpp" break; case 7: /* statement: copy_statement */ #line 522 "parser.y" { (yyval.base_stmt) = (yyvsp[0].copy_stmt); } -#line 3609 "parser.cpp" +#line 3614 "parser.cpp" break; case 8: /* statement: show_statement */ #line 523 "parser.y" { (yyval.base_stmt) = (yyvsp[0].show_stmt); } -#line 3615 "parser.cpp" +#line 3620 "parser.cpp" break; case 9: /* statement: select_statement */ #line 524 "parser.y" { (yyval.base_stmt) = (yyvsp[0].select_stmt); } -#line 3621 "parser.cpp" +#line 3626 "parser.cpp" break; case 10: /* statement: delete_statement */ #line 525 "parser.y" { (yyval.base_stmt) = (yyvsp[0].delete_stmt); } -#line 3627 "parser.cpp" +#line 3632 "parser.cpp" break; case 11: /* statement: update_statement */ #line 526 "parser.y" { (yyval.base_stmt) = (yyvsp[0].update_stmt); } -#line 3633 "parser.cpp" +#line 3638 "parser.cpp" break; case 12: /* statement: insert_statement */ #line 527 "parser.y" { (yyval.base_stmt) = (yyvsp[0].insert_stmt); } -#line 3639 "parser.cpp" +#line 3644 "parser.cpp" break; case 13: /* statement: explain_statement */ #line 528 "parser.y" { (yyval.base_stmt) = (yyvsp[0].explain_stmt); } -#line 3645 "parser.cpp" +#line 3650 "parser.cpp" break; case 14: /* statement: flush_statement */ #line 529 "parser.y" { (yyval.base_stmt) = (yyvsp[0].flush_stmt); } -#line 3651 "parser.cpp" +#line 3656 "parser.cpp" break; case 15: /* statement: optimize_statement */ #line 530 "parser.y" { (yyval.base_stmt) = (yyvsp[0].optimize_stmt); } -#line 3657 "parser.cpp" +#line 3662 "parser.cpp" break; case 16: /* statement: command_statement */ #line 531 "parser.y" { (yyval.base_stmt) = (yyvsp[0].command_stmt); } -#line 3663 "parser.cpp" +#line 3668 "parser.cpp" break; case 17: /* statement: compact_statement */ #line 532 "parser.y" { (yyval.base_stmt) = (yyvsp[0].compact_stmt); } -#line 3669 "parser.cpp" +#line 3674 "parser.cpp" break; case 18: /* statement: admin_statement */ #line 533 "parser.y" { (yyval.base_stmt) = (yyvsp[0].admin_stmt); } -#line 3675 "parser.cpp" +#line 3680 "parser.cpp" break; case 19: /* statement: alter_statement */ #line 534 "parser.y" { (yyval.base_stmt) = (yyvsp[0].alter_stmt); } -#line 3681 "parser.cpp" +#line 3686 "parser.cpp" break; case 20: /* explainable_statement: create_statement */ #line 536 "parser.y" { (yyval.base_stmt) = (yyvsp[0].create_stmt); } -#line 3687 "parser.cpp" +#line 3692 "parser.cpp" break; case 21: /* explainable_statement: drop_statement */ #line 537 "parser.y" { (yyval.base_stmt) = (yyvsp[0].drop_stmt); } -#line 3693 "parser.cpp" +#line 3698 "parser.cpp" break; case 22: /* explainable_statement: copy_statement */ #line 538 "parser.y" { (yyval.base_stmt) = (yyvsp[0].copy_stmt); } -#line 3699 "parser.cpp" +#line 3704 "parser.cpp" break; case 23: /* explainable_statement: show_statement */ #line 539 "parser.y" { (yyval.base_stmt) = (yyvsp[0].show_stmt); } -#line 3705 "parser.cpp" +#line 3710 "parser.cpp" break; case 24: /* explainable_statement: select_statement */ #line 540 "parser.y" { (yyval.base_stmt) = (yyvsp[0].select_stmt); } -#line 3711 "parser.cpp" +#line 3716 "parser.cpp" break; case 25: /* explainable_statement: delete_statement */ #line 541 "parser.y" { (yyval.base_stmt) = (yyvsp[0].delete_stmt); } -#line 3717 "parser.cpp" +#line 3722 "parser.cpp" break; case 26: /* explainable_statement: update_statement */ #line 542 "parser.y" { (yyval.base_stmt) = (yyvsp[0].update_stmt); } -#line 3723 "parser.cpp" +#line 3728 "parser.cpp" break; case 27: /* explainable_statement: insert_statement */ #line 543 "parser.y" { (yyval.base_stmt) = (yyvsp[0].insert_stmt); } -#line 3729 "parser.cpp" +#line 3734 "parser.cpp" break; case 28: /* explainable_statement: flush_statement */ #line 544 "parser.y" { (yyval.base_stmt) = (yyvsp[0].flush_stmt); } -#line 3735 "parser.cpp" +#line 3740 "parser.cpp" break; case 29: /* explainable_statement: optimize_statement */ #line 545 "parser.y" { (yyval.base_stmt) = (yyvsp[0].optimize_stmt); } -#line 3741 "parser.cpp" +#line 3746 "parser.cpp" break; case 30: /* explainable_statement: command_statement */ #line 546 "parser.y" { (yyval.base_stmt) = (yyvsp[0].command_stmt); } -#line 3747 "parser.cpp" +#line 3752 "parser.cpp" break; case 31: /* explainable_statement: compact_statement */ #line 547 "parser.y" { (yyval.base_stmt) = (yyvsp[0].compact_stmt); } -#line 3753 "parser.cpp" +#line 3758 "parser.cpp" break; case 32: /* create_statement: CREATE DATABASE if_not_exists IDENTIFIER COMMENT STRING */ @@ -3771,7 +3776,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.create_stmt)->create_info_->comment_ = (yyvsp[0].str_value); free((yyvsp[0].str_value)); } -#line 3775 "parser.cpp" +#line 3780 "parser.cpp" break; case 33: /* create_statement: CREATE DATABASE if_not_exists IDENTIFIER */ @@ -3791,7 +3796,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.create_stmt)->create_info_ = create_schema_info; (yyval.create_stmt)->create_info_->conflict_type_ = (yyvsp[-1].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; } -#line 3795 "parser.cpp" +#line 3800 "parser.cpp" break; case 34: /* create_statement: CREATE COLLECTION if_not_exists table_name */ @@ -3809,7 +3814,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.create_stmt)->create_info_->conflict_type_ = (yyvsp[-1].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; delete (yyvsp[0].table_name_t); } -#line 3813 "parser.cpp" +#line 3818 "parser.cpp" break; case 35: /* create_statement: CREATE TABLE if_not_exists table_name '(' table_element_array ')' optional_table_properties_list */ @@ -3842,7 +3847,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.create_stmt)->create_info_ = create_table_info; (yyval.create_stmt)->create_info_->conflict_type_ = (yyvsp[-5].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; } -#line 3846 "parser.cpp" +#line 3851 "parser.cpp" break; case 36: /* create_statement: CREATE TABLE if_not_exists table_name AS select_statement */ @@ -3862,7 +3867,7 @@ YYLTYPE yylloc = yyloc_default; create_table_info->select_ = (yyvsp[0].select_stmt); (yyval.create_stmt)->create_info_ = create_table_info; } -#line 3866 "parser.cpp" +#line 3871 "parser.cpp" break; case 37: /* create_statement: CREATE TABLE if_not_exists table_name '(' table_element_array ')' optional_table_properties_list COMMENT STRING */ @@ -3898,7 +3903,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.create_stmt)->create_info_ = create_table_info; (yyval.create_stmt)->create_info_->conflict_type_ = (yyvsp[-7].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; } -#line 3902 "parser.cpp" +#line 3907 "parser.cpp" break; case 38: /* create_statement: CREATE TABLE if_not_exists table_name AS select_statement COMMENT STRING */ @@ -3920,7 +3925,7 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[0].str_value)); (yyval.create_stmt)->create_info_ = create_table_info; } -#line 3924 "parser.cpp" +#line 3929 "parser.cpp" break; case 39: /* create_statement: CREATE VIEW if_not_exists table_name optional_identifier_array AS select_statement */ @@ -3941,7 +3946,7 @@ YYLTYPE yylloc = yyloc_default; create_view_info->conflict_type_ = (yyvsp[-4].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; (yyval.create_stmt)->create_info_ = create_view_info; } -#line 3945 "parser.cpp" +#line 3950 "parser.cpp" break; case 40: /* create_statement: CREATE INDEX if_not_exists_info ON table_name index_info */ @@ -3974,7 +3979,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.create_stmt) = new infinity::CreateStatement(); (yyval.create_stmt)->create_info_ = create_index_info; } -#line 3978 "parser.cpp" +#line 3983 "parser.cpp" break; case 41: /* create_statement: CREATE INDEX if_not_exists_info ON table_name index_info COMMENT STRING */ @@ -4009,7 +4014,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.create_stmt) = new infinity::CreateStatement(); (yyval.create_stmt)->create_info_ = create_index_info; } -#line 4013 "parser.cpp" +#line 4018 "parser.cpp" break; case 42: /* table_element_array: table_element */ @@ -4018,7 +4023,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.table_element_array_t) = new std::vector(); (yyval.table_element_array_t)->push_back((yyvsp[0].table_element_t)); } -#line 4022 "parser.cpp" +#line 4027 "parser.cpp" break; case 43: /* table_element_array: table_element_array ',' table_element */ @@ -4027,7 +4032,7 @@ YYLTYPE yylloc = yyloc_default; (yyvsp[-2].table_element_array_t)->push_back((yyvsp[0].table_element_t)); (yyval.table_element_array_t) = (yyvsp[-2].table_element_array_t); } -#line 4031 "parser.cpp" +#line 4036 "parser.cpp" break; case 44: /* column_def_array: table_column */ @@ -4036,7 +4041,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.column_def_array_t) = new std::vector(); (yyval.column_def_array_t)->push_back((yyvsp[0].table_column_t)); } -#line 4040 "parser.cpp" +#line 4045 "parser.cpp" break; case 45: /* column_def_array: column_def_array ',' table_column */ @@ -4045,7 +4050,7 @@ YYLTYPE yylloc = yyloc_default; (yyvsp[-2].column_def_array_t)->push_back((yyvsp[0].table_column_t)); (yyval.column_def_array_t) = (yyvsp[-2].column_def_array_t); } -#line 4049 "parser.cpp" +#line 4054 "parser.cpp" break; case 46: /* table_element: table_column */ @@ -4053,7 +4058,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.table_element_t) = (yyvsp[0].table_column_t); } -#line 4057 "parser.cpp" +#line 4062 "parser.cpp" break; case 47: /* table_element: table_constraint */ @@ -4061,7 +4066,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.table_element_t) = (yyvsp[0].table_constraint_t); } -#line 4065 "parser.cpp" +#line 4070 "parser.cpp" break; case 48: /* table_column: IDENTIFIER column_type with_index_param_list default_expr */ @@ -4117,7 +4122,7 @@ YYLTYPE yylloc = yyloc_default; } */ } -#line 4121 "parser.cpp" +#line 4126 "parser.cpp" break; case 49: /* table_column: IDENTIFIER column_type column_constraints default_expr */ @@ -4159,7 +4164,7 @@ YYLTYPE yylloc = yyloc_default; } */ } -#line 4163 "parser.cpp" +#line 4168 "parser.cpp" break; case 50: /* table_column: IDENTIFIER column_type with_index_param_list default_expr COMMENT STRING */ @@ -4216,7 +4221,7 @@ YYLTYPE yylloc = yyloc_default; } */ } -#line 4220 "parser.cpp" +#line 4225 "parser.cpp" break; case 51: /* table_column: IDENTIFIER column_type column_constraints default_expr COMMENT STRING */ @@ -4259,559 +4264,559 @@ YYLTYPE yylloc = yyloc_default; } */ } -#line 4263 "parser.cpp" +#line 4268 "parser.cpp" break; case 52: /* column_type: BOOLEAN */ #line 984 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kBoolean, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4269 "parser.cpp" +#line 4274 "parser.cpp" break; case 53: /* column_type: TINYINT */ #line 985 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTinyInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4275 "parser.cpp" +#line 4280 "parser.cpp" break; case 54: /* column_type: SMALLINT */ #line 986 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSmallInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4281 "parser.cpp" +#line 4286 "parser.cpp" break; case 55: /* column_type: INTEGER */ #line 987 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kInteger, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4287 "parser.cpp" +#line 4292 "parser.cpp" break; case 56: /* column_type: INT */ #line 988 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kInteger, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4293 "parser.cpp" +#line 4298 "parser.cpp" break; case 57: /* column_type: BIGINT */ #line 989 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kBigInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4299 "parser.cpp" +#line 4304 "parser.cpp" break; case 58: /* column_type: HUGEINT */ #line 990 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kHugeInt, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4305 "parser.cpp" +#line 4310 "parser.cpp" break; case 59: /* column_type: FLOAT */ #line 991 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kFloat, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4311 "parser.cpp" +#line 4316 "parser.cpp" break; case 60: /* column_type: REAL */ #line 992 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kFloat, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4317 "parser.cpp" +#line 4322 "parser.cpp" break; case 61: /* column_type: DOUBLE */ #line 993 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDouble, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4323 "parser.cpp" +#line 4328 "parser.cpp" break; case 62: /* column_type: FLOAT16 */ #line 994 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kFloat16, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4329 "parser.cpp" +#line 4334 "parser.cpp" break; case 63: /* column_type: BFLOAT16 */ #line 995 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kBFloat16, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4335 "parser.cpp" +#line 4340 "parser.cpp" break; case 64: /* column_type: DATE */ #line 996 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDate, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4341 "parser.cpp" +#line 4346 "parser.cpp" break; case 65: /* column_type: TIME */ #line 997 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTime, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4347 "parser.cpp" +#line 4352 "parser.cpp" break; case 66: /* column_type: DATETIME */ #line 998 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDateTime, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4353 "parser.cpp" +#line 4358 "parser.cpp" break; case 67: /* column_type: TIMESTAMP */ #line 999 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTimestamp, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4359 "parser.cpp" +#line 4364 "parser.cpp" break; case 68: /* column_type: UUID */ #line 1000 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kUuid, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4365 "parser.cpp" +#line 4370 "parser.cpp" break; case 69: /* column_type: POINT */ #line 1001 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kPoint, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4371 "parser.cpp" +#line 4376 "parser.cpp" break; case 70: /* column_type: LINE */ #line 1002 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kLine, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4377 "parser.cpp" +#line 4382 "parser.cpp" break; case 71: /* column_type: LSEG */ #line 1003 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kLineSeg, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4383 "parser.cpp" +#line 4388 "parser.cpp" break; case 72: /* column_type: BOX */ #line 1004 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kBox, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4389 "parser.cpp" +#line 4394 "parser.cpp" break; case 73: /* column_type: CIRCLE */ #line 1007 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kCircle, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4395 "parser.cpp" +#line 4400 "parser.cpp" break; case 74: /* column_type: VARCHAR */ #line 1009 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kVarchar, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4401 "parser.cpp" +#line 4406 "parser.cpp" break; case 75: /* column_type: DECIMAL '(' LONG_VALUE ',' LONG_VALUE ')' */ #line 1010 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDecimal, 0, (yyvsp[-3].long_value), (yyvsp[-1].long_value), infinity::EmbeddingDataType::kElemInvalid}; } -#line 4407 "parser.cpp" +#line 4412 "parser.cpp" break; case 76: /* column_type: DECIMAL '(' LONG_VALUE ')' */ #line 1011 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDecimal, 0, (yyvsp[-1].long_value), 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4413 "parser.cpp" +#line 4418 "parser.cpp" break; case 77: /* column_type: DECIMAL */ #line 1012 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kDecimal, 0, 0, 0, infinity::EmbeddingDataType::kElemInvalid}; } -#line 4419 "parser.cpp" +#line 4424 "parser.cpp" break; case 78: /* column_type: EMBEDDING '(' BIT ',' LONG_VALUE ')' */ #line 1015 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; } -#line 4425 "parser.cpp" +#line 4430 "parser.cpp" break; case 79: /* column_type: EMBEDDING '(' TINYINT ',' LONG_VALUE ')' */ #line 1016 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; } -#line 4431 "parser.cpp" +#line 4436 "parser.cpp" break; case 80: /* column_type: EMBEDDING '(' SMALLINT ',' LONG_VALUE ')' */ #line 1017 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; } -#line 4437 "parser.cpp" +#line 4442 "parser.cpp" break; case 81: /* column_type: EMBEDDING '(' INTEGER ',' LONG_VALUE ')' */ #line 1018 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } -#line 4443 "parser.cpp" +#line 4448 "parser.cpp" break; case 82: /* column_type: EMBEDDING '(' INT ',' LONG_VALUE ')' */ #line 1019 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } -#line 4449 "parser.cpp" +#line 4454 "parser.cpp" break; case 83: /* column_type: EMBEDDING '(' BIGINT ',' LONG_VALUE ')' */ #line 1020 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; } -#line 4455 "parser.cpp" +#line 4460 "parser.cpp" break; case 84: /* column_type: EMBEDDING '(' FLOAT ',' LONG_VALUE ')' */ #line 1021 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; } -#line 4461 "parser.cpp" +#line 4466 "parser.cpp" break; case 85: /* column_type: EMBEDDING '(' DOUBLE ',' LONG_VALUE ')' */ #line 1022 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; } -#line 4467 "parser.cpp" +#line 4472 "parser.cpp" break; case 86: /* column_type: EMBEDDING '(' FLOAT16 ',' LONG_VALUE ')' */ #line 1023 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat16}; } -#line 4473 "parser.cpp" +#line 4478 "parser.cpp" break; case 87: /* column_type: EMBEDDING '(' BFLOAT16 ',' LONG_VALUE ')' */ #line 1024 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBFloat16}; } -#line 4479 "parser.cpp" +#line 4484 "parser.cpp" break; case 88: /* column_type: EMBEDDING '(' UNSIGNED TINYINT ',' LONG_VALUE ')' */ #line 1025 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemUInt8}; } -#line 4485 "parser.cpp" +#line 4490 "parser.cpp" break; case 89: /* column_type: MULTIVECTOR '(' BIT ',' LONG_VALUE ')' */ #line 1026 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; } -#line 4491 "parser.cpp" +#line 4496 "parser.cpp" break; case 90: /* column_type: MULTIVECTOR '(' TINYINT ',' LONG_VALUE ')' */ #line 1027 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; } -#line 4497 "parser.cpp" +#line 4502 "parser.cpp" break; case 91: /* column_type: MULTIVECTOR '(' SMALLINT ',' LONG_VALUE ')' */ #line 1028 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; } -#line 4503 "parser.cpp" +#line 4508 "parser.cpp" break; case 92: /* column_type: MULTIVECTOR '(' INTEGER ',' LONG_VALUE ')' */ #line 1029 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } -#line 4509 "parser.cpp" +#line 4514 "parser.cpp" break; case 93: /* column_type: MULTIVECTOR '(' INT ',' LONG_VALUE ')' */ #line 1030 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } -#line 4515 "parser.cpp" +#line 4520 "parser.cpp" break; case 94: /* column_type: MULTIVECTOR '(' BIGINT ',' LONG_VALUE ')' */ #line 1031 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; } -#line 4521 "parser.cpp" +#line 4526 "parser.cpp" break; case 95: /* column_type: MULTIVECTOR '(' FLOAT ',' LONG_VALUE ')' */ #line 1032 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; } -#line 4527 "parser.cpp" +#line 4532 "parser.cpp" break; case 96: /* column_type: MULTIVECTOR '(' DOUBLE ',' LONG_VALUE ')' */ #line 1033 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; } -#line 4533 "parser.cpp" +#line 4538 "parser.cpp" break; case 97: /* column_type: MULTIVECTOR '(' FLOAT16 ',' LONG_VALUE ')' */ #line 1034 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat16}; } -#line 4539 "parser.cpp" +#line 4544 "parser.cpp" break; case 98: /* column_type: MULTIVECTOR '(' BFLOAT16 ',' LONG_VALUE ')' */ #line 1035 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBFloat16}; } -#line 4545 "parser.cpp" +#line 4550 "parser.cpp" break; case 99: /* column_type: MULTIVECTOR '(' UNSIGNED TINYINT ',' LONG_VALUE ')' */ #line 1036 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kMultiVector, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemUInt8}; } -#line 4551 "parser.cpp" +#line 4556 "parser.cpp" break; case 100: /* column_type: TENSOR '(' BIT ',' LONG_VALUE ')' */ #line 1037 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; } -#line 4557 "parser.cpp" +#line 4562 "parser.cpp" break; case 101: /* column_type: TENSOR '(' TINYINT ',' LONG_VALUE ')' */ #line 1038 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; } -#line 4563 "parser.cpp" +#line 4568 "parser.cpp" break; case 102: /* column_type: TENSOR '(' SMALLINT ',' LONG_VALUE ')' */ #line 1039 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; } -#line 4569 "parser.cpp" +#line 4574 "parser.cpp" break; case 103: /* column_type: TENSOR '(' INTEGER ',' LONG_VALUE ')' */ #line 1040 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } -#line 4575 "parser.cpp" +#line 4580 "parser.cpp" break; case 104: /* column_type: TENSOR '(' INT ',' LONG_VALUE ')' */ #line 1041 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } -#line 4581 "parser.cpp" +#line 4586 "parser.cpp" break; case 105: /* column_type: TENSOR '(' BIGINT ',' LONG_VALUE ')' */ #line 1042 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; } -#line 4587 "parser.cpp" +#line 4592 "parser.cpp" break; case 106: /* column_type: TENSOR '(' FLOAT ',' LONG_VALUE ')' */ #line 1043 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; } -#line 4593 "parser.cpp" +#line 4598 "parser.cpp" break; case 107: /* column_type: TENSOR '(' DOUBLE ',' LONG_VALUE ')' */ #line 1044 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; } -#line 4599 "parser.cpp" +#line 4604 "parser.cpp" break; case 108: /* column_type: TENSOR '(' FLOAT16 ',' LONG_VALUE ')' */ #line 1045 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat16}; } -#line 4605 "parser.cpp" +#line 4610 "parser.cpp" break; case 109: /* column_type: TENSOR '(' BFLOAT16 ',' LONG_VALUE ')' */ #line 1046 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBFloat16}; } -#line 4611 "parser.cpp" +#line 4616 "parser.cpp" break; case 110: /* column_type: TENSOR '(' UNSIGNED TINYINT ',' LONG_VALUE ')' */ #line 1047 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensor, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemUInt8}; } -#line 4617 "parser.cpp" +#line 4622 "parser.cpp" break; case 111: /* column_type: TENSORARRAY '(' BIT ',' LONG_VALUE ')' */ #line 1048 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; } -#line 4623 "parser.cpp" +#line 4628 "parser.cpp" break; case 112: /* column_type: TENSORARRAY '(' TINYINT ',' LONG_VALUE ')' */ #line 1049 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; } -#line 4629 "parser.cpp" +#line 4634 "parser.cpp" break; case 113: /* column_type: TENSORARRAY '(' SMALLINT ',' LONG_VALUE ')' */ #line 1050 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; } -#line 4635 "parser.cpp" +#line 4640 "parser.cpp" break; case 114: /* column_type: TENSORARRAY '(' INTEGER ',' LONG_VALUE ')' */ #line 1051 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } -#line 4641 "parser.cpp" +#line 4646 "parser.cpp" break; case 115: /* column_type: TENSORARRAY '(' INT ',' LONG_VALUE ')' */ #line 1052 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } -#line 4647 "parser.cpp" +#line 4652 "parser.cpp" break; case 116: /* column_type: TENSORARRAY '(' BIGINT ',' LONG_VALUE ')' */ #line 1053 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; } -#line 4653 "parser.cpp" +#line 4658 "parser.cpp" break; case 117: /* column_type: TENSORARRAY '(' FLOAT ',' LONG_VALUE ')' */ #line 1054 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; } -#line 4659 "parser.cpp" +#line 4664 "parser.cpp" break; case 118: /* column_type: TENSORARRAY '(' DOUBLE ',' LONG_VALUE ')' */ #line 1055 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; } -#line 4665 "parser.cpp" +#line 4670 "parser.cpp" break; case 119: /* column_type: TENSORARRAY '(' FLOAT16 ',' LONG_VALUE ')' */ #line 1056 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat16}; } -#line 4671 "parser.cpp" +#line 4676 "parser.cpp" break; case 120: /* column_type: TENSORARRAY '(' BFLOAT16 ',' LONG_VALUE ')' */ #line 1057 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBFloat16}; } -#line 4677 "parser.cpp" +#line 4682 "parser.cpp" break; case 121: /* column_type: TENSORARRAY '(' UNSIGNED TINYINT ',' LONG_VALUE ')' */ #line 1058 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kTensorArray, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemUInt8}; } -#line 4683 "parser.cpp" +#line 4688 "parser.cpp" break; case 122: /* column_type: VECTOR '(' BIT ',' LONG_VALUE ')' */ #line 1059 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; } -#line 4689 "parser.cpp" +#line 4694 "parser.cpp" break; case 123: /* column_type: VECTOR '(' TINYINT ',' LONG_VALUE ')' */ #line 1060 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; } -#line 4695 "parser.cpp" +#line 4700 "parser.cpp" break; case 124: /* column_type: VECTOR '(' SMALLINT ',' LONG_VALUE ')' */ #line 1061 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; } -#line 4701 "parser.cpp" +#line 4706 "parser.cpp" break; case 125: /* column_type: VECTOR '(' INTEGER ',' LONG_VALUE ')' */ #line 1062 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } -#line 4707 "parser.cpp" +#line 4712 "parser.cpp" break; case 126: /* column_type: VECTOR '(' INT ',' LONG_VALUE ')' */ #line 1063 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } -#line 4713 "parser.cpp" +#line 4718 "parser.cpp" break; case 127: /* column_type: VECTOR '(' BIGINT ',' LONG_VALUE ')' */ #line 1064 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; } -#line 4719 "parser.cpp" +#line 4724 "parser.cpp" break; case 128: /* column_type: VECTOR '(' FLOAT ',' LONG_VALUE ')' */ #line 1065 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; } -#line 4725 "parser.cpp" +#line 4730 "parser.cpp" break; case 129: /* column_type: VECTOR '(' DOUBLE ',' LONG_VALUE ')' */ #line 1066 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; } -#line 4731 "parser.cpp" +#line 4736 "parser.cpp" break; case 130: /* column_type: VECTOR '(' FLOAT16 ',' LONG_VALUE ')' */ #line 1067 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat16}; } -#line 4737 "parser.cpp" +#line 4742 "parser.cpp" break; case 131: /* column_type: VECTOR '(' BFLOAT16 ',' LONG_VALUE ')' */ #line 1068 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBFloat16}; } -#line 4743 "parser.cpp" +#line 4748 "parser.cpp" break; case 132: /* column_type: VECTOR '(' UNSIGNED TINYINT ',' LONG_VALUE ')' */ #line 1069 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kEmbedding, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemUInt8}; } -#line 4749 "parser.cpp" +#line 4754 "parser.cpp" break; case 133: /* column_type: SPARSE '(' BIT ',' LONG_VALUE ')' */ #line 1070 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBit}; } -#line 4755 "parser.cpp" +#line 4760 "parser.cpp" break; case 134: /* column_type: SPARSE '(' TINYINT ',' LONG_VALUE ')' */ #line 1071 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt8}; } -#line 4761 "parser.cpp" +#line 4766 "parser.cpp" break; case 135: /* column_type: SPARSE '(' SMALLINT ',' LONG_VALUE ')' */ #line 1072 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt16}; } -#line 4767 "parser.cpp" +#line 4772 "parser.cpp" break; case 136: /* column_type: SPARSE '(' INTEGER ',' LONG_VALUE ')' */ #line 1073 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } -#line 4773 "parser.cpp" +#line 4778 "parser.cpp" break; case 137: /* column_type: SPARSE '(' INT ',' LONG_VALUE ')' */ #line 1074 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt32}; } -#line 4779 "parser.cpp" +#line 4784 "parser.cpp" break; case 138: /* column_type: SPARSE '(' BIGINT ',' LONG_VALUE ')' */ #line 1075 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemInt64}; } -#line 4785 "parser.cpp" +#line 4790 "parser.cpp" break; case 139: /* column_type: SPARSE '(' FLOAT ',' LONG_VALUE ')' */ #line 1076 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat}; } -#line 4791 "parser.cpp" +#line 4796 "parser.cpp" break; case 140: /* column_type: SPARSE '(' DOUBLE ',' LONG_VALUE ')' */ #line 1077 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemDouble}; } -#line 4797 "parser.cpp" +#line 4802 "parser.cpp" break; case 141: /* column_type: SPARSE '(' FLOAT16 ',' LONG_VALUE ')' */ #line 1078 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemFloat16}; } -#line 4803 "parser.cpp" +#line 4808 "parser.cpp" break; case 142: /* column_type: SPARSE '(' BFLOAT16 ',' LONG_VALUE ')' */ #line 1079 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemBFloat16}; } -#line 4809 "parser.cpp" +#line 4814 "parser.cpp" break; case 143: /* column_type: SPARSE '(' UNSIGNED TINYINT ',' LONG_VALUE ')' */ #line 1080 "parser.y" { (yyval.column_type_t) = infinity::ColumnType{infinity::LogicalType::kSparse, (yyvsp[-1].long_value), 0, 0, infinity::EmbeddingDataType::kElemUInt8}; } -#line 4815 "parser.cpp" +#line 4820 "parser.cpp" break; case 144: /* column_constraints: column_constraint */ @@ -4820,7 +4825,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.column_constraints_t) = new std::set(); (yyval.column_constraints_t)->insert((yyvsp[0].column_constraint_t)); } -#line 4824 "parser.cpp" +#line 4829 "parser.cpp" break; case 145: /* column_constraints: column_constraints column_constraint */ @@ -4834,7 +4839,7 @@ YYLTYPE yylloc = yyloc_default; (yyvsp[-1].column_constraints_t)->insert((yyvsp[0].column_constraint_t)); (yyval.column_constraints_t) = (yyvsp[-1].column_constraints_t); } -#line 4838 "parser.cpp" +#line 4843 "parser.cpp" break; case 146: /* column_constraint: PRIMARY KEY */ @@ -4842,7 +4847,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.column_constraint_t) = infinity::ConstraintType::kPrimaryKey; } -#line 4846 "parser.cpp" +#line 4851 "parser.cpp" break; case 147: /* column_constraint: UNIQUE */ @@ -4850,7 +4855,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.column_constraint_t) = infinity::ConstraintType::kUnique; } -#line 4854 "parser.cpp" +#line 4859 "parser.cpp" break; case 148: /* column_constraint: NULLABLE */ @@ -4858,7 +4863,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.column_constraint_t) = infinity::ConstraintType::kNull; } -#line 4862 "parser.cpp" +#line 4867 "parser.cpp" break; case 149: /* column_constraint: NOT NULLABLE */ @@ -4866,7 +4871,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.column_constraint_t) = infinity::ConstraintType::kNotNull; } -#line 4870 "parser.cpp" +#line 4875 "parser.cpp" break; case 150: /* default_expr: DEFAULT constant_expr */ @@ -4874,7 +4879,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.const_expr_t) = (yyvsp[0].const_expr_t); } -#line 4878 "parser.cpp" +#line 4883 "parser.cpp" break; case 151: /* default_expr: %empty */ @@ -4882,7 +4887,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.const_expr_t) = nullptr; } -#line 4886 "parser.cpp" +#line 4891 "parser.cpp" break; case 152: /* table_constraint: PRIMARY KEY '(' identifier_array ')' */ @@ -4892,7 +4897,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.table_constraint_t)->names_ptr_ = (yyvsp[-1].identifier_array_t); (yyval.table_constraint_t)->constraint_ = infinity::ConstraintType::kPrimaryKey; } -#line 4896 "parser.cpp" +#line 4901 "parser.cpp" break; case 153: /* table_constraint: UNIQUE '(' identifier_array ')' */ @@ -4902,7 +4907,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.table_constraint_t)->names_ptr_ = (yyvsp[-1].identifier_array_t); (yyval.table_constraint_t)->constraint_ = infinity::ConstraintType::kUnique; } -#line 4906 "parser.cpp" +#line 4911 "parser.cpp" break; case 154: /* identifier_array: IDENTIFIER */ @@ -4913,7 +4918,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.identifier_array_t)->emplace_back((yyvsp[0].str_value)); free((yyvsp[0].str_value)); } -#line 4917 "parser.cpp" +#line 4922 "parser.cpp" break; case 155: /* identifier_array: identifier_array ',' IDENTIFIER */ @@ -4924,7 +4929,7 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[0].str_value)); (yyval.identifier_array_t) = (yyvsp[-2].identifier_array_t); } -#line 4928 "parser.cpp" +#line 4933 "parser.cpp" break; case 156: /* delete_statement: DELETE FROM table_name where_clause */ @@ -4941,7 +4946,7 @@ YYLTYPE yylloc = yyloc_default; delete (yyvsp[-1].table_name_t); (yyval.delete_stmt)->where_expr_ = (yyvsp[0].expr_t); } -#line 4945 "parser.cpp" +#line 4950 "parser.cpp" break; case 157: /* insert_statement: INSERT INTO table_name optional_identifier_array VALUES insert_row_list */ @@ -4984,7 +4989,7 @@ YYLTYPE yylloc = yyloc_default; delete (yyvsp[-2].identifier_array_t); delete (yyvsp[0].insert_row_list_t); } -#line 4988 "parser.cpp" +#line 4993 "parser.cpp" break; case 158: /* insert_statement: INSERT INTO table_name optional_identifier_array select_without_paren */ @@ -5004,7 +5009,7 @@ YYLTYPE yylloc = yyloc_default; } (yyval.insert_stmt)->select_.reset((yyvsp[0].select_stmt)); } -#line 5008 "parser.cpp" +#line 5013 "parser.cpp" break; case 159: /* optional_identifier_array: '(' identifier_array ')' */ @@ -5012,7 +5017,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.identifier_array_t) = (yyvsp[-1].identifier_array_t); } -#line 5016 "parser.cpp" +#line 5021 "parser.cpp" break; case 160: /* optional_identifier_array: %empty */ @@ -5020,7 +5025,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.identifier_array_t) = nullptr; } -#line 5024 "parser.cpp" +#line 5029 "parser.cpp" break; case 161: /* explain_statement: EXPLAIN IDENTIFIER explainable_statement */ @@ -5038,7 +5043,7 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-1].str_value)); (yyval.explain_stmt)->statement_ = (yyvsp[0].base_stmt); } -#line 5042 "parser.cpp" +#line 5047 "parser.cpp" break; case 162: /* explain_statement: EXPLAIN explainable_statement */ @@ -5048,7 +5053,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.explain_stmt)->type_ =infinity::ExplainType::kPhysical; (yyval.explain_stmt)->statement_ = (yyvsp[0].base_stmt); } -#line 5052 "parser.cpp" +#line 5057 "parser.cpp" break; case 163: /* update_statement: UPDATE table_name SET update_expr_array where_clause */ @@ -5065,7 +5070,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.update_stmt)->where_expr_ = (yyvsp[0].expr_t); (yyval.update_stmt)->update_expr_array_ = (yyvsp[-1].update_expr_array_t); } -#line 5069 "parser.cpp" +#line 5074 "parser.cpp" break; case 164: /* update_expr_array: update_expr */ @@ -5074,7 +5079,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.update_expr_array_t) = new std::vector(); (yyval.update_expr_array_t)->emplace_back((yyvsp[0].update_expr_t)); } -#line 5078 "parser.cpp" +#line 5083 "parser.cpp" break; case 165: /* update_expr_array: update_expr_array ',' update_expr */ @@ -5083,7 +5088,7 @@ YYLTYPE yylloc = yyloc_default; (yyvsp[-2].update_expr_array_t)->emplace_back((yyvsp[0].update_expr_t)); (yyval.update_expr_array_t) = (yyvsp[-2].update_expr_array_t); } -#line 5087 "parser.cpp" +#line 5092 "parser.cpp" break; case 166: /* update_expr: IDENTIFIER '=' expr */ @@ -5095,7 +5100,7 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-2].str_value)); (yyval.update_expr_t)->value = (yyvsp[0].expr_t); } -#line 5099 "parser.cpp" +#line 5104 "parser.cpp" break; case 167: /* drop_statement: DROP DATABASE if_exists IDENTIFIER */ @@ -5111,7 +5116,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.drop_stmt)->drop_info_ = drop_schema_info; (yyval.drop_stmt)->drop_info_->conflict_type_ = (yyvsp[-1].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; } -#line 5115 "parser.cpp" +#line 5120 "parser.cpp" break; case 168: /* drop_statement: DROP COLLECTION if_exists table_name */ @@ -5129,7 +5134,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.drop_stmt)->drop_info_->conflict_type_ = (yyvsp[-1].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; delete (yyvsp[0].table_name_t); } -#line 5133 "parser.cpp" +#line 5138 "parser.cpp" break; case 169: /* drop_statement: DROP TABLE if_exists table_name */ @@ -5147,7 +5152,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.drop_stmt)->drop_info_->conflict_type_ = (yyvsp[-1].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; delete (yyvsp[0].table_name_t); } -#line 5151 "parser.cpp" +#line 5156 "parser.cpp" break; case 170: /* drop_statement: DROP VIEW if_exists table_name */ @@ -5165,7 +5170,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.drop_stmt)->drop_info_->conflict_type_ = (yyvsp[-1].bool_value) ? infinity::ConflictType::kIgnore : infinity::ConflictType::kError; delete (yyvsp[0].table_name_t); } -#line 5169 "parser.cpp" +#line 5174 "parser.cpp" break; case 171: /* drop_statement: DROP INDEX if_exists IDENTIFIER ON table_name */ @@ -5188,7 +5193,7 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[0].table_name_t)->table_name_ptr_); delete (yyvsp[0].table_name_t); } -#line 5192 "parser.cpp" +#line 5197 "parser.cpp" break; case 172: /* copy_statement: COPY table_name TO file_path WITH '(' copy_option_list ')' */ @@ -5246,7 +5251,7 @@ YYLTYPE yylloc = yyloc_default; } delete (yyvsp[-1].copy_option_array); } -#line 5250 "parser.cpp" +#line 5255 "parser.cpp" break; case 173: /* copy_statement: COPY table_name '(' expr_array ')' TO file_path WITH '(' copy_option_list ')' */ @@ -5306,7 +5311,7 @@ YYLTYPE yylloc = yyloc_default; } delete (yyvsp[-1].copy_option_array); } -#line 5310 "parser.cpp" +#line 5315 "parser.cpp" break; case 174: /* copy_statement: COPY table_name FROM file_path WITH '(' copy_option_list ')' */ @@ -5358,7 +5363,7 @@ YYLTYPE yylloc = yyloc_default; } delete (yyvsp[-1].copy_option_array); } -#line 5362 "parser.cpp" +#line 5367 "parser.cpp" break; case 175: /* select_statement: select_without_paren */ @@ -5366,7 +5371,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.select_stmt) = (yyvsp[0].select_stmt); } -#line 5370 "parser.cpp" +#line 5375 "parser.cpp" break; case 176: /* select_statement: select_with_paren */ @@ -5374,7 +5379,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.select_stmt) = (yyvsp[0].select_stmt); } -#line 5378 "parser.cpp" +#line 5383 "parser.cpp" break; case 177: /* select_statement: select_statement set_operator select_clause_without_modifier_paren */ @@ -5388,7 +5393,7 @@ YYLTYPE yylloc = yyloc_default; node->nested_select_ = (yyvsp[0].select_stmt); (yyval.select_stmt) = (yyvsp[-2].select_stmt); } -#line 5392 "parser.cpp" +#line 5397 "parser.cpp" break; case 178: /* select_statement: select_statement set_operator select_clause_without_modifier */ @@ -5402,7 +5407,7 @@ YYLTYPE yylloc = yyloc_default; node->nested_select_ = (yyvsp[0].select_stmt); (yyval.select_stmt) = (yyvsp[-2].select_stmt); } -#line 5406 "parser.cpp" +#line 5411 "parser.cpp" break; case 179: /* select_with_paren: '(' select_without_paren ')' */ @@ -5410,7 +5415,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 5414 "parser.cpp" +#line 5419 "parser.cpp" break; case 180: /* select_with_paren: '(' select_with_paren ')' */ @@ -5418,7 +5423,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 5422 "parser.cpp" +#line 5427 "parser.cpp" break; case 181: /* select_without_paren: with_clause select_clause_with_modifier */ @@ -5427,7 +5432,7 @@ YYLTYPE yylloc = yyloc_default; (yyvsp[0].select_stmt)->with_exprs_ = (yyvsp[-1].with_expr_list_t); (yyval.select_stmt) = (yyvsp[0].select_stmt); } -#line 5431 "parser.cpp" +#line 5436 "parser.cpp" break; case 182: /* select_clause_with_modifier: select_clause_without_modifier order_by_clause limit_expr offset_expr */ @@ -5458,7 +5463,7 @@ YYLTYPE yylloc = yyloc_default; (yyvsp[-3].select_stmt)->offset_expr_ = (yyvsp[0].expr_t); (yyval.select_stmt) = (yyvsp[-3].select_stmt); } -#line 5462 "parser.cpp" +#line 5467 "parser.cpp" break; case 183: /* select_clause_without_modifier_paren: '(' select_clause_without_modifier ')' */ @@ -5466,7 +5471,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 5470 "parser.cpp" +#line 5475 "parser.cpp" break; case 184: /* select_clause_without_modifier_paren: '(' select_clause_without_modifier_paren ')' */ @@ -5474,7 +5479,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } -#line 5478 "parser.cpp" +#line 5483 "parser.cpp" break; case 185: /* select_clause_without_modifier: SELECT distinct expr_array highlight_clause from_clause unnest_clause search_clause where_clause group_by_clause having_clause */ @@ -5496,7 +5501,7 @@ YYLTYPE yylloc = yyloc_default; YYERROR; } } -#line 5500 "parser.cpp" +#line 5505 "parser.cpp" break; case 186: /* order_by_clause: ORDER BY order_by_expr_list */ @@ -5504,7 +5509,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.order_by_expr_list_t) = (yyvsp[0].order_by_expr_list_t); } -#line 5508 "parser.cpp" +#line 5513 "parser.cpp" break; case 187: /* order_by_clause: %empty */ @@ -5512,7 +5517,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.order_by_expr_list_t) = nullptr; } -#line 5516 "parser.cpp" +#line 5521 "parser.cpp" break; case 188: /* order_by_expr_list: order_by_expr */ @@ -5521,7 +5526,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.order_by_expr_list_t) = new std::vector(); (yyval.order_by_expr_list_t)->emplace_back((yyvsp[0].order_by_expr_t)); } -#line 5525 "parser.cpp" +#line 5530 "parser.cpp" break; case 189: /* order_by_expr_list: order_by_expr_list ',' order_by_expr */ @@ -5530,7 +5535,7 @@ YYLTYPE yylloc = yyloc_default; (yyvsp[-2].order_by_expr_list_t)->emplace_back((yyvsp[0].order_by_expr_t)); (yyval.order_by_expr_list_t) = (yyvsp[-2].order_by_expr_list_t); } -#line 5534 "parser.cpp" +#line 5539 "parser.cpp" break; case 190: /* order_by_expr: expr order_by_type */ @@ -5540,7 +5545,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.order_by_expr_t)->expr_ = (yyvsp[-1].expr_t); (yyval.order_by_expr_t)->type_ = (yyvsp[0].order_by_type_t); } -#line 5544 "parser.cpp" +#line 5549 "parser.cpp" break; case 191: /* order_by_type: ASC */ @@ -5548,7 +5553,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.order_by_type_t) = infinity::kAsc; } -#line 5552 "parser.cpp" +#line 5557 "parser.cpp" break; case 192: /* order_by_type: DESC */ @@ -5556,7 +5561,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.order_by_type_t) = infinity::kDesc; } -#line 5560 "parser.cpp" +#line 5565 "parser.cpp" break; case 193: /* order_by_type: %empty */ @@ -5564,7 +5569,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.order_by_type_t) = infinity::kAsc; } -#line 5568 "parser.cpp" +#line 5573 "parser.cpp" break; case 194: /* limit_expr: LIMIT expr */ @@ -5572,13 +5577,13 @@ YYLTYPE yylloc = yyloc_default; { (yyval.expr_t) = (yyvsp[0].expr_t); } -#line 5576 "parser.cpp" +#line 5581 "parser.cpp" break; case 195: /* limit_expr: %empty */ #line 1664 "parser.y" { (yyval.expr_t) = nullptr; } -#line 5582 "parser.cpp" +#line 5587 "parser.cpp" break; case 196: /* offset_expr: OFFSET expr */ @@ -5586,13 +5591,13 @@ YYLTYPE yylloc = yyloc_default; { (yyval.expr_t) = (yyvsp[0].expr_t); } -#line 5590 "parser.cpp" +#line 5595 "parser.cpp" break; case 197: /* offset_expr: %empty */ #line 1670 "parser.y" { (yyval.expr_t) = nullptr; } -#line 5596 "parser.cpp" +#line 5601 "parser.cpp" break; case 198: /* distinct: DISTINCT */ @@ -5600,7 +5605,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.bool_value) = true; } -#line 5604 "parser.cpp" +#line 5609 "parser.cpp" break; case 199: /* distinct: %empty */ @@ -5608,7 +5613,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.bool_value) = false; } -#line 5612 "parser.cpp" +#line 5617 "parser.cpp" break; case 200: /* unnest_clause: UNNEST expr_array */ @@ -5616,7 +5621,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.expr_array_t) = (yyvsp[0].expr_array_t); } -#line 5620 "parser.cpp" +#line 5625 "parser.cpp" break; case 201: /* unnest_clause: %empty */ @@ -5624,7 +5629,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.expr_array_t) = nullptr; } -#line 5628 "parser.cpp" +#line 5633 "parser.cpp" break; case 202: /* highlight_clause: HIGHLIGHT expr_array */ @@ -5632,7 +5637,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.expr_array_t) = (yyvsp[0].expr_array_t); } -#line 5636 "parser.cpp" +#line 5641 "parser.cpp" break; case 203: /* highlight_clause: %empty */ @@ -5640,7 +5645,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.expr_array_t) = nullptr; } -#line 5644 "parser.cpp" +#line 5649 "parser.cpp" break; case 204: /* from_clause: FROM table_reference */ @@ -5648,7 +5653,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.table_reference_t) = (yyvsp[0].table_reference_t); } -#line 5652 "parser.cpp" +#line 5657 "parser.cpp" break; case 205: /* from_clause: %empty */ @@ -5656,7 +5661,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.table_reference_t) = nullptr; } -#line 5660 "parser.cpp" +#line 5665 "parser.cpp" break; case 206: /* search_clause: SEARCH sub_search_array */ @@ -5666,7 +5671,7 @@ YYLTYPE yylloc = yyloc_default; search_expr->SetExprs((yyvsp[0].expr_array_t)); (yyval.expr_t) = search_expr; } -#line 5670 "parser.cpp" +#line 5675 "parser.cpp" break; case 207: /* search_clause: %empty */ @@ -5674,7 +5679,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.expr_t) = nullptr; } -#line 5678 "parser.cpp" +#line 5683 "parser.cpp" break; case 208: /* optional_search_filter_expr: ',' WHERE expr */ @@ -5682,7 +5687,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.expr_t) = (yyvsp[0].expr_t); } -#line 5686 "parser.cpp" +#line 5691 "parser.cpp" break; case 209: /* optional_search_filter_expr: %empty */ @@ -5690,7 +5695,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.expr_t) = nullptr; } -#line 5694 "parser.cpp" +#line 5699 "parser.cpp" break; case 210: /* where_clause: WHERE expr */ @@ -5698,7 +5703,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.expr_t) = (yyvsp[0].expr_t); } -#line 5702 "parser.cpp" +#line 5707 "parser.cpp" break; case 211: /* where_clause: %empty */ @@ -5706,7 +5711,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.expr_t) = nullptr; } -#line 5710 "parser.cpp" +#line 5715 "parser.cpp" break; case 212: /* having_clause: HAVING expr */ @@ -5714,7 +5719,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.expr_t) = (yyvsp[0].expr_t); } -#line 5718 "parser.cpp" +#line 5723 "parser.cpp" break; case 213: /* having_clause: %empty */ @@ -5722,7 +5727,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.expr_t) = nullptr; } -#line 5726 "parser.cpp" +#line 5731 "parser.cpp" break; case 214: /* group_by_clause: GROUP BY expr_array */ @@ -5730,7 +5735,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.expr_array_t) = (yyvsp[0].expr_array_t); } -#line 5734 "parser.cpp" +#line 5739 "parser.cpp" break; case 215: /* group_by_clause: %empty */ @@ -5738,7 +5743,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.expr_array_t) = nullptr; } -#line 5742 "parser.cpp" +#line 5747 "parser.cpp" break; case 216: /* set_operator: UNION */ @@ -5746,7 +5751,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.set_operator_t) = infinity::SetOperatorType::kUnion; } -#line 5750 "parser.cpp" +#line 5755 "parser.cpp" break; case 217: /* set_operator: UNION ALL */ @@ -5754,7 +5759,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.set_operator_t) = infinity::SetOperatorType::kUnionAll; } -#line 5758 "parser.cpp" +#line 5763 "parser.cpp" break; case 218: /* set_operator: INTERSECT */ @@ -5762,7 +5767,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.set_operator_t) = infinity::SetOperatorType::kIntersect; } -#line 5766 "parser.cpp" +#line 5771 "parser.cpp" break; case 219: /* set_operator: EXCEPT */ @@ -5770,7 +5775,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.set_operator_t) = infinity::SetOperatorType::kExcept; } -#line 5774 "parser.cpp" +#line 5779 "parser.cpp" break; case 220: /* table_reference: table_reference_unit */ @@ -5778,7 +5783,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.table_reference_t) = (yyvsp[0].table_reference_t); } -#line 5782 "parser.cpp" +#line 5787 "parser.cpp" break; case 221: /* table_reference: table_reference ',' table_reference_unit */ @@ -5796,7 +5801,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.table_reference_t) = cross_product_ref; } -#line 5800 "parser.cpp" +#line 5805 "parser.cpp" break; case 224: /* table_reference_name: table_name table_alias */ @@ -5814,7 +5819,7 @@ YYLTYPE yylloc = yyloc_default; table_ref->alias_ = (yyvsp[0].table_alias_t); (yyval.table_reference_t) = table_ref; } -#line 5818 "parser.cpp" +#line 5823 "parser.cpp" break; case 225: /* table_reference_name: '(' select_statement ')' table_alias */ @@ -5825,7 +5830,7 @@ YYLTYPE yylloc = yyloc_default; subquery_reference->alias_ = (yyvsp[0].table_alias_t); (yyval.table_reference_t) = subquery_reference; } -#line 5829 "parser.cpp" +#line 5834 "parser.cpp" break; case 226: /* table_name: IDENTIFIER */ @@ -5835,7 +5840,7 @@ YYLTYPE yylloc = yyloc_default; ParserHelper::ToLower((yyvsp[0].str_value)); (yyval.table_name_t)->table_name_ptr_ = (yyvsp[0].str_value); } -#line 5839 "parser.cpp" +#line 5844 "parser.cpp" break; case 227: /* table_name: IDENTIFIER '.' IDENTIFIER */ @@ -5847,7 +5852,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.table_name_t)->schema_name_ptr_ = (yyvsp[-2].str_value); (yyval.table_name_t)->table_name_ptr_ = (yyvsp[0].str_value); } -#line 5851 "parser.cpp" +#line 5856 "parser.cpp" break; case 228: /* table_alias: AS IDENTIFIER */ @@ -5857,7 +5862,7 @@ YYLTYPE yylloc = yyloc_default; ParserHelper::ToLower((yyvsp[0].str_value)); (yyval.table_alias_t)->alias_ = (yyvsp[0].str_value); } -#line 5861 "parser.cpp" +#line 5866 "parser.cpp" break; case 229: /* table_alias: IDENTIFIER */ @@ -5867,7 +5872,7 @@ YYLTYPE yylloc = yyloc_default; ParserHelper::ToLower((yyvsp[0].str_value)); (yyval.table_alias_t)->alias_ = (yyvsp[0].str_value); } -#line 5871 "parser.cpp" +#line 5876 "parser.cpp" break; case 230: /* table_alias: AS IDENTIFIER '(' identifier_array ')' */ @@ -5878,7 +5883,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.table_alias_t)->alias_ = (yyvsp[-3].str_value); (yyval.table_alias_t)->column_alias_array_ = (yyvsp[-1].identifier_array_t); } -#line 5882 "parser.cpp" +#line 5887 "parser.cpp" break; case 231: /* table_alias: %empty */ @@ -5886,7 +5891,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.table_alias_t) = nullptr; } -#line 5890 "parser.cpp" +#line 5895 "parser.cpp" break; case 232: /* with_clause: WITH with_expr_list */ @@ -5894,7 +5899,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.with_expr_list_t) = (yyvsp[0].with_expr_list_t); } -#line 5898 "parser.cpp" +#line 5903 "parser.cpp" break; case 233: /* with_clause: %empty */ @@ -5902,7 +5907,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.with_expr_list_t) = nullptr; } -#line 5906 "parser.cpp" +#line 5911 "parser.cpp" break; case 234: /* with_expr_list: with_expr */ @@ -5911,7 +5916,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.with_expr_list_t) = new std::vector(); (yyval.with_expr_list_t)->emplace_back((yyvsp[0].with_expr_t)); } -#line 5915 "parser.cpp" +#line 5920 "parser.cpp" break; case 235: /* with_expr_list: with_expr_list ',' with_expr */ @@ -5920,7 +5925,7 @@ YYLTYPE yylloc = yyloc_default; (yyvsp[-2].with_expr_list_t)->emplace_back((yyvsp[0].with_expr_t)); (yyval.with_expr_list_t) = (yyvsp[-2].with_expr_list_t); } -#line 5924 "parser.cpp" +#line 5929 "parser.cpp" break; case 236: /* with_expr: IDENTIFIER AS '(' select_clause_with_modifier ')' */ @@ -5932,7 +5937,7 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-4].str_value)); (yyval.with_expr_t)->select_ = (yyvsp[-1].select_stmt); } -#line 5936 "parser.cpp" +#line 5941 "parser.cpp" break; case 237: /* join_clause: table_reference_unit NATURAL JOIN table_reference_name */ @@ -5944,7 +5949,7 @@ YYLTYPE yylloc = yyloc_default; join_reference->join_type_ = infinity::JoinType::kNatural; (yyval.table_reference_t) = join_reference; } -#line 5948 "parser.cpp" +#line 5953 "parser.cpp" break; case 238: /* join_clause: table_reference_unit join_type JOIN table_reference_name ON expr */ @@ -5957,7 +5962,7 @@ YYLTYPE yylloc = yyloc_default; join_reference->condition_ = (yyvsp[0].expr_t); (yyval.table_reference_t) = join_reference; } -#line 5961 "parser.cpp" +#line 5966 "parser.cpp" break; case 239: /* join_type: INNER */ @@ -5965,7 +5970,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.join_type_t) = infinity::JoinType::kInner; } -#line 5969 "parser.cpp" +#line 5974 "parser.cpp" break; case 240: /* join_type: LEFT */ @@ -5973,7 +5978,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.join_type_t) = infinity::JoinType::kLeft; } -#line 5977 "parser.cpp" +#line 5982 "parser.cpp" break; case 241: /* join_type: RIGHT */ @@ -5981,7 +5986,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.join_type_t) = infinity::JoinType::kRight; } -#line 5985 "parser.cpp" +#line 5990 "parser.cpp" break; case 242: /* join_type: OUTER */ @@ -5989,7 +5994,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.join_type_t) = infinity::JoinType::kFull; } -#line 5993 "parser.cpp" +#line 5998 "parser.cpp" break; case 243: /* join_type: FULL */ @@ -5997,7 +6002,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.join_type_t) = infinity::JoinType::kFull; } -#line 6001 "parser.cpp" +#line 6006 "parser.cpp" break; case 244: /* join_type: CROSS */ @@ -6005,14 +6010,14 @@ YYLTYPE yylloc = yyloc_default; { (yyval.join_type_t) = infinity::JoinType::kCross; } -#line 6009 "parser.cpp" +#line 6014 "parser.cpp" break; case 245: /* join_type: %empty */ #line 1900 "parser.y" { } -#line 6016 "parser.cpp" +#line 6021 "parser.cpp" break; case 246: /* show_statement: SHOW DATABASES */ @@ -6021,7 +6026,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kDatabases; } -#line 6025 "parser.cpp" +#line 6030 "parser.cpp" break; case 247: /* show_statement: SHOW TABLES */ @@ -6030,7 +6035,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kTables; } -#line 6034 "parser.cpp" +#line 6039 "parser.cpp" break; case 248: /* show_statement: SHOW VIEWS */ @@ -6039,7 +6044,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kViews; } -#line 6043 "parser.cpp" +#line 6048 "parser.cpp" break; case 249: /* show_statement: SHOW CONFIGS */ @@ -6048,7 +6053,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kConfigs; } -#line 6052 "parser.cpp" +#line 6057 "parser.cpp" break; case 250: /* show_statement: SHOW CONFIG IDENTIFIER */ @@ -6060,7 +6065,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.show_stmt)->var_name_ = std::string((yyvsp[0].str_value)); free((yyvsp[0].str_value)); } -#line 6064 "parser.cpp" +#line 6069 "parser.cpp" break; case 251: /* show_statement: SHOW PROFILES */ @@ -6069,7 +6074,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kProfiles; } -#line 6073 "parser.cpp" +#line 6078 "parser.cpp" break; case 252: /* show_statement: SHOW BUFFER */ @@ -6078,7 +6083,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kBuffer; } -#line 6082 "parser.cpp" +#line 6087 "parser.cpp" break; case 253: /* show_statement: SHOW MEMINDEX */ @@ -6087,7 +6092,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kMemIndex; } -#line 6091 "parser.cpp" +#line 6096 "parser.cpp" break; case 254: /* show_statement: SHOW QUERIES */ @@ -6096,7 +6101,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kQueries; } -#line 6100 "parser.cpp" +#line 6105 "parser.cpp" break; case 255: /* show_statement: SHOW QUERY LONG_VALUE */ @@ -6106,7 +6111,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kQuery; (yyval.show_stmt)->session_id_ = (yyvsp[0].long_value); } -#line 6110 "parser.cpp" +#line 6115 "parser.cpp" break; case 256: /* show_statement: SHOW TRANSACTIONS */ @@ -6115,7 +6120,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kTransactions; } -#line 6119 "parser.cpp" +#line 6124 "parser.cpp" break; case 257: /* show_statement: SHOW TRANSACTION LONG_VALUE */ @@ -6125,62 +6130,71 @@ YYLTYPE yylloc = yyloc_default; (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kTransaction; (yyval.show_stmt)->txn_id_ = (yyvsp[0].long_value); } -#line 6129 "parser.cpp" +#line 6134 "parser.cpp" break; - case 258: /* show_statement: SHOW SESSION VARIABLES */ + case 258: /* show_statement: SHOW TRANSACTION HISTORY */ #line 1959 "parser.y" + { + (yyval.show_stmt) = new infinity::ShowStatement(); + (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kTransactionHistory; +} +#line 6143 "parser.cpp" + break; + + case 259: /* show_statement: SHOW SESSION VARIABLES */ +#line 1963 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kSessionVariables; } -#line 6138 "parser.cpp" +#line 6152 "parser.cpp" break; - case 259: /* show_statement: SHOW GLOBAL VARIABLES */ -#line 1963 "parser.y" + case 260: /* show_statement: SHOW GLOBAL VARIABLES */ +#line 1967 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kGlobalVariables; } -#line 6147 "parser.cpp" +#line 6161 "parser.cpp" break; - case 260: /* show_statement: SHOW SESSION VARIABLE IDENTIFIER */ -#line 1967 "parser.y" + case 261: /* show_statement: SHOW SESSION VARIABLE IDENTIFIER */ +#line 1971 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kSessionVariable; (yyval.show_stmt)->var_name_ = std::string((yyvsp[0].str_value)); free((yyvsp[0].str_value)); } -#line 6158 "parser.cpp" +#line 6172 "parser.cpp" break; - case 261: /* show_statement: SHOW GLOBAL VARIABLE IDENTIFIER */ -#line 1973 "parser.y" + case 262: /* show_statement: SHOW GLOBAL VARIABLE IDENTIFIER */ +#line 1977 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kGlobalVariable; (yyval.show_stmt)->var_name_ = std::string((yyvsp[0].str_value)); free((yyvsp[0].str_value)); } -#line 6169 "parser.cpp" +#line 6183 "parser.cpp" break; - case 262: /* show_statement: SHOW DATABASE IDENTIFIER */ -#line 1979 "parser.y" + case 263: /* show_statement: SHOW DATABASE IDENTIFIER */ +#line 1983 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kDatabase; (yyval.show_stmt)->schema_name_ = (yyvsp[0].str_value); free((yyvsp[0].str_value)); } -#line 6180 "parser.cpp" +#line 6194 "parser.cpp" break; - case 263: /* show_statement: SHOW TABLE table_name */ -#line 1985 "parser.y" + case 264: /* show_statement: SHOW TABLE table_name */ +#line 1989 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kTable; @@ -6192,11 +6206,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[0].table_name_t)->table_name_ptr_); delete (yyvsp[0].table_name_t); } -#line 6196 "parser.cpp" +#line 6210 "parser.cpp" break; - case 264: /* show_statement: SHOW TABLE table_name COLUMNS */ -#line 1996 "parser.y" + case 265: /* show_statement: SHOW TABLE table_name COLUMNS */ +#line 2000 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kColumns; @@ -6208,11 +6222,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-1].table_name_t)->table_name_ptr_); delete (yyvsp[-1].table_name_t); } -#line 6212 "parser.cpp" +#line 6226 "parser.cpp" break; - case 265: /* show_statement: SHOW TABLE table_name SEGMENTS */ -#line 2007 "parser.y" + case 266: /* show_statement: SHOW TABLE table_name SEGMENTS */ +#line 2011 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kSegments; @@ -6224,11 +6238,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-1].table_name_t)->table_name_ptr_); delete (yyvsp[-1].table_name_t); } -#line 6228 "parser.cpp" +#line 6242 "parser.cpp" break; - case 266: /* show_statement: SHOW TABLE table_name SEGMENT LONG_VALUE */ -#line 2018 "parser.y" + case 267: /* show_statement: SHOW TABLE table_name SEGMENT LONG_VALUE */ +#line 2022 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kSegment; @@ -6241,11 +6255,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.show_stmt)->segment_id_ = (yyvsp[0].long_value); delete (yyvsp[-2].table_name_t); } -#line 6245 "parser.cpp" +#line 6259 "parser.cpp" break; - case 267: /* show_statement: SHOW TABLE table_name SEGMENT LONG_VALUE BLOCKS */ -#line 2030 "parser.y" + case 268: /* show_statement: SHOW TABLE table_name SEGMENT LONG_VALUE BLOCKS */ +#line 2034 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kBlocks; @@ -6258,11 +6272,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.show_stmt)->segment_id_ = (yyvsp[-1].long_value); delete (yyvsp[-3].table_name_t); } -#line 6262 "parser.cpp" +#line 6276 "parser.cpp" break; - case 268: /* show_statement: SHOW TABLE table_name SEGMENT LONG_VALUE BLOCK LONG_VALUE */ -#line 2042 "parser.y" + case 269: /* show_statement: SHOW TABLE table_name SEGMENT LONG_VALUE BLOCK LONG_VALUE */ +#line 2046 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kBlock; @@ -6276,11 +6290,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.show_stmt)->block_id_ = (yyvsp[0].long_value); delete (yyvsp[-4].table_name_t); } -#line 6280 "parser.cpp" +#line 6294 "parser.cpp" break; - case 269: /* show_statement: SHOW TABLE table_name SEGMENT LONG_VALUE BLOCK LONG_VALUE COLUMN LONG_VALUE */ -#line 2055 "parser.y" + case 270: /* show_statement: SHOW TABLE table_name SEGMENT LONG_VALUE BLOCK LONG_VALUE COLUMN LONG_VALUE */ +#line 2059 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kBlockColumn; @@ -6295,11 +6309,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.show_stmt)->column_id_ = (yyvsp[0].long_value); delete (yyvsp[-6].table_name_t); } -#line 6299 "parser.cpp" +#line 6313 "parser.cpp" break; - case 270: /* show_statement: SHOW TABLE table_name INDEXES */ -#line 2069 "parser.y" + case 271: /* show_statement: SHOW TABLE table_name INDEXES */ +#line 2073 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kIndexes; @@ -6311,11 +6325,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-1].table_name_t)->table_name_ptr_); delete (yyvsp[-1].table_name_t); } -#line 6315 "parser.cpp" +#line 6329 "parser.cpp" break; - case 271: /* show_statement: SHOW TABLE table_name INDEX IDENTIFIER */ -#line 2080 "parser.y" + case 272: /* show_statement: SHOW TABLE table_name INDEX IDENTIFIER */ +#line 2084 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kIndex; @@ -6330,11 +6344,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.show_stmt)->index_name_ = (yyvsp[0].str_value); free((yyvsp[0].str_value)); } -#line 6334 "parser.cpp" +#line 6348 "parser.cpp" break; - case 272: /* show_statement: SHOW TABLE table_name INDEX IDENTIFIER SEGMENT LONG_VALUE */ -#line 2094 "parser.y" + case 273: /* show_statement: SHOW TABLE table_name INDEX IDENTIFIER SEGMENT LONG_VALUE */ +#line 2098 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kIndexSegment; @@ -6351,11 +6365,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.show_stmt)->segment_id_ = (yyvsp[0].long_value); } -#line 6355 "parser.cpp" +#line 6369 "parser.cpp" break; - case 273: /* show_statement: SHOW TABLE table_name INDEX IDENTIFIER SEGMENT LONG_VALUE CHUNK LONG_VALUE */ -#line 2110 "parser.y" + case 274: /* show_statement: SHOW TABLE table_name INDEX IDENTIFIER SEGMENT LONG_VALUE CHUNK LONG_VALUE */ +#line 2114 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kIndexChunk; @@ -6373,152 +6387,152 @@ YYLTYPE yylloc = yyloc_default; (yyval.show_stmt)->segment_id_ = (yyvsp[-2].long_value); (yyval.show_stmt)->chunk_id_ = (yyvsp[0].long_value); } -#line 6377 "parser.cpp" +#line 6391 "parser.cpp" break; - case 274: /* show_statement: SHOW LOGS */ -#line 2127 "parser.y" + case 275: /* show_statement: SHOW LOGS */ +#line 2131 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kLogs; } -#line 6386 "parser.cpp" +#line 6400 "parser.cpp" break; - case 275: /* show_statement: SHOW DELTA LOGS */ -#line 2131 "parser.y" + case 276: /* show_statement: SHOW DELTA LOGS */ +#line 2135 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kDeltaLogs; } -#line 6395 "parser.cpp" +#line 6409 "parser.cpp" break; - case 276: /* show_statement: SHOW CATALOGS */ -#line 2135 "parser.y" + case 277: /* show_statement: SHOW CATALOGS */ +#line 2139 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kCatalogs; } -#line 6404 "parser.cpp" +#line 6418 "parser.cpp" break; - case 277: /* show_statement: SHOW PERSISTENCE FILES */ -#line 2139 "parser.y" + case 278: /* show_statement: SHOW PERSISTENCE FILES */ +#line 2143 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kPersistenceFiles; } -#line 6413 "parser.cpp" +#line 6427 "parser.cpp" break; - case 278: /* show_statement: SHOW PERSISTENCE OBJECTS */ -#line 2143 "parser.y" + case 279: /* show_statement: SHOW PERSISTENCE OBJECTS */ +#line 2147 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kPersistenceObjects; } -#line 6422 "parser.cpp" +#line 6436 "parser.cpp" break; - case 279: /* show_statement: SHOW PERSISTENCE OBJECT STRING */ -#line 2147 "parser.y" + case 280: /* show_statement: SHOW PERSISTENCE OBJECT STRING */ +#line 2151 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kPersistenceObject; (yyval.show_stmt)->file_name_ = (yyvsp[0].str_value); free((yyvsp[0].str_value)); } -#line 6433 "parser.cpp" +#line 6447 "parser.cpp" break; - case 280: /* show_statement: SHOW MEMORY */ -#line 2153 "parser.y" + case 281: /* show_statement: SHOW MEMORY */ +#line 2157 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kMemory; } -#line 6442 "parser.cpp" +#line 6456 "parser.cpp" break; - case 281: /* show_statement: SHOW MEMORY OBJECTS */ -#line 2157 "parser.y" + case 282: /* show_statement: SHOW MEMORY OBJECTS */ +#line 2161 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kMemoryObjects; } -#line 6451 "parser.cpp" +#line 6465 "parser.cpp" break; - case 282: /* show_statement: SHOW MEMORY ALLOCATION */ -#line 2161 "parser.y" + case 283: /* show_statement: SHOW MEMORY ALLOCATION */ +#line 2165 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kMemoryAllocation; } -#line 6460 "parser.cpp" +#line 6474 "parser.cpp" break; - case 283: /* show_statement: SHOW IDENTIFIER '(' ')' */ -#line 2165 "parser.y" + case 284: /* show_statement: SHOW IDENTIFIER '(' ')' */ +#line 2169 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kFunction; (yyval.show_stmt)->function_name_ = (yyvsp[-2].str_value); free((yyvsp[-2].str_value)); } -#line 6471 "parser.cpp" +#line 6485 "parser.cpp" break; - case 284: /* show_statement: SHOW SNAPSHOTS */ -#line 2171 "parser.y" + case 285: /* show_statement: SHOW SNAPSHOTS */ +#line 2175 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kListSnapshots; } -#line 6480 "parser.cpp" +#line 6494 "parser.cpp" break; - case 285: /* show_statement: SHOW SNAPSHOT IDENTIFIER */ -#line 2175 "parser.y" + case 286: /* show_statement: SHOW SNAPSHOT IDENTIFIER */ +#line 2179 "parser.y" { (yyval.show_stmt) = new infinity::ShowStatement(); (yyval.show_stmt)->show_type_ = infinity::ShowStmtType::kShowSnapshot; (yyval.show_stmt)->snapshot_name_ = (yyvsp[0].str_value); free((yyvsp[0].str_value)); } -#line 6491 "parser.cpp" +#line 6505 "parser.cpp" break; - case 286: /* flush_statement: FLUSH DATA */ -#line 2185 "parser.y" + case 287: /* flush_statement: FLUSH DATA */ +#line 2189 "parser.y" { (yyval.flush_stmt) = new infinity::FlushStatement(); (yyval.flush_stmt)->type_ = infinity::FlushType::kData; } -#line 6500 "parser.cpp" +#line 6514 "parser.cpp" break; - case 287: /* flush_statement: FLUSH LOG */ -#line 2189 "parser.y" + case 288: /* flush_statement: FLUSH LOG */ +#line 2193 "parser.y" { (yyval.flush_stmt) = new infinity::FlushStatement(); (yyval.flush_stmt)->type_ = infinity::FlushType::kLog; } -#line 6509 "parser.cpp" +#line 6523 "parser.cpp" break; - case 288: /* flush_statement: FLUSH BUFFER */ -#line 2193 "parser.y" + case 289: /* flush_statement: FLUSH BUFFER */ +#line 2197 "parser.y" { (yyval.flush_stmt) = new infinity::FlushStatement(); (yyval.flush_stmt)->type_ = infinity::FlushType::kBuffer; } -#line 6518 "parser.cpp" +#line 6532 "parser.cpp" break; - case 289: /* optimize_statement: OPTIMIZE table_name */ -#line 2201 "parser.y" + case 290: /* optimize_statement: OPTIMIZE table_name */ +#line 2205 "parser.y" { (yyval.optimize_stmt) = new infinity::OptimizeStatement(); if((yyvsp[0].table_name_t)->schema_name_ptr_ != nullptr) { @@ -6529,11 +6543,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[0].table_name_t)->table_name_ptr_); delete (yyvsp[0].table_name_t); } -#line 6533 "parser.cpp" +#line 6547 "parser.cpp" break; - case 290: /* optimize_statement: OPTIMIZE IDENTIFIER ON table_name with_index_param_list */ -#line 2212 "parser.y" + case 291: /* optimize_statement: OPTIMIZE IDENTIFIER ON table_name with_index_param_list */ +#line 2216 "parser.y" { (yyval.optimize_stmt) = new infinity::OptimizeStatement(); if((yyvsp[-1].table_name_t)->schema_name_ptr_ != nullptr) { @@ -6553,54 +6567,54 @@ YYLTYPE yylloc = yyloc_default; } delete (yyvsp[0].with_index_param_list_t); } -#line 6557 "parser.cpp" +#line 6571 "parser.cpp" break; - case 291: /* command_statement: USE IDENTIFIER */ -#line 2235 "parser.y" + case 292: /* command_statement: USE IDENTIFIER */ +#line 2239 "parser.y" { (yyval.command_stmt) = new infinity::CommandStatement(); ParserHelper::ToLower((yyvsp[0].str_value)); (yyval.command_stmt)->command_info_ = std::make_shared((yyvsp[0].str_value)); free((yyvsp[0].str_value)); } -#line 6568 "parser.cpp" +#line 6582 "parser.cpp" break; - case 292: /* command_statement: EXPORT PROFILES LONG_VALUE file_path */ -#line 2241 "parser.y" + case 293: /* command_statement: EXPORT PROFILES LONG_VALUE file_path */ +#line 2245 "parser.y" { (yyval.command_stmt) = new infinity::CommandStatement(); (yyval.command_stmt)->command_info_ = std::make_shared((yyvsp[0].str_value), infinity::ExportType::kProfileRecord, (yyvsp[-1].long_value)); free((yyvsp[0].str_value)); } -#line 6578 "parser.cpp" +#line 6592 "parser.cpp" break; - case 293: /* command_statement: SET SESSION IDENTIFIER ON */ -#line 2246 "parser.y" + case 294: /* command_statement: SET SESSION IDENTIFIER ON */ +#line 2250 "parser.y" { ParserHelper::ToLower((yyvsp[-1].str_value)); (yyval.command_stmt) = new infinity::CommandStatement(); (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kSession, infinity::SetVarType::kBool, (yyvsp[-1].str_value), true); free((yyvsp[-1].str_value)); } -#line 6589 "parser.cpp" +#line 6603 "parser.cpp" break; - case 294: /* command_statement: SET SESSION IDENTIFIER OFF */ -#line 2252 "parser.y" + case 295: /* command_statement: SET SESSION IDENTIFIER OFF */ +#line 2256 "parser.y" { ParserHelper::ToLower((yyvsp[-1].str_value)); (yyval.command_stmt) = new infinity::CommandStatement(); (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kSession, infinity::SetVarType::kBool, (yyvsp[-1].str_value), false); free((yyvsp[-1].str_value)); } -#line 6600 "parser.cpp" +#line 6614 "parser.cpp" break; - case 295: /* command_statement: SET SESSION IDENTIFIER IDENTIFIER */ -#line 2258 "parser.y" + case 296: /* command_statement: SET SESSION IDENTIFIER IDENTIFIER */ +#line 2262 "parser.y" { ParserHelper::ToLower((yyvsp[-1].str_value)); ParserHelper::ToLower((yyvsp[0].str_value)); @@ -6609,55 +6623,55 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-1].str_value)); free((yyvsp[0].str_value)); } -#line 6613 "parser.cpp" +#line 6627 "parser.cpp" break; - case 296: /* command_statement: SET SESSION IDENTIFIER LONG_VALUE */ -#line 2266 "parser.y" + case 297: /* command_statement: SET SESSION IDENTIFIER LONG_VALUE */ +#line 2270 "parser.y" { ParserHelper::ToLower((yyvsp[-1].str_value)); (yyval.command_stmt) = new infinity::CommandStatement(); (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kSession, infinity::SetVarType::kInteger, (yyvsp[-1].str_value), (yyvsp[0].long_value)); free((yyvsp[-1].str_value)); } -#line 6624 "parser.cpp" +#line 6638 "parser.cpp" break; - case 297: /* command_statement: SET SESSION IDENTIFIER DOUBLE_VALUE */ -#line 2272 "parser.y" + case 298: /* command_statement: SET SESSION IDENTIFIER DOUBLE_VALUE */ +#line 2276 "parser.y" { ParserHelper::ToLower((yyvsp[-1].str_value)); (yyval.command_stmt) = new infinity::CommandStatement(); (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kSession, infinity::SetVarType::kDouble, (yyvsp[-1].str_value), (yyvsp[0].double_value)); free((yyvsp[-1].str_value)); } -#line 6635 "parser.cpp" +#line 6649 "parser.cpp" break; - case 298: /* command_statement: SET GLOBAL IDENTIFIER ON */ -#line 2278 "parser.y" + case 299: /* command_statement: SET GLOBAL IDENTIFIER ON */ +#line 2282 "parser.y" { ParserHelper::ToLower((yyvsp[-1].str_value)); (yyval.command_stmt) = new infinity::CommandStatement(); (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kGlobal, infinity::SetVarType::kBool, (yyvsp[-1].str_value), true); free((yyvsp[-1].str_value)); } -#line 6646 "parser.cpp" +#line 6660 "parser.cpp" break; - case 299: /* command_statement: SET GLOBAL IDENTIFIER OFF */ -#line 2284 "parser.y" + case 300: /* command_statement: SET GLOBAL IDENTIFIER OFF */ +#line 2288 "parser.y" { ParserHelper::ToLower((yyvsp[-1].str_value)); (yyval.command_stmt) = new infinity::CommandStatement(); (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kGlobal, infinity::SetVarType::kBool, (yyvsp[-1].str_value), false); free((yyvsp[-1].str_value)); } -#line 6657 "parser.cpp" +#line 6671 "parser.cpp" break; - case 300: /* command_statement: SET GLOBAL IDENTIFIER IDENTIFIER */ -#line 2290 "parser.y" + case 301: /* command_statement: SET GLOBAL IDENTIFIER IDENTIFIER */ +#line 2294 "parser.y" { ParserHelper::ToLower((yyvsp[-1].str_value)); ParserHelper::ToLower((yyvsp[0].str_value)); @@ -6666,55 +6680,55 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-1].str_value)); free((yyvsp[0].str_value)); } -#line 6670 "parser.cpp" +#line 6684 "parser.cpp" break; - case 301: /* command_statement: SET GLOBAL IDENTIFIER LONG_VALUE */ -#line 2298 "parser.y" + case 302: /* command_statement: SET GLOBAL IDENTIFIER LONG_VALUE */ +#line 2302 "parser.y" { ParserHelper::ToLower((yyvsp[-1].str_value)); (yyval.command_stmt) = new infinity::CommandStatement(); (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kGlobal, infinity::SetVarType::kInteger, (yyvsp[-1].str_value), (yyvsp[0].long_value)); free((yyvsp[-1].str_value)); } -#line 6681 "parser.cpp" +#line 6695 "parser.cpp" break; - case 302: /* command_statement: SET GLOBAL IDENTIFIER DOUBLE_VALUE */ -#line 2304 "parser.y" + case 303: /* command_statement: SET GLOBAL IDENTIFIER DOUBLE_VALUE */ +#line 2308 "parser.y" { ParserHelper::ToLower((yyvsp[-1].str_value)); (yyval.command_stmt) = new infinity::CommandStatement(); (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kGlobal, infinity::SetVarType::kDouble, (yyvsp[-1].str_value), (yyvsp[0].double_value)); free((yyvsp[-1].str_value)); } -#line 6692 "parser.cpp" +#line 6706 "parser.cpp" break; - case 303: /* command_statement: SET CONFIG IDENTIFIER ON */ -#line 2310 "parser.y" + case 304: /* command_statement: SET CONFIG IDENTIFIER ON */ +#line 2314 "parser.y" { ParserHelper::ToLower((yyvsp[-1].str_value)); (yyval.command_stmt) = new infinity::CommandStatement(); (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kConfig, infinity::SetVarType::kBool, (yyvsp[-1].str_value), true); free((yyvsp[-1].str_value)); } -#line 6703 "parser.cpp" +#line 6717 "parser.cpp" break; - case 304: /* command_statement: SET CONFIG IDENTIFIER OFF */ -#line 2316 "parser.y" + case 305: /* command_statement: SET CONFIG IDENTIFIER OFF */ +#line 2320 "parser.y" { ParserHelper::ToLower((yyvsp[-1].str_value)); (yyval.command_stmt) = new infinity::CommandStatement(); (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kConfig, infinity::SetVarType::kBool, (yyvsp[-1].str_value), false); free((yyvsp[-1].str_value)); } -#line 6714 "parser.cpp" +#line 6728 "parser.cpp" break; - case 305: /* command_statement: SET CONFIG IDENTIFIER IDENTIFIER */ -#line 2322 "parser.y" + case 306: /* command_statement: SET CONFIG IDENTIFIER IDENTIFIER */ +#line 2326 "parser.y" { ParserHelper::ToLower((yyvsp[-1].str_value)); ParserHelper::ToLower((yyvsp[0].str_value)); @@ -6723,33 +6737,33 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-1].str_value)); free((yyvsp[0].str_value)); } -#line 6727 "parser.cpp" +#line 6741 "parser.cpp" break; - case 306: /* command_statement: SET CONFIG IDENTIFIER LONG_VALUE */ -#line 2330 "parser.y" + case 307: /* command_statement: SET CONFIG IDENTIFIER LONG_VALUE */ +#line 2334 "parser.y" { ParserHelper::ToLower((yyvsp[-1].str_value)); (yyval.command_stmt) = new infinity::CommandStatement(); (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kConfig, infinity::SetVarType::kInteger, (yyvsp[-1].str_value), (yyvsp[0].long_value)); free((yyvsp[-1].str_value)); } -#line 6738 "parser.cpp" +#line 6752 "parser.cpp" break; - case 307: /* command_statement: SET CONFIG IDENTIFIER DOUBLE_VALUE */ -#line 2336 "parser.y" + case 308: /* command_statement: SET CONFIG IDENTIFIER DOUBLE_VALUE */ +#line 2340 "parser.y" { ParserHelper::ToLower((yyvsp[-1].str_value)); (yyval.command_stmt) = new infinity::CommandStatement(); (yyval.command_stmt)->command_info_ = std::make_shared(infinity::SetScope::kConfig, infinity::SetVarType::kDouble, (yyvsp[-1].str_value), (yyvsp[0].double_value)); free((yyvsp[-1].str_value)); } -#line 6749 "parser.cpp" +#line 6763 "parser.cpp" break; - case 308: /* command_statement: LOCK TABLE table_name */ -#line 2342 "parser.y" + case 309: /* command_statement: LOCK TABLE table_name */ +#line 2346 "parser.y" { (yyval.command_stmt) = new infinity::CommandStatement(); ParserHelper::ToLower((yyvsp[0].table_name_t)->schema_name_ptr_); @@ -6759,11 +6773,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[0].table_name_t)->table_name_ptr_); delete (yyvsp[0].table_name_t); } -#line 6763 "parser.cpp" +#line 6777 "parser.cpp" break; - case 309: /* command_statement: UNLOCK TABLE table_name */ -#line 2351 "parser.y" + case 310: /* command_statement: UNLOCK TABLE table_name */ +#line 2355 "parser.y" { (yyval.command_stmt) = new infinity::CommandStatement(); ParserHelper::ToLower((yyvsp[0].table_name_t)->schema_name_ptr_); @@ -6773,11 +6787,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[0].table_name_t)->table_name_ptr_); delete (yyvsp[0].table_name_t); } -#line 6777 "parser.cpp" +#line 6791 "parser.cpp" break; - case 310: /* command_statement: CREATE SNAPSHOT IDENTIFIER ON TABLE IDENTIFIER */ -#line 2360 "parser.y" + case 311: /* command_statement: CREATE SNAPSHOT IDENTIFIER ON TABLE IDENTIFIER */ +#line 2364 "parser.y" { ParserHelper::ToLower((yyvsp[-3].str_value)); ParserHelper::ToLower((yyvsp[0].str_value)); @@ -6786,11 +6800,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-3].str_value)); free((yyvsp[0].str_value)); } -#line 6790 "parser.cpp" +#line 6804 "parser.cpp" break; - case 311: /* command_statement: CREATE SNAPSHOT IDENTIFIER ON DATABASE IDENTIFIER */ -#line 2368 "parser.y" + case 312: /* command_statement: CREATE SNAPSHOT IDENTIFIER ON DATABASE IDENTIFIER */ +#line 2372 "parser.y" { ParserHelper::ToLower((yyvsp[-3].str_value)); ParserHelper::ToLower((yyvsp[0].str_value)); @@ -6799,55 +6813,55 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-3].str_value)); free((yyvsp[0].str_value)); } -#line 6803 "parser.cpp" +#line 6817 "parser.cpp" break; - case 312: /* command_statement: CREATE SNAPSHOT IDENTIFIER ON SYSTEM */ -#line 2376 "parser.y" + case 313: /* command_statement: CREATE SNAPSHOT IDENTIFIER ON SYSTEM */ +#line 2380 "parser.y" { ParserHelper::ToLower((yyvsp[-2].str_value)); (yyval.command_stmt) = new infinity::CommandStatement(); (yyval.command_stmt)->command_info_ = std::make_shared((yyvsp[-2].str_value), infinity::SnapshotOp::kCreate, infinity::SnapshotScope::kSystem); free((yyvsp[-2].str_value)); } -#line 6814 "parser.cpp" +#line 6828 "parser.cpp" break; - case 313: /* command_statement: DROP SNAPSHOT IDENTIFIER */ -#line 2382 "parser.y" + case 314: /* command_statement: DROP SNAPSHOT IDENTIFIER */ +#line 2386 "parser.y" { ParserHelper::ToLower((yyvsp[0].str_value)); (yyval.command_stmt) = new infinity::CommandStatement(); (yyval.command_stmt)->command_info_ = std::make_shared((yyvsp[0].str_value), infinity::SnapshotOp::kDrop, infinity::SnapshotScope::kIgnore); free((yyvsp[0].str_value)); } -#line 6825 "parser.cpp" +#line 6839 "parser.cpp" break; - case 314: /* command_statement: RESTORE DATABASE SNAPSHOT IDENTIFIER */ -#line 2388 "parser.y" + case 315: /* command_statement: RESTORE DATABASE SNAPSHOT IDENTIFIER */ +#line 2392 "parser.y" { ParserHelper::ToLower((yyvsp[0].str_value)); (yyval.command_stmt) = new infinity::CommandStatement(); (yyval.command_stmt)->command_info_ = std::make_shared((yyvsp[0].str_value), infinity::SnapshotOp::kRestore, infinity::SnapshotScope::kDatabase); free((yyvsp[0].str_value)); } -#line 6836 "parser.cpp" +#line 6850 "parser.cpp" break; - case 315: /* command_statement: RESTORE TABLE SNAPSHOT IDENTIFIER */ -#line 2394 "parser.y" + case 316: /* command_statement: RESTORE TABLE SNAPSHOT IDENTIFIER */ +#line 2398 "parser.y" { ParserHelper::ToLower((yyvsp[0].str_value)); (yyval.command_stmt) = new infinity::CommandStatement(); (yyval.command_stmt)->command_info_ = std::make_shared((yyvsp[0].str_value), infinity::SnapshotOp::kRestore, infinity::SnapshotScope::kTable); free((yyvsp[0].str_value)); } -#line 6847 "parser.cpp" +#line 6861 "parser.cpp" break; - case 316: /* compact_statement: COMPACT TABLE table_name */ -#line 2401 "parser.y" + case 317: /* compact_statement: COMPACT TABLE table_name */ +#line 2405 "parser.y" { std::string schema_name; if ((yyvsp[0].table_name_t)->schema_name_ptr_ != nullptr) { @@ -6860,41 +6874,41 @@ YYLTYPE yylloc = yyloc_default; (yyval.compact_stmt) = new infinity::ManualCompactStatement(std::move(schema_name), std::move(table_name)); delete (yyvsp[0].table_name_t); } -#line 6864 "parser.cpp" +#line 6878 "parser.cpp" break; - case 317: /* admin_statement: ADMIN SHOW CATALOGS */ -#line 2414 "parser.y" + case 318: /* admin_statement: ADMIN SHOW CATALOGS */ +#line 2418 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListCatalogs; } -#line 6873 "parser.cpp" +#line 6887 "parser.cpp" break; - case 318: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE */ -#line 2418 "parser.y" + case 319: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE */ +#line 2422 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowCatalog; (yyval.admin_stmt)->catalog_file_index_ = (yyvsp[0].long_value); } -#line 6883 "parser.cpp" +#line 6897 "parser.cpp" break; - case 319: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASES */ -#line 2423 "parser.y" + case 320: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASES */ +#line 2427 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListDatabases; (yyval.admin_stmt)->catalog_file_start_index_ = (yyvsp[-2].long_value); (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-1].long_value); } -#line 6894 "parser.cpp" +#line 6908 "parser.cpp" break; - case 320: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE */ -#line 2429 "parser.y" + case 321: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE */ +#line 2433 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowDatabase; @@ -6902,11 +6916,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.admin_stmt)->catalog_file_end_index_ = (yyvsp[-2].long_value); (yyval.admin_stmt)->database_meta_index_ = (yyvsp[0].long_value); } -#line 6906 "parser.cpp" +#line 6920 "parser.cpp" break; - case 321: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLES */ -#line 2436 "parser.y" + case 322: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLES */ +#line 2440 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListTables; @@ -6915,11 +6929,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.admin_stmt)->database_meta_index_ = (yyvsp[-2].long_value); (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-1].long_value); } -#line 6919 "parser.cpp" +#line 6933 "parser.cpp" break; - case 322: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE */ -#line 2444 "parser.y" + case 323: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE */ +#line 2448 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowTable; @@ -6929,11 +6943,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.admin_stmt)->database_entry_index_ = (yyvsp[-2].long_value); (yyval.admin_stmt)->table_meta_index_ = (yyvsp[0].long_value); } -#line 6933 "parser.cpp" +#line 6947 "parser.cpp" break; - case 323: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE COLUMNS */ -#line 2453 "parser.y" + case 324: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE COLUMNS */ +#line 2457 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowColumn; @@ -6944,11 +6958,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-2].long_value); (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-1].long_value); } -#line 6948 "parser.cpp" +#line 6962 "parser.cpp" break; - case 324: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENTS */ -#line 2463 "parser.y" + case 325: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENTS */ +#line 2467 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListSegments; @@ -6959,11 +6973,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-2].long_value); (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-1].long_value); } -#line 6963 "parser.cpp" +#line 6977 "parser.cpp" break; - case 325: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENT LONG_VALUE */ -#line 2473 "parser.y" + case 326: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENT LONG_VALUE */ +#line 2477 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowSegment; @@ -6975,11 +6989,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-2].long_value); (yyval.admin_stmt)->segment_index_ = (yyvsp[0].long_value); } -#line 6979 "parser.cpp" +#line 6993 "parser.cpp" break; - case 326: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENT LONG_VALUE BLOCKS */ -#line 2484 "parser.y" + case 327: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENT LONG_VALUE BLOCKS */ +#line 2488 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListBlocks; @@ -6991,11 +7005,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-3].long_value); (yyval.admin_stmt)->segment_index_ = (yyvsp[-1].long_value); } -#line 6995 "parser.cpp" +#line 7009 "parser.cpp" break; - case 327: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENT LONG_VALUE BLOCK LONG_VALUE */ -#line 2495 "parser.y" + case 328: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENT LONG_VALUE BLOCK LONG_VALUE */ +#line 2499 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowBlock; @@ -7008,11 +7022,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.admin_stmt)->segment_index_ = (yyvsp[-2].long_value); (yyval.admin_stmt)->block_index_ = (yyvsp[0].long_value); } -#line 7012 "parser.cpp" +#line 7026 "parser.cpp" break; - case 328: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENT LONG_VALUE BLOCK LONG_VALUE COLUMNS */ -#line 2507 "parser.y" + case 329: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE SEGMENT LONG_VALUE BLOCK LONG_VALUE COLUMNS */ +#line 2511 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListColumns; @@ -7025,11 +7039,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.admin_stmt)->segment_index_ = (yyvsp[-3].long_value); (yyval.admin_stmt)->block_index_ = (yyvsp[-1].long_value); } -#line 7029 "parser.cpp" +#line 7043 "parser.cpp" break; - case 329: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE INDEXES */ -#line 2519 "parser.y" + case 330: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE INDEXES */ +#line 2523 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListIndexes; @@ -7040,11 +7054,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.admin_stmt)->table_meta_index_ = (yyvsp[-2].long_value); (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-1].long_value); } -#line 7044 "parser.cpp" +#line 7058 "parser.cpp" break; - case 330: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE INDEX LONG_VALUE */ -#line 2529 "parser.y" + case 331: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE INDEX LONG_VALUE */ +#line 2533 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowIndex; @@ -7056,11 +7070,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.admin_stmt)->table_entry_index_ = (yyvsp[-2].long_value); (yyval.admin_stmt)->index_meta_index_ = (yyvsp[0].long_value); } -#line 7060 "parser.cpp" +#line 7074 "parser.cpp" break; - case 331: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE INDEX LONG_VALUE LONG_VALUE SEGMENTS */ -#line 2540 "parser.y" + case 332: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE INDEX LONG_VALUE LONG_VALUE SEGMENTS */ +#line 2544 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListIndexSegments; @@ -7073,11 +7087,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.admin_stmt)->index_meta_index_ = (yyvsp[-2].long_value); (yyval.admin_stmt)->index_entry_index_ = (yyvsp[-1].long_value); } -#line 7077 "parser.cpp" +#line 7091 "parser.cpp" break; - case 332: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE INDEX LONG_VALUE LONG_VALUE SEGMENT LONG_VALUE */ -#line 2552 "parser.y" + case 333: /* admin_statement: ADMIN SHOW CATALOG LONG_VALUE LONG_VALUE DATABASE LONG_VALUE LONG_VALUE TABLE LONG_VALUE LONG_VALUE INDEX LONG_VALUE LONG_VALUE SEGMENT LONG_VALUE */ +#line 2556 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowIndexSegment; @@ -7091,120 +7105,120 @@ YYLTYPE yylloc = yyloc_default; (yyval.admin_stmt)->index_entry_index_ = (yyvsp[-2].long_value); (yyval.admin_stmt)->segment_index_ = (yyvsp[0].long_value); } -#line 7095 "parser.cpp" +#line 7109 "parser.cpp" break; - case 333: /* admin_statement: ADMIN SHOW LOGS */ -#line 2565 "parser.y" + case 334: /* admin_statement: ADMIN SHOW LOGS */ +#line 2569 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListLogFiles; } -#line 7104 "parser.cpp" +#line 7118 "parser.cpp" break; - case 334: /* admin_statement: ADMIN SHOW LOG LONG_VALUE */ -#line 2569 "parser.y" + case 335: /* admin_statement: ADMIN SHOW LOG LONG_VALUE */ +#line 2573 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowLogFile; (yyval.admin_stmt)->log_file_index_ = (yyvsp[0].long_value); } -#line 7114 "parser.cpp" +#line 7128 "parser.cpp" break; - case 335: /* admin_statement: ADMIN SHOW LOG LONG_VALUE INDEXES */ -#line 2574 "parser.y" + case 336: /* admin_statement: ADMIN SHOW LOG LONG_VALUE INDEXES */ +#line 2578 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListLogIndexes; (yyval.admin_stmt)->log_file_index_ = (yyvsp[-1].long_value); } -#line 7124 "parser.cpp" +#line 7138 "parser.cpp" break; - case 336: /* admin_statement: ADMIN SHOW LOG LONG_VALUE INDEX LONG_VALUE */ -#line 2579 "parser.y" + case 337: /* admin_statement: ADMIN SHOW LOG LONG_VALUE INDEX LONG_VALUE */ +#line 2583 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowLogIndex; (yyval.admin_stmt)->log_file_index_ = (yyvsp[-2].long_value); (yyval.admin_stmt)->log_index_in_file_ = (yyvsp[0].long_value); } -#line 7135 "parser.cpp" +#line 7149 "parser.cpp" break; - case 337: /* admin_statement: ADMIN SHOW CONFIGS */ -#line 2585 "parser.y" + case 338: /* admin_statement: ADMIN SHOW CONFIGS */ +#line 2589 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListConfigs; } -#line 7144 "parser.cpp" +#line 7158 "parser.cpp" break; - case 338: /* admin_statement: ADMIN SHOW VARIABLES */ -#line 2589 "parser.y" + case 339: /* admin_statement: ADMIN SHOW VARIABLES */ +#line 2593 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListVariables; } -#line 7153 "parser.cpp" +#line 7167 "parser.cpp" break; - case 339: /* admin_statement: ADMIN SHOW VARIABLE IDENTIFIER */ -#line 2593 "parser.y" + case 340: /* admin_statement: ADMIN SHOW VARIABLE IDENTIFIER */ +#line 2597 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowVariable; (yyval.admin_stmt)->variable_name_ = (yyvsp[0].str_value); free((yyvsp[0].str_value)); } -#line 7164 "parser.cpp" +#line 7178 "parser.cpp" break; - case 340: /* admin_statement: ADMIN CREATE SNAPSHOT */ -#line 2599 "parser.y" + case 341: /* admin_statement: ADMIN CREATE SNAPSHOT */ +#line 2603 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kCreateSnapshot; } -#line 7173 "parser.cpp" +#line 7187 "parser.cpp" break; - case 341: /* admin_statement: ADMIN SHOW SNAPSHOTS */ -#line 2603 "parser.y" + case 342: /* admin_statement: ADMIN SHOW SNAPSHOTS */ +#line 2607 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListSnapshots; } -#line 7182 "parser.cpp" +#line 7196 "parser.cpp" break; - case 342: /* admin_statement: ADMIN SHOW SNAPSHOT IDENTIFIER */ -#line 2607 "parser.y" + case 343: /* admin_statement: ADMIN SHOW SNAPSHOT IDENTIFIER */ +#line 2611 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowSnapshot; (yyval.admin_stmt)->snapshot_name_ = (yyvsp[0].str_value); free((yyvsp[0].str_value)); } -#line 7193 "parser.cpp" +#line 7207 "parser.cpp" break; - case 343: /* admin_statement: ADMIN DELETE SNAPSHOT STRING */ -#line 2613 "parser.y" + case 344: /* admin_statement: ADMIN DELETE SNAPSHOT STRING */ +#line 2617 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kDeleteSnapshot; (yyval.admin_stmt)->snapshot_name_ = (yyvsp[0].str_value); free((yyvsp[0].str_value)); } -#line 7204 "parser.cpp" +#line 7218 "parser.cpp" break; - case 344: /* admin_statement: ADMIN EXPORT SNAPSHOT STRING TO STRING */ -#line 2619 "parser.y" + case 345: /* admin_statement: ADMIN EXPORT SNAPSHOT STRING TO STRING */ +#line 2623 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kExportSnapshot; @@ -7213,82 +7227,82 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-2].str_value)); free((yyvsp[0].str_value)); } -#line 7217 "parser.cpp" +#line 7231 "parser.cpp" break; - case 345: /* admin_statement: ADMIN RECOVER FROM SNAPSHOT STRING */ -#line 2627 "parser.y" + case 346: /* admin_statement: ADMIN RECOVER FROM SNAPSHOT STRING */ +#line 2631 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kRecoverFromSnapshot; (yyval.admin_stmt)->snapshot_name_ = (yyvsp[0].str_value); free((yyvsp[0].str_value)); } -#line 7228 "parser.cpp" +#line 7242 "parser.cpp" break; - case 346: /* admin_statement: ADMIN SHOW NODES */ -#line 2633 "parser.y" + case 347: /* admin_statement: ADMIN SHOW NODES */ +#line 2637 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kListNodes; } -#line 7237 "parser.cpp" +#line 7251 "parser.cpp" break; - case 347: /* admin_statement: ADMIN SHOW NODE STRING */ -#line 2637 "parser.y" + case 348: /* admin_statement: ADMIN SHOW NODE STRING */ +#line 2641 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowNode; (yyval.admin_stmt)->node_name_ = (yyvsp[0].str_value); free((yyvsp[0].str_value)); } -#line 7248 "parser.cpp" +#line 7262 "parser.cpp" break; - case 348: /* admin_statement: ADMIN SHOW NODE */ -#line 2643 "parser.y" + case 349: /* admin_statement: ADMIN SHOW NODE */ +#line 2647 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kShowCurrentNode; } -#line 7257 "parser.cpp" +#line 7271 "parser.cpp" break; - case 349: /* admin_statement: ADMIN REMOVE NODE STRING */ -#line 2647 "parser.y" + case 350: /* admin_statement: ADMIN REMOVE NODE STRING */ +#line 2651 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kRemoveNode; (yyval.admin_stmt)->node_name_ = (yyvsp[0].str_value); free((yyvsp[0].str_value)); } -#line 7268 "parser.cpp" +#line 7282 "parser.cpp" break; - case 350: /* admin_statement: ADMIN SET ADMIN */ -#line 2653 "parser.y" + case 351: /* admin_statement: ADMIN SET ADMIN */ +#line 2657 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kSetRole; (yyval.admin_stmt)->node_role_ = infinity::NodeRole::kAdmin; } -#line 7278 "parser.cpp" +#line 7292 "parser.cpp" break; - case 351: /* admin_statement: ADMIN SET STANDALONE */ -#line 2658 "parser.y" + case 352: /* admin_statement: ADMIN SET STANDALONE */ +#line 2662 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kSetRole; (yyval.admin_stmt)->node_role_ = infinity::NodeRole::kStandalone; } -#line 7288 "parser.cpp" +#line 7302 "parser.cpp" break; - case 352: /* admin_statement: ADMIN SET LEADER USING STRING */ -#line 2663 "parser.y" + case 353: /* admin_statement: ADMIN SET LEADER USING STRING */ +#line 2667 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kSetRole; @@ -7296,11 +7310,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.admin_stmt)->node_name_ = (yyvsp[0].str_value); free((yyvsp[0].str_value)); } -#line 7300 "parser.cpp" +#line 7314 "parser.cpp" break; - case 353: /* admin_statement: ADMIN CONNECT STRING AS FOLLOWER USING STRING */ -#line 2670 "parser.y" + case 354: /* admin_statement: ADMIN CONNECT STRING AS FOLLOWER USING STRING */ +#line 2674 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kSetRole; @@ -7310,11 +7324,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-4].str_value)); free((yyvsp[0].str_value)); } -#line 7314 "parser.cpp" +#line 7328 "parser.cpp" break; - case 354: /* admin_statement: ADMIN CONNECT STRING AS LEARNER USING STRING */ -#line 2679 "parser.y" + case 355: /* admin_statement: ADMIN CONNECT STRING AS LEARNER USING STRING */ +#line 2683 "parser.y" { (yyval.admin_stmt) = new infinity::AdminStatement(); (yyval.admin_stmt)->admin_type_ = infinity::AdminStmtType::kSetRole; @@ -7324,11 +7338,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-4].str_value)); free((yyvsp[0].str_value)); } -#line 7328 "parser.cpp" +#line 7342 "parser.cpp" break; - case 355: /* alter_statement: ALTER TABLE table_name RENAME TO IDENTIFIER */ -#line 2689 "parser.y" + case 356: /* alter_statement: ALTER TABLE table_name RENAME TO IDENTIFIER */ +#line 2693 "parser.y" { auto *ret = new infinity::RenameTableStatement((yyvsp[-3].table_name_t)->schema_name_ptr_, (yyvsp[-3].table_name_t)->table_name_ptr_); (yyval.alter_stmt) = ret; @@ -7338,11 +7352,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-3].table_name_t)->table_name_ptr_); delete (yyvsp[-3].table_name_t); } -#line 7342 "parser.cpp" +#line 7356 "parser.cpp" break; - case 356: /* alter_statement: ALTER TABLE table_name ADD COLUMN '(' column_def_array ')' */ -#line 2698 "parser.y" + case 357: /* alter_statement: ALTER TABLE table_name ADD COLUMN '(' column_def_array ')' */ +#line 2702 "parser.y" { auto *ret = new infinity::AddColumnsStatement((yyvsp[-5].table_name_t)->schema_name_ptr_, (yyvsp[-5].table_name_t)->table_name_ptr_); (yyval.alter_stmt) = ret; @@ -7355,11 +7369,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-5].table_name_t)->table_name_ptr_); delete (yyvsp[-5].table_name_t); } -#line 7359 "parser.cpp" +#line 7373 "parser.cpp" break; - case 357: /* alter_statement: ALTER TABLE table_name DROP COLUMN '(' identifier_array ')' */ -#line 2710 "parser.y" + case 358: /* alter_statement: ALTER TABLE table_name DROP COLUMN '(' identifier_array ')' */ +#line 2714 "parser.y" { auto *ret = new infinity::DropColumnsStatement((yyvsp[-5].table_name_t)->schema_name_ptr_, (yyvsp[-5].table_name_t)->table_name_ptr_); (yyval.alter_stmt) = ret; @@ -7371,29 +7385,29 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-5].table_name_t)->table_name_ptr_); delete (yyvsp[-5].table_name_t); } -#line 7375 "parser.cpp" +#line 7389 "parser.cpp" break; - case 358: /* expr_array: expr_alias */ -#line 2726 "parser.y" + case 359: /* expr_array: expr_alias */ +#line 2730 "parser.y" { (yyval.expr_array_t) = new std::vector(); (yyval.expr_array_t)->emplace_back((yyvsp[0].expr_t)); } -#line 7384 "parser.cpp" +#line 7398 "parser.cpp" break; - case 359: /* expr_array: expr_array ',' expr_alias */ -#line 2730 "parser.y" + case 360: /* expr_array: expr_array ',' expr_alias */ +#line 2734 "parser.y" { (yyvsp[-2].expr_array_t)->emplace_back((yyvsp[0].expr_t)); (yyval.expr_array_t) = (yyvsp[-2].expr_array_t); } -#line 7393 "parser.cpp" +#line 7407 "parser.cpp" break; - case 360: /* insert_row_list: '(' expr_array ')' */ -#line 2735 "parser.y" + case 361: /* insert_row_list: '(' expr_array ')' */ +#line 2739 "parser.y" { auto res = std::make_unique(); for (auto* &expr : *(yyvsp[-1].expr_array_t)) { @@ -7404,11 +7418,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.insert_row_list_t) = new std::vector(); (yyval.insert_row_list_t)->emplace_back(res.release()); } -#line 7408 "parser.cpp" +#line 7422 "parser.cpp" break; - case 361: /* insert_row_list: insert_row_list ',' '(' expr_array ')' */ -#line 2745 "parser.y" + case 362: /* insert_row_list: insert_row_list ',' '(' expr_array ')' */ +#line 2749 "parser.y" { (yyval.insert_row_list_t) = (yyvsp[-4].insert_row_list_t); auto res = std::make_unique(); @@ -7419,57 +7433,57 @@ YYLTYPE yylloc = yyloc_default; delete (yyvsp[-1].expr_array_t); (yyval.insert_row_list_t)->emplace_back(res.release()); } -#line 7423 "parser.cpp" +#line 7437 "parser.cpp" break; - case 362: /* expr_alias: expr AS IDENTIFIER */ -#line 2767 "parser.y" + case 363: /* expr_alias: expr AS IDENTIFIER */ +#line 2771 "parser.y" { (yyval.expr_t) = (yyvsp[-2].expr_t); ParserHelper::ToLower((yyvsp[0].str_value)); (yyval.expr_t)->alias_ = (yyvsp[0].str_value); free((yyvsp[0].str_value)); } -#line 7434 "parser.cpp" +#line 7448 "parser.cpp" break; - case 363: /* expr_alias: expr */ -#line 2773 "parser.y" + case 364: /* expr_alias: expr */ +#line 2777 "parser.y" { (yyval.expr_t) = (yyvsp[0].expr_t); } -#line 7442 "parser.cpp" +#line 7456 "parser.cpp" break; - case 369: /* operand: '(' expr ')' */ -#line 2783 "parser.y" + case 370: /* operand: '(' expr ')' */ +#line 2787 "parser.y" { (yyval.expr_t) = (yyvsp[-1].expr_t); } -#line 7450 "parser.cpp" +#line 7464 "parser.cpp" break; - case 370: /* operand: '(' select_without_paren ')' */ -#line 2786 "parser.y" + case 371: /* operand: '(' select_without_paren ')' */ +#line 2790 "parser.y" { infinity::SubqueryExpr* subquery_expr = new infinity::SubqueryExpr(); subquery_expr->subquery_type_ = infinity::SubqueryType::kScalar; subquery_expr->select_ = (yyvsp[-1].select_stmt); (yyval.expr_t) = subquery_expr; } -#line 7461 "parser.cpp" +#line 7475 "parser.cpp" break; - case 371: /* operand: constant_expr */ -#line 2792 "parser.y" + case 372: /* operand: constant_expr */ +#line 2796 "parser.y" { (yyval.expr_t) = (yyvsp[0].const_expr_t); } -#line 7469 "parser.cpp" +#line 7483 "parser.cpp" break; - case 382: /* match_tensor_expr: MATCH TENSOR '(' column_expr ',' common_array_expr ',' STRING ',' STRING ',' STRING optional_search_filter_expr ')' */ -#line 2808 "parser.y" + case 383: /* match_tensor_expr: MATCH TENSOR '(' column_expr ',' common_array_expr ',' STRING ',' STRING ',' STRING optional_search_filter_expr ')' */ +#line 2812 "parser.y" { auto match_tensor_expr = std::make_unique(); // search column @@ -7485,11 +7499,11 @@ YYLTYPE yylloc = yyloc_default; match_tensor_expr->SetOptionalFilter((yyvsp[-1].expr_t)); (yyval.expr_t) = match_tensor_expr.release(); } -#line 7489 "parser.cpp" +#line 7503 "parser.cpp" break; - case 383: /* match_tensor_expr: MATCH TENSOR '(' column_expr ',' common_array_expr ',' STRING ',' STRING ',' STRING optional_search_filter_expr ')' USING INDEX '(' IDENTIFIER ')' */ -#line 2824 "parser.y" + case 384: /* match_tensor_expr: MATCH TENSOR '(' column_expr ',' common_array_expr ',' STRING ',' STRING ',' STRING optional_search_filter_expr ')' USING INDEX '(' IDENTIFIER ')' */ +#line 2828 "parser.y" { auto match_tensor_expr = std::make_unique(); // search column @@ -7506,11 +7520,11 @@ YYLTYPE yylloc = yyloc_default; match_tensor_expr->index_name_ = (yyvsp[-1].str_value); (yyval.expr_t) = match_tensor_expr.release(); } -#line 7510 "parser.cpp" +#line 7524 "parser.cpp" break; - case 384: /* match_tensor_expr: MATCH TENSOR '(' column_expr ',' common_array_expr ',' STRING ',' STRING ',' STRING optional_search_filter_expr ')' IGNORE INDEX */ -#line 2841 "parser.y" + case 385: /* match_tensor_expr: MATCH TENSOR '(' column_expr ',' common_array_expr ',' STRING ',' STRING ',' STRING optional_search_filter_expr ')' IGNORE INDEX */ +#line 2845 "parser.y" { auto match_tensor_expr = std::make_unique(); // search column @@ -7527,11 +7541,11 @@ YYLTYPE yylloc = yyloc_default; match_tensor_expr->SetOptionalFilter((yyvsp[-3].expr_t)); (yyval.expr_t) = match_tensor_expr.release(); } -#line 7531 "parser.cpp" +#line 7545 "parser.cpp" break; - case 385: /* match_vector_expr: MATCH VECTOR '(' expr ',' array_expr ',' STRING ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' USING INDEX '(' IDENTIFIER ')' with_index_param_list */ -#line 2859 "parser.y" + case 386: /* match_vector_expr: MATCH VECTOR '(' expr ',' array_expr ',' STRING ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' USING INDEX '(' IDENTIFIER ')' with_index_param_list */ +#line 2863 "parser.y" { infinity::KnnExpr* match_vector_expr = new infinity::KnnExpr(); (yyval.expr_t) = match_vector_expr; @@ -7577,11 +7591,11 @@ YYLTYPE yylloc = yyloc_default; Return1: ; } -#line 7581 "parser.cpp" +#line 7595 "parser.cpp" break; - case 386: /* match_vector_expr: MATCH VECTOR '(' expr ',' array_expr ',' STRING ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' IGNORE INDEX */ -#line 2905 "parser.y" + case 387: /* match_vector_expr: MATCH VECTOR '(' expr ',' array_expr ',' STRING ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' IGNORE INDEX */ +#line 2909 "parser.y" { infinity::KnnExpr* match_vector_expr = new infinity::KnnExpr(); (yyval.expr_t) = match_vector_expr; @@ -7620,11 +7634,11 @@ YYLTYPE yylloc = yyloc_default; Return2: ; } -#line 7624 "parser.cpp" +#line 7638 "parser.cpp" break; - case 387: /* match_vector_expr: MATCH VECTOR '(' expr ',' array_expr ',' STRING ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' with_index_param_list */ -#line 2944 "parser.y" + case 388: /* match_vector_expr: MATCH VECTOR '(' expr ',' array_expr ',' STRING ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' with_index_param_list */ +#line 2948 "parser.y" { infinity::KnnExpr* match_vector_expr = new infinity::KnnExpr(); (yyval.expr_t) = match_vector_expr; @@ -7667,11 +7681,11 @@ YYLTYPE yylloc = yyloc_default; Return3: ; } -#line 7671 "parser.cpp" +#line 7685 "parser.cpp" break; - case 388: /* match_vector_expr: MATCH VECTOR '(' expr ',' array_expr ',' STRING ',' STRING optional_search_filter_expr ')' with_index_param_list */ -#line 2987 "parser.y" + case 389: /* match_vector_expr: MATCH VECTOR '(' expr ',' array_expr ',' STRING ',' STRING optional_search_filter_expr ')' with_index_param_list */ +#line 2991 "parser.y" { infinity::KnnExpr* match_vector_expr = new infinity::KnnExpr(); (yyval.expr_t) = match_vector_expr; @@ -7715,11 +7729,11 @@ YYLTYPE yylloc = yyloc_default; Return4: ; } -#line 7719 "parser.cpp" +#line 7733 "parser.cpp" break; - case 389: /* match_sparse_expr: MATCH SPARSE '(' expr ',' common_sparse_array_expr ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' USING INDEX '(' IDENTIFIER ')' with_index_param_list */ -#line 3034 "parser.y" + case 390: /* match_sparse_expr: MATCH SPARSE '(' expr ',' common_sparse_array_expr ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' USING INDEX '(' IDENTIFIER ')' with_index_param_list */ +#line 3038 "parser.y" { auto match_sparse_expr = new infinity::MatchSparseExpr(); (yyval.expr_t) = match_sparse_expr; @@ -7743,11 +7757,11 @@ YYLTYPE yylloc = yyloc_default; match_sparse_expr->index_name_ = (yyvsp[-2].str_value); free((yyvsp[-2].str_value)); } -#line 7747 "parser.cpp" +#line 7761 "parser.cpp" break; - case 390: /* match_sparse_expr: MATCH SPARSE '(' expr ',' common_sparse_array_expr ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' IGNORE INDEX */ -#line 3058 "parser.y" + case 391: /* match_sparse_expr: MATCH SPARSE '(' expr ',' common_sparse_array_expr ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' IGNORE INDEX */ +#line 3062 "parser.y" { auto match_sparse_expr = new infinity::MatchSparseExpr(); (yyval.expr_t) = match_sparse_expr; @@ -7770,11 +7784,11 @@ YYLTYPE yylloc = yyloc_default; match_sparse_expr->ignore_index_ = true; } -#line 7774 "parser.cpp" +#line 7788 "parser.cpp" break; - case 391: /* match_sparse_expr: MATCH SPARSE '(' expr ',' common_sparse_array_expr ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' with_index_param_list */ -#line 3081 "parser.y" + case 392: /* match_sparse_expr: MATCH SPARSE '(' expr ',' common_sparse_array_expr ',' STRING ',' LONG_VALUE optional_search_filter_expr ')' with_index_param_list */ +#line 3085 "parser.y" { auto match_sparse_expr = new infinity::MatchSparseExpr(); (yyval.expr_t) = match_sparse_expr; @@ -7795,11 +7809,11 @@ YYLTYPE yylloc = yyloc_default; // topn and options match_sparse_expr->SetOptParams((yyvsp[-3].long_value), (yyvsp[0].with_index_param_list_t)); } -#line 7799 "parser.cpp" +#line 7813 "parser.cpp" break; - case 392: /* match_sparse_expr: MATCH SPARSE '(' expr ',' common_sparse_array_expr ',' STRING optional_search_filter_expr ')' with_index_param_list */ -#line 3102 "parser.y" + case 393: /* match_sparse_expr: MATCH SPARSE '(' expr ',' common_sparse_array_expr ',' STRING optional_search_filter_expr ')' with_index_param_list */ +#line 3106 "parser.y" { auto match_sparse_expr = new infinity::MatchSparseExpr(); (yyval.expr_t) = match_sparse_expr; @@ -7820,11 +7834,11 @@ YYLTYPE yylloc = yyloc_default; // topn and options match_sparse_expr->SetOptParams(infinity::DEFAULT_MATCH_SPARSE_TOP_N, (yyvsp[0].with_index_param_list_t)); } -#line 7824 "parser.cpp" +#line 7838 "parser.cpp" break; - case 393: /* match_text_expr: MATCH TEXT '(' STRING ',' STRING optional_search_filter_expr ')' */ -#line 3123 "parser.y" + case 394: /* match_text_expr: MATCH TEXT '(' STRING ',' STRING optional_search_filter_expr ')' */ +#line 3127 "parser.y" { infinity::MatchExpr* match_text_expr = new infinity::MatchExpr(); match_text_expr->fields_ = std::string((yyvsp[-4].str_value)); @@ -7834,11 +7848,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-2].str_value)); (yyval.expr_t) = match_text_expr; } -#line 7838 "parser.cpp" +#line 7852 "parser.cpp" break; - case 394: /* match_text_expr: MATCH TEXT '(' STRING ',' STRING ',' STRING optional_search_filter_expr ')' */ -#line 3132 "parser.y" + case 395: /* match_text_expr: MATCH TEXT '(' STRING ',' STRING ',' STRING optional_search_filter_expr ')' */ +#line 3136 "parser.y" { infinity::MatchExpr* match_text_expr = new infinity::MatchExpr(); match_text_expr->fields_ = std::string((yyvsp[-6].str_value)); @@ -7850,11 +7864,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-2].str_value)); (yyval.expr_t) = match_text_expr; } -#line 7854 "parser.cpp" +#line 7868 "parser.cpp" break; - case 395: /* match_text_expr: MATCH TEXT '(' STRING ',' STRING optional_search_filter_expr ')' USING INDEXES '(' STRING ')' */ -#line 3143 "parser.y" + case 396: /* match_text_expr: MATCH TEXT '(' STRING ',' STRING optional_search_filter_expr ')' USING INDEXES '(' STRING ')' */ +#line 3147 "parser.y" { infinity::MatchExpr* match_text_expr = new infinity::MatchExpr(); match_text_expr->fields_ = std::string((yyvsp[-9].str_value)); @@ -7866,11 +7880,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-1].str_value)); (yyval.expr_t) = match_text_expr; } -#line 7870 "parser.cpp" +#line 7884 "parser.cpp" break; - case 396: /* match_text_expr: MATCH TEXT '(' STRING ',' STRING ',' STRING optional_search_filter_expr ')' USING INDEXES '(' STRING ')' */ -#line 3154 "parser.y" + case 397: /* match_text_expr: MATCH TEXT '(' STRING ',' STRING ',' STRING optional_search_filter_expr ')' USING INDEXES '(' STRING ')' */ +#line 3158 "parser.y" { infinity::MatchExpr* match_text_expr = new infinity::MatchExpr(); match_text_expr->fields_ = std::string((yyvsp[-11].str_value)); @@ -7884,11 +7898,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-1].str_value)); (yyval.expr_t) = match_text_expr; } -#line 7888 "parser.cpp" +#line 7902 "parser.cpp" break; - case 397: /* query_expr: QUERY '(' STRING optional_search_filter_expr ')' */ -#line 3168 "parser.y" + case 398: /* query_expr: QUERY '(' STRING optional_search_filter_expr ')' */ +#line 3172 "parser.y" { infinity::MatchExpr* match_text_expr = new infinity::MatchExpr(); match_text_expr->matching_text_ = std::string((yyvsp[-2].str_value)); @@ -7896,11 +7910,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-2].str_value)); (yyval.expr_t) = match_text_expr; } -#line 7900 "parser.cpp" +#line 7914 "parser.cpp" break; - case 398: /* query_expr: QUERY '(' STRING ',' STRING optional_search_filter_expr ')' */ -#line 3175 "parser.y" + case 399: /* query_expr: QUERY '(' STRING ',' STRING optional_search_filter_expr ')' */ +#line 3179 "parser.y" { infinity::MatchExpr* match_text_expr = new infinity::MatchExpr(); match_text_expr->matching_text_ = std::string((yyvsp[-4].str_value)); @@ -7910,22 +7924,22 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[-2].str_value)); (yyval.expr_t) = match_text_expr; } -#line 7914 "parser.cpp" +#line 7928 "parser.cpp" break; - case 399: /* fusion_expr: FUSION '(' STRING ')' */ -#line 3185 "parser.y" + case 400: /* fusion_expr: FUSION '(' STRING ')' */ +#line 3189 "parser.y" { infinity::FusionExpr* fusion_expr = new infinity::FusionExpr(); fusion_expr->method_ = std::string((yyvsp[-1].str_value)); free((yyvsp[-1].str_value)); (yyval.expr_t) = fusion_expr; } -#line 7925 "parser.cpp" +#line 7939 "parser.cpp" break; - case 400: /* fusion_expr: FUSION '(' STRING ',' STRING ')' */ -#line 3191 "parser.y" + case 401: /* fusion_expr: FUSION '(' STRING ',' STRING ')' */ +#line 3195 "parser.y" { auto fusion_expr = std::make_unique(); fusion_expr->method_ = std::string((yyvsp[-3].str_value)); @@ -7937,77 +7951,77 @@ YYLTYPE yylloc = yyloc_default; fusion_expr->JobAfterParser(); (yyval.expr_t) = fusion_expr.release(); } -#line 7941 "parser.cpp" +#line 7955 "parser.cpp" break; - case 401: /* sub_search: match_vector_expr */ -#line 3203 "parser.y" + case 402: /* sub_search: match_vector_expr */ +#line 3207 "parser.y" { (yyval.expr_t) = (yyvsp[0].expr_t); } -#line 7949 "parser.cpp" +#line 7963 "parser.cpp" break; - case 402: /* sub_search: match_text_expr */ -#line 3206 "parser.y" + case 403: /* sub_search: match_text_expr */ +#line 3210 "parser.y" { (yyval.expr_t) = (yyvsp[0].expr_t); } -#line 7957 "parser.cpp" +#line 7971 "parser.cpp" break; - case 403: /* sub_search: match_tensor_expr */ -#line 3209 "parser.y" + case 404: /* sub_search: match_tensor_expr */ +#line 3213 "parser.y" { (yyval.expr_t) = (yyvsp[0].expr_t); } -#line 7965 "parser.cpp" +#line 7979 "parser.cpp" break; - case 404: /* sub_search: match_sparse_expr */ -#line 3212 "parser.y" + case 405: /* sub_search: match_sparse_expr */ +#line 3216 "parser.y" { (yyval.expr_t) = (yyvsp[0].expr_t); } -#line 7973 "parser.cpp" +#line 7987 "parser.cpp" break; - case 405: /* sub_search: query_expr */ -#line 3215 "parser.y" + case 406: /* sub_search: query_expr */ +#line 3219 "parser.y" { (yyval.expr_t) = (yyvsp[0].expr_t); } -#line 7981 "parser.cpp" +#line 7995 "parser.cpp" break; - case 406: /* sub_search: fusion_expr */ -#line 3218 "parser.y" + case 407: /* sub_search: fusion_expr */ +#line 3222 "parser.y" { (yyval.expr_t) = (yyvsp[0].expr_t); } -#line 7989 "parser.cpp" +#line 8003 "parser.cpp" break; - case 407: /* sub_search_array: sub_search */ -#line 3222 "parser.y" + case 408: /* sub_search_array: sub_search */ +#line 3226 "parser.y" { (yyval.expr_array_t) = new std::vector(); (yyval.expr_array_t)->emplace_back((yyvsp[0].expr_t)); } -#line 7998 "parser.cpp" +#line 8012 "parser.cpp" break; - case 408: /* sub_search_array: sub_search_array ',' sub_search */ -#line 3226 "parser.y" + case 409: /* sub_search_array: sub_search_array ',' sub_search */ +#line 3230 "parser.y" { (yyvsp[-2].expr_array_t)->emplace_back((yyvsp[0].expr_t)); (yyval.expr_array_t) = (yyvsp[-2].expr_array_t); } -#line 8007 "parser.cpp" +#line 8021 "parser.cpp" break; - case 409: /* function_expr: IDENTIFIER '(' ')' */ -#line 3231 "parser.y" + case 410: /* function_expr: IDENTIFIER '(' ')' */ +#line 3235 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); ParserHelper::ToLower((yyvsp[-2].str_value)); @@ -8016,11 +8030,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_ = nullptr; (yyval.expr_t) = func_expr; } -#line 8020 "parser.cpp" +#line 8034 "parser.cpp" break; - case 410: /* function_expr: IDENTIFIER '(' expr_array ')' */ -#line 3239 "parser.y" + case 411: /* function_expr: IDENTIFIER '(' expr_array ')' */ +#line 3243 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); ParserHelper::ToLower((yyvsp[-3].str_value)); @@ -8029,11 +8043,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_ = (yyvsp[-1].expr_array_t); (yyval.expr_t) = func_expr; } -#line 8033 "parser.cpp" +#line 8047 "parser.cpp" break; - case 411: /* function_expr: IDENTIFIER '(' DISTINCT expr_array ')' */ -#line 3247 "parser.y" + case 412: /* function_expr: IDENTIFIER '(' DISTINCT expr_array ')' */ +#line 3251 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); ParserHelper::ToLower((yyvsp[-4].str_value)); @@ -8043,11 +8057,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->distinct_ = true; (yyval.expr_t) = func_expr; } -#line 8047 "parser.cpp" +#line 8061 "parser.cpp" break; - case 412: /* function_expr: operand IS NOT NULLABLE */ -#line 3256 "parser.y" + case 413: /* function_expr: operand IS NOT NULLABLE */ +#line 3260 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = "is_not_null"; @@ -8055,11 +8069,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[-3].expr_t)); (yyval.expr_t) = func_expr; } -#line 8059 "parser.cpp" +#line 8073 "parser.cpp" break; - case 413: /* function_expr: operand IS NULLABLE */ -#line 3263 "parser.y" + case 414: /* function_expr: operand IS NULLABLE */ +#line 3267 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = "is_null"; @@ -8067,11 +8081,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[-2].expr_t)); (yyval.expr_t) = func_expr; } -#line 8071 "parser.cpp" +#line 8085 "parser.cpp" break; - case 414: /* function_expr: NOT operand */ -#line 3270 "parser.y" + case 415: /* function_expr: NOT operand */ +#line 3274 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = "not"; @@ -8079,11 +8093,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); (yyval.expr_t) = func_expr; } -#line 8083 "parser.cpp" +#line 8097 "parser.cpp" break; - case 415: /* function_expr: '-' operand */ -#line 3277 "parser.y" + case 416: /* function_expr: '-' operand */ +#line 3281 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = "-"; @@ -8091,11 +8105,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); (yyval.expr_t) = func_expr; } -#line 8095 "parser.cpp" +#line 8109 "parser.cpp" break; - case 416: /* function_expr: '+' operand */ -#line 3284 "parser.y" + case 417: /* function_expr: '+' operand */ +#line 3288 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = "+"; @@ -8103,11 +8117,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); (yyval.expr_t) = func_expr; } -#line 8107 "parser.cpp" +#line 8121 "parser.cpp" break; - case 417: /* function_expr: operand '-' operand */ -#line 3291 "parser.y" + case 418: /* function_expr: operand '-' operand */ +#line 3295 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = "-"; @@ -8116,11 +8130,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); (yyval.expr_t) = func_expr; } -#line 8120 "parser.cpp" +#line 8134 "parser.cpp" break; - case 418: /* function_expr: operand '+' operand */ -#line 3299 "parser.y" + case 419: /* function_expr: operand '+' operand */ +#line 3303 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = "+"; @@ -8129,11 +8143,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); (yyval.expr_t) = func_expr; } -#line 8133 "parser.cpp" +#line 8147 "parser.cpp" break; - case 419: /* function_expr: operand '*' operand */ -#line 3307 "parser.y" + case 420: /* function_expr: operand '*' operand */ +#line 3311 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = "*"; @@ -8142,11 +8156,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); (yyval.expr_t) = func_expr; } -#line 8146 "parser.cpp" +#line 8160 "parser.cpp" break; - case 420: /* function_expr: operand '/' operand */ -#line 3315 "parser.y" + case 421: /* function_expr: operand '/' operand */ +#line 3319 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = "/"; @@ -8155,11 +8169,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); (yyval.expr_t) = func_expr; } -#line 8159 "parser.cpp" +#line 8173 "parser.cpp" break; - case 421: /* function_expr: operand '%' operand */ -#line 3323 "parser.y" + case 422: /* function_expr: operand '%' operand */ +#line 3327 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = "%"; @@ -8168,11 +8182,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); (yyval.expr_t) = func_expr; } -#line 8172 "parser.cpp" +#line 8186 "parser.cpp" break; - case 422: /* function_expr: operand '=' operand */ -#line 3331 "parser.y" + case 423: /* function_expr: operand '=' operand */ +#line 3335 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = "="; @@ -8181,11 +8195,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); (yyval.expr_t) = func_expr; } -#line 8185 "parser.cpp" +#line 8199 "parser.cpp" break; - case 423: /* function_expr: operand EQUAL operand */ -#line 3339 "parser.y" + case 424: /* function_expr: operand EQUAL operand */ +#line 3343 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = "="; @@ -8194,11 +8208,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); (yyval.expr_t) = func_expr; } -#line 8198 "parser.cpp" +#line 8212 "parser.cpp" break; - case 424: /* function_expr: operand NOT_EQ operand */ -#line 3347 "parser.y" + case 425: /* function_expr: operand NOT_EQ operand */ +#line 3351 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = "<>"; @@ -8207,11 +8221,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); (yyval.expr_t) = func_expr; } -#line 8211 "parser.cpp" +#line 8225 "parser.cpp" break; - case 425: /* function_expr: operand '<' operand */ -#line 3355 "parser.y" + case 426: /* function_expr: operand '<' operand */ +#line 3359 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = "<"; @@ -8220,11 +8234,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); (yyval.expr_t) = func_expr; } -#line 8224 "parser.cpp" +#line 8238 "parser.cpp" break; - case 426: /* function_expr: operand '>' operand */ -#line 3363 "parser.y" + case 427: /* function_expr: operand '>' operand */ +#line 3367 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = ">"; @@ -8233,11 +8247,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); (yyval.expr_t) = func_expr; } -#line 8237 "parser.cpp" +#line 8251 "parser.cpp" break; - case 427: /* function_expr: operand LESS_EQ operand */ -#line 3371 "parser.y" + case 428: /* function_expr: operand LESS_EQ operand */ +#line 3375 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = "<="; @@ -8246,11 +8260,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); (yyval.expr_t) = func_expr; } -#line 8250 "parser.cpp" +#line 8264 "parser.cpp" break; - case 428: /* function_expr: operand GREATER_EQ operand */ -#line 3379 "parser.y" + case 429: /* function_expr: operand GREATER_EQ operand */ +#line 3383 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = ">="; @@ -8259,11 +8273,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); (yyval.expr_t) = func_expr; } -#line 8263 "parser.cpp" +#line 8277 "parser.cpp" break; - case 429: /* function_expr: EXTRACT '(' STRING FROM operand ')' */ -#line 3387 "parser.y" + case 430: /* function_expr: EXTRACT '(' STRING FROM operand ')' */ +#line 3391 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); ParserHelper::ToLower((yyvsp[-3].str_value)); @@ -8294,11 +8308,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[-1].expr_t)); (yyval.expr_t) = func_expr; } -#line 8298 "parser.cpp" +#line 8312 "parser.cpp" break; - case 430: /* function_expr: operand LIKE operand */ -#line 3417 "parser.y" + case 431: /* function_expr: operand LIKE operand */ +#line 3421 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = "like"; @@ -8307,11 +8321,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); (yyval.expr_t) = func_expr; } -#line 8311 "parser.cpp" +#line 8325 "parser.cpp" break; - case 431: /* function_expr: operand NOT LIKE operand */ -#line 3425 "parser.y" + case 432: /* function_expr: operand NOT LIKE operand */ +#line 3429 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = "not_like"; @@ -8320,11 +8334,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); (yyval.expr_t) = func_expr; } -#line 8324 "parser.cpp" +#line 8338 "parser.cpp" break; - case 432: /* conjunction_expr: expr AND expr */ -#line 3434 "parser.y" + case 433: /* conjunction_expr: expr AND expr */ +#line 3438 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = "and"; @@ -8333,11 +8347,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); (yyval.expr_t) = func_expr; } -#line 8337 "parser.cpp" +#line 8351 "parser.cpp" break; - case 433: /* conjunction_expr: expr OR expr */ -#line 3442 "parser.y" + case 434: /* conjunction_expr: expr OR expr */ +#line 3446 "parser.y" { infinity::FunctionExpr* func_expr = new infinity::FunctionExpr(); func_expr->func_name_ = "or"; @@ -8346,11 +8360,11 @@ YYLTYPE yylloc = yyloc_default; func_expr->arguments_->emplace_back((yyvsp[0].expr_t)); (yyval.expr_t) = func_expr; } -#line 8350 "parser.cpp" +#line 8364 "parser.cpp" break; - case 434: /* between_expr: operand BETWEEN operand AND operand */ -#line 3451 "parser.y" + case 435: /* between_expr: operand BETWEEN operand AND operand */ +#line 3455 "parser.y" { infinity::BetweenExpr* between_expr = new infinity::BetweenExpr(); between_expr->value_ = (yyvsp[-4].expr_t); @@ -8358,44 +8372,44 @@ YYLTYPE yylloc = yyloc_default; between_expr->upper_bound_ = (yyvsp[0].expr_t); (yyval.expr_t) = between_expr; } -#line 8362 "parser.cpp" +#line 8376 "parser.cpp" break; - case 435: /* in_expr: operand IN '(' expr_array ')' */ -#line 3459 "parser.y" + case 436: /* in_expr: operand IN '(' expr_array ')' */ +#line 3463 "parser.y" { infinity::InExpr* in_expr = new infinity::InExpr(true); in_expr->left_ = (yyvsp[-4].expr_t); in_expr->arguments_ = (yyvsp[-1].expr_array_t); (yyval.expr_t) = in_expr; } -#line 8373 "parser.cpp" +#line 8387 "parser.cpp" break; - case 436: /* in_expr: operand NOT IN '(' expr_array ')' */ -#line 3465 "parser.y" + case 437: /* in_expr: operand NOT IN '(' expr_array ')' */ +#line 3469 "parser.y" { infinity::InExpr* in_expr = new infinity::InExpr(false); in_expr->left_ = (yyvsp[-5].expr_t); in_expr->arguments_ = (yyvsp[-1].expr_array_t); (yyval.expr_t) = in_expr; } -#line 8384 "parser.cpp" +#line 8398 "parser.cpp" break; - case 437: /* case_expr: CASE expr case_check_array END */ -#line 3472 "parser.y" + case 438: /* case_expr: CASE expr case_check_array END */ +#line 3476 "parser.y" { infinity::CaseExpr* case_expr = new infinity::CaseExpr(); case_expr->expr_ = (yyvsp[-2].expr_t); case_expr->case_check_array_ = (yyvsp[-1].case_check_array_t); (yyval.expr_t) = case_expr; } -#line 8395 "parser.cpp" +#line 8409 "parser.cpp" break; - case 438: /* case_expr: CASE expr case_check_array ELSE expr END */ -#line 3478 "parser.y" + case 439: /* case_expr: CASE expr case_check_array ELSE expr END */ +#line 3482 "parser.y" { infinity::CaseExpr* case_expr = new infinity::CaseExpr(); case_expr->expr_ = (yyvsp[-4].expr_t); @@ -8403,32 +8417,32 @@ YYLTYPE yylloc = yyloc_default; case_expr->else_expr_ = (yyvsp[-1].expr_t); (yyval.expr_t) = case_expr; } -#line 8407 "parser.cpp" +#line 8421 "parser.cpp" break; - case 439: /* case_expr: CASE case_check_array END */ -#line 3485 "parser.y" + case 440: /* case_expr: CASE case_check_array END */ +#line 3489 "parser.y" { infinity::CaseExpr* case_expr = new infinity::CaseExpr(); case_expr->case_check_array_ = (yyvsp[-1].case_check_array_t); (yyval.expr_t) = case_expr; } -#line 8417 "parser.cpp" +#line 8431 "parser.cpp" break; - case 440: /* case_expr: CASE case_check_array ELSE expr END */ -#line 3490 "parser.y" + case 441: /* case_expr: CASE case_check_array ELSE expr END */ +#line 3494 "parser.y" { infinity::CaseExpr* case_expr = new infinity::CaseExpr(); case_expr->case_check_array_ = (yyvsp[-3].case_check_array_t); case_expr->else_expr_ = (yyvsp[-1].expr_t); (yyval.expr_t) = case_expr; } -#line 8428 "parser.cpp" +#line 8442 "parser.cpp" break; - case 441: /* case_check_array: WHEN expr THEN expr */ -#line 3497 "parser.y" + case 442: /* case_check_array: WHEN expr THEN expr */ +#line 3501 "parser.y" { (yyval.case_check_array_t) = new std::vector(); infinity::WhenThen* when_then_ptr = new infinity::WhenThen(); @@ -8436,11 +8450,11 @@ YYLTYPE yylloc = yyloc_default; when_then_ptr->then_ = (yyvsp[0].expr_t); (yyval.case_check_array_t)->emplace_back(when_then_ptr); } -#line 8440 "parser.cpp" +#line 8454 "parser.cpp" break; - case 442: /* case_check_array: case_check_array WHEN expr THEN expr */ -#line 3504 "parser.y" + case 443: /* case_check_array: case_check_array WHEN expr THEN expr */ +#line 3508 "parser.y" { infinity::WhenThen* when_then_ptr = new infinity::WhenThen(); when_then_ptr->when_ = (yyvsp[-2].expr_t); @@ -8448,11 +8462,11 @@ YYLTYPE yylloc = yyloc_default; (yyvsp[-4].case_check_array_t)->emplace_back(when_then_ptr); (yyval.case_check_array_t) = (yyvsp[-4].case_check_array_t); } -#line 8452 "parser.cpp" +#line 8466 "parser.cpp" break; - case 443: /* cast_expr: CAST '(' expr AS column_type ')' */ -#line 3512 "parser.y" + case 444: /* cast_expr: CAST '(' expr AS column_type ')' */ +#line 3516 "parser.y" { std::shared_ptr type_info_ptr{nullptr}; switch((yyvsp[-1].column_type_t).logical_type_) { @@ -8479,33 +8493,33 @@ YYLTYPE yylloc = yyloc_default; cast_expr->expr_ = (yyvsp[-3].expr_t); (yyval.expr_t) = cast_expr; } -#line 8483 "parser.cpp" +#line 8497 "parser.cpp" break; - case 444: /* subquery_expr: EXISTS '(' select_without_paren ')' */ -#line 3539 "parser.y" + case 445: /* subquery_expr: EXISTS '(' select_without_paren ')' */ +#line 3543 "parser.y" { infinity::SubqueryExpr* subquery_expr = new infinity::SubqueryExpr(); subquery_expr->subquery_type_ = infinity::SubqueryType::kExists; subquery_expr->select_ = (yyvsp[-1].select_stmt); (yyval.expr_t) = subquery_expr; } -#line 8494 "parser.cpp" +#line 8508 "parser.cpp" break; - case 445: /* subquery_expr: NOT EXISTS '(' select_without_paren ')' */ -#line 3545 "parser.y" + case 446: /* subquery_expr: NOT EXISTS '(' select_without_paren ')' */ +#line 3549 "parser.y" { infinity::SubqueryExpr* subquery_expr = new infinity::SubqueryExpr(); subquery_expr->subquery_type_ = infinity::SubqueryType::kNotExists; subquery_expr->select_ = (yyvsp[-1].select_stmt); (yyval.expr_t) = subquery_expr; } -#line 8505 "parser.cpp" +#line 8519 "parser.cpp" break; - case 446: /* subquery_expr: operand IN '(' select_without_paren ')' */ -#line 3551 "parser.y" + case 447: /* subquery_expr: operand IN '(' select_without_paren ')' */ +#line 3555 "parser.y" { infinity::SubqueryExpr* subquery_expr = new infinity::SubqueryExpr(); subquery_expr->subquery_type_ = infinity::SubqueryType::kIn; @@ -8513,11 +8527,11 @@ YYLTYPE yylloc = yyloc_default; subquery_expr->select_ = (yyvsp[-1].select_stmt); (yyval.expr_t) = subquery_expr; } -#line 8517 "parser.cpp" +#line 8531 "parser.cpp" break; - case 447: /* subquery_expr: operand NOT IN '(' select_without_paren ')' */ -#line 3558 "parser.y" + case 448: /* subquery_expr: operand NOT IN '(' select_without_paren ')' */ +#line 3562 "parser.y" { infinity::SubqueryExpr* subquery_expr = new infinity::SubqueryExpr(); subquery_expr->subquery_type_ = infinity::SubqueryType::kNotIn; @@ -8525,11 +8539,11 @@ YYLTYPE yylloc = yyloc_default; subquery_expr->select_ = (yyvsp[-1].select_stmt); (yyval.expr_t) = subquery_expr; } -#line 8529 "parser.cpp" +#line 8543 "parser.cpp" break; - case 448: /* column_expr: IDENTIFIER */ -#line 3566 "parser.y" + case 449: /* column_expr: IDENTIFIER */ +#line 3570 "parser.y" { infinity::ColumnExpr* column_expr = new infinity::ColumnExpr(); ParserHelper::ToLower((yyvsp[0].str_value)); @@ -8537,11 +8551,11 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[0].str_value)); (yyval.expr_t) = column_expr; } -#line 8541 "parser.cpp" +#line 8555 "parser.cpp" break; - case 449: /* column_expr: column_expr '.' IDENTIFIER */ -#line 3573 "parser.y" + case 450: /* column_expr: column_expr '.' IDENTIFIER */ +#line 3577 "parser.y" { infinity::ColumnExpr* column_expr = (infinity::ColumnExpr*)(yyvsp[-2].expr_t); ParserHelper::ToLower((yyvsp[0].str_value)); @@ -8549,21 +8563,21 @@ YYLTYPE yylloc = yyloc_default; free((yyvsp[0].str_value)); (yyval.expr_t) = column_expr; } -#line 8553 "parser.cpp" +#line 8567 "parser.cpp" break; - case 450: /* column_expr: '*' */ -#line 3580 "parser.y" + case 451: /* column_expr: '*' */ +#line 3584 "parser.y" { infinity::ColumnExpr* column_expr = new infinity::ColumnExpr(); column_expr->star_ = true; (yyval.expr_t) = column_expr; } -#line 8563 "parser.cpp" +#line 8577 "parser.cpp" break; - case 451: /* column_expr: column_expr '.' '*' */ -#line 3585 "parser.y" + case 452: /* column_expr: column_expr '.' '*' */ +#line 3589 "parser.y" { infinity::ColumnExpr* column_expr = (infinity::ColumnExpr*)(yyvsp[-2].expr_t); if(column_expr->star_) { @@ -8573,232 +8587,232 @@ YYLTYPE yylloc = yyloc_default; column_expr->star_ = true; (yyval.expr_t) = column_expr; } -#line 8577 "parser.cpp" +#line 8591 "parser.cpp" break; - case 452: /* constant_expr: STRING */ -#line 3595 "parser.y" + case 453: /* constant_expr: STRING */ +#line 3599 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kString); const_expr->str_value_ = (yyvsp[0].str_value); (yyval.const_expr_t) = const_expr; } -#line 8587 "parser.cpp" +#line 8601 "parser.cpp" break; - case 453: /* constant_expr: TRUE */ -#line 3600 "parser.y" + case 454: /* constant_expr: TRUE */ +#line 3604 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kBoolean); const_expr->bool_value_ = true; (yyval.const_expr_t) = const_expr; } -#line 8597 "parser.cpp" +#line 8611 "parser.cpp" break; - case 454: /* constant_expr: FALSE */ -#line 3605 "parser.y" + case 455: /* constant_expr: FALSE */ +#line 3609 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kBoolean); const_expr->bool_value_ = false; (yyval.const_expr_t) = const_expr; } -#line 8607 "parser.cpp" +#line 8621 "parser.cpp" break; - case 455: /* constant_expr: DOUBLE_VALUE */ -#line 3610 "parser.y" + case 456: /* constant_expr: DOUBLE_VALUE */ +#line 3614 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDouble); const_expr->double_value_ = (yyvsp[0].double_value); (yyval.const_expr_t) = const_expr; } -#line 8617 "parser.cpp" +#line 8631 "parser.cpp" break; - case 456: /* constant_expr: LONG_VALUE */ -#line 3615 "parser.y" + case 457: /* constant_expr: LONG_VALUE */ +#line 3619 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInteger); const_expr->integer_value_ = (yyvsp[0].long_value); (yyval.const_expr_t) = const_expr; } -#line 8627 "parser.cpp" +#line 8641 "parser.cpp" break; - case 457: /* constant_expr: DATE STRING */ -#line 3620 "parser.y" + case 458: /* constant_expr: DATE STRING */ +#line 3624 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDate); const_expr->date_value_ = (yyvsp[0].str_value); (yyval.const_expr_t) = const_expr; } -#line 8637 "parser.cpp" +#line 8651 "parser.cpp" break; - case 458: /* constant_expr: TIME STRING */ -#line 3625 "parser.y" + case 459: /* constant_expr: TIME STRING */ +#line 3629 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kTime); const_expr->date_value_ = (yyvsp[0].str_value); (yyval.const_expr_t) = const_expr; } -#line 8647 "parser.cpp" +#line 8661 "parser.cpp" break; - case 459: /* constant_expr: DATETIME STRING */ -#line 3630 "parser.y" + case 460: /* constant_expr: DATETIME STRING */ +#line 3634 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDateTime); const_expr->date_value_ = (yyvsp[0].str_value); (yyval.const_expr_t) = const_expr; } -#line 8657 "parser.cpp" +#line 8671 "parser.cpp" break; - case 460: /* constant_expr: TIMESTAMP STRING */ -#line 3635 "parser.y" + case 461: /* constant_expr: TIMESTAMP STRING */ +#line 3639 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kTimestamp); const_expr->date_value_ = (yyvsp[0].str_value); (yyval.const_expr_t) = const_expr; } -#line 8667 "parser.cpp" +#line 8681 "parser.cpp" break; - case 461: /* constant_expr: INTERVAL interval_expr */ -#line 3640 "parser.y" + case 462: /* constant_expr: INTERVAL interval_expr */ +#line 3644 "parser.y" { (yyval.const_expr_t) = (yyvsp[0].const_expr_t); } -#line 8675 "parser.cpp" +#line 8689 "parser.cpp" break; - case 462: /* constant_expr: interval_expr */ -#line 3643 "parser.y" + case 463: /* constant_expr: interval_expr */ +#line 3647 "parser.y" { (yyval.const_expr_t) = (yyvsp[0].const_expr_t); } -#line 8683 "parser.cpp" +#line 8697 "parser.cpp" break; - case 463: /* constant_expr: common_array_expr */ -#line 3646 "parser.y" + case 464: /* constant_expr: common_array_expr */ +#line 3650 "parser.y" { (yyval.const_expr_t) = (yyvsp[0].const_expr_t); } -#line 8691 "parser.cpp" +#line 8705 "parser.cpp" break; - case 464: /* common_array_expr: array_expr */ -#line 3650 "parser.y" + case 465: /* common_array_expr: array_expr */ +#line 3654 "parser.y" { (yyval.const_expr_t) = (yyvsp[0].const_expr_t); } -#line 8699 "parser.cpp" +#line 8713 "parser.cpp" break; - case 465: /* common_array_expr: subarray_array_expr */ -#line 3653 "parser.y" + case 466: /* common_array_expr: subarray_array_expr */ +#line 3657 "parser.y" { (yyval.const_expr_t) = (yyvsp[0].const_expr_t); } -#line 8707 "parser.cpp" +#line 8721 "parser.cpp" break; - case 466: /* common_array_expr: sparse_array_expr */ -#line 3656 "parser.y" + case 467: /* common_array_expr: sparse_array_expr */ +#line 3660 "parser.y" { (yyval.const_expr_t) = (yyvsp[0].const_expr_t); } -#line 8715 "parser.cpp" +#line 8729 "parser.cpp" break; - case 467: /* common_array_expr: empty_array_expr */ -#line 3659 "parser.y" + case 468: /* common_array_expr: empty_array_expr */ +#line 3663 "parser.y" { (yyval.const_expr_t) = (yyvsp[0].const_expr_t); } -#line 8723 "parser.cpp" +#line 8737 "parser.cpp" break; - case 468: /* common_sparse_array_expr: sparse_array_expr */ -#line 3663 "parser.y" + case 469: /* common_sparse_array_expr: sparse_array_expr */ +#line 3667 "parser.y" { (yyval.const_expr_t) = (yyvsp[0].const_expr_t); } -#line 8731 "parser.cpp" +#line 8745 "parser.cpp" break; - case 469: /* common_sparse_array_expr: array_expr */ -#line 3666 "parser.y" + case 470: /* common_sparse_array_expr: array_expr */ +#line 3670 "parser.y" { (yyval.const_expr_t) = (yyvsp[0].const_expr_t); } -#line 8739 "parser.cpp" +#line 8753 "parser.cpp" break; - case 470: /* common_sparse_array_expr: empty_array_expr */ -#line 3669 "parser.y" + case 471: /* common_sparse_array_expr: empty_array_expr */ +#line 3673 "parser.y" { (yyval.const_expr_t) = (yyvsp[0].const_expr_t); } -#line 8747 "parser.cpp" +#line 8761 "parser.cpp" break; - case 471: /* subarray_array_expr: unclosed_subarray_array_expr ']' */ -#line 3673 "parser.y" + case 472: /* subarray_array_expr: unclosed_subarray_array_expr ']' */ +#line 3677 "parser.y" { (yyval.const_expr_t) = (yyvsp[-1].const_expr_t); } -#line 8755 "parser.cpp" +#line 8769 "parser.cpp" break; - case 472: /* unclosed_subarray_array_expr: '[' common_array_expr */ -#line 3677 "parser.y" + case 473: /* unclosed_subarray_array_expr: '[' common_array_expr */ +#line 3681 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kSubArrayArray); const_expr->sub_array_array_.emplace_back((yyvsp[0].const_expr_t)); (yyval.const_expr_t) = const_expr; } -#line 8765 "parser.cpp" +#line 8779 "parser.cpp" break; - case 473: /* unclosed_subarray_array_expr: unclosed_subarray_array_expr ',' common_array_expr */ -#line 3682 "parser.y" + case 474: /* unclosed_subarray_array_expr: unclosed_subarray_array_expr ',' common_array_expr */ +#line 3686 "parser.y" { (yyvsp[-2].const_expr_t)->sub_array_array_.emplace_back((yyvsp[0].const_expr_t)); (yyval.const_expr_t) = (yyvsp[-2].const_expr_t); } -#line 8774 "parser.cpp" +#line 8788 "parser.cpp" break; - case 474: /* sparse_array_expr: long_sparse_array_expr */ -#line 3687 "parser.y" + case 475: /* sparse_array_expr: long_sparse_array_expr */ +#line 3691 "parser.y" { (yyval.const_expr_t) = (yyvsp[0].const_expr_t); } -#line 8782 "parser.cpp" +#line 8796 "parser.cpp" break; - case 475: /* sparse_array_expr: double_sparse_array_expr */ -#line 3690 "parser.y" + case 476: /* sparse_array_expr: double_sparse_array_expr */ +#line 3694 "parser.y" { (yyval.const_expr_t) = (yyvsp[0].const_expr_t); } -#line 8790 "parser.cpp" +#line 8804 "parser.cpp" break; - case 476: /* long_sparse_array_expr: unclosed_long_sparse_array_expr ']' */ -#line 3694 "parser.y" + case 477: /* long_sparse_array_expr: unclosed_long_sparse_array_expr ']' */ +#line 3698 "parser.y" { (yyval.const_expr_t) = (yyvsp[-1].const_expr_t); } -#line 8798 "parser.cpp" +#line 8812 "parser.cpp" break; - case 477: /* unclosed_long_sparse_array_expr: '[' int_sparse_ele */ -#line 3698 "parser.y" + case 478: /* unclosed_long_sparse_array_expr: '[' int_sparse_ele */ +#line 3702 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kLongSparseArray); const_expr->long_sparse_array_.first.emplace_back((yyvsp[0].int_sparse_ele_t)->first); @@ -8806,30 +8820,30 @@ YYLTYPE yylloc = yyloc_default; delete (yyvsp[0].int_sparse_ele_t); (yyval.const_expr_t) = const_expr; } -#line 8810 "parser.cpp" +#line 8824 "parser.cpp" break; - case 478: /* unclosed_long_sparse_array_expr: unclosed_long_sparse_array_expr ',' int_sparse_ele */ -#line 3705 "parser.y" + case 479: /* unclosed_long_sparse_array_expr: unclosed_long_sparse_array_expr ',' int_sparse_ele */ +#line 3709 "parser.y" { (yyvsp[-2].const_expr_t)->long_sparse_array_.first.emplace_back((yyvsp[0].int_sparse_ele_t)->first); (yyvsp[-2].const_expr_t)->long_sparse_array_.second.emplace_back((yyvsp[0].int_sparse_ele_t)->second); delete (yyvsp[0].int_sparse_ele_t); (yyval.const_expr_t) = (yyvsp[-2].const_expr_t); } -#line 8821 "parser.cpp" +#line 8835 "parser.cpp" break; - case 479: /* double_sparse_array_expr: unclosed_double_sparse_array_expr ']' */ -#line 3712 "parser.y" + case 480: /* double_sparse_array_expr: unclosed_double_sparse_array_expr ']' */ +#line 3716 "parser.y" { (yyval.const_expr_t) = (yyvsp[-1].const_expr_t); } -#line 8829 "parser.cpp" +#line 8843 "parser.cpp" break; - case 480: /* unclosed_double_sparse_array_expr: '[' float_sparse_ele */ -#line 3716 "parser.y" + case 481: /* unclosed_double_sparse_array_expr: '[' float_sparse_ele */ +#line 3720 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDoubleSparseArray); const_expr->double_sparse_array_.first.emplace_back((yyvsp[0].float_sparse_ele_t)->first); @@ -8837,266 +8851,266 @@ YYLTYPE yylloc = yyloc_default; delete (yyvsp[0].float_sparse_ele_t); (yyval.const_expr_t) = const_expr; } -#line 8841 "parser.cpp" +#line 8855 "parser.cpp" break; - case 481: /* unclosed_double_sparse_array_expr: unclosed_double_sparse_array_expr ',' float_sparse_ele */ -#line 3723 "parser.y" + case 482: /* unclosed_double_sparse_array_expr: unclosed_double_sparse_array_expr ',' float_sparse_ele */ +#line 3727 "parser.y" { (yyvsp[-2].const_expr_t)->double_sparse_array_.first.emplace_back((yyvsp[0].float_sparse_ele_t)->first); (yyvsp[-2].const_expr_t)->double_sparse_array_.second.emplace_back((yyvsp[0].float_sparse_ele_t)->second); delete (yyvsp[0].float_sparse_ele_t); (yyval.const_expr_t) = (yyvsp[-2].const_expr_t); } -#line 8852 "parser.cpp" +#line 8866 "parser.cpp" break; - case 482: /* empty_array_expr: '[' ']' */ -#line 3730 "parser.y" + case 483: /* empty_array_expr: '[' ']' */ +#line 3734 "parser.y" { (yyval.const_expr_t) = new infinity::ConstantExpr(infinity::LiteralType::kEmptyArray); } -#line 8860 "parser.cpp" +#line 8874 "parser.cpp" break; - case 483: /* int_sparse_ele: LONG_VALUE ':' LONG_VALUE */ -#line 3734 "parser.y" + case 484: /* int_sparse_ele: LONG_VALUE ':' LONG_VALUE */ +#line 3738 "parser.y" { (yyval.int_sparse_ele_t) = new std::pair{(yyvsp[-2].long_value), (yyvsp[0].long_value)}; } -#line 8868 "parser.cpp" +#line 8882 "parser.cpp" break; - case 484: /* float_sparse_ele: LONG_VALUE ':' DOUBLE_VALUE */ -#line 3738 "parser.y" + case 485: /* float_sparse_ele: LONG_VALUE ':' DOUBLE_VALUE */ +#line 3742 "parser.y" { (yyval.float_sparse_ele_t) = new std::pair{(yyvsp[-2].long_value), (yyvsp[0].double_value)}; } -#line 8876 "parser.cpp" +#line 8890 "parser.cpp" break; - case 485: /* array_expr: long_array_expr */ -#line 3742 "parser.y" + case 486: /* array_expr: long_array_expr */ +#line 3746 "parser.y" { (yyval.const_expr_t) = (yyvsp[0].const_expr_t); } -#line 8884 "parser.cpp" +#line 8898 "parser.cpp" break; - case 486: /* array_expr: double_array_expr */ -#line 3745 "parser.y" + case 487: /* array_expr: double_array_expr */ +#line 3749 "parser.y" { (yyval.const_expr_t) = (yyvsp[0].const_expr_t); } -#line 8892 "parser.cpp" +#line 8906 "parser.cpp" break; - case 487: /* long_array_expr: unclosed_long_array_expr ']' */ -#line 3749 "parser.y" + case 488: /* long_array_expr: unclosed_long_array_expr ']' */ +#line 3753 "parser.y" { (yyval.const_expr_t) = (yyvsp[-1].const_expr_t); } -#line 8900 "parser.cpp" +#line 8914 "parser.cpp" break; - case 488: /* unclosed_long_array_expr: '[' LONG_VALUE */ -#line 3753 "parser.y" + case 489: /* unclosed_long_array_expr: '[' LONG_VALUE */ +#line 3757 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kIntegerArray); const_expr->long_array_.emplace_back((yyvsp[0].long_value)); (yyval.const_expr_t) = const_expr; } -#line 8910 "parser.cpp" +#line 8924 "parser.cpp" break; - case 489: /* unclosed_long_array_expr: unclosed_long_array_expr ',' LONG_VALUE */ -#line 3758 "parser.y" + case 490: /* unclosed_long_array_expr: unclosed_long_array_expr ',' LONG_VALUE */ +#line 3762 "parser.y" { (yyvsp[-2].const_expr_t)->long_array_.emplace_back((yyvsp[0].long_value)); (yyval.const_expr_t) = (yyvsp[-2].const_expr_t); } -#line 8919 "parser.cpp" +#line 8933 "parser.cpp" break; - case 490: /* double_array_expr: unclosed_double_array_expr ']' */ -#line 3763 "parser.y" + case 491: /* double_array_expr: unclosed_double_array_expr ']' */ +#line 3767 "parser.y" { (yyval.const_expr_t) = (yyvsp[-1].const_expr_t); } -#line 8927 "parser.cpp" +#line 8941 "parser.cpp" break; - case 491: /* unclosed_double_array_expr: '[' DOUBLE_VALUE */ -#line 3767 "parser.y" + case 492: /* unclosed_double_array_expr: '[' DOUBLE_VALUE */ +#line 3771 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kDoubleArray); const_expr->double_array_.emplace_back((yyvsp[0].double_value)); (yyval.const_expr_t) = const_expr; } -#line 8937 "parser.cpp" +#line 8951 "parser.cpp" break; - case 492: /* unclosed_double_array_expr: unclosed_double_array_expr ',' DOUBLE_VALUE */ -#line 3772 "parser.y" + case 493: /* unclosed_double_array_expr: unclosed_double_array_expr ',' DOUBLE_VALUE */ +#line 3776 "parser.y" { (yyvsp[-2].const_expr_t)->double_array_.emplace_back((yyvsp[0].double_value)); (yyval.const_expr_t) = (yyvsp[-2].const_expr_t); } -#line 8946 "parser.cpp" +#line 8960 "parser.cpp" break; - case 493: /* interval_expr: LONG_VALUE SECONDS */ -#line 3777 "parser.y" + case 494: /* interval_expr: LONG_VALUE SECONDS */ +#line 3781 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); const_expr->interval_type_ = infinity::TimeUnit::kSecond; const_expr->integer_value_ = (yyvsp[-1].long_value); (yyval.const_expr_t) = const_expr; } -#line 8957 "parser.cpp" +#line 8971 "parser.cpp" break; - case 494: /* interval_expr: LONG_VALUE SECOND */ -#line 3783 "parser.y" + case 495: /* interval_expr: LONG_VALUE SECOND */ +#line 3787 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); const_expr->interval_type_ = infinity::TimeUnit::kSecond; const_expr->integer_value_ = (yyvsp[-1].long_value); (yyval.const_expr_t) = const_expr; } -#line 8968 "parser.cpp" +#line 8982 "parser.cpp" break; - case 495: /* interval_expr: LONG_VALUE MINUTES */ -#line 3789 "parser.y" + case 496: /* interval_expr: LONG_VALUE MINUTES */ +#line 3793 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); const_expr->interval_type_ = infinity::TimeUnit::kMinute; const_expr->integer_value_ = (yyvsp[-1].long_value); (yyval.const_expr_t) = const_expr; } -#line 8979 "parser.cpp" +#line 8993 "parser.cpp" break; - case 496: /* interval_expr: LONG_VALUE MINUTE */ -#line 3795 "parser.y" + case 497: /* interval_expr: LONG_VALUE MINUTE */ +#line 3799 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); const_expr->interval_type_ = infinity::TimeUnit::kMinute; const_expr->integer_value_ = (yyvsp[-1].long_value); (yyval.const_expr_t) = const_expr; } -#line 8990 "parser.cpp" +#line 9004 "parser.cpp" break; - case 497: /* interval_expr: LONG_VALUE HOURS */ -#line 3801 "parser.y" + case 498: /* interval_expr: LONG_VALUE HOURS */ +#line 3805 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); const_expr->interval_type_ = infinity::TimeUnit::kHour; const_expr->integer_value_ = (yyvsp[-1].long_value); (yyval.const_expr_t) = const_expr; } -#line 9001 "parser.cpp" +#line 9015 "parser.cpp" break; - case 498: /* interval_expr: LONG_VALUE HOUR */ -#line 3807 "parser.y" + case 499: /* interval_expr: LONG_VALUE HOUR */ +#line 3811 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); const_expr->interval_type_ = infinity::TimeUnit::kHour; const_expr->integer_value_ = (yyvsp[-1].long_value); (yyval.const_expr_t) = const_expr; } -#line 9012 "parser.cpp" +#line 9026 "parser.cpp" break; - case 499: /* interval_expr: LONG_VALUE DAYS */ -#line 3813 "parser.y" + case 500: /* interval_expr: LONG_VALUE DAYS */ +#line 3817 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); const_expr->interval_type_ = infinity::TimeUnit::kDay; const_expr->integer_value_ = (yyvsp[-1].long_value); (yyval.const_expr_t) = const_expr; } -#line 9023 "parser.cpp" +#line 9037 "parser.cpp" break; - case 500: /* interval_expr: LONG_VALUE DAY */ -#line 3819 "parser.y" + case 501: /* interval_expr: LONG_VALUE DAY */ +#line 3823 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); const_expr->interval_type_ = infinity::TimeUnit::kDay; const_expr->integer_value_ = (yyvsp[-1].long_value); (yyval.const_expr_t) = const_expr; } -#line 9034 "parser.cpp" +#line 9048 "parser.cpp" break; - case 501: /* interval_expr: LONG_VALUE MONTHS */ -#line 3825 "parser.y" + case 502: /* interval_expr: LONG_VALUE MONTHS */ +#line 3829 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); const_expr->interval_type_ = infinity::TimeUnit::kMonth; const_expr->integer_value_ = (yyvsp[-1].long_value); (yyval.const_expr_t) = const_expr; } -#line 9045 "parser.cpp" +#line 9059 "parser.cpp" break; - case 502: /* interval_expr: LONG_VALUE MONTH */ -#line 3831 "parser.y" + case 503: /* interval_expr: LONG_VALUE MONTH */ +#line 3835 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); const_expr->interval_type_ = infinity::TimeUnit::kMonth; const_expr->integer_value_ = (yyvsp[-1].long_value); (yyval.const_expr_t) = const_expr; } -#line 9056 "parser.cpp" +#line 9070 "parser.cpp" break; - case 503: /* interval_expr: LONG_VALUE YEARS */ -#line 3837 "parser.y" + case 504: /* interval_expr: LONG_VALUE YEARS */ +#line 3841 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); const_expr->interval_type_ = infinity::TimeUnit::kYear; const_expr->integer_value_ = (yyvsp[-1].long_value); (yyval.const_expr_t) = const_expr; } -#line 9067 "parser.cpp" +#line 9081 "parser.cpp" break; - case 504: /* interval_expr: LONG_VALUE YEAR */ -#line 3843 "parser.y" + case 505: /* interval_expr: LONG_VALUE YEAR */ +#line 3847 "parser.y" { infinity::ConstantExpr* const_expr = new infinity::ConstantExpr(infinity::LiteralType::kInterval); const_expr->interval_type_ = infinity::TimeUnit::kYear; const_expr->integer_value_ = (yyvsp[-1].long_value); (yyval.const_expr_t) = const_expr; } -#line 9078 "parser.cpp" +#line 9092 "parser.cpp" break; - case 505: /* copy_option_list: copy_option */ -#line 3854 "parser.y" + case 506: /* copy_option_list: copy_option */ +#line 3858 "parser.y" { (yyval.copy_option_array) = new std::vector(); (yyval.copy_option_array)->push_back((yyvsp[0].copy_option_t)); } -#line 9087 "parser.cpp" +#line 9101 "parser.cpp" break; - case 506: /* copy_option_list: copy_option_list ',' copy_option */ -#line 3858 "parser.y" + case 507: /* copy_option_list: copy_option_list ',' copy_option */ +#line 3862 "parser.y" { (yyvsp[-2].copy_option_array)->push_back((yyvsp[0].copy_option_t)); (yyval.copy_option_array) = (yyvsp[-2].copy_option_array); } -#line 9096 "parser.cpp" +#line 9110 "parser.cpp" break; - case 507: /* copy_option: FORMAT IDENTIFIER */ -#line 3863 "parser.y" + case 508: /* copy_option: FORMAT IDENTIFIER */ +#line 3867 "parser.y" { (yyval.copy_option_t) = new infinity::CopyOption(); (yyval.copy_option_t)->option_type_ = infinity::CopyOptionType::kFormat; @@ -9128,11 +9142,11 @@ YYLTYPE yylloc = yyloc_default; YYERROR; } } -#line 9132 "parser.cpp" +#line 9146 "parser.cpp" break; - case 508: /* copy_option: DELIMITER STRING */ -#line 3894 "parser.y" + case 509: /* copy_option: DELIMITER STRING */ +#line 3898 "parser.y" { (yyval.copy_option_t) = new infinity::CopyOption(); (yyval.copy_option_t)->option_type_ = infinity::CopyOptionType::kDelimiter; @@ -9143,83 +9157,83 @@ YYLTYPE yylloc = yyloc_default; } free((yyvsp[0].str_value)); } -#line 9147 "parser.cpp" +#line 9161 "parser.cpp" break; - case 509: /* copy_option: HEADER */ -#line 3904 "parser.y" + case 510: /* copy_option: HEADER */ +#line 3908 "parser.y" { (yyval.copy_option_t) = new infinity::CopyOption(); (yyval.copy_option_t)->option_type_ = infinity::CopyOptionType::kHeader; (yyval.copy_option_t)->header_ = true; } -#line 9157 "parser.cpp" +#line 9171 "parser.cpp" break; - case 510: /* copy_option: OFFSET LONG_VALUE */ -#line 3909 "parser.y" + case 511: /* copy_option: OFFSET LONG_VALUE */ +#line 3913 "parser.y" { (yyval.copy_option_t) = new infinity::CopyOption(); (yyval.copy_option_t)->option_type_ = infinity::CopyOptionType::kOffset; (yyval.copy_option_t)->offset_ = (yyvsp[0].long_value); } -#line 9167 "parser.cpp" +#line 9181 "parser.cpp" break; - case 511: /* copy_option: LIMIT LONG_VALUE */ -#line 3914 "parser.y" + case 512: /* copy_option: LIMIT LONG_VALUE */ +#line 3918 "parser.y" { (yyval.copy_option_t) = new infinity::CopyOption(); (yyval.copy_option_t)->option_type_ = infinity::CopyOptionType::kLimit; (yyval.copy_option_t)->limit_ = (yyvsp[0].long_value); } -#line 9177 "parser.cpp" +#line 9191 "parser.cpp" break; - case 512: /* copy_option: ROWLIMIT LONG_VALUE */ -#line 3919 "parser.y" + case 513: /* copy_option: ROWLIMIT LONG_VALUE */ +#line 3923 "parser.y" { (yyval.copy_option_t) = new infinity::CopyOption(); (yyval.copy_option_t)->option_type_ = infinity::CopyOptionType::kRowLimit; (yyval.copy_option_t)->row_limit_ = (yyvsp[0].long_value); } -#line 9187 "parser.cpp" +#line 9201 "parser.cpp" break; - case 513: /* file_path: STRING */ -#line 3925 "parser.y" + case 514: /* file_path: STRING */ +#line 3929 "parser.y" { (yyval.str_value) = (yyvsp[0].str_value); } -#line 9195 "parser.cpp" +#line 9209 "parser.cpp" break; - case 514: /* if_exists: IF EXISTS */ -#line 3929 "parser.y" + case 515: /* if_exists: IF EXISTS */ +#line 3933 "parser.y" { (yyval.bool_value) = true; } -#line 9201 "parser.cpp" +#line 9215 "parser.cpp" break; - case 515: /* if_exists: %empty */ -#line 3930 "parser.y" + case 516: /* if_exists: %empty */ +#line 3934 "parser.y" { (yyval.bool_value) = false; } -#line 9207 "parser.cpp" +#line 9221 "parser.cpp" break; - case 516: /* if_not_exists: IF NOT EXISTS */ -#line 3932 "parser.y" + case 517: /* if_not_exists: IF NOT EXISTS */ +#line 3936 "parser.y" { (yyval.bool_value) = true; } -#line 9213 "parser.cpp" +#line 9227 "parser.cpp" break; - case 517: /* if_not_exists: %empty */ -#line 3933 "parser.y" + case 518: /* if_not_exists: %empty */ +#line 3937 "parser.y" { (yyval.bool_value) = false; } -#line 9219 "parser.cpp" +#line 9233 "parser.cpp" break; - case 520: /* if_not_exists_info: if_not_exists IDENTIFIER */ -#line 3948 "parser.y" + case 521: /* if_not_exists_info: if_not_exists IDENTIFIER */ +#line 3952 "parser.y" { (yyval.if_not_exists_info_t) = new infinity::IfNotExistsInfo(); (yyval.if_not_exists_info_t)->exists_ = true; @@ -9228,80 +9242,80 @@ YYLTYPE yylloc = yyloc_default; (yyval.if_not_exists_info_t)->info_ = (yyvsp[0].str_value); free((yyvsp[0].str_value)); } -#line 9232 "parser.cpp" +#line 9246 "parser.cpp" break; - case 521: /* if_not_exists_info: %empty */ -#line 3956 "parser.y" + case 522: /* if_not_exists_info: %empty */ +#line 3960 "parser.y" { (yyval.if_not_exists_info_t) = new infinity::IfNotExistsInfo(); } -#line 9240 "parser.cpp" +#line 9254 "parser.cpp" break; - case 522: /* with_index_param_list: WITH '(' index_param_list ')' */ -#line 3960 "parser.y" + case 523: /* with_index_param_list: WITH '(' index_param_list ')' */ +#line 3964 "parser.y" { (yyval.with_index_param_list_t) = (yyvsp[-1].index_param_list_t); } -#line 9248 "parser.cpp" +#line 9262 "parser.cpp" break; - case 523: /* with_index_param_list: %empty */ -#line 3963 "parser.y" + case 524: /* with_index_param_list: %empty */ +#line 3967 "parser.y" { (yyval.with_index_param_list_t) = new std::vector(); } -#line 9256 "parser.cpp" +#line 9270 "parser.cpp" break; - case 524: /* optional_table_properties_list: PROPERTIES '(' index_param_list ')' */ -#line 3967 "parser.y" + case 525: /* optional_table_properties_list: PROPERTIES '(' index_param_list ')' */ +#line 3971 "parser.y" { (yyval.with_index_param_list_t) = (yyvsp[-1].index_param_list_t); } -#line 9264 "parser.cpp" +#line 9278 "parser.cpp" break; - case 525: /* optional_table_properties_list: %empty */ -#line 3970 "parser.y" + case 526: /* optional_table_properties_list: %empty */ +#line 3974 "parser.y" { (yyval.with_index_param_list_t) = nullptr; } -#line 9272 "parser.cpp" +#line 9286 "parser.cpp" break; - case 526: /* index_param_list: index_param */ -#line 3974 "parser.y" + case 527: /* index_param_list: index_param */ +#line 3978 "parser.y" { (yyval.index_param_list_t) = new std::vector(); (yyval.index_param_list_t)->push_back((yyvsp[0].index_param_t)); } -#line 9281 "parser.cpp" +#line 9295 "parser.cpp" break; - case 527: /* index_param_list: index_param_list ',' index_param */ -#line 3978 "parser.y" + case 528: /* index_param_list: index_param_list ',' index_param */ +#line 3982 "parser.y" { (yyvsp[-2].index_param_list_t)->push_back((yyvsp[0].index_param_t)); (yyval.index_param_list_t) = (yyvsp[-2].index_param_list_t); } -#line 9290 "parser.cpp" +#line 9304 "parser.cpp" break; - case 528: /* index_param: IDENTIFIER */ -#line 3983 "parser.y" + case 529: /* index_param: IDENTIFIER */ +#line 3987 "parser.y" { ParserHelper::ToLower((yyvsp[0].str_value)); (yyval.index_param_t) = new infinity::InitParameter(); (yyval.index_param_t)->param_name_ = (yyvsp[0].str_value); free((yyvsp[0].str_value)); } -#line 9301 "parser.cpp" +#line 9315 "parser.cpp" break; - case 529: /* index_param: IDENTIFIER '=' IDENTIFIER */ -#line 3989 "parser.y" + case 530: /* index_param: IDENTIFIER '=' IDENTIFIER */ +#line 3993 "parser.y" { ParserHelper::ToLower((yyvsp[-2].str_value)); ParserHelper::ToLower((yyvsp[0].str_value)); @@ -9312,11 +9326,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.index_param_t)->param_value_ = (yyvsp[0].str_value); free((yyvsp[0].str_value)); } -#line 9316 "parser.cpp" +#line 9330 "parser.cpp" break; - case 530: /* index_param: IDENTIFIER '=' STRING */ -#line 3999 "parser.y" + case 531: /* index_param: IDENTIFIER '=' STRING */ +#line 4003 "parser.y" { ParserHelper::ToLower((yyvsp[-2].str_value)); ParserHelper::ToLower((yyvsp[0].str_value)); @@ -9327,11 +9341,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.index_param_t)->param_value_ = (yyvsp[0].str_value); free((yyvsp[0].str_value)); } -#line 9331 "parser.cpp" +#line 9345 "parser.cpp" break; - case 531: /* index_param: IDENTIFIER '=' LONG_VALUE */ -#line 4009 "parser.y" + case 532: /* index_param: IDENTIFIER '=' LONG_VALUE */ +#line 4013 "parser.y" { ParserHelper::ToLower((yyvsp[-2].str_value)); (yyval.index_param_t) = new infinity::InitParameter(); @@ -9340,11 +9354,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.index_param_t)->param_value_ = std::to_string((yyvsp[0].long_value)); } -#line 9344 "parser.cpp" +#line 9358 "parser.cpp" break; - case 532: /* index_param: IDENTIFIER '=' DOUBLE_VALUE */ -#line 4017 "parser.y" + case 533: /* index_param: IDENTIFIER '=' DOUBLE_VALUE */ +#line 4021 "parser.y" { ParserHelper::ToLower((yyvsp[-2].str_value)); (yyval.index_param_t) = new infinity::InitParameter(); @@ -9353,11 +9367,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.index_param_t)->param_value_ = std::to_string((yyvsp[0].double_value)); } -#line 9357 "parser.cpp" +#line 9371 "parser.cpp" break; - case 533: /* index_info: '(' IDENTIFIER ')' USING IDENTIFIER with_index_param_list */ -#line 4028 "parser.y" + case 534: /* index_info: '(' IDENTIFIER ')' USING IDENTIFIER with_index_param_list */ +#line 4032 "parser.y" { ParserHelper::ToLower((yyvsp[-1].str_value)); infinity::IndexType index_type = infinity::IndexType::kInvalid; @@ -9389,22 +9403,22 @@ YYLTYPE yylloc = yyloc_default; (yyval.index_info_t)->index_param_list_ = (yyvsp[0].with_index_param_list_t); free((yyvsp[-4].str_value)); } -#line 9393 "parser.cpp" +#line 9407 "parser.cpp" break; - case 534: /* index_info: '(' IDENTIFIER ')' */ -#line 4059 "parser.y" + case 535: /* index_info: '(' IDENTIFIER ')' */ +#line 4063 "parser.y" { (yyval.index_info_t) = new infinity::IndexInfo(); (yyval.index_info_t)->index_type_ = infinity::IndexType::kSecondary; (yyval.index_info_t)->column_name_ = (yyvsp[-1].str_value); free((yyvsp[-1].str_value)); } -#line 9404 "parser.cpp" +#line 9418 "parser.cpp" break; -#line 9408 "parser.cpp" +#line 9422 "parser.cpp" default: break; } @@ -9633,7 +9647,7 @@ YYLTYPE yylloc = yyloc_default; return yyresult; } -#line 4066 "parser.y" +#line 4070 "parser.y" void diff --git a/src/parser/parser.h b/src/parser/parser.h index 0adebe02a0..a5f9c953b1 100644 --- a/src/parser/parser.h +++ b/src/parser/parser.h @@ -330,7 +330,8 @@ struct SQL_LTYPE { FILES = 457, /* FILES */ MEMORY = 458, /* MEMORY */ ALLOCATION = 459, /* ALLOCATION */ - NUMBER = 460 /* NUMBER */ + HISTORY = 460, /* HISTORY */ + NUMBER = 461 /* NUMBER */ }; typedef enum sqltokentype sqltoken_kind_t; #endif @@ -418,7 +419,7 @@ union SQLSTYPE std::pair* int_sparse_ele_t; std::pair* float_sparse_ele_t; -#line 422 "parser.h" +#line 423 "parser.h" }; typedef union SQLSTYPE SQLSTYPE; diff --git a/src/parser/parser.y b/src/parser/parser.y index 56d6fb0be1..a05ae8bd84 100644 --- a/src/parser/parser.y +++ b/src/parser/parser.y @@ -396,7 +396,7 @@ struct SQL_LTYPE { %token USING SESSION GLOBAL OFF EXPORT CONFIGS CONFIG PROFILES VARIABLES VARIABLE DELTA LOGS CATALOGS CATALOG %token SEARCH MATCH MAXSIM QUERY QUERIES FUSION ROWLIMIT %token ADMIN LEADER FOLLOWER LEARNER CONNECT STANDALONE NODES NODE REMOVE SNAPSHOT SNAPSHOTS RECOVER RESTORE -%token PERSISTENCE OBJECT OBJECTS FILES MEMORY ALLOCATION +%token PERSISTENCE OBJECT OBJECTS FILES MEMORY ALLOCATION HISTORY %token NUMBER @@ -1956,6 +1956,10 @@ show_statement: SHOW DATABASES { $$->show_type_ = infinity::ShowStmtType::kTransaction; $$->txn_id_ = $3; } +| SHOW TRANSACTION HISTORY { + $$ = new infinity::ShowStatement(); + $$->show_type_ = infinity::ShowStmtType::kTransactionHistory; +} | SHOW SESSION VARIABLES { $$ = new infinity::ShowStatement(); $$->show_type_ = infinity::ShowStmtType::kSessionVariables; diff --git a/src/parser/statement/show_statement.cpp b/src/parser/statement/show_statement.cpp index 00f3db370f..d1895042e5 100644 --- a/src/parser/statement/show_statement.cpp +++ b/src/parser/statement/show_statement.cpp @@ -120,6 +120,10 @@ std::string ShowStatement::ToString() const { ss << "Show transaction"; break; } + case ShowStmtType::kTransactionHistory: { + ss << "Show transaction history"; + break; + } case ShowStmtType::kGlobalVariable: { ss << "Show global variable"; break; diff --git a/src/parser/statement/show_statement.h b/src/parser/statement/show_statement.h index 45413daa00..46b2574d0f 100644 --- a/src/parser/statement/show_statement.h +++ b/src/parser/statement/show_statement.h @@ -48,6 +48,7 @@ enum class ShowStmtType { kQuery, kTransactions, kTransaction, + kTransactionHistory, kIndexSegment, kIndexChunk, kLogs, diff --git a/src/planner/explain_ast.cpp b/src/planner/explain_ast.cpp index 329a965a33..51cbbb6092 100644 --- a/src/planner/explain_ast.cpp +++ b/src/planner/explain_ast.cpp @@ -709,6 +709,10 @@ Status ExplainAST::BuildShow(const ShowStatement *show_statement, SharedPtremplace_back(MakeShared("SHOW TRANSACTION")); break; } + case ShowStmtType::kTransactionHistory: { + result->emplace_back(MakeShared("SHOW TRANSACTION HISTORY")); + break; + } case ShowStmtType::kProfiles: { result->emplace_back(MakeShared("SHOW QUERIES")); break; diff --git a/src/planner/explain_logical_plan.cpp b/src/planner/explain_logical_plan.cpp index 14f2c9342c..0aeea615c6 100644 --- a/src/planner/explain_logical_plan.cpp +++ b/src/planner/explain_logical_plan.cpp @@ -1723,6 +1723,24 @@ Status ExplainLogicalPlan::Explain(const LogicalShow *show_node, SharedPtremplace_back(MakeShared(output_columns_str)); break; } + case ShowStmtType::kTransactionHistory: { + String show_str; + if (intent_size != 0) { + show_str = String(intent_size - 2, ' '); + show_str += "-> SHOW TRANSACTION HISTORY "; + } else { + show_str = "SHOW TRANSACTION HISTORY "; + } + show_str += "("; + show_str += std::to_string(show_node->node_id()); + show_str += ")"; + result->emplace_back(MakeShared(show_str)); + + String output_columns_str = String(intent_size, ' '); + output_columns_str += " - output columns: [transaction]"; + result->emplace_back(MakeShared(output_columns_str)); + break; + } case ShowStmtType::kIndexes: { String show_str; if (intent_size != 0) { diff --git a/src/planner/logical_planner.cpp b/src/planner/logical_planner.cpp index 67cc68dc62..67c5c5ab09 100644 --- a/src/planner/logical_planner.cpp +++ b/src/planner/logical_planner.cpp @@ -1515,6 +1515,14 @@ Status LogicalPlanner::BuildShow(ShowStatement *statement, SharedPtrtxn_id_); break; } + case ShowStmtType::kTransactionHistory: { + this->logical_plan_ = MakeShared(bind_context_ptr->GetNewLogicalNodeId(), + ShowStmtType::kTransactionHistory, + statement->schema_name_, + statement->table_name_, + bind_context_ptr->GenerateTableIndex()); + break; + } case ShowStmtType::kSegments: { this->logical_plan_ = MakeShared(bind_context_ptr->GetNewLogicalNodeId(), ShowStmtType::kSegments, diff --git a/src/planner/node/logical_show.cpp b/src/planner/node/logical_show.cpp index 51fa10b9ec..dc69678161 100644 --- a/src/planner/node/logical_show.cpp +++ b/src/planner/node/logical_show.cpp @@ -84,6 +84,8 @@ String ToString(ShowStmtType type) { return "Show transactions"; case ShowStmtType::kTransaction: return "Show transaction"; + case ShowStmtType::kTransactionHistory: + return "Show transaction history"; case ShowStmtType::kLogs: return "Show logs"; case ShowStmtType::kDeltaLogs: diff --git a/src/storage/storage.cpp b/src/storage/storage.cpp index 415f98f2d6..bb43e3d7dc 100644 --- a/src/storage/storage.cpp +++ b/src/storage/storage.cpp @@ -337,6 +337,7 @@ Status Storage::AdminToWriter() { auto force_ckp_task = MakeShared(txn, true, system_start_ts); bg_processor_->Submit(force_ckp_task); force_ckp_task->Wait(); + txn->AddOperation(MakeShared("ForceCheckpointTask")); txn->SetReaderAllowed(true); txn_mgr_->CommitTxn(txn); diff --git a/src/storage/txn/txn.cpp b/src/storage/txn/txn.cpp index 798181c1df..df5e6df6b8 100644 --- a/src/storage/txn/txn.cpp +++ b/src/storage/txn/txn.cpp @@ -61,27 +61,33 @@ import snapshot_info; namespace infinity { Txn::Txn(TxnManager *txn_manager, BufferManager *buffer_manager, TransactionID txn_id, TxnTimeStamp begin_ts, SharedPtr txn_text) - : txn_mgr_(txn_manager), buffer_mgr_(buffer_manager), txn_store_(this), txn_id_(txn_id), begin_ts_(begin_ts), wal_entry_(MakeShared()), + : txn_mgr_(txn_manager), buffer_mgr_(buffer_manager), txn_store_(this), wal_entry_(MakeShared()), txn_delta_ops_entry_(MakeUnique()), txn_text_(std::move(txn_text)) { catalog_ = InfinityContext::instance().storage()->catalog(); #ifdef INFINITY_DEBUG GlobalResourceUsage::IncrObjectCount("Txn"); #endif + txn_context_ptr_ = TxnContext::Make(); + txn_context_ptr_->txn_id_ = txn_id; + txn_context_ptr_->begin_ts_ = begin_ts; } Txn::Txn(BufferManager *buffer_mgr, TxnManager *txn_mgr, TransactionID txn_id, TxnTimeStamp begin_ts) - : txn_mgr_(txn_mgr), buffer_mgr_(buffer_mgr), txn_store_(this), txn_id_(txn_id), begin_ts_(begin_ts), wal_entry_(MakeShared()), + : txn_mgr_(txn_mgr), buffer_mgr_(buffer_mgr), txn_store_(this), wal_entry_(MakeShared()), txn_delta_ops_entry_(MakeUnique()) { catalog_ = InfinityContext::instance().storage()->catalog(); #ifdef INFINITY_DEBUG GlobalResourceUsage::IncrObjectCount("Txn"); #endif + txn_context_ptr_ = TxnContext::Make(); + txn_context_ptr_->txn_id_ = txn_id; + txn_context_ptr_->begin_ts_ = begin_ts; } UniquePtr Txn::NewReplayTxn(BufferManager *buffer_mgr, TxnManager *txn_mgr, TransactionID txn_id, TxnTimeStamp begin_ts) { auto txn = MakeUnique(buffer_mgr, txn_mgr, txn_id, begin_ts); - txn->commit_ts_ = begin_ts; - txn->state_ = TxnState::kCommitted; + txn->txn_context_ptr_->commit_ts_ = begin_ts; + txn->txn_context_ptr_->state_ = TxnState::kCommitted; return txn; } @@ -100,7 +106,10 @@ Status Txn::Import(TableEntry *table_entry, SharedPtr segment_entr // build WalCmd WalSegmentInfo segment_info(segment_entry.get()); - wal_entry_->cmds_.push_back(MakeShared(db_name, table_name, std::move(segment_info))); + + SharedPtr wal_command = MakeShared(db_name, table_name, std::move(segment_info)); + wal_entry_->cmds_.push_back(wal_command); + txn_context_ptr_->AddOperation(MakeShared(wal_command->ToString())); TxnTableStore *table_store = this->GetTxnTableStore(table_entry); table_store->Import(std::move(segment_entry), this); @@ -115,7 +124,10 @@ Status Txn::Append(TableEntry *table_entry, const SharedPtr &input_bl this->CheckTxn(db_name); TxnTableStore *table_store = this->GetTxnTableStore(table_entry); - wal_entry_->cmds_.push_back(MakeShared(db_name, table_name, input_block)); + SharedPtr wal_command = MakeShared(db_name, table_name, input_block); + wal_entry_->cmds_.push_back(wal_command); + txn_context_ptr_->AddOperation(MakeShared(wal_command->ToString())); + auto [err_msg, append_status] = table_store->Append(input_block); return append_status; } @@ -126,14 +138,16 @@ Status Txn::Delete(TableEntry *table_entry, const Vector &row_ids, bool c this->CheckTxn(db_name); - if (check_conflict && table_entry->CheckDeleteConflict(row_ids, txn_id_)) { + if (check_conflict && table_entry->CheckDeleteConflict(row_ids, txn_context_ptr_->txn_id_)) { String log_msg = fmt::format("Rollback delete in table {} due to conflict.", table_name); RecoverableError(Status::TxnRollback(TxnID(), log_msg)); } TxnTableStore *table_store = this->GetTxnTableStore(table_entry); - wal_entry_->cmds_.push_back(MakeShared(db_name, table_name, row_ids)); + SharedPtr wal_command = MakeShared(db_name, table_name, row_ids); + wal_entry_->cmds_.push_back(wal_command); + txn_context_ptr_->AddOperation(MakeShared(wal_command->ToString())); auto [err_msg, delete_status] = table_store->Delete(row_ids); return delete_status; } @@ -154,7 +168,10 @@ Status Txn::OptIndex(TableIndexEntry *table_index_entry, VectorGetTableName(); table_index_entry->OptIndex(txn_table_store, init_params, false /*replay*/); - wal_entry_->cmds_.push_back(MakeShared(db_name_, table_name, index_name, std::move(init_params))); + SharedPtr wal_command = MakeShared(db_name_, table_name, index_name, std::move(init_params)); + wal_entry_->cmds_.push_back(wal_command); + txn_context_ptr_->AddOperation(MakeShared(wal_command->ToString())); + return Status::OK(); } @@ -185,13 +202,15 @@ Status Txn::CreateDatabase(const SharedPtr &db_name, ConflictType confli this->CheckTxnStatus(); TxnTimeStamp begin_ts = this->BeginTS(); - auto [db_entry, status] = catalog_->CreateDatabase(db_name, comment, this->txn_id_, begin_ts, txn_mgr_, conflict_type); + auto [db_entry, status] = catalog_->CreateDatabase(db_name, comment, txn_context_ptr_->txn_id_, begin_ts, txn_mgr_, conflict_type); if (db_entry == nullptr) { // nullptr means some exception happened return status; } txn_store_.AddDBStore(db_entry); - wal_entry_->cmds_.push_back(MakeShared(*db_name, db_entry->GetPathNameTail(), *comment)); + SharedPtr wal_command = MakeShared(*db_name, db_entry->GetPathNameTail(), *comment); + wal_entry_->cmds_.push_back(wal_command); + txn_context_ptr_->AddOperation(MakeShared(wal_command->ToString())); return Status::OK(); } @@ -199,13 +218,15 @@ Status Txn::DropDatabase(const String &db_name, ConflictType conflict_type) { this->CheckTxnStatus(); TxnTimeStamp begin_ts = this->BeginTS(); - auto [dropped_db_entry, status] = catalog_->DropDatabase(db_name, txn_id_, begin_ts, txn_mgr_, conflict_type); + auto [dropped_db_entry, status] = catalog_->DropDatabase(db_name, txn_context_ptr_->txn_id_, begin_ts, txn_mgr_, conflict_type); if (dropped_db_entry.get() == nullptr) { return status; } txn_store_.DropDBStore(dropped_db_entry.get()); - wal_entry_->cmds_.push_back(MakeShared(db_name)); + SharedPtr wal_command = MakeShared(db_name); + wal_entry_->cmds_.push_back(wal_command); + txn_context_ptr_->AddOperation(MakeShared(wal_command->ToString())); return Status::OK(); } @@ -213,20 +234,20 @@ Tuple Txn::GetDatabase(const String &db_name) { this->CheckTxnStatus(); TxnTimeStamp begin_ts = this->BeginTS(); - return catalog_->GetDatabase(db_name, this->txn_id_, begin_ts); + return catalog_->GetDatabase(db_name, txn_context_ptr_->txn_id_, begin_ts); } Tuple, Status> Txn::GetDatabaseInfo(const String &db_name) { this->CheckTxnStatus(); TxnTimeStamp begin_ts = this->BeginTS(); - return catalog_->GetDatabaseInfo(db_name, this->txn_id_, begin_ts); + return catalog_->GetDatabaseInfo(db_name, txn_context_ptr_->txn_id_, begin_ts); } Vector Txn::ListDatabases() { Vector res; - Vector db_entries = catalog_->Databases(txn_id_, this->BeginTS()); + Vector db_entries = catalog_->Databases(txn_context_ptr_->txn_id_, this->BeginTS()); SizeT db_count = db_entries.size(); for (SizeT idx = 0; idx < db_count; ++idx) { DBEntry *db_entry = db_entries[idx]; @@ -250,14 +271,16 @@ Status Txn::CreateTable(const String &db_name, const SharedPtr &table_ LOG_TRACE("Txn::CreateTable try to insert a created table placeholder on catalog"); - auto [table_entry, table_status] = catalog_->CreateTable(db_name, txn_id_, begin_ts, table_def, conflict_type, txn_mgr_); + auto [table_entry, table_status] = catalog_->CreateTable(db_name, txn_context_ptr_->txn_id_, begin_ts, table_def, conflict_type, txn_mgr_); if (table_entry == nullptr) { return table_status; } txn_store_.AddTableStore(table_entry); - wal_entry_->cmds_.push_back(MakeShared(std::move(db_name), table_entry->GetPathNameTail(), table_def)); + SharedPtr wal_command = MakeShared(std::move(db_name), table_entry->GetPathNameTail(), table_def); + wal_entry_->cmds_.push_back(wal_command); + txn_context_ptr_->AddOperation(MakeShared(wal_command->ToString())); LOG_TRACE("Txn::CreateTable created table entry is inserted."); return Status::OK(); @@ -271,7 +294,7 @@ Status Txn::RenameTable(TableEntry *old_table_entry, const String &new_table_nam Status Txn::AddColumns(TableEntry *table_entry, const Vector> &column_defs) { TxnTimeStamp begin_ts = this->BeginTS(); - auto [db_entry, db_status] = catalog_->GetDatabase(*table_entry->GetDBName(), txn_id_, begin_ts); + auto [db_entry, db_status] = catalog_->GetDatabase(*table_entry->GetDBName(), txn_context_ptr_->txn_id_, begin_ts); if (!db_status.ok()) { return db_status; } @@ -279,19 +302,22 @@ Status Txn::AddColumns(TableEntry *table_entry, const VectorInitCompactionAlg(begin_ts); TxnTableStore *txn_table_store = txn_store_.GetTxnTableStore(new_table_entry.get()); new_table_entry->AddColumns(column_defs, txn_table_store); - auto add_status = db_entry->AddTable(std::move(new_table_entry), txn_id_, begin_ts, txn_mgr_, true /*add_if_found*/); + auto add_status = db_entry->AddTable(std::move(new_table_entry), txn_context_ptr_->txn_id_, begin_ts, txn_mgr_, true /*add_if_found*/); if (!add_status.ok()) { return add_status; } - wal_entry_->cmds_.push_back(MakeShared(*table_entry->GetDBName(), *table_entry->GetTableName(), column_defs)); + SharedPtr wal_command = MakeShared(*table_entry->GetDBName(), *table_entry->GetTableName(), column_defs); + wal_entry_->cmds_.push_back(wal_command); + txn_context_ptr_->AddOperation(MakeShared(wal_command->ToString())); + return Status::OK(); } Status Txn::DropColumns(TableEntry *table_entry, const Vector &column_names) { TxnTimeStamp begin_ts = this->BeginTS(); - auto [db_entry, db_status] = catalog_->GetDatabase(*table_entry->GetDBName(), txn_id_, begin_ts); + auto [db_entry, db_status] = catalog_->GetDatabase(*table_entry->GetDBName(), txn_context_ptr_->txn_id_, begin_ts); if (!db_status.ok()) { return db_status; } @@ -299,12 +325,15 @@ Status Txn::DropColumns(TableEntry *table_entry, const Vector &column_na new_table_entry->InitCompactionAlg(begin_ts); TxnTableStore *txn_table_store = txn_store_.GetTxnTableStore(new_table_entry.get()); new_table_entry->DropColumns(column_names, txn_table_store); - auto drop_status = db_entry->AddTable(std::move(new_table_entry), txn_id_, begin_ts, txn_mgr_, true /*add_if_found*/); + auto drop_status = db_entry->AddTable(std::move(new_table_entry), txn_context_ptr_->txn_id_, begin_ts, txn_mgr_, true /*add_if_found*/); if (!drop_status.ok()) { return drop_status; } - wal_entry_->cmds_.push_back(MakeShared(*table_entry->GetDBName(), *table_entry->GetTableName(), column_names)); + SharedPtr wal_command = MakeShared(*table_entry->GetDBName(), *table_entry->GetTableName(), column_names); + wal_entry_->cmds_.push_back(wal_command); + txn_context_ptr_->AddOperation(MakeShared(wal_command->ToString())); + return Status::OK(); } @@ -314,14 +343,17 @@ Status Txn::DropTableCollectionByName(const String &db_name, const String &table TxnTimeStamp begin_ts = this->BeginTS(); LOG_TRACE("Txn::DropTableCollectionByName try to insert a dropped table placeholder on catalog"); - auto [table_entry, table_status] = catalog_->DropTableByName(db_name, table_name, conflict_type, txn_id_, begin_ts, txn_mgr_); + auto [table_entry, table_status] = catalog_->DropTableByName(db_name, table_name, conflict_type, txn_context_ptr_->txn_id_, begin_ts, txn_mgr_); if (table_entry.get() == nullptr) { return table_status; } txn_store_.DropTableStore(table_entry.get()); - wal_entry_->cmds_.push_back(MakeShared(db_name, table_name)); + + SharedPtr wal_command = MakeShared(db_name, table_name); + wal_entry_->cmds_.push_back(wal_command); + txn_context_ptr_->AddOperation(MakeShared(wal_command->ToString())); LOG_TRACE("Txn::DropTableCollectionByName dropped table entry is inserted."); return Status::OK(); @@ -331,7 +363,8 @@ Status Txn::DropTableCollectionByName(const String &db_name, const String &table Tuple Txn::CreateIndexDef(TableEntry *table_entry, const SharedPtr &index_base, ConflictType conflict_type) { TxnTimeStamp begin_ts = this->BeginTS(); - auto [table_index_entry, index_status] = catalog_->CreateIndex(table_entry, index_base, conflict_type, txn_id_, begin_ts, txn_mgr_); + auto [table_index_entry, index_status] = + catalog_->CreateIndex(table_entry, index_base, conflict_type, txn_context_ptr_->txn_id_, begin_ts, txn_mgr_); if (table_index_entry == nullptr) { // nullptr means some exception happened return {nullptr, index_status}; } @@ -339,8 +372,12 @@ Tuple Txn::CreateIndexDef(TableEntry *table_entry, co txn_table_store->AddIndexStore(table_index_entry); String index_dir_tail = table_index_entry->GetPathNameTail(); - wal_entry_->cmds_.push_back( - MakeShared(*table_entry->GetDBName(), *table_entry->GetTableName(), std::move(index_dir_tail), index_base)); + + SharedPtr wal_command = + MakeShared(*table_entry->GetDBName(), *table_entry->GetTableName(), std::move(index_dir_tail), index_base); + wal_entry_->cmds_.push_back(wal_command); + txn_context_ptr_->AddOperation(MakeShared(wal_command->ToString())); + return {table_index_entry, index_status}; } @@ -348,12 +385,12 @@ Tuple Txn::GetIndexByName(const String &db_name, cons this->CheckTxn(db_name); TxnTimeStamp begin_ts = this->BeginTS(); - return catalog_->GetIndexByName(db_name, table_name, index_name, txn_id_, begin_ts); + return catalog_->GetIndexByName(db_name, table_name, index_name, txn_context_ptr_->txn_id_, begin_ts); } Tuple, Status> Txn::GetTableIndexInfo(const String &db_name, const String &table_name, const String &index_name) { TxnTimeStamp begin_ts = this->BeginTS(); - return catalog_->GetTableIndexInfo(db_name, table_name, index_name, txn_id_, begin_ts); + return catalog_->GetTableIndexInfo(db_name, table_name, index_name, txn_context_ptr_->txn_id_, begin_ts); } Pair, Status> @@ -421,7 +458,8 @@ Status Txn::DropIndexByName(const String &db_name, const String &table_name, con TxnTimeStamp begin_ts = this->BeginTS(); - auto [table_index_entry, index_status] = catalog_->DropIndex(db_name, table_name, index_name, conflict_type, txn_id_, begin_ts, txn_mgr_); + auto [table_index_entry, index_status] = + catalog_->DropIndex(db_name, table_name, index_name, conflict_type, txn_context_ptr_->txn_id_, begin_ts, txn_mgr_); if (table_index_entry.get() == nullptr) { return index_status; } @@ -429,7 +467,10 @@ Status Txn::DropIndexByName(const String &db_name, const String &table_name, con auto *txn_table_store = this->GetTxnTableStore(table_entry); txn_table_store->DropIndexStore(table_index_entry.get()); - wal_entry_->cmds_.push_back(MakeShared(db_name, table_name, index_name)); + SharedPtr wal_command = MakeShared(db_name, table_name, index_name); + wal_entry_->cmds_.push_back(wal_command); + txn_context_ptr_->AddOperation(MakeShared(wal_command->ToString())); + return index_status; } @@ -438,7 +479,7 @@ Tuple Txn::GetTableByName(const String &db_name, const Str TxnTimeStamp begin_ts = this->BeginTS(); - return catalog_->GetTableByName(db_name, table_name, txn_id_, begin_ts); + return catalog_->GetTableByName(db_name, table_name, txn_context_ptr_->txn_id_, begin_ts); } Tuple, Status> Txn::GetTableInfo(const String &db_name, const String &table_name) { @@ -477,67 +518,68 @@ Status Txn::GetViews(const String &, Vector &output_view_array) { TxnTimeStamp Txn::CommitTS() const { std::shared_lock r_locker(rw_locker_); - return commit_ts_; + return txn_context_ptr_->commit_ts_; } -TxnTimeStamp Txn::BeginTS() const { return begin_ts_; } +TxnTimeStamp Txn::BeginTS() const { return txn_context_ptr_->begin_ts_; } TxnState Txn::GetTxnState() const { std::shared_lock r_locker(rw_locker_); - return state_; + return txn_context_ptr_->state_; } -TxnType Txn::GetTxnType() const { return type_; } +TxnType Txn::GetTxnType() const { return txn_context_ptr_->type_; } void Txn::SetTxnRollbacking(TxnTimeStamp rollback_ts) { std::unique_lock w_locker(rw_locker_); - if (state_ != TxnState::kCommitting && state_ != TxnState::kStarted) { - String error_message = fmt::format("Transaction is in {} status, which can't rollback.", ToString(state_)); + TxnState txn_state = txn_context_ptr_->state_; + if (txn_state != TxnState::kCommitting && txn_state != TxnState::kStarted) { + String error_message = fmt::format("Transaction is in {} status, which can't rollback.", TxnState2Str(txn_state)); UnrecoverableError(error_message); } - state_ = TxnState::kRollbacking; - commit_ts_ = rollback_ts; // update commit_ts ? + txn_context_ptr_->state_ = TxnState::kRollbacking; + txn_context_ptr_->commit_ts_ = rollback_ts; // update commit_ts ? } void Txn::SetTxnRollbacked() { std::unique_lock w_locker(rw_locker_); - state_ = TxnState::kRollbacked; + txn_context_ptr_->state_ = TxnState::kRollbacked; } -void Txn::SetTxnRead() { type_ = TxnType::kRead; } +void Txn::SetTxnRead() { txn_context_ptr_->type_ = TxnType::kRead; } -void Txn::SetTxnWrite() { type_ = TxnType::kWrite; } +void Txn::SetTxnWrite() { txn_context_ptr_->type_ = TxnType::kWrite; } void Txn::SetTxnCommitted() { std::unique_lock w_locker(rw_locker_); - if (state_ != TxnState::kCommitting) { + if (txn_context_ptr_->state_ != TxnState::kCommitting) { String error_message = "Transaction isn't in COMMITTING status."; UnrecoverableError(error_message); } - state_ = TxnState::kCommitted; + txn_context_ptr_->state_ = TxnState::kCommitted; } void Txn::SetTxnCommitting(TxnTimeStamp commit_ts) { std::unique_lock w_locker(rw_locker_); - if (state_ != TxnState::kStarted) { + if (txn_context_ptr_->state_ != TxnState::kStarted) { String error_message = "Transaction isn't in STARTED status."; UnrecoverableError(error_message); } - state_ = TxnState::kCommitting; - commit_ts_ = commit_ts; + txn_context_ptr_->state_ = TxnState::kCommitting; + txn_context_ptr_->commit_ts_ = commit_ts; wal_entry_->commit_ts_ = commit_ts; } WalEntry *Txn::GetWALEntry() const { return wal_entry_.get(); } // void Txn::Begin() { -// TxnTimeStamp ts = txn_mgr_->GetBeginTimestamp(txn_id_); -// LOG_TRACE(fmt::format("Txn: {} is Begin. begin ts: {}", txn_id_, ts)); +// TxnTimeStamp ts = txn_mgr_->GetBeginTimestamp(txn_context_ptr_->txn_id_); +// LOG_TRACE(fmt::format("Txn: {} is Begin. begin ts: {}", txn_context_ptr_->txn_id_, ts)); // this->SetTxnBegin(ts); // } // void Txn::SetBeginTS(TxnTimeStamp begin_ts) { -// LOG_TRACE(fmt::format("Txn: {} is Begin. begin ts: {}", txn_id_, begin_ts)); +// LOG_TRACE(fmt::format("Txn: {} is Begin. begin ts: {}", txn_context_ptr_->txn_id_, begin_ts)); // this->SetTxnBegin(begin_ts); // } @@ -561,22 +603,23 @@ TxnTimeStamp Txn::Commit() { // register commit ts in wal manager here, define the commit sequence TxnTimeStamp commit_ts = txn_mgr_->GetWriteCommitTS(this); - LOG_TRACE(fmt::format("Txn: {} is committing, begin_ts:{} committing ts: {}", txn_id_, BeginTS(), commit_ts)); + LOG_TRACE(fmt::format("Txn: {} is committing, begin_ts:{} committing ts: {}", txn_context_ptr_->txn_id_, BeginTS(), commit_ts)); this->SetTxnCommitting(commit_ts); txn_store_.PrepareCommit1(); // Only for import and compact, pre-commit segment - // LOG_INFO(fmt::format("Txn {} commit ts: {}", txn_id_, commit_ts)); + // LOG_INFO(fmt::format("Txn {} commit ts: {}", txn_context_ptr_->txn_id_, commit_ts)); if (const auto conflict_reason = txn_mgr_->CheckTxnConflict(this); conflict_reason) { - LOG_ERROR(fmt::format("Txn: {} is rolled back. rollback ts: {}. Txn conflict reason: {}.", txn_id_, commit_ts, *conflict_reason)); + LOG_ERROR( + fmt::format("Txn: {} is rolled back. rollback ts: {}. Txn conflict reason: {}.", txn_context_ptr_->txn_id_, commit_ts, *conflict_reason)); wal_entry_ = nullptr; txn_mgr_->SendToWAL(this); - RecoverableError(Status::TxnConflict(txn_id_, fmt::format("Txn conflict reason: {}.", *conflict_reason))); + RecoverableError(Status::TxnConflict(txn_context_ptr_->txn_id_, fmt::format("Txn conflict reason: {}.", *conflict_reason))); } // Put wal entry to the manager in the same order as commit_ts. - wal_entry_->txn_id_ = txn_id_; + wal_entry_->txn_id_ = txn_context_ptr_->txn_id_; txn_mgr_->SendToWAL(this); // Wait until CommitTxnBottom is done. @@ -596,32 +639,32 @@ TxnTimeStamp Txn::Commit() { bool Txn::CheckConflict() { return txn_store_.CheckConflict(catalog_); } Optional Txn::CheckConflict(Txn *other_txn) { - LOG_TRACE(fmt::format("Txn {} check conflict with {}.", txn_id_, other_txn->txn_id_)); + LOG_TRACE(fmt::format("Txn {} check conflict with {}.", txn_context_ptr_->txn_id_, other_txn->txn_context_ptr_->txn_id_)); return txn_store_.CheckConflict(other_txn->txn_store_); } void Txn::CommitBottom() { - LOG_TRACE(fmt::format("Txn bottom: {} is started.", txn_id_)); + LOG_TRACE(fmt::format("Txn bottom: {} is started.", txn_context_ptr_->txn_id_)); // prepare to commit txn local data into table TxnTimeStamp commit_ts = this->CommitTS(); - txn_store_.PrepareCommit(txn_id_, commit_ts, buffer_mgr_); + txn_store_.PrepareCommit(txn_context_ptr_->txn_id_, commit_ts, buffer_mgr_); - txn_store_.CommitBottom(txn_id_, commit_ts); + txn_store_.CommitBottom(txn_context_ptr_->txn_id_, commit_ts); txn_store_.AddDeltaOp(txn_delta_ops_entry_.get(), txn_mgr_); // Don't need to write empty CatalogDeltaEntry (read-only transactions). if (!txn_delta_ops_entry_->operations().empty()) { - txn_delta_ops_entry_->SaveState(txn_id_, this->CommitTS(), txn_mgr_->NextSequence()); + txn_delta_ops_entry_->SaveState(txn_context_ptr_->txn_id_, this->CommitTS(), txn_mgr_->NextSequence()); } // Notify the top half std::unique_lock lk(commit_lock_); commit_bottom_done_ = true; commit_cv_.notify_one(); - LOG_TRACE(fmt::format("Txn bottom: {} is finished.", txn_id_)); + LOG_TRACE(fmt::format("Txn bottom: {} is finished.", txn_context_ptr_->txn_id_)); } void Txn::CancelCommitBottom() { @@ -640,14 +683,14 @@ void Txn::Rollback() { } else if (state == TxnState::kCommitting) { abort_ts = this->CommitTS(); } else { - String error_message = fmt::format("Transaction {} state is {}.", txn_id_, ToString(state)); + String error_message = fmt::format("Transaction {} state is {}.", txn_context_ptr_->txn_id_, TxnState2Str(state)); UnrecoverableError(error_message); } this->SetTxnRollbacking(abort_ts); - txn_store_.Rollback(txn_id_, abort_ts); + txn_store_.Rollback(txn_context_ptr_->txn_id_, abort_ts); - LOG_TRACE(fmt::format("Txn: {} is dropped.", txn_id_)); + LOG_TRACE(fmt::format("Txn: {} is dropped.", txn_context_ptr_->txn_id_)); } void Txn::AddWalCmd(const SharedPtr &cmd) { @@ -658,6 +701,7 @@ void Txn::AddWalCmd(const SharedPtr &cmd) { UnrecoverableError(fmt::format("Should add wal cmd in started state, begin_ts: {}", begin_ts)); } wal_entry_->cmds_.push_back(cmd); + txn_context_ptr_->AddOperation(MakeShared(cmd->ToString())); } // the max_commit_ts is determined by the max commit ts of flushed delta entry @@ -668,7 +712,9 @@ bool Txn::DeltaCheckpoint(TxnTimeStamp last_ckp_ts, TxnTimeStamp &max_commit_ts) if (!catalog_->SaveDeltaCatalog(last_ckp_ts, max_commit_ts, delta_path, delta_name)) { return false; } - wal_entry_->cmds_.push_back(MakeShared(max_commit_ts, false, delta_path, delta_name)); + SharedPtr wal_command = MakeShared(max_commit_ts, false, delta_path, delta_name); + wal_entry_->cmds_.push_back(wal_command); + txn_context_ptr_->AddOperation(MakeShared(wal_command->ToString())); return true; } @@ -678,7 +724,10 @@ void Txn::FullCheckpoint(const TxnTimeStamp max_commit_ts) { String full_path, full_name; catalog_->SaveFullCatalog(max_commit_ts, full_path, full_name); - wal_entry_->cmds_.push_back(MakeShared(max_commit_ts, true, full_path, full_name)); + + SharedPtr wal_command = MakeShared(max_commit_ts, true, full_path, full_name); + wal_entry_->cmds_.push_back(wal_command); + txn_context_ptr_->AddOperation(MakeShared(wal_command->ToString())); } void Txn::AddWriteTxnNum(TableEntry *table_entry) { diff --git a/src/storage/txn/txn.cppm b/src/storage/txn/txn.cppm index 6179517531..fe7082e70b 100644 --- a/src/storage/txn/txn.cppm +++ b/src/storage/txn/txn.cppm @@ -33,6 +33,7 @@ import internal_types; import column_def; import value; import snapshot_info; +import txn_context; namespace infinity { @@ -184,7 +185,7 @@ public: // Getter BufferManager *buffer_mgr() const { return buffer_mgr_; } - inline TransactionID TxnID() const { return txn_id_; } + inline TransactionID TxnID() const { return txn_context_ptr_->txn_id_; } TxnTimeStamp CommitTS() const; @@ -237,6 +238,10 @@ public: TxnStore *txn_store() { return &txn_store_; } + SharedPtr txn_context() const { return txn_context_ptr_; } + void AddOperation(const SharedPtr &operation_text) { txn_context_ptr_->AddOperation(operation_text); } + Vector> GetOperations() const { return txn_context_ptr_->GetOperations(); } + private: void CheckTxnStatus(); @@ -249,14 +254,9 @@ private: Catalog *catalog_{}; TxnStore txn_store_; // this has this ptr, so txn cannot be moved. - TransactionID txn_id_{}; // Use as txn context; mutable std::shared_mutex rw_locker_{}; - const TxnTimeStamp begin_ts_{}; - TxnTimeStamp commit_ts_{}; - TxnState state_{TxnState::kStarted}; - TxnType type_{TxnType::kInvalid}; // Handled database String db_name_{}; @@ -277,6 +277,9 @@ private: // ADMIN command which allowed in follower and learner bool allowed_in_reader_{false}; + +private: + SharedPtr txn_context_ptr_{}; }; } // namespace infinity diff --git a/src/storage/txn/txn_context.cpp b/src/storage/txn/txn_context.cpp new file mode 100644 index 0000000000..fc84a3ed80 --- /dev/null +++ b/src/storage/txn/txn_context.cpp @@ -0,0 +1,34 @@ +// Copyright(C) 2025 InfiniFlow, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module; + +#include + +module txn_context; + +import stl; + +namespace infinity { + +String TxnContext::ToString() { + std::stringstream ss; + ss << "Txn ID: " << txn_id_ << ", Begin TS: " << begin_ts_ << ", Commit TS: " << commit_ts_ << ", State: " << TxnState2Str(state_) << "\n"; + for (const auto &operation : operations_) { + ss << *operation << "\n"; + } + return ss.str(); +} + +} \ No newline at end of file diff --git a/src/storage/txn/txn_context.cppm b/src/storage/txn/txn_context.cppm new file mode 100644 index 0000000000..01ccaa4f3d --- /dev/null +++ b/src/storage/txn/txn_context.cppm @@ -0,0 +1,41 @@ +// Copyright(C) 2024 InfiniFlow, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module; + +export module txn_context; + +import stl; +import txn_state; + +namespace infinity { + +export struct TxnContext { + // This struct is used to store the operation history of a transaction. This history can be used for debugging purposes. + static UniquePtr Make() { return MakeUnique(); } + + void AddOperation(const SharedPtr &operation_text) { operations_.push_back(operation_text); } + Vector> GetOperations() const { return operations_; } + String ToString(); + + TransactionID txn_id_{}; + TxnTimeStamp begin_ts_{}; + TxnTimeStamp commit_ts_{}; + TxnState state_{TxnState::kStarted}; + TxnType type_{TxnType::kInvalid}; + + Vector> operations_; +}; + +} // namespace infinity diff --git a/src/storage/txn/txn_manager.cpp b/src/storage/txn/txn_manager.cpp index a2bad7f40c..57b382cb07 100644 --- a/src/storage/txn/txn_manager.cpp +++ b/src/storage/txn/txn_manager.cpp @@ -285,6 +285,18 @@ UniquePtr TxnManager::GetTxnInfoByID(TransactionID txn_id) const { return MakeUnique(iter->first, iter->second->GetTxnText()); } +Vector> TxnManager::GetTxnContextHistories() const { + std::unique_lock w_lock(locker_); + Vector> txn_context_histories; + txn_context_histories.reserve(txn_context_histories_.size()); + + for (const auto &context_ptr : txn_context_histories_) { + txn_context_histories.emplace_back(context_ptr); + } + + return txn_context_histories; +} + TxnTimeStamp TxnManager::CurrentTS() const { return current_ts_; } TxnTimeStamp TxnManager::GetNewTimeStamp() { return current_ts_ + 1; } @@ -317,11 +329,17 @@ TxnTimeStamp TxnManager::GetCleanupScanTS() { void TxnManager::CleanupTxn(Txn *txn) { TxnType txn_type = txn->GetTxnType(); + TransactionID txn_id = txn->TxnID(); switch (txn_type) { case TxnType::kRead: { // For read-only Txn only remove txn from txn_map std::lock_guard guard(locker_); - txn_map_.erase(txn->TxnID()); + // SharedPtr txn_ptr = txn_map_[txn_id]; + // if (txn_contexts_.size() >= DEFAULT_TXN_HISTORY_SIZE) { + // txn_contexts_.pop_front(); + // } + // txn_contexts_.push_back(txn_ptr); + txn_map_.erase(txn_id); break; } case TxnType::kWrite: { @@ -337,11 +355,10 @@ void TxnManager::CleanupTxn(Txn *txn) { break; } default: { - String error_message = fmt::format("Invalid transaction status: {}", ToString(txn_state)); + String error_message = fmt::format("Invalid transaction status: {}", TxnState2Str(txn_state)); UnrecoverableError(error_message); } } - TransactionID txn_id = txn->TxnID(); { // cleanup the txn from committing_txn and txm_map auto commit_ts = txn->CommitTS(); @@ -350,6 +367,11 @@ void TxnManager::CleanupTxn(Txn *txn) { if (remove_n == 0) { UnrecoverableError("Txn not found in committing_txns_"); } + SharedPtr txn_ptr = txn_map_[txn_id]; + if (txn_context_histories_.size() >= DEFAULT_TXN_HISTORY_SIZE) { + txn_context_histories_.pop_front(); + } + txn_context_histories_.push_back(txn_ptr->txn_context()); remove_n = txn_map_.erase(txn_id); if (remove_n == 0) { String error_message = fmt::format("Txn: {} not found in txn map", txn_id); diff --git a/src/storage/txn/txn_manager.cppm b/src/storage/txn/txn_manager.cppm index 4acf0ee236..e0ba6c73b9 100644 --- a/src/storage/txn/txn_manager.cppm +++ b/src/storage/txn/txn_manager.cppm @@ -22,6 +22,7 @@ import buffer_manager; import txn_state; import wal_entry; import default_values; +import txn_context; namespace infinity { @@ -78,6 +79,8 @@ public: UniquePtr GetTxnInfoByID(TransactionID txn_id) const; + Vector> GetTxnContextHistories() const; + TxnTimeStamp CurrentTS() const; TxnTimeStamp GetNewTimeStamp(); @@ -112,6 +115,8 @@ private: BufferManager *buffer_mgr_{}; HashMap> txn_map_{}; + Deque> txn_context_histories_{}; + WalManager *wal_mgr_; Deque> beginned_txns_; // sorted by begin ts diff --git a/src/storage/txn/txn_state.cppm b/src/storage/txn/txn_state.cppm index b6af9f00fc..ef0e5bdb35 100644 --- a/src/storage/txn/txn_state.cppm +++ b/src/storage/txn/txn_state.cppm @@ -32,7 +32,7 @@ export enum class TxnState { kInvalid, }; -export inline String ToString(TxnState txn_state) { +export inline String TxnState2Str(TxnState txn_state) { switch (txn_state) { case TxnState::kNotStarted: { return "Not Started"; @@ -67,4 +67,18 @@ export enum class TxnType : i8 { kInvalid, }; +export inline String TxnType2Str(TxnType txn_type) { + switch (txn_type) { + case TxnType::kRead: { + return "Read"; + } + case TxnType::kWrite: { + return "Write"; + } + default: { + return "Not decided"; + } + } +} + } // namespace infinity diff --git a/src/unit_test/storage/txn/constants.cpp b/src/unit_test/storage/txn/constants.cpp index 41697920d2..07726ae7b2 100644 --- a/src/unit_test/storage/txn/constants.cpp +++ b/src/unit_test/storage/txn/constants.cpp @@ -30,5 +30,5 @@ class TxnContants : public BaseTest {}; TEST_F(TxnContants, test1) { using namespace infinity; - EXPECT_EQ(ToString(TxnState::kStarted), "Started"); + EXPECT_EQ(TxnState2Str(TxnState::kStarted), "Started"); } diff --git a/test/sql/dql/result_cache/cached_index_scan.slt b/test/sql/dql/result_cache/cached_index_scan.slt index b9026bdda8..085ddf3942 100644 --- a/test/sql/dql/result_cache/cached_index_scan.slt +++ b/test/sql/dql/result_cache/cached_index_scan.slt @@ -39,18 +39,18 @@ SELECT * FROM cached_index_scan WHERE (c1 < 5) OR (c1 > 10000 AND c1 < 10005) OR 10004 20 1 19990 22 5 -query I -EXPLAIN SELECT * FROM cached_index_scan WHERE (c1 < 5) OR (c1 > 10000 AND c1 < 10005) OR c1 = 19990 ORDER BY c1; ----- - PROJECT (5) - - table index: #4 - - expressions: [c1 (#0), mod_256_min_128 (#1), mod_7 (#2)] - -> SORT (4) - - expressions: [c1 (#0) ASC] - - output columns: [c1, __rowid] - -> Read cache (7) - - table name: (default_db.cached_index_scan) - - output columns: [__rowid] +# query I +# EXPLAIN SELECT * FROM cached_index_scan WHERE (c1 < 5) OR (c1 > 10000 AND c1 < 10005) OR c1 = 19990 ORDER BY c1; +#---- +# PROJECT (5) +# - table index: #4 +# - expressions: [c1 (#0), mod_256_min_128 (#1), mod_7 (#2)] +# -> SORT (4) +# - expressions: [c1 (#0) ASC] +# - output columns: [c1, __rowid] +# -> Read cache (7) +# - table name: (default_db.cached_index_scan) +# - output columns: [__rowid] query I SELECT * FROM cached_index_scan WHERE (c1 < 5) OR (c1 > 10000 AND c1 < 10005) OR c1 = 19990 ORDER BY c1; From dd36ce89600353b98f883fa7ba79fdc690e3b315 Mon Sep 17 00:00:00 2001 From: Jin Hai Date: Fri, 3 Jan 2025 16:15:21 +0800 Subject: [PATCH 5/9] Fix show txn history without ongoing txn (#2420) ### What problem does this PR solve? As title ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) Signed-off-by: Jin Hai --- src/storage/io/s3_client_minio.cpp | 2 +- src/storage/txn/txn_manager.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/storage/io/s3_client_minio.cpp b/src/storage/io/s3_client_minio.cpp index 8aff3915f0..0f122880cd 100644 --- a/src/storage/io/s3_client_minio.cpp +++ b/src/storage/io/s3_client_minio.cpp @@ -56,7 +56,7 @@ Status S3ClientMinio::UploadObject(const String &bucket_name, const String &obje if (resp) { LOG_INFO(fmt::format("{} uploaded to {}/{} successfully", file_path, bucket_name, object_name)); } else { - UnrecoverableError(fmt::format("Unable to upload object: {}/{}, reason: {}", bucket_name, object_name, resp.Error().String())); + UnrecoverableError(fmt::format("Unable to upload object: {}/{}, code: {}, reason: {}", bucket_name, object_name, resp.code, resp.Error().String())); } return Status::OK(); } diff --git a/src/storage/txn/txn_manager.cpp b/src/storage/txn/txn_manager.cpp index 57b382cb07..a79adc0f0b 100644 --- a/src/storage/txn/txn_manager.cpp +++ b/src/storage/txn/txn_manager.cpp @@ -294,6 +294,10 @@ Vector> TxnManager::GetTxnContextHistories() const { txn_context_histories.emplace_back(context_ptr); } + for (const auto& ongoing_txn_pair: txn_map_) { + txn_context_histories.push_back(ongoing_txn_pair.second->txn_context()); + } + return txn_context_histories; } From 4b0159b0cf29a6da432e99e2963d548cf80d6a27 Mon Sep 17 00:00:00 2001 From: shen yushi Date: Fri, 3 Jan 2025 17:49:09 +0800 Subject: [PATCH 6/9] Mmap3 (#2419) ### What problem does this PR solve? ### Type of change - [x] New Feature (non-breaking change which adds functionality) --- python/test_pysdk/test_knn.py | 6 +- src/parser/type/serialize.cppm | 7 + src/parser/type/serialize.h | 69 +++ src/storage/buffer/buffer_obj.cpp | 11 +- .../file_worker/bmp_index_file_worker.cpp | 64 +- .../file_worker/bmp_index_file_worker.cppm | 4 + .../buffer/file_worker/file_worker.cpp | 38 +- .../buffer/file_worker/file_worker.cppm | 2 + src/storage/io/virtual_store.cpp | 24 + src/storage/io/virtual_store.cppm | 3 + src/storage/knn_index/sparse/abstract_bmp.cpp | 101 +-- .../knn_index/sparse/abstract_bmp.cppm | 54 +- src/storage/knn_index/sparse/bmp_alg.cpp | 329 ---------- src/storage/knn_index/sparse/bmp_alg.cppm | 578 ++++++++++++------ .../knn_index/sparse/bmp_alg_serialize.cpp | 232 ------- .../knn_index/sparse/bmp_blockterms.cppm | 121 ---- src/storage/knn_index/sparse/bmp_fwd.cppm | 543 ++++++++++++++++ src/storage/knn_index/sparse/bmp_ivt.cppm | 461 ++++++++++++++ src/storage/knn_index/sparse/bmp_posting.cpp | 78 --- src/storage/knn_index/sparse/bmp_posting.cppm | 80 --- .../sparse/bmp_posting_serialize.cpp | 113 ---- src/storage/knn_index/sparse/bmp_util.cppm | 43 ++ src/storage/meta/entry/chunk_index_entry.cpp | 16 +- .../meta/entry/segment_index_entry.cpp | 25 +- .../persistence/persistence_manager.cpp | 18 +- .../persistence/persistence_manager.cppm | 2 + .../knnindex/knn_sparse/test_bmp_fwd.cpp | 159 +++++ .../knnindex/knn_sparse/test_bmp_index.cpp | 60 +- .../knnindex/knn_sparse/test_bmp_ivt.cpp | 173 ++++++ .../dql/knn/sparse/test_knn_sparse_bmp.slt | 8 +- .../sparse/test_knn_sparse_bmp_realtime.slt | 8 +- tools/generate_big_sparse.py | 14 +- 32 files changed, 2181 insertions(+), 1263 deletions(-) delete mode 100644 src/storage/knn_index/sparse/bmp_alg.cpp delete mode 100644 src/storage/knn_index/sparse/bmp_alg_serialize.cpp delete mode 100644 src/storage/knn_index/sparse/bmp_blockterms.cppm create mode 100644 src/storage/knn_index/sparse/bmp_fwd.cppm create mode 100644 src/storage/knn_index/sparse/bmp_ivt.cppm delete mode 100644 src/storage/knn_index/sparse/bmp_posting.cpp delete mode 100644 src/storage/knn_index/sparse/bmp_posting.cppm delete mode 100644 src/storage/knn_index/sparse/bmp_posting_serialize.cpp create mode 100644 src/unit_test/storage/knnindex/knn_sparse/test_bmp_fwd.cpp create mode 100644 src/unit_test/storage/knnindex/knn_sparse/test_bmp_ivt.cpp diff --git a/python/test_pysdk/test_knn.py b/python/test_pysdk/test_knn.py index 764ce58d73..dd6953e568 100644 --- a/python/test_pysdk/test_knn.py +++ b/python/test_pysdk/test_knn.py @@ -1069,7 +1069,7 @@ def test_sparse_knn_with_index(self, check_data, suffix): index.IndexType.BMP, {"block_size": "8", "compress_type": "compress"}), ConflictType.Error) - table_obj.optimize("idx1", {"topk": "3"}) + # table_obj.optimize("idx1", {"topk": "3"}) res, extra_result = (table_obj .output(["*", "_row_id", "_similarity"]) @@ -1592,7 +1592,7 @@ def test_sparse_knn_with_invalid_alpha_beta(self, check_data, alpha, beta, suffi index.IndexType.BMP, {"block_size": "8", "compress_type": "compress"}), ConflictType.Error) - table_obj.optimize("idx1", {"topk": "3"}) + # table_obj.optimize("idx1", {"topk": "3"}) with pytest.raises(InfinityException) as e: res, extra_result = (table_obj @@ -1910,7 +1910,7 @@ def test_match_sparse_index_hint(self, check_data, suffix): index.IndexType.BMP, {"block_size": "8", "compress_type": "raww"}), ConflictType.Error) - table_obj.optimize("idx1", {"topk": "3"}) + # table_obj.optimize("idx1", {"topk": "3"}) res, extra_result = (table_obj .output(["*", "_row_id", "_similarity"]) diff --git a/src/parser/type/serialize.cppm b/src/parser/type/serialize.cppm index 47bd0f349a..dce52469c8 100644 --- a/src/parser/type/serialize.cppm +++ b/src/parser/type/serialize.cppm @@ -23,8 +23,15 @@ namespace infinity { export using infinity::GetSizeInBytes; export using infinity::ReadBuf; export using infinity::ReadBufAdv; +export using infinity::ReadBufVecAdv; export using infinity::WriteBuf; export using infinity::WriteBufAdv; export using infinity::WriteBufVecAdv; +export using infinity::GetSizeInBytesAligned; +export using infinity::GetSizeInBytesVecAligned; +export using infinity::ReadBufAdvAligned; +export using infinity::ReadBufVecAdvAligned; +export using infinity::WriteBufAdvAligned; +export using infinity::WriteBufVecAdvAligned; } // namespace infinity \ No newline at end of file diff --git a/src/parser/type/serialize.h b/src/parser/type/serialize.h index b0815efbe2..9415df0dd0 100644 --- a/src/parser/type/serialize.h +++ b/src/parser/type/serialize.h @@ -65,6 +65,14 @@ inline std::string ReadBufAdv(const char *&buf) { return str; } +template +const T *ReadBufVecAdv(const char *&buf, size_t size) { + static_assert(std::is_standard_layout_v, "T must be POD"); + T *data = reinterpret_cast(const_cast(buf)); + buf += sizeof(T) * size; + return data; +} + template inline void WriteBuf(char *const buf, const T &value) { static_assert(std::is_standard_layout_v, "T must be POD"); @@ -100,4 +108,65 @@ inline void WriteBufVecAdv(char *&buf, const T *data, size_t size) { buf += sizeof(T) * size; } +template +void GetSizeInBytesAligned(char *&start) { + static_assert(std::is_standard_layout_v, "T must be POD"); + auto ptr = reinterpret_cast(start); + size_t t_align = std::alignment_of_v; + ptr = (ptr + t_align - 1) & ~(t_align - 1); + start = reinterpret_cast(ptr); + start += sizeof(T); +} + +template +void GetSizeInBytesVecAligned(char *&start, size_t size) { + static_assert(std::is_standard_layout_v, "T must be POD"); + auto ptr = reinterpret_cast(start); + size_t t_align = std::alignment_of_v; + ptr = (ptr + t_align - 1) & ~(t_align - 1); + start = reinterpret_cast(ptr); + start += sizeof(T) * size; +} + +template +T ReadBufAdvAligned(const char *&buf) { + static_assert(std::is_standard_layout_v, "T must be POD"); + auto ptr = reinterpret_cast(buf); + size_t t_align = std::alignment_of_v; + ptr = (ptr + t_align - 1) & ~(t_align - 1); + buf = reinterpret_cast(ptr); + return ReadBufAdv(buf); +} + +template +const T *ReadBufVecAdvAligned(const char *&buf, size_t size) { + static_assert(std::is_standard_layout_v, "T must be POD"); + auto ptr = reinterpret_cast(buf); + size_t t_align = std::alignment_of_v; + ptr = (ptr + t_align - 1) & ~(t_align - 1); + buf = reinterpret_cast(ptr); + return ReadBufVecAdv(buf, size); +} + +template +void WriteBufAdvAligned(char *&buf, const T &value) { + static_assert(std::is_standard_layout_v, "T must be POD"); + auto ptr = reinterpret_cast(buf); + size_t t_align = std::alignment_of_v; + ptr = (ptr + t_align - 1) & ~(t_align - 1); + buf = reinterpret_cast(ptr); + WriteBuf(buf, value); + buf += sizeof(T); +} + +template +void WriteBufVecAdvAligned(char *&buf, const T *data, size_t size) { + static_assert(std::is_standard_layout_v, "T must be POD"); + auto ptr = reinterpret_cast(buf); + size_t t_align = std::alignment_of_v; + ptr = (ptr + t_align - 1) & ~(t_align - 1); + buf = reinterpret_cast(ptr); + WriteBufVecAdv(buf, data, size); +} + } // namespace infinity \ No newline at end of file diff --git a/src/storage/buffer/buffer_obj.cpp b/src/storage/buffer/buffer_obj.cpp index 1264f6555e..cda1915564 100644 --- a/src/storage/buffer/buffer_obj.cpp +++ b/src/storage/buffer/buffer_obj.cpp @@ -220,6 +220,12 @@ void BufferObj::PickForCleanup() { LOG_INFO(fmt::format("BufferObj::PickForCleanup: obj_rc_ is {}, buffer: {}", obj_rc_, GetFilename())); return; } + if (type_ == BufferType::kMmap) { + file_worker_->Munmap(); + buffer_mgr_->AddToCleanList(this, false /*do_free*/); + status_ = BufferStatus::kClean; + return; + } switch (status_) { // when insert data into table with index, the index buffer_obj // will remain BufferStatus::kNew, so we should allow this situation @@ -269,6 +275,9 @@ void BufferObj::CleanupTempFile() const { void BufferObj::ToMmap() { std::unique_lock locker(w_locker_); + if (type_ == BufferType::kMmap) { + return; + } if (type_ != BufferType::kPersistent) { String error_message = fmt::format("Invalid buffer type: {}", BufferTypeToString(type_)); UnrecoverableError(error_message); @@ -328,7 +337,7 @@ void BufferObj::UnloadInner() { status_ = BufferStatus::kFreed; type_ = BufferType::kMmap; } else if (type_ == BufferType::kMmap) { - file_worker_->Munmap(); + file_worker_->MmapNotNeed(); status_ = BufferStatus::kFreed; } else { buffer_mgr_->PushGCQueue(this); diff --git a/src/storage/buffer/file_worker/bmp_index_file_worker.cpp b/src/storage/buffer/file_worker/bmp_index_file_worker.cpp index 3a6e69837f..0f1a117763 100644 --- a/src/storage/buffer/file_worker/bmp_index_file_worker.cpp +++ b/src/storage/buffer/file_worker/bmp_index_file_worker.cpp @@ -104,7 +104,16 @@ bool BMPIndexFileWorker::WriteToFileImpl(bool to_spill, bool &prepare_success, c if constexpr (std::is_same_v) { UnrecoverableError("Invalid index type."); } else { - index->Save(*file_handle_); + using IndexT = std::decay_t; + if constexpr (IndexT::kOwnMem) { + if (to_spill) { + index->Save(*file_handle_); + } else { + index->SaveToPtr(*file_handle_); + } + } else { + UnrecoverableError("BMPIndexFileWorker::WriteToFileImpl: index does not own memory"); + } } }, *bmp_index); @@ -125,10 +134,61 @@ void BMPIndexFileWorker::ReadFromFileImpl(SizeT file_size) { UnrecoverableError("Invalid index type."); } else { using IndexT = std::decay_t; - index = new IndexT(IndexT::Load(*file_handle_)); + if constexpr (IndexT::kOwnMem) { + index = new IndexT(IndexT::Load(*file_handle_)); + } else { + UnrecoverableError("BMPIndexFileWorker::ReadFromFileImpl: index does not own memory"); + } + } + }, + *bmp_index); +} + +bool BMPIndexFileWorker::ReadFromMmapImpl(const void *ptr, SizeT size) { + if (mmap_data_ != nullptr) { + UnrecoverableError("Data is already allocated."); + } + mmap_data_ = reinterpret_cast(new AbstractBMP(BMPIndexInMem::InitAbstractIndex(index_base_.get(), column_def_.get(), false))); + auto *bmp_index = reinterpret_cast(mmap_data_); + std::visit( + [&](auto &&index) { + using T = std::decay_t; + if constexpr (std::is_same_v) { + UnrecoverableError("Invalid index type."); + } else { + using IndexT = std::decay_t; + if constexpr (!IndexT::kOwnMem) { + const auto *p = static_cast(ptr); + index = new IndexT(IndexT::LoadFromPtr(p, size)); + } else { + UnrecoverableError("BMPIndexFileWorker::ReadFromMmapImpl: index own memory"); + } + } + }, + *bmp_index); + return true; +} + +void BMPIndexFileWorker::FreeFromMmapImpl() { + if (mmap_data_ == nullptr) { + return; + } + auto *bmp_index = reinterpret_cast(mmap_data_); + std::visit( + [&](auto &&index) { + using T = std::decay_t; + if constexpr (!std::is_same_v) { + using IndexT = std::decay_t; + if constexpr (!IndexT::kOwnMem) { + delete index; + } else { + UnrecoverableError("Invalid index type."); + } } }, *bmp_index); + delete bmp_index; + mmap_data_ = nullptr; } } // namespace infinity diff --git a/src/storage/buffer/file_worker/bmp_index_file_worker.cppm b/src/storage/buffer/file_worker/bmp_index_file_worker.cppm index e3480b230b..e520ca36f6 100644 --- a/src/storage/buffer/file_worker/bmp_index_file_worker.cppm +++ b/src/storage/buffer/file_worker/bmp_index_file_worker.cppm @@ -54,6 +54,10 @@ protected: void ReadFromFileImpl(SizeT file_size) override; + bool ReadFromMmapImpl(const void *ptr, SizeT size) override; + + void FreeFromMmapImpl() override; + private: SizeT index_size_{}; }; diff --git a/src/storage/buffer/file_worker/file_worker.cpp b/src/storage/buffer/file_worker/file_worker.cpp index dc05e05705..00922bf0e6 100644 --- a/src/storage/buffer/file_worker/file_worker.cpp +++ b/src/storage/buffer/file_worker/file_worker.cpp @@ -14,6 +14,9 @@ module; +#include +#include +#include #include module file_worker; @@ -207,28 +210,43 @@ void FileWorker::CleanupTempFile() const { } void FileWorker::Mmap() { - if (mmap_addr_ != nullptr || mmap_data_ != nullptr) { - UnrecoverableError("Mmap already exists"); + if (mmap_addr_ != nullptr) { + return; } auto [defer_fn, read_path] = GetFilePathInner(false); bool use_object_cache = persistence_manager_ != nullptr; - SizeT file_size = VirtualStore::GetFileSize(read_path); - VirtualStore::MmapFile(read_path, mmap_addr_, file_size); if (use_object_cache) { - const void *ptr = mmap_addr_ + obj_addr_.part_offset_; - this->ReadFromMmapImpl(ptr, obj_addr_.part_size_); + int ret = VirtualStore::MmapFilePart(read_path, obj_addr_.part_offset_, obj_addr_.part_size_, mmap_addr_); + if (ret < 0) { + UnrecoverableError(fmt::format("Mmap file {} failed. {}", read_path, strerror(errno))); + } + this->ReadFromMmapImpl(mmap_addr_, obj_addr_.part_size_); } else { - const void *ptr = mmap_addr_; - this->ReadFromMmapImpl(ptr, file_size); + SizeT file_size = VirtualStore::GetFileSize(read_path); + int ret = VirtualStore::MmapFile(read_path, mmap_addr_, file_size); + if (ret < 0) { + UnrecoverableError(fmt::format("Mmap file {} failed. {}", read_path, strerror(errno))); + } + this->ReadFromMmapImpl(mmap_addr_, file_size); } } void FileWorker::Munmap() { - auto [defer_fn, read_path] = GetFilePathInner(false); + if (mmap_addr_ == nullptr) { + return; + } this->FreeFromMmapImpl(); - VirtualStore::MunmapFile(read_path); + auto [defer_fn, read_path] = GetFilePathInner(false); + bool use_object_cache = persistence_manager_ != nullptr; + if (use_object_cache) { + VirtualStore::MunmapFilePart(mmap_addr_, obj_addr_.part_offset_, obj_addr_.part_size_); + } else { + VirtualStore::MunmapFile(read_path); + } mmap_addr_ = nullptr; mmap_data_ = nullptr; } +void FileWorker::MmapNotNeed() {} + } // namespace infinity \ No newline at end of file diff --git a/src/storage/buffer/file_worker/file_worker.cppm b/src/storage/buffer/file_worker/file_worker.cppm index 1929a92bd7..45eb99d142 100644 --- a/src/storage/buffer/file_worker/file_worker.cppm +++ b/src/storage/buffer/file_worker/file_worker.cppm @@ -103,6 +103,8 @@ public: void Munmap(); + void MmapNotNeed(); + protected: virtual bool ReadFromMmapImpl([[maybe_unused]] const void *ptr, [[maybe_unused]] SizeT size) { UnrecoverableError("Not implemented"); diff --git a/src/storage/io/virtual_store.cpp b/src/storage/io/virtual_store.cpp index 03e12c702a..a7f8e274ad 100644 --- a/src/storage/io/virtual_store.cpp +++ b/src/storage/io/virtual_store.cpp @@ -446,6 +446,30 @@ i32 VirtualStore::MunmapFile(const String &file_path) { return 0; } +i32 VirtualStore::MmapFilePart(const String &file_path, SizeT offset, SizeT length, u8 *&data_ptr) { + SizeT align_offset = offset / getpagesize() * getpagesize(); + SizeT diff = offset - align_offset; + SizeT align_length = length + diff; + int fd = open(file_path.c_str(), O_RDONLY); + if (fd < 0) { + return -1; + } + void *ret = mmap(NULL, align_length, PROT_READ, MAP_SHARED, fd, align_offset); + close(fd); + if (ret == MAP_FAILED) { + return -1; + } + data_ptr = reinterpret_cast(ret) + diff; + return 0; +} + +i32 VirtualStore::MunmapFilePart(u8 *data_ptr, SizeT offset, SizeT length) { + SizeT align_offset = offset / getpagesize() * getpagesize(); + u8 *aligned_ptr = data_ptr - offset + align_offset; + SizeT align_length = length + data_ptr - aligned_ptr; + return munmap(aligned_ptr, align_length); +} + // Remote storage StorageType VirtualStore::storage_type_ = StorageType::kInvalid; String VirtualStore::bucket_ = "infinity"; diff --git a/src/storage/io/virtual_store.cppm b/src/storage/io/virtual_store.cppm index 643a14fa6b..1a516b1c38 100644 --- a/src/storage/io/virtual_store.cppm +++ b/src/storage/io/virtual_store.cppm @@ -72,6 +72,9 @@ public: static i32 MmapFile(const String &file_path, u8 *&data_ptr, SizeT &data_len); static i32 MunmapFile(const String &file_path); + static i32 MmapFilePart(const String &file_path, SizeT offset, SizeT length, u8 *&data_ptr); + static i32 MunmapFilePart(u8 *data_ptr, SizeT offset, SizeT length); + static Status InitRemoteStore(StorageType storage_type = StorageType::kMinio, const String &URL = "http://localhost:9000", bool HTTPS = false, diff --git a/src/storage/knn_index/sparse/abstract_bmp.cpp b/src/storage/knn_index/sparse/abstract_bmp.cpp index 52c434c6cb..c8a569abc7 100644 --- a/src/storage/knn_index/sparse/abstract_bmp.cpp +++ b/src/storage/knn_index/sparse/abstract_bmp.cpp @@ -43,7 +43,13 @@ MemIndexTracerInfo BMPIndexInMem::GetInfo() const { if constexpr (std::is_same_v) { return {}; } else { - return {index->MemoryUsage(), index->DocNum()}; + using IndexT = typename std::remove_pointer_t; + if constexpr (IndexT::kOwnMem) { + return {index->MemoryUsage(), index->DocNum()}; + } else { + UnrecoverableError("BMPIndexInMem::GetInfo: index does not own memory"); + return {}; + } } }, bmp_); @@ -63,30 +69,17 @@ BMPIndexInMem::BMPIndexInMem(RowID begin_row_id, const IndexBase *index_base, co using T = std::decay_t; if constexpr (!std::is_same_v) { using IndexT = std::decay_t; - bmp_ = new IndexT(term_num, block_size); + if constexpr (IndexT::kOwnMem) { + bmp_ = new IndexT(term_num, block_size); + } else { + UnrecoverableError("BMPIndexInMem::BMPIndexInMem: index does not own memory"); + } } }, bmp_); own_memory_ = true; } -AbstractBMP BMPIndexInMem::InitAbstractIndex(const IndexBase *index_base, const ColumnDef *column_def) { - const auto *index_bmp = static_cast(index_base); - const auto *sparse_info = static_cast(column_def->type()->type_info().get()); - - switch (sparse_info->DataType()) { - case EmbeddingDataType::kElemFloat: { - return InitAbstractIndex(index_bmp, sparse_info); - } - case EmbeddingDataType::kElemDouble: { - return InitAbstractIndex(index_bmp, sparse_info); - } - default: { - return nullptr; - } - } -} - BMPIndexInMem::~BMPIndexInMem() { if (!own_memory_) { return; @@ -97,11 +90,16 @@ BMPIndexInMem::~BMPIndexInMem() { if constexpr (std::is_same_v) { return; } else { - SizeT mem_used = index->MemoryUsage(); - if (index != nullptr) { - delete index; + using IndexT = std::decay_t; + if constexpr (IndexT::kOwnMem) { + SizeT mem_used = index->MemoryUsage(); + if (index != nullptr) { + delete index; + } + DecreaseMemoryUsageBase(mem_used); + } else { + UnrecoverableError("BMPIndexInMem::~BMPIndexInMem: index does not own memory"); } - DecreaseMemoryUsageBase(mem_used); } }, bmp_); @@ -114,7 +112,13 @@ SizeT BMPIndexInMem::GetRowCount() const { if constexpr (std::is_same_v) { return SizeT(0); } else { - return index->DocNum(); + using IndexT = std::decay_t; + if constexpr (IndexT::kOwnMem) { + return index->DocNum(); + } else { + UnrecoverableError("BMPIndexInMem::GetRowCount: index does not own memory"); + return SizeT(0); + } } }, bmp_); @@ -129,13 +133,17 @@ void BMPIndexInMem::AddDocs(SizeT block_offset, BlockColumnEntry *block_column_e return; } else { using IndexT = std::decay_t; - using SparseRefT = SparseVecRef; - SizeT mem_before = index->MemoryUsage(); - MemIndexInserterIter iter(block_offset, block_column_entry, buffer_mgr, row_offset, row_count); - index->AddDocs(std::move(iter)); - SizeT mem_after = index->MemoryUsage(); - IncreaseMemoryUsageBase(mem_after - mem_before); - LOG_INFO(fmt::format("before : {} -> after : {}, add mem_used : {}", mem_before, mem_after, mem_after - mem_before)); + if constexpr (IndexT::kOwnMem) { + using SparseRefT = SparseVecRef; + SizeT mem_before = index->MemoryUsage(); + MemIndexInserterIter iter(block_offset, block_column_entry, buffer_mgr, row_offset, row_count); + index->AddDocs(std::move(iter)); + SizeT mem_after = index->MemoryUsage(); + IncreaseMemoryUsageBase(mem_after - mem_before); + LOG_INFO(fmt::format("before : {} -> after : {}, add mem_used : {}", mem_before, mem_after, mem_after - mem_before)); + } else { + UnrecoverableError("BMPIndexInMem::AddDocs: index does not own memory"); + } } }, bmp_); @@ -149,14 +157,18 @@ void BMPIndexInMem::AddDocs(const SegmentEntry *segment_entry, BufferManager *bu return; } else { using IndexT = std::decay_t; - using SparseRefT = SparseVecRef; - - if (check_ts) { - OneColumnIterator iter(segment_entry, buffer_mgr, column_id, begin_ts); - index->AddDocs(std::move(iter)); + if constexpr (!IndexT::kOwnMem) { + UnrecoverableError("BMPIndexInMem::AddDocs: index does not own memory"); } else { - OneColumnIterator iter(segment_entry, buffer_mgr, column_id, begin_ts); - index->AddDocs(std::move(iter)); + using SparseRefT = SparseVecRef; + + if (check_ts) { + OneColumnIterator iter(segment_entry, buffer_mgr, column_id, begin_ts); + index->AddDocs(std::move(iter)); + } else { + OneColumnIterator iter(segment_entry, buffer_mgr, column_id, begin_ts); + index->AddDocs(std::move(iter)); + } } } }, @@ -175,10 +187,15 @@ SharedPtr BMPIndexInMem::Dump(SegmentIndexEntry *segment_index_ if constexpr (std::is_same_v) { return; } else { - row_count = index->DocNum(); - index_size = index->GetSizeInBytes(); - if (dump_size != nullptr) { - *dump_size = index->MemoryUsage(); + using IndexT = std::decay_t; + if constexpr (IndexT::kOwnMem) { + row_count = index->DocNum(); + index_size = index->GetSizeInBytes(); + if (dump_size != nullptr) { + *dump_size = index->MemoryUsage(); + } + } else { + UnrecoverableError("BMPIndexInMem::Dump: index does not own memory"); } } }, diff --git a/src/storage/knn_index/sparse/abstract_bmp.cppm b/src/storage/knn_index/sparse/abstract_bmp.cppm index 25aa696d1b..a986a2ead9 100644 --- a/src/storage/knn_index/sparse/abstract_bmp.cppm +++ b/src/storage/knn_index/sparse/abstract_bmp.cppm @@ -53,6 +53,20 @@ export using AbstractBMP = std::variant *, BMPAlg *, BMPAlg *, + + BMPAlg *, + BMPAlg *, + BMPAlg *, + BMPAlg *, + BMPAlg *, + BMPAlg *, + BMPAlg *, + BMPAlg *, + BMPAlg *, + BMPAlg *, + BMPAlg *, + BMPAlg *, + std::nullptr_t>; export struct BMPIndexInMem final : public BaseMemIndex { @@ -66,15 +80,15 @@ public: TableIndexEntry *table_index_entry() const override; private: - template + template static AbstractBMP InitAbstractIndex(const IndexBMP *index_bmp) { switch (index_bmp->compress_type_) { case BMPCompressType::kCompressed: { - using BMPIndex = BMPAlg; + using BMPIndex = BMPAlg; return static_cast(nullptr); } case BMPCompressType::kRaw: { - using BMPIndex = BMPAlg; + using BMPIndex = BMPAlg; return static_cast(nullptr); } default: { @@ -83,17 +97,35 @@ private: } } - template + template static AbstractBMP InitAbstractIndex(const IndexBMP *index_bmp, const SparseInfo *sparse_info) { switch (sparse_info->IndexType()) { case EmbeddingDataType::kElemInt8: { - return InitAbstractIndex(index_bmp); + return InitAbstractIndex(index_bmp); } case EmbeddingDataType::kElemInt16: { - return InitAbstractIndex(index_bmp); + return InitAbstractIndex(index_bmp); } case EmbeddingDataType::kElemInt32: { - return InitAbstractIndex(index_bmp); + return InitAbstractIndex(index_bmp); + } + default: { + return nullptr; + } + } + } + + template + static AbstractBMP InitAbstractIndex(const IndexBase *index_base, const ColumnDef *column_def) { + const auto *index_bmp = static_cast(index_base); + const auto *sparse_info = static_cast(column_def->type()->type_info().get()); + + switch (sparse_info->DataType()) { + case EmbeddingDataType::kElemFloat: { + return InitAbstractIndex(index_bmp, sparse_info); + } + case EmbeddingDataType::kElemDouble: { + return InitAbstractIndex(index_bmp, sparse_info); } default: { return nullptr; @@ -102,7 +134,13 @@ private: } public: - static AbstractBMP InitAbstractIndex(const IndexBase *index_base, const ColumnDef *column_def); + static AbstractBMP InitAbstractIndex(const IndexBase *index_base, const ColumnDef *column_def, bool own_mem = true) { + if (own_mem) { + return InitAbstractIndex(index_base, column_def); + } else { + return InitAbstractIndex(index_base, column_def); + } + } BMPIndexInMem(const BMPIndexInMem &) = delete; BMPIndexInMem &operator=(const BMPIndexInMem &) = delete; diff --git a/src/storage/knn_index/sparse/bmp_alg.cpp b/src/storage/knn_index/sparse/bmp_alg.cpp deleted file mode 100644 index 8d44817dde..0000000000 --- a/src/storage/knn_index/sparse/bmp_alg.cpp +++ /dev/null @@ -1,329 +0,0 @@ -// Copyright(C) 2023 InfiniFlow, Inc. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -module; - -#include "common/simd/simd_common_intrin_include.h" -#include -#include - -module bmp_alg; - -import infinity_exception; -import third_party; -import serialize; -import segment_iter; -import bp_reordering; -import bmp_blockterms; - -namespace infinity { - -template -template -void BMPIvt::AddBlock(BMPBlockID block_id, - const Vector, Vector>> &tail_terms, - SizeT &mem_usage) { - HashMap max_scores; - for (const auto &[indices, data] : tail_terms) { - SizeT block_size = indices.size(); - for (SizeT i = 0; i < block_size; ++i) { - IdxType term_id = indices[i]; - DataType score = data[i]; - max_scores[term_id] = std::max(max_scores[term_id], score); - } - } - for (const auto &[term_id, score] : max_scores) { - postings_[term_id].data_.AddBlock(block_id, score, mem_usage); - } -} - -template -void BMPIvt::Optimize(i32 topk, Vector> ivt_scores) { - for (SizeT term_id = 0; term_id < ivt_scores.size(); ++term_id) { - auto &posting = postings_[term_id]; - auto &term_scores = ivt_scores[term_id]; - posting.kth_ = topk; - if ((i32)term_scores.size() < topk) { - continue; - } - std::nth_element(term_scores.begin(), term_scores.begin() + topk - 1, term_scores.end(), std::greater<>()); - posting.kth_score_ = term_scores[topk - 1]; - } -} - -template class BMPIvt; -template class BMPIvt; -template class BMPIvt; -template class BMPIvt; - -template -SizeT TailFwd::AddDoc(const SparseVecRef &doc) { - Vector indices; - Vector data; - indices.reserve(doc.nnz_); - data.reserve(doc.nnz_); - for (i32 i = 0; i < doc.nnz_; ++i) { - indices.push_back(doc.indices_[i]); - data.push_back(doc.data_[i]); - } - tail_terms_.emplace_back(std::move(indices), std::move(data)); - return tail_terms_.size(); -} - -template -Vector, Vector>> TailFwd::ToBlockFwd() const { - Vector> term_pairs; - SizeT block_size = tail_terms_.size(); - for (SizeT block_offset = 0; block_offset < block_size; ++block_offset) { - SizeT block_size = tail_terms_[block_offset].first.size(); - for (SizeT i = 0; i < block_size; ++i) { - IdxType term_id = tail_terms_[block_offset].first[i]; - DataType score = tail_terms_[block_offset].second[i]; - term_pairs.emplace_back(term_id, block_offset, score); - } - } - std::sort(term_pairs.begin(), term_pairs.end(), [](const auto &a, const auto &b) { return std::get<0>(a) < std::get<0>(b); }); - - Vector, Vector>> res; - IdxType last_term_id = -1; - Vector block_offsets; - Vector scores; - for (const auto &[term_id, block_offset, score] : term_pairs) { - if (term_id != last_term_id) { - if (last_term_id != -1) { - res.emplace_back(last_term_id, std::move(block_offsets), std::move(scores)); - } - last_term_id = term_id; - } - block_offsets.push_back(block_offset); - scores.push_back(score); - } - if (!block_offsets.empty()) { - res.emplace_back(last_term_id, std::move(block_offsets), std::move(scores)); - } - return res; -} - -template -Vector TailFwd::GetScores(const SparseVecRef &query) const { - SizeT tail_size = tail_terms_.size(); - Vector res(tail_size, 0.0); - for (SizeT offset = 0; offset < tail_size; ++offset) { - const auto &[indices, data] = tail_terms_[offset]; - SizeT j = 0; - for (i32 i = 0; i < query.nnz_; ++i) { - IdxType query_term = query.indices_[i]; - DataType query_score = query.data_[i]; - while (j < indices.size() && indices[j] < query_term) { - ++j; - } - if (j == indices.size()) { - break; - } - if (indices[j] == query_term) { - res[offset] += query_score * data[j]; - } - } - } - return res; -} - -template class TailFwd; -template class TailFwd; -template class TailFwd; -template class TailFwd; -template class TailFwd; -template class TailFwd; - -template -Optional> BlockFwd::AddDoc(const SparseVecRef &doc, SizeT &mem_usage) { - SizeT tail_size = tail_fwd_.AddDoc(doc); - if (tail_size < block_size_) { - return None; - } - TailFwd tail_fwd1(block_size_); - std::swap(tail_fwd1, tail_fwd_); - - Vector, Vector>> block_terms = tail_fwd1.ToBlockFwd(); - block_terms_list_.emplace_back(block_terms); - mem_usage += block_terms_list_.back().GetSizeInBytes(); - return tail_fwd1; -} - -template -Vector, Vector>> BlockFwd::GetFwd(SizeT doc_num, SizeT term_num) const { - SizeT doc_n = doc_num / block_size_ * block_size_; - Vector, Vector>> fwd(doc_n); - for (SizeT block_id = 0; block_id < block_terms_list_.size(); ++block_id) { - const auto &block_terms = block_terms_list_[block_id]; - for (auto iter = block_terms.Iter(); iter.HasNext(); iter.Next()) { - const auto &[term_id, block_size, block_offsets, scores] = iter.Value(); - for (SizeT i = 0; i < block_size; ++i) { - BMPDocID doc_id = block_offsets[i] + block_id * block_size_; - DataType score = scores[i]; - fwd[doc_id].first.push_back(term_id); - fwd[doc_id].second.push_back(score); - } - } - } - return fwd; -} - -template -Vector> BlockFwd::GetIvtScores(SizeT term_num) const { - Vector> res(term_num); - for (const auto &block_terms : block_terms_list_) { - for (auto iter = block_terms.Iter(); iter.HasNext(); iter.Next()) { - const auto [term_id, block_size, block_offsets, scores] = iter.Value(); - for (SizeT i = 0; i < block_size; ++i) { - res[term_id].push_back(scores[i]); - } - } - } - return res; -} - -template -Vector BlockFwd::GetScores(BMPBlockID block_id, const SparseVecRef &query) const { - const auto &block_terms = block_terms_list_[block_id]; - Vector res(block_size_, 0.0); - - i32 i = 0; - for (auto iter = block_terms.Iter(); iter.HasNext(); iter.Next()) { - const auto [term_id, block_size, block_offsets, scores] = iter.Value(); - while (i < query.nnz_ && query.indices_[i] < term_id) { - ++i; - } - if (i == query.nnz_) { - break; - } - if (query.indices_[i] == term_id) { - Calculate(block_size, block_offsets, scores, res, query.data_[i]); - } - } - return res; -} - -template -void BlockFwd::Prefetch(BMPBlockID block_id) const { - block_terms_list_[block_id].Prefetch(); -} - -template -void BlockFwd::Calculate(SizeT block_size, - const BMPBlockOffset *block_offsets, - const DataType *scores, - Vector &res, - DataType query_score) { - for (SizeT i = 0; i < block_size; ++i) { - BMPBlockOffset block_offset = block_offsets[i]; - res[block_offset] += query_score * scores[i]; - } -} - -template class BlockFwd; -template class BlockFwd; -template class BlockFwd; -template class BlockFwd; -template class BlockFwd; -template class BlockFwd; - -template -void BMPAlg::AddDoc(const SparseVecRef &doc, BMPDocID doc_id, bool lck) { - std::unique_lock lock; - if (lck) { - lock = std::unique_lock(mtx_); - } - - SizeT mem_usage = 0; - doc_ids_.push_back(doc_id); - Optional> tail_fwd = block_fwd_.AddDoc(doc, mem_usage); - if (!tail_fwd.has_value()) { - mem_usage_.fetch_add(sizeof(BMPDocID) + mem_usage); - return; - } - BMPBlockID block_id = block_fwd_.block_num() - 1; - const auto &tail_terms = tail_fwd->GetTailTerms(); - bm_ivt_.AddBlock(block_id, tail_terms, mem_usage); - mem_usage_.fetch_add(sizeof(BMPDocID) + mem_usage); -} - -template -SizeT BMPAlg::DocNum() const { - std::shared_lock lock(mtx_); - return doc_ids_.size(); -} - -template -void BMPAlg::Optimize(const BMPOptimizeOptions &options) { - std::unique_lock lock(mtx_); - - if (options.bp_reorder_) { - SizeT block_size = block_fwd_.block_size(); - SizeT term_num = bm_ivt_.term_num(); - SizeT doc_num = doc_ids_.size() - doc_ids_.size() % block_size; - - bm_ivt_ = BMPIvt(term_num); - Vector, Vector>> fwd = block_fwd_.GetFwd(doc_num, term_num); - TailFwd tail_fwd = block_fwd_.GetTailFwd(); - block_fwd_ = BlockFwd(block_size); - - BPReordering bp(term_num); - // add bp parameter here - for (BMPDocID i = 0; i < doc_num; ++i) { - bp.AddDoc(&fwd[i].first); - } - Vector remap = bp(); - - Vector doc_ids; - std::swap(doc_ids, doc_ids_); - for (BMPDocID new_id = 0; new_id < doc_num; ++new_id) { - BMPDocID old_id = remap[new_id]; - SparseVecRef doc((i32)fwd[old_id].first.size(), fwd[old_id].first.data(), fwd[old_id].second.data()); - this->AddDoc(doc, doc_ids[old_id], false); - } - for (BMPDocID i = doc_num; i < doc_ids.size(); ++i) { - const auto &[indices, data] = tail_fwd.GetTailTerms()[i - doc_num]; - SparseVecRef doc((i32)indices.size(), indices.data(), data.data()); - this->AddDoc(doc, doc_ids[i], false); - } - } - if (options.topk_ != 0) { - SizeT term_num = bm_ivt_.term_num(); - Vector> ivt_scores = block_fwd_.GetIvtScores(term_num); - bm_ivt_.Optimize(options.topk_, std::move(ivt_scores)); - } -} - -template -Pair, Vector> -BMPAlg::SearchKnn(const SparseVecRef &query, i32 topk, const BmpSearchOptions &options) const { - return SearchKnn(query, topk, options, nullptr); -} - -template class BMPAlg; -template class BMPAlg; -template class BMPAlg; -template class BMPAlg; -template class BMPAlg; -template class BMPAlg; - -template class BMPAlg; -template class BMPAlg; -template class BMPAlg; -template class BMPAlg; -template class BMPAlg; -template class BMPAlg; - -} // namespace infinity diff --git a/src/storage/knn_index/sparse/bmp_alg.cppm b/src/storage/knn_index/sparse/bmp_alg.cppm index 5f892c5a78..74457a233f 100644 --- a/src/storage/knn_index/sparse/bmp_alg.cppm +++ b/src/storage/knn_index/sparse/bmp_alg.cppm @@ -19,273 +19,447 @@ export module bmp_alg; import stl; import sparse_util; import local_file_handle; -import bm_posting; import bmp_util; import hnsw_common; import knn_result_handler; -import bmp_blockterms; +import bmp_ivt; +import bmp_fwd; +import bp_reordering; +import serialize; +import third_party; +import infinity_exception; namespace infinity { -template -class BMPIvt { -private: - BMPIvt(Vector> postings) : postings_(std::move(postings)) {} - +export template +class BMPAlgBase { public: - BMPIvt(SizeT term_num) : postings_(term_num) {} - - template - void AddBlock(BMPBlockID block_id, const Vector, Vector>> &tail_terms, SizeT &mem_usage); - - void Optimize(i32 topk, Vector> ivt_scores); - - const BlockPostings &GetPostings(SizeT term_id) const { return postings_[term_id]; } - - void Prefetch(SizeT term_id) const { postings_[term_id].Prefetch(); } - - SizeT term_num() const { return postings_.size(); } - - SizeT GetSizeInBytes() const; - void WriteAdv(char *&p) const; - static BMPIvt ReadAdv(const char *&p); - -private: - Vector> postings_; -}; - -template -class TailFwd { -private: - TailFwd(Vector, Vector>> tail_terms) : tail_terms_(std::move(tail_terms)) {} +protected: + BMPAlgBase(BMPIvt bm_ivt, BlockFwd block_fwd, VecPtr doc_ids) + : bm_ivt_(std::move(bm_ivt)), block_fwd_(std::move(block_fwd)), doc_ids_(std::move(doc_ids)) {} + BMPAlgBase(SizeT term_num, SizeT block_size) : bm_ivt_(term_num), block_fwd_(block_size) {} public: - TailFwd(SizeT block_size) { tail_terms_.reserve(block_size); } - - SizeT AddDoc(const SparseVecRef &doc); + BMPAlgBase() {} - const Vector, Vector>> &GetTailTerms() const { return tail_terms_; } - - Vector, Vector>> ToBlockFwd() const; - - Vector GetScores(const SparseVecRef &query) const; - - SizeT GetSizeInBytes() const; - void WriteAdv(char *&p) const; - static TailFwd ReadAdv(const char *&p); - -private: - Vector, Vector>> tail_terms_; -}; - -template -class BlockFwd { -public: - BlockFwd(SizeT block_size, Vector> block_terms_list, TailFwd tail_fwd) - : block_size_(block_size), block_terms_list_(std::move(block_terms_list)), tail_fwd_(std::move(tail_fwd)) {} + Pair, Vector> + SearchKnn(const SparseVecRef &query, i32 topk, const BmpSearchOptions &options) const { + return SearchKnn(query, topk, options, nullptr); + } - BlockFwd(SizeT block_size) : block_size_(block_size), tail_fwd_(block_size) {} + template Filter = NoneType> + Pair, Vector> + SearchKnn(const SparseVecRef &query, i32 topk, const BmpSearchOptions &options, const Filter &filter) const { + if (topk == 0) { + return {{}, {}}; + } - Optional> AddDoc(const SparseVecRef &doc, SizeT &mem_usage); + SizeT block_size = block_fwd_.block_size(); + SparseVecEle keeped_query; + if (options.beta_ < 1.0) { + i32 terms_to_keep = std::ceil(query.nnz_ * options.beta_); + Vector query_term_idxes(query.nnz_); + std::iota(query_term_idxes.begin(), query_term_idxes.end(), 0); + std::partial_sort(query_term_idxes.begin(), query_term_idxes.begin() + terms_to_keep, query_term_idxes.end(), [&](SizeT a, SizeT b) { + return query.data_[a] > query.data_[b]; + }); + query_term_idxes.resize(terms_to_keep); + std::sort(query_term_idxes.begin(), query_term_idxes.end(), [&](SizeT a, SizeT b) { return query.indices_[a] < query.indices_[b]; }); + + keeped_query.Init(query_term_idxes, query.data_, query.indices_); + } + const SparseVecRef &query_ref = + options.beta_ < 1.0 ? SparseVecRef(keeped_query.nnz_, keeped_query.indices_.get(), keeped_query.data_.get()) : query; + + DataType threshold = 0.0; + SizeT block_num = block_fwd_.block_num(); + Vector upper_bounds(block_num, 0.0); + for (i32 i = 0; i < query_ref.nnz_; ++i) { + // if (i + 1 < query_ref.nnz_) { + // IdxType next_query_term = query_ref.indices_[i + 1]; + // bm_ivt_.Prefetch(next_query_term); + // } + IdxType query_term = query_ref.indices_[i]; + DataType query_score = query_ref.data_[i]; + const auto &posting = bm_ivt_.GetPostings(query_term); + threshold = std::max(threshold, query_score * posting.kth(topk)); + Calculate2(upper_bounds, query_score, posting.data()); + } - Vector, Vector>> GetFwd(SizeT doc_num, SizeT term_num) const; + Vector> block_scores; + for (SizeT block_id = 0; block_id < block_num; ++block_id) { + if (upper_bounds[block_id] >= threshold) { + block_scores.emplace_back(upper_bounds[block_id], block_id); + } + } + std::sort(block_scores.begin(), block_scores.end(), [](const auto &a, const auto &b) { return a.first > b.first; }); - TailFwd GetTailFwd() { return std::move(tail_fwd_); } + Vector result(topk); + Vector result_score(topk); + HeapResultHandler> result_handler(1 /*query_n*/, topk, result_score.data(), result.data()); - Vector> GetIvtScores(SizeT term_num) const; + auto add_result = [&](DataType score, BMPDocID doc_id) { + if constexpr (std::is_same_v) { + result_handler.AddResult(0 /*query_id*/, score, doc_id); + } else { + if (filter(doc_ids_[doc_id])) { + result_handler.AddResult(0 /*query_id*/, score, doc_id); + } + } + }; - Vector GetScores(BMPBlockID block_id, const SparseVecRef &query) const; + SizeT block_scores_num = block_scores.size(); + for (SizeT i = 0; i < block_scores_num; ++i) { + if (i + 1 < block_scores_num) { + BMPBlockID next_block_id = block_scores[i + 1].second; + block_fwd_.Prefetch(next_block_id); + } + const auto &[ub_score, block_id] = block_scores[i]; + BMPDocID off = block_id * block_size; + const auto &block_terms = block_fwd_.GetBlockTerms(block_id); + Vector scores = GetScores(block_terms, query_ref); + for (SizeT block_off = 0; block_off < scores.size(); ++block_off) { + BMPDocID doc_id = off + block_off; + DataType score = scores[block_off]; + add_result(score, doc_id); + } + DataType min_score = result_handler.GetDistance0(0 /*query_id*/); + if (result_handler.GetSize(0) == u32(topk) && ub_score * options.alpha_ < min_score) { + break; + } + } - Vector GetScoresTail(const SparseVecRef &query) const { return tail_fwd_.GetScores(query); } + if (options.use_tail_) { + Vector tail_scores = block_fwd_.GetScoresTail(query_ref); + for (SizeT i = 0; i < tail_scores.size(); ++i) { + BMPDocID doc_id = block_num * block_size + i; + DataType score = tail_scores[i]; + add_result(score, doc_id); + } + } - void Prefetch(BMPBlockID block_id) const; + SizeT res_n = result_handler.GetSize(0 /*query_id*/); + result_handler.End(0 /*query_id*/); + result.erase(result.begin() + res_n, result.end()); + result_score.erase(result_score.begin() + res_n, result_score.end()); + Vector result_docid(res_n); + std::transform(result.begin(), result.end(), result_docid.begin(), [&](BMPDocID doc_id) { return doc_ids_[doc_id]; }); + return {result_docid, result_score}; + } - SizeT block_size() const { return block_size_; } +protected: + Vector GetScores(const BlockTerms &block_terms, const SparseVecRef &query) const { + Vector res(block_fwd_.block_size(), 0.0); - SizeT block_num() const { return block_terms_list_.size(); } + i32 i = 0; + for (auto iter = block_terms.Iter(); iter.HasNext(); iter.Next()) { + const auto [term_id, block_size, block_offsets, scores] = iter.Value(); + while (i < query.nnz_ && query.indices_[i] < term_id) { + ++i; + } + if (i == query.nnz_) { + break; + } + if (query.indices_[i] == term_id) { + Calculate(block_size, block_offsets, scores, res, query.data_[i]); + } + } + return res; + } - SizeT GetSizeInBytes() const; - void WriteAdv(char *&p) const; - static BlockFwd ReadAdv(const char *&p); + static void + Calculate(SizeT block_size, const BMPBlockOffset *block_offsets, const DataType *scores, Vector &res, DataType query_score) { + for (SizeT i = 0; i < block_size; ++i) { + BMPBlockOffset block_offset = block_offsets[i]; + res[block_offset] += query_score * scores[i]; + } + } -private: - static void Calculate(SizeT block_size, const BMPBlockOffset *block_offsets, const DataType *scores, Vector &res, DataType query_score); + static void Calculate2(Vector &upper_bounds, DataType query_score, const BlockData &block_data) { + if constexpr (CompressType == BMPCompressType::kCompressed) { + SizeT block_size = block_data.block_size(); + const BMPBlockID *block_ids = block_data.block_ids(); + const DataType *max_scores = block_data.max_scores(); + for (SizeT i = 0; i < block_size; ++i) { + BMPBlockID block_id = block_ids[i]; + DataType score = max_scores[i]; + upper_bounds[block_id] += score * query_score; + } + } else { + SizeT block_size = block_data.block_size(); + const DataType *max_scores = block_data.max_scores(); + for (BMPBlockID block_id = 0; block_id < BMPBlockID(block_size); ++block_id) { + if (max_scores[block_id] > 0.0) { + upper_bounds[block_id] += max_scores[block_id] * query_score; + } + } + } + } -private: - SizeT block_size_; - Vector> block_terms_list_; - TailFwd tail_fwd_; +protected: + BMPIvt bm_ivt_; + BlockFwd block_fwd_; + VecPtr doc_ids_; }; +export template +class BMPAlg {}; + export template -class BMPAlg { +class BMPAlg : public BMPAlgBase { public: using DataT = DataType; using IdxT = IdxType; + constexpr static SizeT kAlign = 8; + constexpr static bool kOwnMem = true; private: - BMPAlg(BMPIvt bm_ivt, BlockFwd block_fwd, Vector doc_ids) - : bm_ivt_(std::move(bm_ivt)), block_fwd_(std::move(block_fwd)), doc_ids_(std::move(doc_ids)) {} + BMPAlg(BMPIvt bm_ivt, + BlockFwd block_fwd, + VecPtr doc_ids) + : BMPAlgBase(std::move(bm_ivt), std::move(block_fwd), std::move(doc_ids)) {} public: - BMPAlg(SizeT term_num, SizeT block_size) : bm_ivt_(term_num), block_fwd_(block_size) {} + BMPAlg(SizeT term_num, SizeT block_size) : BMPAlgBase(term_num, block_size) {} - void AddDoc(const SparseVecRef &doc, BMPDocID doc_id, bool lock = true); + void AddDoc(const SparseVecRef &doc, BMPDocID doc_id, bool lck = true) { + std::unique_lock lock; + if (lck) { + lock = std::unique_lock(mtx_); + } + + SizeT mem_usage = 0; + this->doc_ids_.push_back(doc_id); + Optional> tail_fwd = this->block_fwd_.AddDoc(doc, mem_usage); + if (!tail_fwd.has_value()) { + mem_usage_.fetch_add(sizeof(BMPDocID) + mem_usage); + return; + } + BMPBlockID block_id = this->block_fwd_.block_num() - 1; + const auto &tail_terms = tail_fwd->GetTailTerms(); + this->bm_ivt_.AddBlock(block_id, tail_terms, mem_usage); + mem_usage_.fetch_add(sizeof(BMPDocID) + mem_usage); + } template , BMPDocID> Iterator> - SizeT AddDocs(Iterator iter); + SizeT AddDocs(Iterator iter) { + SizeT cnt = 0; + while (true) { + auto ret = iter.Next(); + if (!ret.has_value()) { + break; + } + const auto &[sparse_ref, doc_id] = *ret; + AddDoc(sparse_ref, doc_id); + ++cnt; + } + return cnt; + } - SizeT DocNum() const; + SizeT DocNum() const { + std::shared_lock lock(mtx_); + return this->doc_ids_.size(); + } - void Optimize(const BMPOptimizeOptions &options); + void Optimize(const BMPOptimizeOptions &options) { + std::unique_lock lock(mtx_); - Pair, Vector> SearchKnn(const SparseVecRef &query, i32 topk, const BmpSearchOptions &options) const; + if (options.bp_reorder_) { + SizeT block_size = this->block_fwd_.block_size(); + SizeT term_num = this->bm_ivt_.term_num(); + SizeT doc_num = this->doc_ids_.size() - this->doc_ids_.size() % block_size; - template Filter = NoneType> - Pair, Vector> - SearchKnn(const SparseVecRef &query, i32 topk, const BmpSearchOptions &options, const Filter &filter) const; + this->bm_ivt_ = BMPIvt(term_num); + Vector, Vector>> fwd = this->block_fwd_.GetFwd(doc_num, term_num); + TailFwd tail_fwd = this->block_fwd_.GetTailFwd(); + this->block_fwd_ = BlockFwd(block_size); - void Save(LocalFileHandle &file_handle) const; + BPReordering bp(term_num); + // add bp parameter here + for (BMPDocID i = 0; i < doc_num; ++i) { + bp.AddDoc(&fwd[i].first); + } + Vector remap = bp(); - static BMPAlg Load(LocalFileHandle &file_handle); + Vector doc_ids = this->doc_ids_.exchange(Vector()); + for (BMPDocID new_id = 0; new_id < doc_num; ++new_id) { + BMPDocID old_id = remap[new_id]; + SparseVecRef doc((i32)fwd[old_id].first.size(), fwd[old_id].first.data(), fwd[old_id].second.data()); + this->AddDoc(doc, doc_ids[old_id], false); + } + for (BMPDocID i = doc_num; i < doc_ids.size(); ++i) { + const auto &[indices, data] = tail_fwd.GetTailTerms()[i - doc_num]; + SparseVecRef doc((i32)indices.size(), indices.data(), data.data()); + this->AddDoc(doc, doc_ids[i], false); + } + } + if (options.topk_ != 0) { + SizeT term_num = this->bm_ivt_.term_num(); + Vector> ivt_scores = this->block_fwd_.GetIvtScores(term_num); + this->bm_ivt_.Optimize(options.topk_, std::move(ivt_scores)); + } + } + + Pair, Vector> + SearchKnn(const SparseVecRef &query, i32 topk, const BmpSearchOptions &options) const { + return SearchKnn(query, topk, options, nullptr); + } - SizeT GetSizeInBytes() const; + template Filter = NoneType> + Pair, Vector> + SearchKnn(const SparseVecRef &query, i32 topk, const BmpSearchOptions &options, const Filter &filter) const { + std::shared_lock lock(mtx_, std::defer_lock); + if (options.use_lock_) { + lock.lock(); + } + return BMPAlgBase::SearchKnn(query, topk, options, filter); + } - inline SizeT MemoryUsage() const { return mem_usage_.load(); } + void Save(LocalFileHandle &file_handle) const { + auto size = GetSizeInBytes(); + auto buffer = MakeUnique(sizeof(size) + size); + char *p = buffer.get(); + WriteBufAdv(p, size); + WriteAdv(p); + if (SizeT write_n = p - buffer.get(); write_n != sizeof(size) + size) { + UnrecoverableError(fmt::format("BMPAlg::Save: write_n != sizeof(size) + size: {} != {}", write_n, sizeof(size) + size)); + } + file_handle.Append(buffer.get(), sizeof(size) + size); + } -private: - void WriteAdv(char *&p) const; + static BMPAlg Load(LocalFileHandle &file_handle) { + SizeT size; + file_handle.Read(&size, sizeof(size)); + auto buffer = MakeUnique(size); + file_handle.Read(buffer.get(), size); + const char *p = buffer.get(); + return ReadAdv(p); + } - static BMPAlg ReadAdv(const char *&p); + SizeT GetSizeInBytes() const { + std::shared_lock lock(mtx_); -private: - BMPIvt bm_ivt_; - BlockFwd block_fwd_; - Vector doc_ids_; - Atomic mem_usage_ = 0; + SizeT size = 0; + size += this->bm_ivt_.GetSizeInBytes(); + size += this->block_fwd_.GetSizeInBytes(); + size += sizeof(SizeT); + size += this->doc_ids_.size() * sizeof(BMPDocID); + return size; + } - mutable std::shared_mutex mtx_; -}; + inline SizeT MemoryUsage() const { return mem_usage_.load(); } -template -template , BMPDocID> Iterator> -SizeT BMPAlg::AddDocs(Iterator iter) { - SizeT cnt = 0; - while (true) { - auto ret = iter.Next(); - if (!ret.has_value()) { - break; + void SaveToPtr(LocalFileHandle &file_handle) { + Finalize(); + + char *p0 = nullptr; + GetSizeToPtr(p0); + char *p1 = nullptr; + SizeT size = p0 - p1; + auto buffer = MakeUnique(size); + char *p = buffer.get(); + WriteToPtr(p); + if (SizeT write_n = p - buffer.get(); write_n != size) { + UnrecoverableError(fmt::format("BMPAlg::SaveToPtr: write_n != size: {} != {}", write_n, size)); } - const auto &[sparse_ref, doc_id] = *ret; - AddDoc(sparse_ref, doc_id); - ++cnt; - } - return cnt; -} - -template -template Filter> -Pair, Vector> BMPAlg::SearchKnn(const SparseVecRef &query, - i32 topk, - const BmpSearchOptions &options, - const Filter &filter) const { - if (topk == 0) { - return {{}, {}}; - } - std::shared_lock lock(mtx_, std::defer_lock); - if (options.use_lock_) { - lock.lock(); + file_handle.Append(buffer.get(), size); } - SizeT block_size = block_fwd_.block_size(); - SparseVecEle keeped_query; - if (options.beta_ < 1.0) { - i32 terms_to_keep = std::ceil(query.nnz_ * options.beta_); - Vector query_term_idxes(query.nnz_); - std::iota(query_term_idxes.begin(), query_term_idxes.end(), 0); - std::partial_sort(query_term_idxes.begin(), query_term_idxes.begin() + terms_to_keep, query_term_idxes.end(), [&](SizeT a, SizeT b) { - return query.data_[a] > query.data_[b]; - }); - query_term_idxes.resize(terms_to_keep); - std::sort(query_term_idxes.begin(), query_term_idxes.end(), [&](SizeT a, SizeT b) { return query.indices_[a] < query.indices_[b]; }); - - keeped_query.Init(query_term_idxes, query.data_, query.indices_); +private: + void Finalize() { + auto tail_fwd = this->block_fwd_.Finalize(); + if (tail_fwd.has_value()) { + SizeT mem_usage = 0; + + BMPBlockID block_id = this->block_fwd_.block_num() - 1; + auto tail_terms = tail_fwd->GetTailTerms(); + this->bm_ivt_.AddBlock(block_id, tail_terms, mem_usage); + } } - const SparseVecRef &query_ref = - options.beta_ < 1.0 ? SparseVecRef(keeped_query.nnz_, keeped_query.indices_.get(), keeped_query.data_.get()) : query; - - DataType threshold = 0.0; - SizeT block_num = block_fwd_.block_num(); - Vector upper_bounds(block_num, 0.0); - for (i32 i = 0; i < query_ref.nnz_; ++i) { - // if (i + 1 < query_ref.nnz_) { - // IdxType next_query_term = query_ref.indices_[i + 1]; - // bm_ivt_.Prefetch(next_query_term); - // } - IdxType query_term = query_ref.indices_[i]; - DataType query_score = query_ref.data_[i]; - const auto &posting = bm_ivt_.GetPostings(query_term); - threshold = std::max(threshold, query_score * posting.kth(topk)); - posting.data_.Calculate(upper_bounds, query_score); + + void GetSizeToPtr(char *&p) const { + this->bm_ivt_.GetSizeToPtr(p); + this->block_fwd_.GetSizeToPtr(p); + GetSizeInBytesAligned(p); + GetSizeInBytesVecAligned(p, this->doc_ids_.size()); } - Vector> block_scores; - for (SizeT block_id = 0; block_id < block_num; ++block_id) { - if (upper_bounds[block_id] >= threshold) { - block_scores.emplace_back(upper_bounds[block_id], block_id); + void WriteToPtr(char *&p) const { + if (reinterpret_cast(p) % kAlign != 0) { + UnrecoverableError(fmt::format("BMPAlg::WriteToPtr: p % kAlign != 0: {} % {} != 0", reinterpret_cast(p), kAlign)); } + char *start = p; + this->bm_ivt_.WriteToPtr(p); + [[maybe_unused]] SizeT sz1 = p - start; + start = p; + this->block_fwd_.WriteToPtr(p); + [[maybe_unused]] SizeT sz2 = p - start; + start = p; + WriteBufAdvAligned(p, this->doc_ids_.size()); + WriteBufVecAdvAligned(p, this->doc_ids_.data(), this->doc_ids_.size()); + [[maybe_unused]] SizeT sz3 = p - start; } - std::sort(block_scores.begin(), block_scores.end(), [](const auto &a, const auto &b) { return a.first > b.first; }); - Vector result(topk); - Vector result_score(topk); - HeapResultHandler> result_handler(1 /*query_n*/, topk, result_score.data(), result.data()); + void WriteAdv(char *&p) const { + std::shared_lock lock(mtx_); - auto add_result = [&](DataType score, BMPDocID doc_id) { - if constexpr (std::is_same_v) { - result_handler.AddResult(0 /*query_id*/, score, doc_id); - } else { - if (filter(doc_ids_[doc_id])) { - result_handler.AddResult(0 /*query_id*/, score, doc_id); - } - } - }; + this->bm_ivt_.WriteAdv(p); + this->block_fwd_.WriteAdv(p); + SizeT doc_num = this->doc_ids_.size(); + WriteBufAdv(p, doc_num); + WriteBufVecAdv(p, this->doc_ids_.data(), this->doc_ids_.size()); + } - SizeT block_scores_num = block_scores.size(); - for (SizeT i = 0; i < block_scores_num; ++i) { - if (i + 1 < block_scores_num) { - BMPBlockID next_block_id = block_scores[i + 1].second; - block_fwd_.Prefetch(next_block_id); - } - const auto &[ub_score, block_id] = block_scores[i]; - BMPDocID off = block_id * block_size; - Vector scores = block_fwd_.GetScores(block_id, query_ref); - for (SizeT block_off = 0; block_off < scores.size(); ++block_off) { - BMPDocID doc_id = off + block_off; - DataType score = scores[block_off]; - add_result(score, doc_id); - } - if (result_handler.GetSize(0) == u32(topk) && ub_score * options.alpha_ < result_handler.GetDistance0(0 /*query_id*/)) { - break; + static BMPAlg ReadAdv(const char *&p) { + auto postings = BMPIvt::ReadAdv(p); + auto block_fwd = BlockFwd::ReadAdv(p); + SizeT doc_num = ReadBufAdv(p); + Vector doc_ids(doc_num); + for (SizeT i = 0; i < doc_num; ++i) { + doc_ids[i] = ReadBufAdv(p); } + return BMPAlg(std::move(postings), std::move(block_fwd), std::move(doc_ids)); } - if (options.use_tail_) { - Vector tail_scores = block_fwd_.GetScoresTail(query_ref); - for (SizeT i = 0; i < tail_scores.size(); ++i) { - BMPDocID doc_id = block_num * block_size + i; - DataType score = tail_scores[i]; - add_result(score, doc_id); +private: + Atomic mem_usage_ = 0; + + mutable std::shared_mutex mtx_; +}; + +export template +class BMPAlg : public BMPAlgBase { +public: + using DataT = DataType; + using IdxT = IdxType; + constexpr static bool kOwnMem = false; + constexpr static SizeT kAlign = 8; + +private: + BMPAlg(BMPIvt bm_ivt, + BlockFwd block_fwd, + VecPtr doc_ids) + : BMPAlgBase(std::move(bm_ivt), std::move(block_fwd), std::move(doc_ids)) {} + +public: + static BMPAlg LoadFromPtr(const char *&p, SizeT size) { + if (reinterpret_cast(p) % kAlign != 0) { + UnrecoverableError(fmt::format("BMPAlg::LoadFromPtr: p % kAlign != 0: {} % {} != 0", reinterpret_cast(p), kAlign)); } + const char *start = p; + auto bm_ivt = BMPIvt::ReadFromPtr(p); + auto block_fwd = BlockFwd::LoadFromPtr(p); + SizeT doc_num = ReadBufAdvAligned(p); + const BMPDocID *doc_ids = ReadBufVecAdvAligned(p, doc_num); + if (SizeT(p - start) != size) { + UnrecoverableError(fmt::format("BMPAlg::LoadFromPtr: p - start != size: {} != {}", p - start, size)); + } + return BMPAlg(std::move(bm_ivt), + std::move(block_fwd), + VecPtr(doc_ids, doc_num)); } - SizeT res_n = result_handler.GetSize(0 /*query_id*/); - result_handler.End(0 /*query_id*/); - result.erase(result.begin() + res_n, result.end()); - result_score.erase(result_score.begin() + res_n, result_score.end()); - Vector result_docid(res_n); - std::transform(result.begin(), result.end(), result_docid.begin(), [&](BMPDocID doc_id) { return doc_ids_[doc_id]; }); - return {result_docid, result_score}; -} +private: +}; } // namespace infinity diff --git a/src/storage/knn_index/sparse/bmp_alg_serialize.cpp b/src/storage/knn_index/sparse/bmp_alg_serialize.cpp deleted file mode 100644 index e483b95c81..0000000000 --- a/src/storage/knn_index/sparse/bmp_alg_serialize.cpp +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright(C) 2023 InfiniFlow, Inc. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -module; - -#include "common/simd/simd_common_intrin_include.h" -#include - -module bmp_alg; - -import infinity_exception; -import third_party; -import serialize; - -namespace infinity { - -// --------------------------BMPIvt-------------------------- - -template -SizeT BMPIvt::GetSizeInBytes() const { - SizeT size = sizeof(SizeT); - for (const auto &posting : postings_) { - size += posting.GetSizeInBytes(); - } - return size; -} - -template -void BMPIvt::WriteAdv(char *&p) const { - SizeT posting_size = postings_.size(); - WriteBufAdv(p, posting_size); - for (const auto &posting : postings_) { - posting.WriteAdv(p); - } -} - -template -BMPIvt BMPIvt::ReadAdv(const char *&p) { - SizeT posting_size = ReadBufAdv(p); - Vector> postings(posting_size); - for (SizeT i = 0; i < posting_size; ++i) { - postings[i] = BlockPostings::ReadAdv(p); - } - return BMPIvt(std::move(postings)); -} - -template class BMPIvt; -template class BMPIvt; -template class BMPIvt; -template class BMPIvt; - -// --------------------------TailFwd-------------------------- - -template -SizeT TailFwd::GetSizeInBytes() const { - SizeT size = sizeof(SizeT); - for (const auto &tail_terms : tail_terms_) { - const auto [indices, data] = tail_terms; - size += sizeof(SizeT) + indices.size() * sizeof(IdxType) + data.size() * sizeof(DataType); - } - return size; -} - -template -void TailFwd::WriteAdv(char *&p) const { - SizeT tail_num = tail_terms_.size(); - WriteBufAdv(p, tail_num); - for (const auto &tail_terms : tail_terms_) { - const auto &[indices, data] = tail_terms; - SizeT term_num = indices.size(); - WriteBufAdv(p, term_num); - WriteBufVecAdv(p, indices.data(), indices.size()); - WriteBufVecAdv(p, data.data(), data.size()); - } -} - -template -TailFwd TailFwd::ReadAdv(const char *&p) { - SizeT tail_num = ReadBufAdv(p); - Vector, Vector>> tail_terms(tail_num); - for (SizeT i = 0; i < tail_num; ++i) { - SizeT term_num = ReadBufAdv(p); - auto &[indices, data] = tail_terms[i]; - indices.resize(term_num); - data.resize(term_num); - for (SizeT j = 0; j < term_num; ++j) { - indices[j] = ReadBufAdv(p); - } - for (SizeT j = 0; j < term_num; ++j) { - data[j] = ReadBufAdv(p); - } - } - return TailFwd(std::move(tail_terms)); -} - -template class TailFwd; -template class TailFwd; -template class TailFwd; -template class TailFwd; -template class TailFwd; -template class TailFwd; - -// --------------------------BlockFwd-------------------------- - -template -SizeT BlockFwd::GetSizeInBytes() const { - SizeT size = sizeof(block_size_) + sizeof(SizeT); - for (const auto &block_terms : block_terms_list_) { - size += block_terms.GetSizeInBytes(); - } - size += tail_fwd_.GetSizeInBytes(); - return size; -} - -template -void BlockFwd::WriteAdv(char *&p) const { - WriteBufAdv(p, block_size_); - SizeT block_num = block_terms_list_.size(); - WriteBufAdv(p, block_num); - for (const auto &block_terms : block_terms_list_) { - block_terms.WriteAdv(p); - } - tail_fwd_.WriteAdv(p); -} - -template -BlockFwd BlockFwd::ReadAdv(const char *&p) { - SizeT block_size = ReadBufAdv(p); - SizeT block_num = ReadBufAdv(p); - Vector> block_terms_list; - block_terms_list.reserve(block_num); - for (SizeT i = 0; i < block_num; ++i) { - auto block_terms = BlockTerms::ReadAdv(p); - block_terms_list.push_back(std::move(block_terms)); - } - auto tail_fwd = TailFwd::ReadAdv(p); - return BlockFwd(block_size, std::move(block_terms_list), std::move(tail_fwd)); -} - -template class BlockFwd; -template class BlockFwd; -template class BlockFwd; -template class BlockFwd; -template class BlockFwd; -template class BlockFwd; - -// --------------------------BMPAlg-------------------------- - -template -void BMPAlg::Save(LocalFileHandle &file_handle) const { - auto size = GetSizeInBytes(); - auto buffer = MakeUnique(sizeof(size) + size); - char *p = buffer.get(); - WriteBufAdv(p, size); - WriteAdv(p); - if (SizeT write_n = p - buffer.get(); write_n != sizeof(size) + size) { - UnrecoverableError(fmt::format("BMPAlg::Save: write_n != sizeof(size) + size: {} != {}", write_n, sizeof(size) + size)); - } - file_handle.Append(buffer.get(), sizeof(size) + size); -} - -template -BMPAlg BMPAlg::Load(LocalFileHandle &file_handle) { - SizeT size; - file_handle.Read(&size, sizeof(size)); - auto buffer = MakeUnique(size); - file_handle.Read(buffer.get(), size); - const char *p = buffer.get(); - return ReadAdv(p); -} - -template -SizeT BMPAlg::GetSizeInBytes() const { - std::shared_lock lock(mtx_); - - SizeT size = 0; - size += bm_ivt_.GetSizeInBytes(); - size += block_fwd_.GetSizeInBytes(); - size += sizeof(SizeT); - size += doc_ids_.size() * sizeof(BMPDocID); - return size; -} - -template -void BMPAlg::WriteAdv(char *&p) const { - std::shared_lock lock(mtx_); - - bm_ivt_.WriteAdv(p); - block_fwd_.WriteAdv(p); - SizeT doc_num = doc_ids_.size(); - WriteBufAdv(p, doc_num); - WriteBufVecAdv(p, doc_ids_.data(), doc_ids_.size()); -} - -template -BMPAlg BMPAlg::ReadAdv(const char *&p) { - auto postings = BMPIvt::ReadAdv(p); - auto block_fwd = BlockFwd::ReadAdv(p); - SizeT doc_num = ReadBufAdv(p); - Vector doc_ids(doc_num); - for (SizeT i = 0; i < doc_num; ++i) { - doc_ids[i] = ReadBufAdv(p); - } - return BMPAlg(std::move(postings), std::move(block_fwd), std::move(doc_ids)); -} - -template class BMPAlg; -template class BMPAlg; -template class BMPAlg; -template class BMPAlg; -template class BMPAlg; -template class BMPAlg; - -template class BMPAlg; -template class BMPAlg; -template class BMPAlg; -template class BMPAlg; -template class BMPAlg; -template class BMPAlg; - -} // namespace infinity \ No newline at end of file diff --git a/src/storage/knn_index/sparse/bmp_blockterms.cppm b/src/storage/knn_index/sparse/bmp_blockterms.cppm deleted file mode 100644 index d5d7cb11f2..0000000000 --- a/src/storage/knn_index/sparse/bmp_blockterms.cppm +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright(C) 2023 InfiniFlow, Inc. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -module; - -#include "common/simd/simd_common_intrin_include.h" - -export module bmp_blockterms; - -import stl; -import bmp_util; -import infinity_exception; -import serialize; - -namespace infinity { - -export template -class BlockTerms; - -export template -class BlockTermsIter { -public: - BlockTermsIter(const char *ptr, const char *ptr_end) : ptr_(ptr), ptr_end_(ptr_end) {} - - bool HasNext() const { return ptr_ < ptr_end_; } - - Tuple Value() { - const char *p = ptr_; - auto block_size = ReadBufAdv(p); - auto term_id = ReadBufAdv(p); - - auto *block_offsets = reinterpret_cast(p); - auto *values = reinterpret_cast(block_offsets + block_size); - return {term_id, block_size, block_offsets, values}; - } - - void Next() { - auto block_size = ReadBuf(ptr_); - ptr_ += sizeof(block_size) + sizeof(IdxType) + block_size * sizeof(BMPBlockOffset) + block_size * sizeof(DataType); - } - -private: - const char *ptr_; - const char *ptr_end_; -}; - -export template -class BlockTerms { - using IterT = BlockTermsIter; - -public: - BlockTerms(const Vector, Vector>> &block_terms) - : data_len_(GetBufferSize(block_terms)), data_(MakeUniqueForOverwrite(data_len_)) { - char *ptr = data_.get(); - for (const auto &[term_id, block_offsets, values] : block_terms) { - SizeT block_size = block_offsets.size(); - WriteBufAdv(ptr, block_size); - WriteBufAdv(ptr, term_id); - WriteBufVecAdv(ptr, block_offsets.data(), block_size); - WriteBufVecAdv(ptr, values.data(), block_size); - } - } - -private: - static SizeT GetBufferSize(const Vector, Vector>> &block_terms) { - SizeT size = 0; - for (const auto &[term_id, block_offsets, values] : block_terms) { - SizeT block_size = block_offsets.size(); - if (block_size != values.size()) { - UnrecoverableError("Block offsets and values size mismatch"); - } - size += sizeof(block_size); - size += sizeof(term_id); - size += block_size * sizeof(BMPBlockOffset); - size += block_size * sizeof(DataType); - } - return size; - } - - BlockTerms(SizeT data_len, UniquePtr data) : data_len_(data_len), data_(std::move(data)) {} - -public: - IterT Iter() const { return IterT(data_.get(), data_.get() + data_len_); } - - SizeT GetSizeInBytes() const { return sizeof(data_len_) + data_len_; } - - void WriteAdv(char *&p) const { - WriteBufAdv(p, data_len_); - WriteBufVecAdv(p, data_.get(), data_len_); - } - - static BlockTerms ReadAdv(const char *&p) { - SizeT data_len = ReadBufAdv(p); - UniquePtr data = MakeUniqueForOverwrite(data_len); - std::memcpy(data.get(), p, data_len); - p += data_len; - return BlockTerms(data_len, std::move(data)); - } - - void Prefetch() const { - const char *ptr = data_.get(); - _mm_prefetch(ptr, _MM_HINT_T0); - } - -private: - SizeT data_len_{}; - UniquePtr data_{}; -}; - -} // namespace infinity \ No newline at end of file diff --git a/src/storage/knn_index/sparse/bmp_fwd.cppm b/src/storage/knn_index/sparse/bmp_fwd.cppm new file mode 100644 index 0000000000..352bb4d365 --- /dev/null +++ b/src/storage/knn_index/sparse/bmp_fwd.cppm @@ -0,0 +1,543 @@ +// Copyright(C) 2023 InfiniFlow, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module; + +#include "common/simd/simd_common_intrin_include.h" +#include + +export module bmp_fwd; + +import stl; +import sparse_util; +import local_file_handle; +import bmp_util; +import knn_result_handler; +import serialize; +import infinity_exception; + +namespace infinity { + +template +class BlockTermsIter; + +template +class BlockTermsIter { +public: + BlockTermsIter(const char *ptr, const char *ptr_end) : ptr_(ptr), ptr_end_(ptr_end) {} + + bool HasNext() const { return ptr_ < ptr_end_; } + + Tuple Value() const { + const char *p = ptr_; + auto block_size = ReadBufAdv(p); + auto term_id = ReadBufAdv(p); + + auto *block_offsets = reinterpret_cast(p); + auto *values = reinterpret_cast(block_offsets + block_size); + return {term_id, block_size, block_offsets, values}; + } + + void Next() { + auto block_size = ReadBuf(ptr_); + ptr_ += sizeof(block_size) + sizeof(IdxType) + block_size * sizeof(BMPBlockOffset) + block_size * sizeof(DataType); + } + +private: + const char *ptr_; + const char *ptr_end_; +}; + +template +class BlockTermsIter { +public: + BlockTermsIter(SizeT block_term_remain, + const SizeT *block_size_prefix_sum, + const IdxType *term_ids, + const BMPBlockOffset *block_offsets, + const DataType *values) + : block_term_remain_(block_term_remain), block_size_prefix_sum_(block_size_prefix_sum), term_ids_(term_ids), block_offsets_(block_offsets), + values_(values) {} + + bool HasNext() const { return block_term_remain_ > 0; } + + Tuple Value() const { + SizeT block_size = block_size_prefix_sum_[1] - block_size_prefix_sum_[0]; + return {term_ids_[0], block_size, block_offsets_, values_}; + } + + void Next() { + SizeT block_size = block_size_prefix_sum_[1] - block_size_prefix_sum_[0]; + ++block_size_prefix_sum_; + ++term_ids_; + block_offsets_ += block_size; + values_ += block_size; + --block_term_remain_; + } + +private: + SizeT block_term_remain_{}; + const SizeT *block_size_prefix_sum_; + const IdxType *term_ids_; + const BMPBlockOffset *block_offsets_; + const DataType *values_; +}; + +export template +class BlockTerms {}; + +export template +class BlockTerms { + using IterT = BlockTermsIter; + +public: + BlockTerms(const Vector, Vector>> &block_terms) + : data_len_(GetBufferSize(block_terms)), data_(MakeUniqueForOverwrite(data_len_)) { + char *ptr = data_.get(); + for (const auto &[term_id, block_offsets, values] : block_terms) { + SizeT block_size = block_offsets.size(); + WriteBufAdv(ptr, block_size); + WriteBufAdv(ptr, term_id); + WriteBufVecAdv(ptr, block_offsets.data(), block_size); + WriteBufVecAdv(ptr, values.data(), block_size); + } + } + +private: + static SizeT GetBufferSize(const Vector, Vector>> &block_terms) { + SizeT size = 0; + for (const auto &[term_id, block_offsets, values] : block_terms) { + SizeT block_size = block_offsets.size(); + if (block_size != values.size()) { + UnrecoverableError("Block offsets and values size mismatch"); + } + size += sizeof(block_size); + size += sizeof(term_id); + size += block_size * sizeof(BMPBlockOffset); + size += block_size * sizeof(DataType); + } + return size; + } + + BlockTerms(SizeT data_len, UniquePtr data) : data_len_(data_len), data_(std::move(data)) {} + +public: + IterT Iter() const { return IterT(data_.get(), data_.get() + data_len_); } + + SizeT GetSizeInBytes() const { return sizeof(data_len_) + data_len_; } + + void WriteAdv(char *&p) const { + WriteBufAdv(p, data_len_); + WriteBufVecAdv(p, data_.get(), data_len_); + } + + static BlockTerms ReadAdv(const char *&p) { + SizeT data_len = ReadBufAdv(p); + UniquePtr data = MakeUniqueForOverwrite(data_len); + std::memcpy(data.get(), p, data_len); + p += data_len; + return BlockTerms(data_len, std::move(data)); + } + + void GetSizeToPtr(char *&p) const { + GetSizeInBytesAligned(p); + SizeT block_size_sum = 0; + SizeT cnt = 0; + for (auto iter = Iter(); iter.HasNext(); iter.Next()) { + auto [term_id, block_size, block_offsets, values] = iter.Value(); + block_size_sum += block_size; + ++cnt; + } + GetSizeInBytesVecAligned(p, cnt + 1); + GetSizeInBytesVecAligned(p, cnt); + GetSizeInBytesVecAligned(p, block_size_sum); + GetSizeInBytesVecAligned(p, block_size_sum); + } + + void WriteToPtr(char *&p) const { + SizeT block_size_sum = 0; + Vector block_size_prefix_sum; + Vector term_ids; + Vector block_offsets_vec; + Vector values_vec; + block_size_prefix_sum.push_back(0); + for (auto iter = Iter(); iter.HasNext(); iter.Next()) { + auto [term_id, block_size, block_offsets, values] = iter.Value(); + block_size_sum += block_size; + block_size_prefix_sum.push_back(block_size_sum); + term_ids.push_back(term_id); + for (SizeT i = 0; i < block_size; ++i) { + block_offsets_vec.push_back(block_offsets[i]); + values_vec.push_back(values[i]); + } + } + WriteBufAdvAligned(p, term_ids.size()); + WriteBufVecAdvAligned(p, block_size_prefix_sum.data(), block_size_prefix_sum.size()); + WriteBufVecAdvAligned(p, term_ids.data(), term_ids.size()); + WriteBufVecAdvAligned(p, block_offsets_vec.data(), block_offsets_vec.size()); + WriteBufVecAdvAligned(p, values_vec.data(), values_vec.size()); + } + + void Prefetch() const { + const char *ptr = data_.get(); + _mm_prefetch(ptr, _MM_HINT_T0); + } + +private: + SizeT data_len_{}; + UniquePtr data_{}; +}; + +export template +class BlockTerms { + using IterT = BlockTermsIter; + +public: + IterT Iter() const { return IterT(block_term_num_, block_size_prefix_sum_, term_ids_, block_offsets_, values_); } + + static BlockTerms ReadFromPtr(const char *&p) { + BlockTerms ret; + ret.block_term_num_ = ReadBufAdvAligned(p); + ret.block_size_prefix_sum_ = ReadBufVecAdvAligned(p, ret.block_term_num_ + 1); + ret.term_ids_ = ReadBufVecAdvAligned(p, ret.block_term_num_); + SizeT block_size_sum = ret.block_size_prefix_sum_[ret.block_term_num_]; + ret.block_offsets_ = ReadBufVecAdvAligned(p, block_size_sum); + ret.values_ = ReadBufVecAdvAligned(p, block_size_sum); + return ret; + } + + void Prefetch() const { + _mm_prefetch(block_size_prefix_sum_, _MM_HINT_T0); + _mm_prefetch(term_ids_, _MM_HINT_T0); + _mm_prefetch(block_offsets_, _MM_HINT_T0); + _mm_prefetch(values_, _MM_HINT_T0); + } + +private: + SizeT block_term_num_; + const SizeT *block_size_prefix_sum_; + const IdxType *term_ids_; + const BMPBlockOffset *block_offsets_; + const DataType *values_; +}; + +export template +class TailFwd { +private: + TailFwd(Vector, Vector>> tail_terms) : tail_terms_(std::move(tail_terms)) {} + +public: + TailFwd() = default; + TailFwd(SizeT block_size) { tail_terms_.reserve(block_size); } + + SizeT AddDoc(const SparseVecRef &doc) { + Vector indices; + Vector data; + indices.reserve(doc.nnz_); + data.reserve(doc.nnz_); + for (i32 i = 0; i < doc.nnz_; ++i) { + indices.push_back(doc.indices_[i]); + data.push_back(doc.data_[i]); + } + tail_terms_.emplace_back(std::move(indices), std::move(data)); + return tail_terms_.size(); + } + + const Vector, Vector>> &GetTailTerms() const { return tail_terms_; } + + Vector, Vector>> ToBlockFwd() const { + Vector> term_pairs; + SizeT block_size = tail_terms_.size(); + for (SizeT block_offset = 0; block_offset < block_size; ++block_offset) { + SizeT block_size = tail_terms_[block_offset].first.size(); + for (SizeT i = 0; i < block_size; ++i) { + IdxType term_id = tail_terms_[block_offset].first[i]; + DataType score = tail_terms_[block_offset].second[i]; + term_pairs.emplace_back(term_id, block_offset, score); + } + } + std::sort(term_pairs.begin(), term_pairs.end(), [](const auto &a, const auto &b) { return std::get<0>(a) < std::get<0>(b); }); + + Vector, Vector>> res; + IdxType last_term_id = -1; + Vector block_offsets; + Vector scores; + for (const auto &[term_id, block_offset, score] : term_pairs) { + if (term_id != last_term_id) { + if (last_term_id != -1) { + res.emplace_back(last_term_id, std::move(block_offsets), std::move(scores)); + } + last_term_id = term_id; + } + block_offsets.push_back(block_offset); + scores.push_back(score); + } + if (!block_offsets.empty()) { + res.emplace_back(last_term_id, std::move(block_offsets), std::move(scores)); + } + return res; + } + + Vector GetScores(const SparseVecRef &query) const { + SizeT tail_size = tail_terms_.size(); + Vector res(tail_size, 0.0); + for (SizeT offset = 0; offset < tail_size; ++offset) { + const auto &[indices, data] = tail_terms_[offset]; + SizeT j = 0; + for (i32 i = 0; i < query.nnz_; ++i) { + IdxType query_term = query.indices_[i]; + DataType query_score = query.data_[i]; + while (j < indices.size() && indices[j] < query_term) { + ++j; + } + if (j == indices.size()) { + break; + } + if (indices[j] == query_term) { + res[offset] += query_score * data[j]; + } + } + } + return res; + } + + SizeT GetSizeInBytes() const { + SizeT size = sizeof(SizeT); + for (const auto &tail_terms : tail_terms_) { + const auto [indices, data] = tail_terms; + size += sizeof(SizeT) + indices.size() * sizeof(IdxType) + data.size() * sizeof(DataType); + } + return size; + } + + void WriteAdv(char *&p) const { + SizeT tail_num = tail_terms_.size(); + WriteBufAdv(p, tail_num); + for (const auto &tail_terms : tail_terms_) { + const auto &[indices, data] = tail_terms; + SizeT term_num = indices.size(); + WriteBufAdv(p, term_num); + WriteBufVecAdv(p, indices.data(), indices.size()); + WriteBufVecAdv(p, data.data(), data.size()); + } + } + + static TailFwd ReadAdv(const char *&p) { + SizeT tail_num = ReadBufAdv(p); + Vector, Vector>> tail_terms(tail_num); + for (SizeT i = 0; i < tail_num; ++i) { + SizeT term_num = ReadBufAdv(p); + auto &[indices, data] = tail_terms[i]; + indices.resize(term_num); + data.resize(term_num); + for (SizeT j = 0; j < term_num; ++j) { + indices[j] = ReadBufAdv(p); + } + for (SizeT j = 0; j < term_num; ++j) { + data[j] = ReadBufAdv(p); + } + } + return TailFwd(std::move(tail_terms)); + } + +private: + Vector, Vector>> tail_terms_; +}; + +export template +class BlockFwd; + +export template +class BlockFwd { +public: + BlockFwd() = default; + + BlockFwd(SizeT block_size, Vector> block_terms_list, TailFwd tail_fwd) + : block_size_(block_size), block_terms_list_(std::move(block_terms_list)), tail_fwd_(std::move(tail_fwd)) {} + + BlockFwd(SizeT block_size) : block_size_(block_size), tail_fwd_(block_size) {} + + Optional> AddDoc(const SparseVecRef &doc, SizeT &mem_usage) { + SizeT tail_size = tail_fwd_.AddDoc(doc); + if (tail_size < block_size_) { + return None; + } + TailFwd tail_fwd1(block_size_); + std::swap(tail_fwd1, tail_fwd_); + + Vector, Vector>> block_terms = tail_fwd1.ToBlockFwd(); + block_terms_list_.emplace_back(block_terms); + mem_usage += block_terms_list_.back().GetSizeInBytes(); + return tail_fwd1; + } + + Optional> Finalize() { + if (tail_fwd_.GetTailTerms().size() == 0) { + return None; + } + Vector, Vector>> block_terms = tail_fwd_.ToBlockFwd(); + block_terms_list_.emplace_back(block_terms); + return std::move(tail_fwd_); + } + + Vector, Vector>> GetFwd(SizeT doc_num, SizeT term_num) const { + SizeT doc_n = doc_num / block_size_ * block_size_; + Vector, Vector>> fwd(doc_n); + for (SizeT block_id = 0; block_id < block_terms_list_.size(); ++block_id) { + const auto &block_terms = block_terms_list_[block_id]; + for (auto iter = block_terms.Iter(); iter.HasNext(); iter.Next()) { + const auto &[term_id, block_size, block_offsets, scores] = iter.Value(); + for (SizeT i = 0; i < block_size; ++i) { + BMPDocID doc_id = block_offsets[i] + block_id * block_size_; + DataType score = scores[i]; + fwd[doc_id].first.push_back(term_id); + fwd[doc_id].second.push_back(score); + } + } + } + return fwd; + } + + TailFwd GetTailFwd() { return std::move(tail_fwd_); } + + Vector> GetIvtScores(SizeT term_num) const { + Vector> res(term_num); + for (const auto &block_terms : block_terms_list_) { + for (auto iter = block_terms.Iter(); iter.HasNext(); iter.Next()) { + const auto [term_id, block_size, block_offsets, scores] = iter.Value(); + for (SizeT i = 0; i < block_size; ++i) { + res[term_id].push_back(scores[i]); + } + } + } + return res; + } + + const BlockTerms &GetBlockTerms(BMPBlockID block_id) const { return block_terms_list_[block_id]; } + + Vector GetScoresTail(const SparseVecRef &query) const { return tail_fwd_.GetScores(query); } + + void Prefetch(BMPBlockID block_id) const { this->block_terms_list_[block_id].Prefetch(); } + + SizeT block_size() const { return block_size_; } + + SizeT block_num() const { return block_terms_list_.size(); } + + SizeT GetSizeInBytes() const { + SizeT size = sizeof(this->block_size_) + sizeof(SizeT); + for (const auto &block_terms : this->block_terms_list_) { + size += block_terms.GetSizeInBytes(); + } + size += tail_fwd_.GetSizeInBytes(); + return size; + } + + void WriteAdv(char *&p) const { + WriteBufAdv(p, this->block_size_); + SizeT block_num = this->block_terms_list_.size(); + WriteBufAdv(p, block_num); + for (const auto &block_terms : this->block_terms_list_) { + block_terms.WriteAdv(p); + } + tail_fwd_.WriteAdv(p); + } + + static BlockFwd ReadAdv(const char *&p) { + SizeT block_size = ReadBufAdv(p); + SizeT block_num = ReadBufAdv(p); + Vector> block_terms_list; + block_terms_list.reserve(block_num); + for (SizeT i = 0; i < block_num; ++i) { + auto block_terms = BlockTerms::ReadAdv(p); + block_terms_list.push_back(std::move(block_terms)); + } + auto tail_fwd = TailFwd::ReadAdv(p); + return BlockFwd(block_size, std::move(block_terms_list), std::move(tail_fwd)); + } + + void GetSizeToPtr(char *&p) const { + GetSizeInBytesAligned(p); + GetSizeInBytesAligned(p); + GetSizeInBytesVecAligned(p, block_terms_list_.size() + 1); + for (const auto &block_terms : block_terms_list_) { + block_terms.GetSizeToPtr(p); + } + } + + void WriteToPtr(char *&p) const { + WriteBufAdvAligned(p, block_size_); + WriteBufAdvAligned(p, block_terms_list_.size()); + Vector offsets; + { + char *p1 = p; + GetSizeInBytesVecAligned(p1, block_terms_list_.size()); + char *p2 = p1; + offsets.push_back(0); + for (const auto &block_terms : block_terms_list_) { + block_terms.GetSizeToPtr(p2); + offsets.push_back(p2 - p1); + } + } + WriteBufVecAdvAligned(p, offsets.data(), offsets.size()); + for (const auto &block_terms : block_terms_list_) { + block_terms.WriteToPtr(p); + } + } + +private: + SizeT block_size_ = 0; + Vector> block_terms_list_; + TailFwd tail_fwd_; +}; + +export template +class BlockFwd { +public: + BlockFwd() = default; + + static BlockFwd LoadFromPtr(const char *&p) { + BlockFwd ret; + ret.block_size_ = ReadBufAdvAligned(p); + ret.block_num_ = ReadBufAdvAligned(p); + ret.offsets_ = ReadBufVecAdvAligned(p, ret.block_num_ + 1); + ret.data_ = p; + p += ret.offsets_[ret.block_num_]; + return ret; + } + + BlockTerms GetBlockTerms(BMPBlockID block_id) const { + SizeT offset = offsets_[block_id]; + const char *ptr = data_ + offset; + return BlockTerms::ReadFromPtr(ptr); + } + + Vector GetScoresTail(const SparseVecRef &query) const { return {}; } + + void Prefetch(BMPBlockID block_id) const { + SizeT offset = offsets_[block_id]; + const char *ptr = data_ + offset; + BlockTerms::ReadFromPtr(ptr).Prefetch(); + } + + SizeT block_size() const { return block_size_; } + SizeT block_num() const { return block_num_; } + +private: + SizeT block_size_ = 0; + SizeT block_num_ = 0; + const SizeT *offsets_ = nullptr; + const char *data_ = nullptr; +}; + +} // namespace infinity \ No newline at end of file diff --git a/src/storage/knn_index/sparse/bmp_ivt.cppm b/src/storage/knn_index/sparse/bmp_ivt.cppm new file mode 100644 index 0000000000..bf6b5617f7 --- /dev/null +++ b/src/storage/knn_index/sparse/bmp_ivt.cppm @@ -0,0 +1,461 @@ +// Copyright(C) 2023 InfiniFlow, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module; + +#include "common/simd/simd_common_intrin_include.h" +#include + +export module bmp_ivt; + +import stl; +import sparse_util; +import local_file_handle; +import bmp_util; +import knn_result_handler; +import serialize; + +namespace infinity { + +export template +struct BlockData {}; + +export template +struct BlockData { +public: + void AddBlock(BMPBlockID block_id, DataType max_score, SizeT &mem_usage) { + block_ids_.push_back(block_id); + max_scores_.push_back(max_score); + mem_usage += (sizeof(BMPBlockID) + sizeof(DataType)); + } + + void Prefetch() const { + _mm_prefetch((const char *)block_ids_.data(), _MM_HINT_T0); + _mm_prefetch((const char *)max_scores_.data(), _MM_HINT_T0); + } + + SizeT GetSizeInBytes() const { return sizeof(SizeT) + block_ids_.size() * sizeof(BMPBlockID) + max_scores_.size() * sizeof(DataType); } + + void WriteAdv(char *&p) const { + SizeT max_score_size = max_scores_.size(); + WriteBufAdv(p, max_score_size); + WriteBufVecAdv(p, block_ids_.data(), block_ids_.size()); + WriteBufVecAdv(p, max_scores_.data(), max_scores_.size()); + } + + static BlockData ReadAdv(const char *&p) { + BlockData res; + SizeT max_score_size = ReadBufAdv(p); + res.block_ids_.resize(max_score_size); + res.max_scores_.resize(max_score_size); + for (SizeT i = 0; i < max_score_size; ++i) { + res.block_ids_[i] = ReadBufAdv(p); + } + for (SizeT i = 0; i < max_score_size; ++i) { + res.max_scores_[i] = ReadBufAdv(p); + } + return res; + } + + static void GetSizeToPtr(char *&p, const Vector *> &block_data_list) { + GetSizeInBytesVecAligned(p, block_data_list.size() + 1); + SizeT num_sum = 0; + for (const auto *block_data : block_data_list) { + num_sum += block_data->block_ids_.size(); + } + GetSizeInBytesVecAligned(p, num_sum); + GetSizeInBytesVecAligned(p, num_sum); + } + + static void WriteToPtr(char *&p, const Vector *> &block_data_list) { + SizeT num_sum = 0; + Vector block_data_prefix_sum; + block_data_prefix_sum.push_back(0); + for (const auto *block_data : block_data_list) { + num_sum += block_data->block_ids_.size(); + block_data_prefix_sum.push_back(num_sum); + } + WriteBufVecAdvAligned(p, block_data_prefix_sum.data(), block_data_prefix_sum.size()); + for (const auto *block_data : block_data_list) { + WriteBufVecAdvAligned(p, block_data->block_ids_.data(), block_data->block_ids_.size()); + } + for (const auto *block_data : block_data_list) { + WriteBufVecAdvAligned(p, block_data->max_scores_.data(), block_data->max_scores_.size()); + } + } + + SizeT block_size() const { return block_ids_.size(); } + const BMPBlockID *block_ids() const { return block_ids_.data(); } + const DataType *max_scores() const { return max_scores_.data(); } + +private: + Vector block_ids_; + Vector max_scores_; +}; + +export template +struct BlockData { +public: + BlockData(SizeT block_size, const BMPBlockID *block_ids, const DataType *max_scores) + : block_size_(block_size), block_ids_(block_ids), max_scores_(max_scores) {} + + void Prefetch() const { + _mm_prefetch((const char *)block_ids_, _MM_HINT_T0); + _mm_prefetch((const char *)max_scores_, _MM_HINT_T0); + } + + static Tuple ReadFromPtr(const char *&p, SizeT posting_num) { + const SizeT *block_data_prefix_sum = ReadBufVecAdvAligned(p, posting_num + 1); + SizeT block_data_num = block_data_prefix_sum[posting_num]; + const BMPBlockID *block_ids = ReadBufVecAdvAligned(p, block_data_num); + const DataType *max_scores = ReadBufVecAdvAligned(p, block_data_num); + return {block_data_prefix_sum, block_ids, max_scores}; + } + + SizeT block_size() const { return block_size_; } + const BMPBlockID *block_ids() const { return block_ids_; } + const DataType *max_scores() const { return max_scores_; } + +private: + SizeT block_size_; + const BMPBlockID *block_ids_; + const DataType *max_scores_; +}; + +export template +struct BlockData { +public: + void AddBlock(BMPBlockID block_id, DataType max_score, SizeT &mem_usage) { + if (block_id >= (BMPBlockID)max_scores_.size()) { + mem_usage += sizeof(BMPBlockID) * (block_id + 1 - max_scores_.size()); + max_scores_.resize(block_id + 1, 0.0); + } + max_scores_[block_id] = max_score; + } + + void Prefetch() const { _mm_prefetch((const char *)max_scores_.data(), _MM_HINT_T0); } + + SizeT GetSizeInBytes() const { return sizeof(SizeT) + max_scores_.size() * sizeof(DataType); } + + void WriteAdv(char *&p) const { + SizeT max_score_size = max_scores_.size(); + WriteBufAdv(p, max_score_size); + WriteBufVecAdv(p, max_scores_.data(), max_scores_.size()); + } + + static BlockData ReadAdv(const char *&p) { + BlockData res; + SizeT max_score_size = ReadBufAdv(p); + res.max_scores_.resize(max_score_size); + for (SizeT i = 0; i < max_score_size; ++i) { + res.max_scores_[i] = ReadBufAdv(p); + } + return res; + } + + static void GetSizeToPtr(char *&p, const Vector *> &block_data_list) { + GetSizeInBytesVecAligned(p, block_data_list.size() + 1); + SizeT num_sum = 0; + for (const auto *block_data : block_data_list) { + num_sum += block_data->max_scores_.size(); + } + GetSizeInBytesVecAligned(p, num_sum); + } + + static void WriteToPtr(char *&p, const Vector *> &block_data_list) { + SizeT num_sum = 0; + Vector block_data_prefix_sum; + block_data_prefix_sum.push_back(0); + for (const auto *block_data : block_data_list) { + num_sum += block_data->max_scores_.size(); + block_data_prefix_sum.push_back(num_sum); + } + WriteBufVecAdvAligned(p, block_data_prefix_sum.data(), block_data_prefix_sum.size()); + for (const auto *block_data : block_data_list) { + WriteBufVecAdvAligned(p, block_data->max_scores_.data(), block_data->max_scores_.size()); + } + } + + SizeT block_size() const { return max_scores_.size(); } + const DataType *max_scores() const { return max_scores_.data(); } + +public: + Vector max_scores_; +}; + +export template +struct BlockData { +public: + BlockData(SizeT block_size, const DataType *max_scores) : block_size_(block_size), max_scores_(max_scores) {} + + void Prefetch() const { _mm_prefetch((const char *)max_scores_, _MM_HINT_T0); } + + static Tuple ReadFromPtr(const char *&p, SizeT posting_num) { + const SizeT *block_data_prefix_sum = ReadBufVecAdvAligned(p, posting_num + 1); + SizeT block_data_num = block_data_prefix_sum[posting_num]; + const DataType *max_scores = ReadBufVecAdvAligned(p, block_data_num); + return {block_data_prefix_sum, max_scores}; + } + + SizeT block_size() const { return block_size_; } + const DataType *max_scores() const { return max_scores_; } + +private: + SizeT block_size_; + const DataType *max_scores_; +}; + +template +struct BlockPostingsBase { +public: + BlockPostingsBase() = default; + BlockPostingsBase(i32 kth, DataType kth_score, BlockData data) + : kth_(kth), kth_score_(kth_score), data_(std::move(data)) {} + + DataType kth(i32 topk) const { return topk == kth_ ? kth_score_ : 0.0; } + + const BlockData &data() const { return data_; } + BlockData &data() { return data_; } + + void SetKth(i32 kth, DataType kth_score) { + kth_ = kth; + kth_score_ = kth_score; + } + + i32 kth_ = -1; + DataType kth_score_ = 0.0; + +protected: + BlockData data_; +}; + +template +struct BlockPostings {}; + +template +struct BlockPostings : public BlockPostingsBase { +public: + SizeT GetSizeInBytes() const { return sizeof(this->kth_) + sizeof(this->kth_score_) + this->data_.GetSizeInBytes(); } + + void WriteAdv(char *&p) const { + WriteBufAdv(p, this->kth_); + WriteBufAdv(p, this->kth_score_); + this->data_.WriteAdv(p); + } + + static BlockPostings ReadAdv(const char *&p) { + BlockPostings res; + res.kth_ = ReadBufAdv(p); + res.kth_score_ = ReadBufAdv(p); + res.data_ = BlockData::ReadAdv(p); + return res; + } + + static void GetSizeToPtr(char *&p, const Vector> &postings) { + GetSizeInBytesAligned(p); + GetSizeInBytesVecAligned(p, postings.size()); + GetSizeInBytesVecAligned(p, postings.size()); + Vector *> block_data_list; + for (const auto &posting : postings) { + block_data_list.push_back(&posting.data_); + } + BlockData::GetSizeToPtr(p, block_data_list); + } + + static void WriteToPtr(char *&p, const Vector> &postings) { + WriteBufAdvAligned(p, postings.size()); + Vector kths; + Vector kth_scores; + for (const auto &posting : postings) { + kths.push_back(posting.kth_); + kth_scores.push_back(posting.kth_score_); + } + WriteBufVecAdvAligned(p, kths.data(), kths.size()); + WriteBufVecAdvAligned(p, kth_scores.data(), kth_scores.size()); + Vector *> block_data_list; + for (const auto &posting : postings) { + block_data_list.push_back(&posting.data_); + } + BlockData::WriteToPtr(p, block_data_list); + } +}; + +template +struct BlockPostings : public BlockPostingsBase { +public: + static Tuple ReadFromPtr(const char *&p) { + SizeT posting_num = ReadBufAdvAligned(p); + const i32 *kths = ReadBufVecAdvAligned(p, posting_num); + const DataType *kth_scores = ReadBufVecAdvAligned(p, posting_num); + return {posting_num, kths, kth_scores}; + } + + BlockPostings(i32 kth, DataType kth_score, BlockData data) + : BlockPostingsBase(kth, kth_score, std::move(data)) {} +}; + +export template +class BMPIvt {}; + +export template +class BMPIvt { +private: + BMPIvt(Vector> postings) : postings_(std::move(postings)) {} + +public: + BMPIvt() {} + BMPIvt(SizeT term_num) : postings_(term_num) {} + + template + void AddBlock(BMPBlockID block_id, const Vector, Vector>> &tail_terms, SizeT &mem_usage) { + HashMap max_scores; + for (const auto &[indices, data] : tail_terms) { + SizeT block_size = indices.size(); + for (SizeT i = 0; i < block_size; ++i) { + IdxType term_id = indices[i]; + DataType score = data[i]; + max_scores[term_id] = std::max(max_scores[term_id], score); + } + } + for (const auto &[term_id, score] : max_scores) { + postings_[term_id].data().AddBlock(block_id, score, mem_usage); + } + } + + void Optimize(i32 topk, Vector> ivt_scores) { + for (SizeT term_id = 0; term_id < ivt_scores.size(); ++term_id) { + auto &posting = postings_[term_id]; + auto &term_scores = ivt_scores[term_id]; + if ((i32)term_scores.size() < topk) { + posting.SetKth(topk, 0.0); + continue; + } + std::nth_element(term_scores.begin(), term_scores.begin() + topk - 1, term_scores.end(), std::greater<>()); + posting.SetKth(topk, term_scores[topk - 1]); + } + } + + const BlockPostings &GetPostings(SizeT term_id) const { return postings_[term_id]; } + + void Prefetch(SizeT term_id) const { postings_[term_id].data().Prefetch(); } + + SizeT term_num() const { return postings_.size(); } + + SizeT GetSizeInBytes() const { + SizeT size = sizeof(SizeT); + for (const auto &posting : postings_) { + size += posting.GetSizeInBytes(); + } + return size; + } + + void WriteAdv(char *&p) const { + SizeT posting_size = postings_.size(); + WriteBufAdv(p, posting_size); + for (const auto &posting : postings_) { + posting.WriteAdv(p); + } + } + + static BMPIvt ReadAdv(const char *&p) { + SizeT posting_size = ReadBufAdv(p); + Vector> postings(posting_size); + for (SizeT i = 0; i < posting_size; ++i) { + postings[i] = BlockPostings::ReadAdv(p); + } + return BMPIvt(std::move(postings)); + } + + void GetSizeToPtr(char *&p) const { BlockPostings::GetSizeToPtr(p, postings_); } + + void WriteToPtr(char *&p) const { BlockPostings::WriteToPtr(p, postings_); } + +private: + Vector> postings_; +}; + +template +class BMPIvtBase { +protected: + SizeT posting_size_ = 0; + const i32 *kth_ = nullptr; + const DataType *kth_score_ = nullptr; + const SizeT *block_data_prefix_sum_ = nullptr; +}; + +export template +class BMPIvt : public BMPIvtBase { +public: + BMPIvt() {} + + BlockPostings GetPostings(SizeT term_id) const { + i32 kth = this->kth_[term_id]; + DataType kth_score = this->kth_score_[term_id]; + using BlockData = BlockData; + SizeT block_data_size = this->block_data_prefix_sum_[term_id + 1] - this->block_data_prefix_sum_[term_id]; + const BMPBlockID *block_ids = block_ids_ + this->block_data_prefix_sum_[term_id]; + const DataType *max_scores = max_scores_ + this->block_data_prefix_sum_[term_id]; + return BlockPostings(kth, + kth_score, + BlockData(block_data_size, block_ids, max_scores)); + } + + void Prefetch(SizeT term_id) const { + _mm_prefetch((const char *)(block_ids_ + this->block_data_prefix_sum_[term_id]), _MM_HINT_T0); + _mm_prefetch((const char *)(max_scores_ + this->block_data_prefix_sum_[term_id]), _MM_HINT_T0); + } + + static BMPIvt ReadFromPtr(const char *&p) { + BMPIvt ret{}; + std::tie(ret.posting_size_, ret.kth_, ret.kth_score_) = + BlockPostings::ReadFromPtr(p); + std::tie(ret.block_data_prefix_sum_, ret.block_ids_, ret.max_scores_) = + BlockData::ReadFromPtr(p, ret.posting_size_); + return ret; + } + +private: + const BMPBlockID *block_ids_ = nullptr; + const DataType *max_scores_ = nullptr; +}; + +export template +class BMPIvt : public BMPIvtBase { +public: + BMPIvt() {} + + BlockPostings GetPostings(SizeT term_id) const { + i32 kth = this->kth_[term_id]; + DataType kth_score = this->kth_score_[term_id]; + using BlockData = BlockData; + SizeT block_data_size = this->block_data_prefix_sum_[term_id + 1] - this->block_data_prefix_sum_[term_id]; + const DataType *max_scores = max_scores_ + this->block_data_prefix_sum_[term_id]; + return BlockPostings(kth, kth_score, BlockData(block_data_size, max_scores)); + } + + void Prefetch(SizeT term_id) const { _mm_prefetch((const char *)(max_scores_ + this->block_data_prefix_sum_[term_id]), _MM_HINT_T0); } + + static BMPIvt ReadFromPtr(const char *&p) { + BMPIvt ret{}; + std::tie(ret.posting_size_, ret.kth_, ret.kth_score_) = BlockPostings::ReadFromPtr(p); + std::tie(ret.block_data_prefix_sum_, ret.max_scores_) = + BlockData::ReadFromPtr(p, ret.posting_size_); + return ret; + } + +private: + const DataType *max_scores_ = nullptr; +}; + +} // namespace infinity \ No newline at end of file diff --git a/src/storage/knn_index/sparse/bmp_posting.cpp b/src/storage/knn_index/sparse/bmp_posting.cpp deleted file mode 100644 index 2f0fc5d1f1..0000000000 --- a/src/storage/knn_index/sparse/bmp_posting.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright(C) 2023 InfiniFlow, Inc. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -module; - -#include "common/simd/simd_common_intrin_include.h" - -module bm_posting; - -import stl; -import infinity_exception; - -namespace infinity { - -template -void BlockData::Calculate(Vector &upper_bounds, DataType query_score) const { - SizeT block_size = block_ids_.size(); - for (SizeT i = 0; i < block_size; ++i) { - BMPBlockID block_id = block_ids_[i]; - DataType score = max_scores_[i]; - upper_bounds[block_id] += score * query_score; - } -} - -template -void BlockData::AddBlock(BMPBlockID block_id, DataType max_score, SizeT &mem_usage) { - block_ids_.push_back(block_id); - max_scores_.push_back(max_score); - mem_usage += (sizeof(BMPBlockID) + sizeof(DataType)); -} - -template -void BlockData::Prefetch() const { - _mm_prefetch((const char *)block_ids_.data(), _MM_HINT_T0); - _mm_prefetch((const char *)max_scores_.data(), _MM_HINT_T0); -} - -template struct BlockData; -template struct BlockData; - -template -void BlockData::Calculate(Vector &upper_bounds, DataType query_score) const { - for (BMPBlockID block_id = 0; block_id < (BMPBlockID)max_scores_.size(); ++block_id) { - if (max_scores_[block_id] > 0.0) { - upper_bounds[block_id] += max_scores_[block_id] * query_score; - } - } -} - -template -void BlockData::AddBlock(BMPBlockID block_id, DataType max_score, SizeT &mem_usage) { - if (block_id >= (BMPBlockID)max_scores_.size()) { - mem_usage += sizeof(BMPBlockID) * (block_id + 1 - max_scores_.size()); - max_scores_.resize(block_id + 1, 0.0); - } - max_scores_[block_id] = max_score; -} - -template -void BlockData::Prefetch() const { - _mm_prefetch((const char *)max_scores_.data(), _MM_HINT_T0); -} - -template struct BlockData; -template struct BlockData; - -} // namespace infinity diff --git a/src/storage/knn_index/sparse/bmp_posting.cppm b/src/storage/knn_index/sparse/bmp_posting.cppm deleted file mode 100644 index 0d176a5818..0000000000 --- a/src/storage/knn_index/sparse/bmp_posting.cppm +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright(C) 2023 InfiniFlow, Inc. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -module; - -export module bm_posting; - -import stl; -import bmp_util; - -namespace infinity { - -export template -struct BlockData {}; - -template -struct BlockData { -public: - void Calculate(Vector &upper_bounds, DataType query_score) const; - - void AddBlock(BMPBlockID block_id, DataType max_score, SizeT &mem_usage); - - void Prefetch() const; - - SizeT GetSizeInBytes() const; - void WriteAdv(char *&p) const; - static BlockData ReadAdv(const char *&p); - -private: - Vector block_ids_; - Vector max_scores_; -}; - -export template -struct BlockData { -public: - // template - void Calculate(Vector &upper_bounds, DataType query_score) const; - - void AddBlock(BMPBlockID block_id, DataType max_score, SizeT &mem_usage); - - void Prefetch() const; - - SizeT GetSizeInBytes() const; - void WriteAdv(char *&p) const; - static BlockData ReadAdv(const char *&p); - -public: - Vector max_scores_; -}; - -export template -struct BlockPostings { -public: - DataType kth(i32 topk) const { return topk == kth_ ? kth_score_ : 0.0; } - - void Prefetch() const { data_.Prefetch(); } - - SizeT GetSizeInBytes() const; - void WriteAdv(char *&p) const; - static BlockPostings ReadAdv(const char *&p); - -public: - i32 kth_{-1}; - DataType kth_score_; - BlockData data_; -}; - -} // namespace infinity diff --git a/src/storage/knn_index/sparse/bmp_posting_serialize.cpp b/src/storage/knn_index/sparse/bmp_posting_serialize.cpp deleted file mode 100644 index cbdf0a64fa..0000000000 --- a/src/storage/knn_index/sparse/bmp_posting_serialize.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright(C) 2023 InfiniFlow, Inc. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -module; - -module bm_posting; - -import stl; -import serialize; - -namespace infinity { - -// --------------------------CompressedBlockData-------------------------- - -template -SizeT BlockData::GetSizeInBytes() const { - return sizeof(SizeT) + block_ids_.size() * sizeof(BMPBlockID) + max_scores_.size() * sizeof(DataType); -} - -template -void BlockData::WriteAdv(char *&p) const { - SizeT max_score_size = max_scores_.size(); - WriteBufAdv(p, max_score_size); - WriteBufVecAdv(p, block_ids_.data(), block_ids_.size()); - WriteBufVecAdv(p, max_scores_.data(), max_scores_.size()); -} - -template -BlockData BlockData::ReadAdv(const char *&p) { - BlockData res; - SizeT max_score_size = ReadBufAdv(p); - res.block_ids_.resize(max_score_size); - res.max_scores_.resize(max_score_size); - for (SizeT i = 0; i < max_score_size; ++i) { - res.block_ids_[i] = ReadBufAdv(p); - } - for (SizeT i = 0; i < max_score_size; ++i) { - res.max_scores_[i] = ReadBufAdv(p); - } - return res; -} - -template struct BlockData; -template struct BlockData; - -// --------------------------RawBlockData-------------------------- - -template -SizeT BlockData::GetSizeInBytes() const { - return sizeof(SizeT) + max_scores_.size() * sizeof(DataType); -} - -template -void BlockData::WriteAdv(char *&p) const { - SizeT max_score_size = max_scores_.size(); - WriteBufAdv(p, max_score_size); - WriteBufVecAdv(p, max_scores_.data(), max_scores_.size()); -} - -template -BlockData BlockData::ReadAdv(const char *&p) { - BlockData res; - SizeT max_score_size = ReadBufAdv(p); - res.max_scores_.resize(max_score_size); - for (SizeT i = 0; i < max_score_size; ++i) { - res.max_scores_[i] = ReadBufAdv(p); - } - return res; -} - -template struct BlockData; -template struct BlockData; - -// --------------------------BlockPostings-------------------------- - -template -SizeT BlockPostings::GetSizeInBytes() const { - return sizeof(kth_) + sizeof(kth_score_) + data_.GetSizeInBytes(); -} - -template -void BlockPostings::WriteAdv(char *&p) const { - WriteBufAdv(p, kth_); - WriteBufAdv(p, kth_score_); - data_.WriteAdv(p); -} - -template -BlockPostings BlockPostings::ReadAdv(const char *&p) { - BlockPostings res; - res.kth_ = ReadBufAdv(p); - res.kth_score_ = ReadBufAdv(p); - res.data_ = BlockData::ReadAdv(p); - return res; -} - -template struct BlockPostings; -template struct BlockPostings; -template struct BlockPostings; -template struct BlockPostings; - -} // namespace infinity \ No newline at end of file diff --git a/src/storage/knn_index/sparse/bmp_util.cppm b/src/storage/knn_index/sparse/bmp_util.cppm index c51eb80ad9..a854e77e3f 100644 --- a/src/storage/knn_index/sparse/bmp_util.cppm +++ b/src/storage/knn_index/sparse/bmp_util.cppm @@ -32,6 +32,49 @@ export enum class BMPCompressType : i8 { kInvalid = 2, }; +export enum class BMPOwnMem : i8 { + kTrue = 0, + kFalse = 1, +}; + +export template +class VecPtr {}; + +export template +class VecPtr { +public: + VecPtr() = default; + VecPtr(Vector ptr) : vec_(std::move(ptr)) {} + + T &operator[](SizeT idx) { return vec_[idx]; } + const T &operator[](SizeT idx) const { return vec_[idx]; } + + T *data() { return vec_.data(); } + const T *data() const { return vec_.data(); } + SizeT size() const { return vec_.size(); } + + template + void push_back(U&& val) { vec_.push_back(std::forward(val)); } + + Vector exchange(Vector vec) { return std::exchange(vec_, std::move(vec)); } + +private: + Vector vec_; +}; + +export template +class VecPtr { +public: + VecPtr() = default; + VecPtr(const T *ptr, SizeT size) : ptr_(ptr), size_(size) {} + + const T &operator[](SizeT idx) const { return ptr_[idx]; } + +private: + const T *ptr_ = nullptr; + SizeT size_ = 0; +}; + export BMPCompressType BMPCompressTypeFromString(const String &compress_type_str) { if (IsEqual(compress_type_str, "raww")) { return BMPCompressType::kRaw; diff --git a/src/storage/meta/entry/chunk_index_entry.cpp b/src/storage/meta/entry/chunk_index_entry.cpp index 6c12c170e5..9eb250ac21 100644 --- a/src/storage/meta/entry/chunk_index_entry.cpp +++ b/src/storage/meta/entry/chunk_index_entry.cpp @@ -341,7 +341,9 @@ SharedPtr ChunkIndexEntry::NewReplayChunkIndexEntry(ChunkID chu index_base, column_def, buffer_mgr->persistence_manager()); - chunk_index_entry->buffer_obj_ = buffer_mgr->GetBufferObject(std::move(file_worker)); + BufferObj *buffer_obj = buffer_mgr->GetBufferObject(std::move(file_worker)); + buffer_obj->ToMmap(); + chunk_index_entry->buffer_obj_ = buffer_obj; break; } default: { @@ -450,7 +452,19 @@ void ChunkIndexEntry::SaveIndexFile() { if (buffer_obj_ == nullptr) { return; } + if (buffer_obj_->type() == BufferType::kMmap) { + return; + } buffer_obj_->Save(); + switch (segment_index_entry_->table_index_entry()->index_base()->index_type_) { + case IndexType::kBMP: { + buffer_obj_->ToMmap(); + break; + } + default: { + break; + } + } } void ChunkIndexEntry::DeprecateChunk(TxnTimeStamp commit_ts) { diff --git a/src/storage/meta/entry/segment_index_entry.cpp b/src/storage/meta/entry/segment_index_entry.cpp index cfa01e5281..3ad7f36c28 100644 --- a/src/storage/meta/entry/segment_index_entry.cpp +++ b/src/storage/meta/entry/segment_index_entry.cpp @@ -720,7 +720,12 @@ void SegmentIndexEntry::OptIndex(IndexBase *index_base, if constexpr (std::is_same_v) { UnrecoverableError("Invalid index type."); } else { - index->Optimize(options); + using IndexT = typename std::remove_pointer_t; + if constexpr (IndexT::kOwnMem) { + index->Optimize(options); + } else { + UnrecoverableError("Invalid index type."); + } } }, index); @@ -937,12 +942,20 @@ ChunkIndexEntry *SegmentIndexEntry::RebuildChunkIndexEntries(TxnTableStore *txn_ UnrecoverableError("Invalid index type."); } else { using IndexT = std::decay_t; - using SparseRefT = SparseVecRef; - - CappedOneColumnIterator iter(segment_entry, buffer_mgr, column_def->id(), begin_ts, row_count); - index->AddDocs(std::move(iter)); + if constexpr (IndexT::kOwnMem) { + using SparseRefT = SparseVecRef; + + CappedOneColumnIterator iter(segment_entry, + buffer_mgr, + column_def->id(), + begin_ts, + row_count); + index->AddDocs(std::move(iter)); + } else { + UnrecoverableError("Invalid index type."); + } } - }, + }, abstract_bmp); merged_chunk_index_entry = memory_bmp_index->Dump(this, buffer_mgr); break; diff --git a/src/storage/persistence/persistence_manager.cpp b/src/storage/persistence/persistence_manager.cpp index 24a6209dcc..433f16d185 100644 --- a/src/storage/persistence/persistence_manager.cpp +++ b/src/storage/persistence/persistence_manager.cpp @@ -163,9 +163,10 @@ PersistWriteResult PersistenceManager::Persist(const String &file_path, const St return result; } else { std::lock_guard lock(mtx_); - if (int(src_size) > CurrentObjRoomNoLock()) { + if (int(src_size) >= CurrentObjRoomNoLock()) { CurrentObjFinalizeNoLock(result.persist_keys_, result.drop_keys_); } + current_object_size_ = (current_object_size_ + ObjAlignment - 1) & ~(ObjAlignment - 1); ObjAddr obj_addr(current_object_key_, current_object_size_, src_size); CurrentObjAppendNoLock(tmp_file_path, src_size); fs::remove(tmp_file_path, ec); @@ -369,6 +370,14 @@ void PersistenceManager::CurrentObjAppendNoLock(const String &tmp_file_path, Siz String error_message = fmt::format("Failed to open destination file {} {}", strerror(errno), dst_fp.string()); UnrecoverableError(error_message); } + { + dstFile.seekp(0, std::ios::end); + SizeT current_size = dstFile.tellp(); + if (current_size < current_object_size_) { + std::vector zero_padding(current_object_size_ - current_size, 0); + dstFile.write(zero_padding.data(), zero_padding.size()); + } + } char buffer[BUFFER_SIZE]; while (srcFile.read(buffer, BUFFER_SIZE)) { dstFile.write(buffer, srcFile.gcount()); @@ -404,7 +413,9 @@ void PersistenceManager::CleanupNoLock(const ObjAddr &object_addr, return; } } - Range orig_range(object_addr.part_offset_, object_addr.part_offset_ + object_addr.part_size_); + SizeT range_end = object_addr.part_offset_ + object_addr.part_size_; + range_end = (range_end + ObjAlignment - 1) & ~(ObjAlignment - 1); + Range orig_range(object_addr.part_offset_, range_end); Range range(orig_range); auto inst_it = obj_stat->deleted_ranges_.lower_bound(range); @@ -460,7 +471,8 @@ void PersistenceManager::CleanupNoLock(const ObjAddr &object_addr, } LOG_TRACE(fmt::format("Deleted object {} range [{}, {})", object_addr.obj_key_, orig_range.start_, orig_range.end_)); - if (range.start_ == 0 && range.end_ == obj_stat->obj_size_ && object_addr.obj_key_ != current_object_key_) { + SizeT obj_size = (obj_stat->obj_size_ + ObjAlignment - 1) & ~(ObjAlignment - 1); + if (range.start_ == 0 && range.end_ == obj_size && object_addr.obj_key_ != current_object_key_) { if (object_addr.obj_key_.empty()) { String error_message = fmt::format("Failed to find object key"); UnrecoverableError(error_message); diff --git a/src/storage/persistence/persistence_manager.cppm b/src/storage/persistence/persistence_manager.cppm index 4b7d532c3b..0f98c6849c 100644 --- a/src/storage/persistence/persistence_manager.cppm +++ b/src/storage/persistence/persistence_manager.cppm @@ -61,6 +61,8 @@ export struct PersistReadResult { export class PersistenceManager { public: + constexpr static SizeT ObjAlignment = 8; + // TODO: build cache from existing files under workspace PersistenceManager(const String &workspace, const String &data_dir, SizeT object_size_limit, bool local_storage = true); diff --git a/src/unit_test/storage/knnindex/knn_sparse/test_bmp_fwd.cpp b/src/unit_test/storage/knnindex/knn_sparse/test_bmp_fwd.cpp new file mode 100644 index 0000000000..1ade973271 --- /dev/null +++ b/src/unit_test/storage/knnindex/knn_sparse/test_bmp_fwd.cpp @@ -0,0 +1,159 @@ +// Copyright(C) 2023 InfiniFlow, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "gtest/gtest.h" + +import stl; +import sparse_util; +import bmp_util; +import base_test; +import sparse_test_util; +import bmp_fwd; +import compilation_config; +import virtual_store; +import infinity_exception; +import local_file_handle; +import third_party; + +using namespace infinity; + +class BMPFwdTest : public BaseTest { +protected: + template + void TestFunc(u32 block_size) { + using BMPFwd1 = BlockFwd; + using BMPFwd2 = BlockFwd; + + u32 nrow = 1000; + u32 ncol = 1000; + f32 sparsity = 0.05; + + const SparseMatrix dataset = SparseTestUtil::GenerateDataset(nrow, ncol, sparsity, 0.0, 10.0); + + String save_path = String(tmp_data_path()) + "/bmpfwd_test1.index"; + String save2_path = String(tmp_data_path()) + "/bmpfwd_test2.index"; + + auto check = [&](const BMPFwd1 &fwd1, const BMPFwd2 &fwd2) { + EXPECT_EQ(fwd1.block_size(), fwd2.block_size()); + EXPECT_EQ(fwd1.block_num(), fwd2.block_num()); + for (BMPBlockID block_id = 0; block_id < BMPBlockID(fwd1.block_num()); ++block_id) { + const auto &block_terms1 = fwd1.GetBlockTerms(block_id); + const auto &block_terms2 = fwd2.GetBlockTerms(block_id); + auto iter1 = block_terms1.Iter(); + auto iter2 = block_terms2.Iter(); + while (iter1.HasNext() && iter2.HasNext()) { + const auto [term_id, block_size, block_offsets, values] = iter1.Value(); + const auto [term_id2, block_size2, block_offsets2, values2] = iter2.Value(); + EXPECT_EQ(term_id, term_id2); + EXPECT_EQ(block_size, block_size2); + for (SizeT i = 0; i < block_size; ++i) { + EXPECT_EQ(block_offsets[i], block_offsets2[i]); + EXPECT_EQ(values[i], values2[i]); + } + iter1.Next(); + iter2.Next(); + } + EXPECT_FALSE(iter1.HasNext()); + EXPECT_FALSE(iter2.HasNext()); + } + }; + + SizeT filesize1 = 0; + SizeT filesize2 = 0; + { + SizeT mem_used; + BMPFwd1 fwd1(block_size); + for (SparseMatrixIter iter(dataset); iter.HasNext(); iter.Next()) { + SparseVecRef vec = iter.val(); + fwd1.AddDoc(vec, mem_used); + } + filesize1 = fwd1.GetSizeInBytes(); + auto buffer = MakeUnique(filesize1); + char *p = buffer.get(); + fwd1.WriteAdv(p); + EXPECT_EQ(p - buffer.get(), filesize1); + + auto [file_handle, status] = VirtualStore::Open(save_path, FileAccessMode::kWrite); + if (!status.ok()) { + UnrecoverableError(fmt::format("Failed to open file: {}", save_path)); + } + file_handle->Append(buffer.get(), filesize1); + } + { + auto [file_handle, status] = VirtualStore::Open(save_path, FileAccessMode::kRead); + if (!status.ok()) { + UnrecoverableError(fmt::format("Failed to open file: {}", save_path)); + } + auto buffer = MakeUnique(filesize1); + file_handle->Read(buffer.get(), filesize1); + const char *p = buffer.get(); + [[maybe_unused]] auto fwd1 = BMPFwd1::ReadAdv(p); + EXPECT_EQ(p - buffer.get(), filesize1); + + auto [file_handle2, status2] = VirtualStore::Open(save2_path, FileAccessMode::kWrite); + if (!status2.ok()) { + UnrecoverableError(fmt::format("Failed to open file: {}", save2_path)); + } + + { + char *p0 = nullptr; + fwd1.GetSizeToPtr(p0); + char *p1 = nullptr; + filesize2 = p0 - p1; + } + auto buffer2 = MakeUnique(filesize2); + char *p2 = buffer2.get(); + fwd1.WriteToPtr(p2); + EXPECT_EQ(p2 - buffer2.get(), filesize2); + file_handle2->Append(buffer2.get(), filesize2); + +// #define USE_MMAP +#ifdef USE_MMAP + unsigned char *data_ptr; + int ret = VirtualStore::MmapFile(save2_path, data_ptr, filesize2); + if (ret < 0) { + UnrecoverableError("mmap failed"); + } + p = reinterpret_cast(data_ptr); +#else + std::tie(file_handle2, status2) = VirtualStore::Open(save2_path, FileAccessMode::kRead); + if (!status2.ok()) { + UnrecoverableError(fmt::format("Failed to open file: {}", save2_path)); + } + file_handle2->Read(buffer2.get(), filesize2); + p = buffer2.get(); +#endif + const char *start_p = p; + auto fwd2 = BMPFwd2::LoadFromPtr(p); + EXPECT_EQ(p - start_p, filesize2); + + check(fwd1, fwd2); + +#ifdef USE_MMAP + VirtualStore::MunmapFile(save2_path); +#endif + } + }; +}; + +TEST_F(BMPFwdTest, test1) { + { + u32 block_size = 8; + TestFunc(block_size); + } + { + u32 block_size = 8; + TestFunc(block_size); + } +} diff --git a/src/unit_test/storage/knnindex/knn_sparse/test_bmp_index.cpp b/src/unit_test/storage/knnindex/knn_sparse/test_bmp_index.cpp index 72376aba37..42f5fefe49 100644 --- a/src/unit_test/storage/knnindex/knn_sparse/test_bmp_index.cpp +++ b/src/unit_test/storage/knnindex/knn_sparse/test_bmp_index.cpp @@ -34,7 +34,8 @@ class BMPIndexTest : public BaseTest { protected: template void TestFunc(u32 block_size) { - using BMPAlg = BMPAlg; + using BMPAlg1 = BMPAlg; + using BMPAlg2 = BMPAlg; u32 nrow = 1000; u32 ncol = 1000; @@ -53,8 +54,15 @@ class BMPIndexTest : public BaseTest { const auto [gt_indices_list, gt_scores_list] = SparseTestUtil::GenerateGroundtruth(dataset, query_set, topk, false); String save_path = String(tmp_data_path()) + "/bmindex_test1.index"; + String save2_path = String(tmp_data_path()) + "/bmindex_test2.index"; + if (VirtualStore::Exists(save_path)) { + VirtualStore::DeleteFile(save_path); + } + if (VirtualStore::Exists(save2_path)) { + VirtualStore::DeleteFile(save2_path); + } - auto test_query = [&](const BMPAlg &index) { + auto test_query = [&](const auto &index) { { SparseMatrixIter iter(query_set); SparseVecRef vec = iter.val(); @@ -86,7 +94,7 @@ class BMPIndexTest : public BaseTest { } }; { - BMPAlg index(ncol, block_size); + BMPAlg1 index(ncol, block_size); for (SparseMatrixIter iter(dataset); iter.HasNext(); iter.Next()) { SparseVecRef vec = iter.val(); auto row_id = iter.row_id(); @@ -109,9 +117,27 @@ class BMPIndexTest : public BaseTest { if (!status.ok()) { UnrecoverableError(fmt::format("Failed to open file: {}", save_path)); } - auto index = BMPAlg::Load(*file_handle); + auto index = BMPAlg1::Load(*file_handle); + + test_query(index); + auto [file_handle2, status2] = VirtualStore::Open(save2_path, FileAccessMode::kWrite); + if (!status2.ok()) { + UnrecoverableError(fmt::format("Failed to open file: {}", save2_path)); + } + index.SaveToPtr(*file_handle2); + } + { + unsigned char *data_ptr = nullptr; + SizeT file_size = VirtualStore::GetFileSize(save2_path); + int ret = VirtualStore::MmapFile(save2_path, data_ptr, file_size); + if (ret < 0) { + UnrecoverableError("mmap failed"); + } + const char *ptr = reinterpret_cast(data_ptr); + auto index = BMPAlg2::LoadFromPtr(ptr, file_size); test_query(index); + VirtualStore::MunmapFile(save2_path); } } }; @@ -121,18 +147,18 @@ TEST_F(BMPIndexTest, test1) { u32 block_size = 8; TestFunc(block_size); } - { - u32 block_size = 64; - TestFunc(block_size); - } - { - u32 block_size = 8; - TestFunc(block_size); - } - { - u32 block_size = 8; - TestFunc(block_size); - } + // { + // u32 block_size = 64; + // TestFunc(block_size); + // } + // { + // u32 block_size = 8; + // TestFunc(block_size); + // } + // { + // u32 block_size = 8; + // TestFunc(block_size); + // } } TEST_F(BMPIndexTest, test2) { @@ -170,7 +196,7 @@ TEST_F(BMPIndexTest, test2) { index.AddDoc(vec3, 4); index.AddDoc(vec3, 5); - [[maybe_unused]] auto [indices, scores] = index.SearchKnn(query, topk, options); + auto [indices, scores] = index.SearchKnn(query, topk, options); ASSERT_EQ(indices.size(), topk); ASSERT_EQ(indices[0], 0); ASSERT_EQ(indices[1], 2); diff --git a/src/unit_test/storage/knnindex/knn_sparse/test_bmp_ivt.cpp b/src/unit_test/storage/knnindex/knn_sparse/test_bmp_ivt.cpp new file mode 100644 index 0000000000..bee7e50e3d --- /dev/null +++ b/src/unit_test/storage/knnindex/knn_sparse/test_bmp_ivt.cpp @@ -0,0 +1,173 @@ +// Copyright(C) 2023 InfiniFlow, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "gtest/gtest.h" + +import stl; +import sparse_util; +import bmp_util; +import base_test; +import sparse_test_util; +import bmp_ivt; +import bmp_fwd; +import compilation_config; +import virtual_store; +import infinity_exception; +import local_file_handle; +import third_party; + +using namespace infinity; + +class BMPIvtTest : public BaseTest { +protected: + template + void TestFunc(u32 block_size) { + using BMPIvt1 = BMPIvt; + using BMPIvt2 = BMPIvt; + + u32 nrow = 1000; + u32 ncol = 1000; + f32 sparsity = 0.05; + + const SparseMatrix dataset = SparseTestUtil::GenerateDataset(nrow, ncol, sparsity, 0.0, 10.0); + + String save_path = String(tmp_data_path()) + "/bmpivt_test1.index"; + String save2_path = String(tmp_data_path()) + "/bmpivt_test2.index"; + + auto check = [&](const BMPIvt1 &ivt1, const BMPIvt2 &ivt2, BMPBlockID block_num) { + for (BMPBlockID block_id = 0; block_id < block_num; ++block_id) { + const auto &postings1 = ivt1.GetPostings(block_id); + const auto &postings2 = ivt2.GetPostings(block_id); + EXPECT_EQ(postings1.kth_, postings2.kth_); + EXPECT_EQ(postings1.kth_score_, postings2.kth_score_); + const auto &block_data1 = postings1.data(); + const auto &block_data2 = postings2.data(); + if constexpr (CompressType == BMPCompressType::kCompressed) { + EXPECT_EQ(block_data1.block_size(), block_data2.block_size()); + for (SizeT i = 0; i < block_data1.block_size(); ++i) { + EXPECT_EQ(block_data1.block_ids()[i], block_data2.block_ids()[i]); + EXPECT_EQ(block_data1.max_scores()[i], block_data2.max_scores()[i]); + } + } else { + EXPECT_EQ(block_data1.block_size(), block_data2.block_size()); + for (BMPBlockID block_id = 0; block_id < BMPBlockID(block_data1.block_size()); ++block_id) { + EXPECT_EQ(block_data1.max_scores()[block_id], block_data2.max_scores()[block_id]); + } + } + } + }; + + SizeT filesize1 = 0; + SizeT filesize2 = 0; + BMPBlockID block_id = 0; + { + SizeT mem_used; + BMPIvt1 ivt1(ncol); + auto tail_fwd = MakeUnique>(block_size); + for (SparseMatrixIter iter(dataset); iter.HasNext(); iter.Next()) { + SparseVecRef vec = iter.val(); + SizeT tail_size = tail_fwd->AddDoc(vec); + if (tail_size >= block_size) { + auto tail_fwd1 = MakeUnique>(block_size); + std::swap(tail_fwd1, tail_fwd); + const auto &tail_terms = tail_fwd1->GetTailTerms(); + ivt1.AddBlock(block_id, tail_terms, mem_used); + } + ++block_id; + } + + filesize1 = ivt1.GetSizeInBytes(); + auto buffer = MakeUnique(filesize1); + char *p = buffer.get(); + ivt1.WriteAdv(p); + EXPECT_EQ(p - buffer.get(), filesize1); + + auto [file_handle, status] = VirtualStore::Open(save_path, FileAccessMode::kWrite); + if (!status.ok()) { + UnrecoverableError(fmt::format("Failed to open file: {}", save_path)); + } + file_handle->Append(buffer.get(), filesize1); + } + { + auto [file_handle, status] = VirtualStore::Open(save_path, FileAccessMode::kRead); + if (!status.ok()) { + UnrecoverableError(fmt::format("Failed to open file: {}", save_path)); + } + auto buffer = MakeUnique(filesize1); + file_handle->Read(buffer.get(), filesize1); + const char *p = buffer.get(); + auto ivt1 = BMPIvt1::ReadAdv(p); + EXPECT_EQ(p - buffer.get(), filesize1); + + auto [file_handle2, status2] = VirtualStore::Open(save2_path, FileAccessMode::kWrite); + if (!status2.ok()) { + UnrecoverableError(fmt::format("Failed to open file: {}", save2_path)); + } + + { + char *p0 = nullptr; + ivt1.GetSizeToPtr(p0); + char *p1 = nullptr; + filesize2 = p0 - p1; + } + auto buffer2 = MakeUnique(filesize2); + char *p2 = buffer2.get(); + ivt1.WriteToPtr(p2); + EXPECT_EQ(p2 - buffer2.get(), filesize2); + file_handle2->Append(buffer2.get(), filesize2); + + p = nullptr; +// #define USE_MMAP +#ifdef USE_MMAP + unsigned char *data_ptr; + int ret = VirtualStore::MmapFile(save2_path, data_ptr, filesize2); + if (ret < 0) { + UnrecoverableError("mmap failed"); + } + p = reinterpret_cast(data_ptr); +#else + std::tie(file_handle2, status2) = VirtualStore::Open(save2_path, FileAccessMode::kRead); + if (!status2.ok()) { + UnrecoverableError(fmt::format("Failed to open file: {}", save2_path)); + } + file_handle2->Read(buffer2.get(), filesize2); + p = buffer2.get(); +#endif + const char *start_p = p; + [[maybe_unused]] auto ivt2 = BMPIvt2::ReadFromPtr(p); + EXPECT_EQ(p - start_p, filesize2); + + check(ivt1, ivt2, block_id); + +#ifdef USE_MMAP + VirtualStore::MunmapFile(save2_path); +#endif + } + }; +}; + +TEST_F(BMPIvtTest, test1) { + { + u32 block_size = 8; + TestFunc(block_size); + } + { + u32 block_size = 8; + TestFunc(block_size); + } + { + u32 block_size = 8; + TestFunc(block_size); + } +} diff --git a/test/sql/dql/knn/sparse/test_knn_sparse_bmp.slt b/test/sql/dql/knn/sparse/test_knn_sparse_bmp.slt index 08eb6e8f57..46335ad6c7 100644 --- a/test/sql/dql/knn/sparse/test_knn_sparse_bmp.slt +++ b/test/sql/dql/knn/sparse/test_knn_sparse_bmp.slt @@ -34,8 +34,8 @@ SELECT col1 FROM test_knn_sparse_bmp SEARCH MATCH SPARSE (col2, [0:1.0,20:2.0,80 2 1 -statement ok -OPTIMIZE idx1 ON test_knn_sparse_bmp WITH (topk = 3); +# statement ok +# OPTIMIZE idx1 ON test_knn_sparse_bmp WITH (topk = 3); query I SELECT col1 FROM test_knn_sparse_bmp SEARCH MATCH SPARSE (col2, [0:1.0,20:2.0,80:3.0], 'ip', 3); @@ -71,8 +71,8 @@ SELECT col1 FROM test_knn_sparse_bmp SEARCH MATCH SPARSE (col2, [0:1.0,20:2.0,80 4 4 -statement ok -OPTIMIZE idx1 ON test_knn_sparse_bmp WITH (topk = 3); +# OPTIMIZE idx1 ON test_knn_sparse_bmp WITH (topk = 3); +# statement ok query I SELECT col1 FROM test_knn_sparse_bmp SEARCH MATCH SPARSE (col2, [0:1.0,20:2.0,80:3.0], 'ip', 3) USING INDEX(idx1); diff --git a/test/sql/dql/knn/sparse/test_knn_sparse_bmp_realtime.slt b/test/sql/dql/knn/sparse/test_knn_sparse_bmp_realtime.slt index d999c980da..af3c5839b4 100644 --- a/test/sql/dql/knn/sparse/test_knn_sparse_bmp_realtime.slt +++ b/test/sql/dql/knn/sparse/test_knn_sparse_bmp_realtime.slt @@ -23,8 +23,8 @@ SELECT col1 FROM test_knn_sparse_bmp SEARCH MATCH SPARSE (col2, [0:1.0,20:2.0,80 2 1 -statement ok -OPTIMIZE idx1 ON test_knn_sparse_bmp WITH (topk = 3); +# statement ok +# OPTIMIZE idx1 ON test_knn_sparse_bmp WITH (topk = 3); query I SELECT col1 FROM test_knn_sparse_bmp SEARCH MATCH SPARSE (col2, [0:1.0,20:2.0,80:3.0], 'ip', 3); @@ -61,8 +61,8 @@ SELECT col1 FROM test_knn_sparse_bmp SEARCH MATCH SPARSE (col2, [0:1.0,20:2.0,80 4 4 -statement ok -OPTIMIZE idx1 ON test_knn_sparse_bmp WITH (topk = 3); +# statement ok +# OPTIMIZE idx1 ON test_knn_sparse_bmp WITH (topk = 3); query I SELECT col1 FROM test_knn_sparse_bmp SEARCH MATCH SPARSE (col2, [0:1.0,20:2.0,80:3.0], 'ip', 3); diff --git a/tools/generate_big_sparse.py b/tools/generate_big_sparse.py index 9494b9adea..ebc3042143 100644 --- a/tools/generate_big_sparse.py +++ b/tools/generate_big_sparse.py @@ -171,13 +171,13 @@ def generate(generate_if_exists: bool, copy_dir: str): ) bmp_knn_slt_file.write("\n") - bmp_knn_slt_file.write("statement ok\n") - bmp_knn_slt_file.write( - "OPTIMIZE {} ON {} WITH (bp_reorder, topk = {});\n".format( - index_name, table_name, topk - ) - ) - bmp_knn_slt_file.write("\n") + # bmp_knn_slt_file.write("statement ok\n") + # bmp_knn_slt_file.write( + # "OPTIMIZE {} ON {} WITH (bp_reorder, topk = {});\n".format( + # index_name, table_name, topk + # ) + # ) + # bmp_knn_slt_file.write("\n") for i in range(0, query_n): bmp_knn_slt_file.write("query I\n") From 9e0b6cc55f7d4edc682b0190b871dd3cef06af38 Mon Sep 17 00:00:00 2001 From: Jin Hai Date: Fri, 3 Jan 2025 19:51:49 +0800 Subject: [PATCH 7/9] Add snapshot, part2 (#2421) ### What problem does this PR solve? _Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR._ ### Type of change - [x] New Feature (non-breaking change which adds functionality) --------- Signed-off-by: Jin Hai --- src/common/utility/utility.cppm | 2 + src/executor/operator/physical_command.cpp | 57 ++-- src/executor/operator/snapshot/snapshot.cppm | 2 +- .../operator/snapshot/table_snapshot.cpp | 17 +- src/parser/statement/command_statement.h | 3 +- src/storage/common/snapshot_info.cpp | 247 ++++++++++++++++++ src/storage/common/snapshot_info.cppm | 31 ++- src/storage/io/virtual_store.cpp | 23 ++ src/storage/io/virtual_store.cppm | 1 + src/storage/meta/entry/block_column_entry.cpp | 13 +- .../meta/entry/block_column_entry.cppm | 2 +- src/storage/meta/entry/block_entry.cpp | 16 ++ src/storage/meta/entry/block_entry.cppm | 2 + src/storage/meta/entry/segment_entry.cpp | 15 ++ src/storage/meta/entry/segment_entry.cppm | 3 + src/storage/meta/entry/table_entry.cpp | 20 ++ src/storage/meta/entry/table_entry.cppm | 3 + 17 files changed, 421 insertions(+), 36 deletions(-) create mode 100644 src/storage/common/snapshot_info.cpp diff --git a/src/common/utility/utility.cppm b/src/common/utility/utility.cppm index 0230cf67f4..ab1554e4b2 100644 --- a/src/common/utility/utility.cppm +++ b/src/common/utility/utility.cppm @@ -40,4 +40,6 @@ IdentifierValidationStatus IdentifierValidation(const String &identifier); bool ParseIPPort(const String &str, String &ip, i64 &port); String StringTransform(const String &source, const String &from, const String &to); + +bool CompressDirectory(const String &source_dir, const String &dest_file); } // namespace infinity diff --git a/src/executor/operator/physical_command.cpp b/src/executor/operator/physical_command.cpp index b7bf4b6115..7f6d7c2b53 100644 --- a/src/executor/operator/physical_command.cpp +++ b/src/executor/operator/physical_command.cpp @@ -49,6 +49,7 @@ import periodic_trigger; import bg_task; import wal_manager; import result_cache_manager; +import snapshot; namespace infinity { @@ -456,9 +457,39 @@ bool PhysicalCommand::Execute(QueryContext *query_context, OperatorState *operat SnapshotCmd *snapshot_cmd = static_cast(command_info_.get()); LOG_INFO(fmt::format("Execute snapshot command")); SnapshotOp snapshot_operation = snapshot_cmd->operation(); - switch(snapshot_operation) { + SnapshotScope snapshot_scope = snapshot_cmd->scope(); + const String &snapshot_name = snapshot_cmd->name(); + switch (snapshot_operation) { case SnapshotOp::kCreate: { LOG_INFO(fmt::format("Execute snapshot create")); + switch (snapshot_scope) { + case SnapshotScope::kSystem: { + LOG_INFO(fmt::format("Execute snapshot system")); + break; + } + case SnapshotScope::kDatabase: { + LOG_INFO(fmt::format("Execute snapshot database")); + break; + } + case SnapshotScope::kTable: { + const String &table_name = snapshot_cmd->object_name(); + Status snapshot_status = Snapshot::CreateTableSnapshot(query_context, snapshot_name, table_name); + if (!snapshot_status.ok()) { + RecoverableError(snapshot_status); + } + LOG_INFO(fmt::format("Execute snapshot table")); + break; + } + case SnapshotScope::kIgnore: { + LOG_INFO(fmt::format("Execute snapshot ignore")); + break; + } + default: { + String error_message = "Invalid snapshot scope"; + UnrecoverableError(error_message); + break; + } + } break; } case SnapshotOp::kDrop: { @@ -476,30 +507,6 @@ bool PhysicalCommand::Execute(QueryContext *query_context, OperatorState *operat } } - SnapshotScope snapshot_scope = snapshot_cmd->scope(); - switch(snapshot_scope) { - case SnapshotScope::kSystem: { - LOG_INFO(fmt::format("Execute snapshot system")); - break; - } - case SnapshotScope::kDatabase: { - LOG_INFO(fmt::format("Execute snapshot database")); - break; - } - case SnapshotScope::kTable: { - LOG_INFO(fmt::format("Execute snapshot table")); - break; - } - case SnapshotScope::kIgnore: { - LOG_INFO(fmt::format("Execute snapshot ignore")); - break; - } - default: { - String error_message = "Invalid snapshot scope"; - UnrecoverableError(error_message); - break; - } - } break; } default: { diff --git a/src/executor/operator/snapshot/snapshot.cppm b/src/executor/operator/snapshot/snapshot.cppm index f2f63f725e..d86bc88452 100644 --- a/src/executor/operator/snapshot/snapshot.cppm +++ b/src/executor/operator/snapshot/snapshot.cppm @@ -23,7 +23,7 @@ import query_context; namespace infinity { -class Snapshot { +export class Snapshot { public: static Status CreateTableSnapshot(QueryContext *query_context, const String &snapshot_name, const String& table_name); static Status RestoreTableSnapshot(); diff --git a/src/executor/operator/snapshot/table_snapshot.cpp b/src/executor/operator/snapshot/table_snapshot.cpp index 62d159b36f..f3a91e96da 100644 --- a/src/executor/operator/snapshot/table_snapshot.cpp +++ b/src/executor/operator/snapshot/table_snapshot.cpp @@ -21,13 +21,24 @@ import txn; import query_context; import table_entry; import status; +import third_party; +import config; namespace infinity { Status Snapshot::CreateTableSnapshot(QueryContext *query_context, const String &snapshot_name, const String &table_name) { -// Txn *txn_ptr = query_context->GetTxn(); -// const String &db_name = query_context->schema_name(); -// auto [table_entry, table_status] = txn_ptr->GetTableByName(db_name, table_name); + Txn *txn_ptr = query_context->GetTxn(); + const String &db_name = query_context->schema_name(); + Tuple result = txn_ptr->GetTableByName(db_name, table_name); + TableEntry *table_entry_ptr = std::get<0>(result); + Status table_status = std::get<1>(result); + if (!table_status.ok()) { + return table_status; + } + SharedPtr table_snapshot = table_entry_ptr->GetSnapshotInfo(); + table_snapshot->snapshot_name_ = snapshot_name; + String snapshot_dir = query_context->global_config()->SnapshotDir(); + table_snapshot->Serialize(snapshot_dir); return Status::OK(); } diff --git a/src/parser/statement/command_statement.h b/src/parser/statement/command_statement.h index c9284c2294..ff157fb221 100644 --- a/src/parser/statement/command_statement.h +++ b/src/parser/statement/command_statement.h @@ -248,7 +248,7 @@ class TestCmd final : public CommandInfo { }; enum class SnapshotOp { kCreate, kDrop, kRestore, kInvalid }; -enum class SnapshotScope { kTable, kDatabase, kSystem, kIgnore, kInvalid }; +enum class SnapshotScope : uint8_t { kTable = 0, kDatabase, kSystem, kIgnore, kInvalid }; class SnapshotCmd final : public CommandInfo { public: @@ -258,6 +258,7 @@ class SnapshotCmd final : public CommandInfo { [[nodiscard]] std::string ToString() const final; const std::string &name() { return name_; } + const std::string &object_name() { return object_name_.value(); } SnapshotOp operation() { return operation_; } SnapshotScope &scope() { return scope_; } diff --git a/src/storage/common/snapshot_info.cpp b/src/storage/common/snapshot_info.cpp new file mode 100644 index 0000000000..b877e1e2ea --- /dev/null +++ b/src/storage/common/snapshot_info.cpp @@ -0,0 +1,247 @@ +// Copyright(C) 2024 InfiniFlow, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module; + +#include + +module snapshot_info; + +import stl; +import status; +import command_statement; +// import index_base; +import third_party; +import constant_expr; +import logger; +import virtual_store; +import local_file_handle; +import infinity_exception; +import infinity_context; +import config; +import persistence_manager; +import persist_result_handler; +import defer_op; + +namespace infinity { + +nlohmann::json BlockColumnSnapshotInfo::Serialize() { + nlohmann::json json_res; + json_res["column_id"] = column_id_; + json_res["filename"] = filename_; + for (const auto &outline_snapshot : outline_snapshots_) { + json_res["outlines"].emplace_back(outline_snapshot->filename_); + } + return json_res; +} + +nlohmann::json BlockSnapshotInfo::Serialize() { + nlohmann::json json_res; + json_res["block_id"] = block_id_; + json_res["block_dir"] = block_dir_; + for (const auto &column_block_snapshot : column_block_snapshots_) { + json_res["columns"].emplace_back(column_block_snapshot->Serialize()); + } + return json_res; +} + +nlohmann::json SegmentSnapshotInfo::Serialize() { + nlohmann::json json_res; + json_res["segment_id"] = segment_id_; + json_res["segment_dir"] = segment_dir_; + for (const auto &block_snapshot : block_snapshots_) { + json_res["blocks"].emplace_back(block_snapshot->Serialize()); + } + return json_res; +} + +void TableSnapshotInfo::Serialize(const String &save_dir) { + + Config *config = InfinityContext::instance().config(); + PersistenceManager *persistence_manager = InfinityContext::instance().persistence_manager(); + + // Get files + Vector original_files = GetFiles(); + + // Copy files + if (persistence_manager != nullptr) { + PersistResultHandler pm_handler(persistence_manager); + for (const auto &file : original_files) { + PersistReadResult result = persistence_manager->GetObjCache(file); + DeferFn defer_fn([&]() { + auto res = persistence_manager->PutObjCache(file); + pm_handler.HandleWriteResult(res); + }); + + const ObjAddr &obj_addr = pm_handler.HandleReadResult(result); + if (!obj_addr.Valid()) { + String error_message = fmt::format("Failed to find object for local path {}", file); + UnrecoverableError(error_message); + } + String read_path = persistence_manager->GetObjPath(obj_addr.obj_key_); + LOG_INFO(fmt::format("READ: {} from {}", file, read_path)); + + auto [reader_handle, reader_open_status] = VirtualStore::Open(read_path, FileAccessMode::kRead); + if (!reader_open_status.ok()) { + UnrecoverableError(reader_open_status.message()); + } + + auto seek_status = reader_handle->Seek(obj_addr.part_offset_); + if (!seek_status.ok()) { + UnrecoverableError(seek_status.message()); + } + + auto file_size = obj_addr.part_size_; + auto buffer = std::make_unique(file_size); + auto [nread, read_status] = reader_handle->Read(buffer.get(), file_size); + + String dst_file_path = fmt::format("{}/{}/{}", save_dir, snapshot_name_, file); + String dst_dir = VirtualStore::GetParentPath(dst_file_path); + if (!VirtualStore::Exists(dst_dir)) { + VirtualStore::MakeDirectory(dst_dir); + } + + auto [write_file_handle, writer_open_status] = VirtualStore::Open(dst_file_path, FileAccessMode::kWrite); + if (!writer_open_status.ok()) { + UnrecoverableError(writer_open_status.message()); + } + + Status write_status = write_file_handle->Append(buffer.get(), file_size); + if (!write_status.ok()) { + UnrecoverableError(write_status.message()); + } + write_file_handle->Sync(); + } + } else { + String data_dir = config->DataDir(); + for (const auto &file : original_files) { + String src_file_path = fmt::format("{}/{}", data_dir, file); + String dst_file_path = fmt::format("{}/{}/{}", save_dir, snapshot_name_, file); + // LOG_INFO(fmt::format("Copy from: {} to {}", src_file_path, dst_file_path)); + Status copy_status = VirtualStore::Copy(dst_file_path, src_file_path); + if (!copy_status.ok()) { + RecoverableError(copy_status); + } + } + } + + // Compress the directory + String directory = fmt::format("{}/{}", save_dir, snapshot_name_); + String zip_filename = fmt::format("{}/{}.zip", save_dir, snapshot_name_); + String command = fmt::format("zip -r {} {}", directory, zip_filename); + int ret = system(command.c_str()); + if (ret != 0) { + Status status = Status::IOError(fmt::format("Failed to compress directory: {}", directory)); + RecoverableError(status); + } + // Get the MD5 of compress file + String md5_command = fmt::format("md5sum {}", zip_filename); + FILE *md5_fp = popen(md5_command.c_str(), "r"); + if (md5_fp == nullptr) { + Status status = Status::IOError(fmt::format("Failed to get md5 of file: {}", zip_filename)); + RecoverableError(status); + } + char md5_buf[1024]; + if (fgets(md5_buf, sizeof(md5_buf), md5_fp) == nullptr) { + Status status = Status::IOError(fmt::format("Failed to read md5 of file: {}", zip_filename)); + RecoverableError(status); + } + pclose(md5_fp); + String md5 = md5_buf; + md5 = md5.substr(0, md5.find(" ")); + LOG_INFO(fmt::format("MD5: {}", md5)); + + // Remove the directory + VirtualStore::RemoveDirectory(directory); + + nlohmann::json json_res; + json_res["version"] = version_; + json_res["snapshot_name"] = snapshot_name_; + json_res["snapshot_scope"] = SnapshotScope::kTable; + json_res["database_name"] = db_name_; + json_res["table_name"] = table_name_; + json_res["table_comment"] = table_comment_; + json_res["md5"] = md5; + + json_res["txn_id"] = txn_id_; + json_res["begin_ts"] = begin_ts_; + json_res["commit_ts"] = commit_ts_; + json_res["max_commit_ts"] = max_commit_ts_; + + json_res["next_column_id"] = next_column_id_; + json_res["next_segment_id"] = next_segment_id_; + + for (const auto &column_def : this->columns_) { + nlohmann::json column_def_json; + column_def_json["column_type"] = column_def->type()->Serialize(); + column_def_json["column_id"] = column_def->id(); + column_def_json["column_name"] = column_def->name(); + + for (const auto &column_constraint : column_def->constraints_) { + column_def_json["constraints"].emplace_back(column_constraint); + } + + if (!(column_def->comment().empty())) { + column_def_json["column_comment"] = column_def->comment(); + } + + if (column_def->has_default_value()) { + auto default_expr = dynamic_pointer_cast(column_def->default_expr_); + column_def_json["default"] = default_expr->Serialize(); + } + + json_res["column_definition"].emplace_back(column_def_json); + } + + for (const auto &segment_snapshot_pair : segment_snapshots_) { + json_res["segments"].emplace_back(segment_snapshot_pair.second->Serialize()); + } + + String json_string = json_res.dump(); + + Path save_path = Path(save_dir) / fmt::format("{}.json", snapshot_name_); + + if (!VirtualStore::Exists(save_dir)) { + VirtualStore::MakeDirectory(save_dir); + } + auto [snapshot_file_handle, status] = VirtualStore::Open(save_path.string(), FileAccessMode::kWrite); + if (!status.ok()) { + UnrecoverableError(fmt::format("{}: {}", save_path.string(), status.message())); + } + + status = snapshot_file_handle->Append(json_string.data(), json_string.size()); + if (!status.ok()) { + RecoverableError(status); + } + snapshot_file_handle->Sync(); + + LOG_INFO(fmt::format("{}", json_res.dump())); +} + +Vector TableSnapshotInfo::GetFiles() const { + Vector files; + for (const auto &segment_snapshot_pair : segment_snapshots_) { + for (const auto &block_snapshot : segment_snapshot_pair.second->block_snapshots_) { + for (const auto &column_block_snapshot : block_snapshot->column_block_snapshots_) { + files.emplace_back(VirtualStore::ConcatenatePath(block_snapshot->block_dir_, column_block_snapshot->filename_)); + for (const auto &outline_snapshot : column_block_snapshot->outline_snapshots_) { + files.emplace_back(VirtualStore::ConcatenatePath(block_snapshot->block_dir_, outline_snapshot->filename_)); + } + } + } + } + return files; +} + +} // namespace infinity diff --git a/src/storage/common/snapshot_info.cppm b/src/storage/common/snapshot_info.cppm index 0cae732816..396d0c3a8b 100644 --- a/src/storage/common/snapshot_info.cppm +++ b/src/storage/common/snapshot_info.cppm @@ -20,14 +20,16 @@ import stl; import status; import command_statement; import index_base; +import third_party; +import column_def; namespace infinity { export struct SnapshotInfo { // structure to represent the snapshot String snapshot_name_; - String filename_; SnapshotScope scope_; + SizeT version_{1}; // version 1, start from 0.6.0 }; export struct OutlineSnapshotInfo { @@ -37,17 +39,25 @@ export struct OutlineSnapshotInfo { export struct BlockColumnSnapshotInfo { ColumnID column_id_; String filename_; - Vector outline_snapshots_; + Vector> outline_snapshots_; + + nlohmann::json Serialize(); }; export struct BlockSnapshotInfo { BlockID block_id_; - Vector column_block_snapshots_; + String block_dir_; + Vector> column_block_snapshots_; + + nlohmann::json Serialize(); }; export struct SegmentSnapshotInfo { SegmentID segment_id_; - Vector block_snapshots_; + String segment_dir_; + Vector> block_snapshots_; + + nlohmann::json Serialize(); }; export struct ChunkIndexSnapshot { @@ -69,6 +79,19 @@ export struct TableIndexSnapshotInfo { export struct TableSnapshotInfo : public SnapshotInfo { String db_name_; String table_name_; + String table_comment_{}; + + TxnTimeStamp txn_id_{}; + TxnTimeStamp begin_ts_{}; + TxnTimeStamp commit_ts_{}; + TxnTimeStamp max_commit_ts_{}; + ColumnID next_column_id_{}; + SegmentID next_segment_id_{}; + Vector> columns_{}; + + Map> segment_snapshots_{}; + Vector GetFiles() const; + void Serialize(const String& save_path); }; } // namespace infinity diff --git a/src/storage/io/virtual_store.cpp b/src/storage/io/virtual_store.cpp index a7f8e274ad..1a51ce3ccb 100644 --- a/src/storage/io/virtual_store.cpp +++ b/src/storage/io/virtual_store.cpp @@ -337,6 +337,29 @@ Status VirtualStore::Merge(const String &dst_path, const String &src_path) { return Status::OK(); } +Status VirtualStore::Copy(const String &dst_path, const String &src_path) { + if (!std::filesystem::path(dst_path).is_absolute()) { + String error_message = fmt::format("{} isn't absolute path.", dst_path); + UnrecoverableError(error_message); + } + if (!std::filesystem::path(src_path).is_absolute()) { + String error_message = fmt::format("{} isn't absolute path.", src_path); + UnrecoverableError(error_message); + } + + String dst_dir = GetParentPath(dst_path); + if (!VirtualStore::Exists(dst_dir)) { + VirtualStore::MakeDirectory(dst_dir); + } + + try { + std::filesystem::copy(src_path, dst_path, fs::copy_options::update_existing); + } catch (const std::filesystem::filesystem_error &e) { + return Status::IOError(fmt::format("Failed to copy file: {}", e.what())); + } + return Status::OK(); +} + Tuple>, Status> VirtualStore::ListDirectory(const String &path) { if (!std::filesystem::path(path).is_absolute()) { String error_message = fmt::format("{} isn't absolute path.", path); diff --git a/src/storage/io/virtual_store.cppm b/src/storage/io/virtual_store.cppm index 1a516b1c38..3dc54e622b 100644 --- a/src/storage/io/virtual_store.cppm +++ b/src/storage/io/virtual_store.cppm @@ -64,6 +64,7 @@ public: static Status Rename(const String &old_path, const String &new_path); static Status Truncate(const String &file_name, SizeT new_length); static Status Merge(const String &dst_file, const String &src_file); + static Status Copy(const String &dst_file, const String &src_file); static Tuple>, Status> ListDirectory(const String &path); static SizeT GetFileSize(const String &path); static String GetParentPath(const String &path); diff --git a/src/storage/meta/entry/block_column_entry.cpp b/src/storage/meta/entry/block_column_entry.cpp index 1833b3366d..96e7b70733 100644 --- a/src/storage/meta/entry/block_column_entry.cpp +++ b/src/storage/meta/entry/block_column_entry.cpp @@ -171,7 +171,18 @@ ColumnVector BlockColumnEntry::GetConstColumnVector(BufferManager *buffer_mgr, S return GetColumnVectorInner(buffer_mgr, ColumnVectorTipe::kReadOnly, row_count); } -SharedPtr BlockColumnEntry::GetSnapshotInfo() { return nullptr; } +SharedPtr BlockColumnEntry::GetSnapshotInfo() const { + SharedPtr block_column_snapshot_info = MakeShared(); + block_column_snapshot_info->column_id_ = column_id_; + block_column_snapshot_info->filename_ = *file_name_; + SizeT outline_count = outline_buffers_.size(); + for (SizeT file_idx = 0; file_idx < outline_count; ++file_idx) { + String outline_file_path = *OutlineFilename(file_idx); + SharedPtr outline_snapshot_info = MakeShared(); + outline_snapshot_info->filename_ = outline_file_path; + } + return block_column_snapshot_info; +} ColumnVector BlockColumnEntry::GetColumnVectorInner(BufferManager *buffer_mgr, const ColumnVectorTipe tipe, SizeT row_count) { if (this->buffer_ == nullptr) { diff --git a/src/storage/meta/entry/block_column_entry.cppm b/src/storage/meta/entry/block_column_entry.cppm index 43a54e5a06..c439ca9e30 100644 --- a/src/storage/meta/entry/block_column_entry.cppm +++ b/src/storage/meta/entry/block_column_entry.cppm @@ -94,7 +94,7 @@ public: ColumnVector GetConstColumnVector(BufferManager *buffer_mgr, SizeT row_count); - SharedPtr GetSnapshotInfo(); + SharedPtr GetSnapshotInfo() const; private: ColumnVector GetColumnVectorInner(BufferManager *buffer_mgr, const ColumnVectorTipe tipe, SizeT row_count); diff --git a/src/storage/meta/entry/block_entry.cpp b/src/storage/meta/entry/block_entry.cpp index 27f5b62245..85c9523b7e 100644 --- a/src/storage/meta/entry/block_entry.cpp +++ b/src/storage/meta/entry/block_entry.cpp @@ -39,6 +39,7 @@ import buffer_obj; import logical_type; import infinity_context; import virtual_store; +import snapshot_info; namespace infinity { @@ -464,6 +465,21 @@ void BlockEntry::DropColumns(const Vector &column_ids, TxnTableStore * } } +SharedPtr BlockEntry::GetSnapshotInfo() const { + SharedPtr block_snapshot_info = MakeShared(); + block_snapshot_info->block_id_ = block_id_; + block_snapshot_info->block_dir_ = *block_dir_; + + SizeT column_count = this->columns_.size(); + block_snapshot_info->column_block_snapshots_.reserve(column_count); + for (SizeT column_id = 0; column_id < column_count; ++column_id) { + SharedPtr block_column_snapshot_info = columns_[column_id]->GetSnapshotInfo(); + block_snapshot_info->column_block_snapshots_.push_back(block_column_snapshot_info); + } + + return block_snapshot_info; +} + void BlockEntry::CheckFlush(TxnTimeStamp checkpoint_ts, bool &flush_column, bool &flush_version, bool check_commit) const { // Skip if entry has been flushed at some previous checkpoint, or is invisible at current checkpoint. flush_column = false; diff --git a/src/storage/meta/entry/block_entry.cppm b/src/storage/meta/entry/block_entry.cppm index 15da6b572f..aedb048627 100644 --- a/src/storage/meta/entry/block_entry.cppm +++ b/src/storage/meta/entry/block_entry.cppm @@ -36,6 +36,7 @@ import wal_entry; import column_def; import txn_store; import cleanup_scanner; +import snapshot_info; namespace infinity { @@ -194,6 +195,7 @@ public: void DropColumns(const Vector &column_ids, TxnTableStore *table_store); + SharedPtr GetSnapshotInfo() const; public: // Setter, Used in import, segment append block, and block append block in compact inline void IncreaseRowCount(SizeT increased_row_count) { block_row_count_ += increased_row_count; } diff --git a/src/storage/meta/entry/segment_entry.cpp b/src/storage/meta/entry/segment_entry.cpp index 6cfc56db66..a69bd18111 100644 --- a/src/storage/meta/entry/segment_entry.cpp +++ b/src/storage/meta/entry/segment_entry.cpp @@ -723,6 +723,21 @@ void SegmentEntry::DropColumns(const Vector &column_ids, TxnTableStore } } +SharedPtr SegmentEntry::GetSnapshotInfo() const { + SharedPtr segment_snapshot_info = MakeShared(); + segment_snapshot_info->segment_id_ = segment_id_; + segment_snapshot_info->segment_dir_ = *segment_dir_; + + std::shared_lock lock(rw_locker_); + SizeT block_count = block_entries_.size(); + segment_snapshot_info->block_snapshots_.reserve(block_count); + for(SizeT block_id = 0; block_id < block_count; ++ block_id) { + SharedPtr block_snapshot_info = block_entries_[block_id]->GetSnapshotInfo(); + segment_snapshot_info->block_snapshots_.push_back(block_snapshot_info); + } + return segment_snapshot_info; +} + SizeT SegmentEntry::GetStorageSize() const { SizeT result = 0; std::shared_lock lock(rw_locker_); diff --git a/src/storage/meta/entry/segment_entry.cppm b/src/storage/meta/entry/segment_entry.cppm index 905bf7b793..2541bc4d50 100644 --- a/src/storage/meta/entry/segment_entry.cppm +++ b/src/storage/meta/entry/segment_entry.cppm @@ -34,6 +34,7 @@ import roaring_bitmap; import wal_entry; import column_def; import constant_expr; +import snapshot_info; namespace infinity { @@ -290,6 +291,8 @@ public: void AddColumns(const Vector> &columns, TxnTableStore *table_store); void DropColumns(const Vector &column_ids, TxnTableStore *table_store); + + SharedPtr GetSnapshotInfo() const; }; } // namespace infinity diff --git a/src/storage/meta/entry/table_entry.cpp b/src/storage/meta/entry/table_entry.cpp index c8384f26c7..10709dca5e 100644 --- a/src/storage/meta/entry/table_entry.cpp +++ b/src/storage/meta/entry/table_entry.cpp @@ -68,6 +68,7 @@ import cast_expression; import expression_evaluator; import column_vector; import expression_state; +import snapshot_info; namespace infinity { @@ -1653,4 +1654,23 @@ void TableEntry::DropColumns(const Vector &column_names, TxnTableStore * } } +SharedPtr TableEntry::GetSnapshotInfo() const { + SharedPtr table_snapshot_info = MakeShared(); + table_snapshot_info->db_name_ = *GetDBName(); + table_snapshot_info->table_name_ = *table_name_; + table_snapshot_info->table_comment_ = *table_comment_; + table_snapshot_info->txn_id_ = txn_id_; + table_snapshot_info->begin_ts_ = begin_ts_; + table_snapshot_info->commit_ts_ = commit_ts_; + table_snapshot_info->max_commit_ts_ = max_commit_ts_; + table_snapshot_info->next_column_id_ = next_column_id_; + table_snapshot_info->next_segment_id_ = next_segment_id_; + table_snapshot_info->columns_ = columns_; + for (const auto &segment_pair : segment_map_) { + SharedPtr segment_snapshot_info = segment_pair.second->GetSnapshotInfo(); + table_snapshot_info->segment_snapshots_.emplace(segment_pair.first, segment_snapshot_info); + } + return table_snapshot_info; +} + } // namespace infinity diff --git a/src/storage/meta/entry/table_entry.cppm b/src/storage/meta/entry/table_entry.cppm index 91198454cd..5c80d1a2a1 100644 --- a/src/storage/meta/entry/table_entry.cppm +++ b/src/storage/meta/entry/table_entry.cppm @@ -45,6 +45,7 @@ import block_entry; import column_index_reader; import value; import infinity_exception; +import snapshot_info; namespace infinity { @@ -399,6 +400,8 @@ public: void AddColumns(const Vector> &columns, TxnTableStore *txn_store); void DropColumns(const Vector &column_names, TxnTableStore *txn_store); + + SharedPtr GetSnapshotInfo() const; }; } // namespace infinity From 2b26868c0ebcd2a81ce23aa0e8b0cbb7143235c3 Mon Sep 17 00:00:00 2001 From: Jin Hai Date: Sat, 4 Jan 2025 17:39:50 +0800 Subject: [PATCH 8/9] Add snapshot, part3 (#2423) ### What problem does this PR solve? _Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR._ ### Type of change - [x] New Feature (non-breaking change which adds functionality) --------- Signed-off-by: Jin Hai --- CMakeLists.txt | 4 +- src/common/utility/utility.cpp | 29 +++++++++++++++ src/common/utility/utility.cppm | 5 ++- src/storage/common/snapshot_info.cpp | 44 ++++++++++------------ src/storage/io/virtual_store.cpp | 55 ++++++++++++++++++++++++++++ src/storage/io/virtual_store.cppm | 5 +++ 6 files changed, 114 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e6bdc0d224..3572f609fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,7 +68,7 @@ execute_process( OUTPUT_VARIABLE GIT_BRANCH_NAME OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process( - COMMAND "${GIT_EXECUTABLE}" rev-parse HEAD + COMMAND "${GIT_EXECUTABLE}" describe --tags --match=v* --first-parent --always OUTPUT_VARIABLE GIT_COMMIT_ID OUTPUT_STRIP_TRAILING_WHITESPACE) if("${GIT_BRANCH_NAME}" STREQUAL "") @@ -260,7 +260,7 @@ if(DEFINED CPACK_PACKAGE_VERSION) string(REPLACE "-" "." CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}") endif() if(NOT DEFINED CPACK_PACKAGE_VERSION OR CPACK_PACKAGE_VERSION STREQUAL "") - set(CPACK_PACKAGE_VERSION "0.5.2") + set(CPACK_PACKAGE_VERSION "${GIT_COMMIT_ID}") endif() set(CPACK_PACKAGE_RELEASE 1) set(CPACK_PACKAGE_CONTACT "Zhichang Yu ") diff --git a/src/common/utility/utility.cpp b/src/common/utility/utility.cpp index 5acab31265..f3a6fe71ce 100644 --- a/src/common/utility/utility.cpp +++ b/src/common/utility/utility.cpp @@ -15,6 +15,7 @@ module; #include +#include #include #include @@ -124,4 +125,32 @@ String StringTransform(const String &source, const String &from, const String &t return ret; } +String CalcMD5(const char *input_str, SizeT length) { + MD5_CTX ctx; + MD5_Init(&ctx); + MD5_Update(&ctx, input_str, length); + + unsigned char md[MD5_DIGEST_LENGTH]; + MD5_Final(md, &ctx); + + std::stringstream hex_stream; + for (int i = 0; i < MD5_DIGEST_LENGTH; ++i) { + hex_stream << std::hex << std::setw(2) << std::setfill('0') << static_cast(md[i]); + } + + return hex_stream.str(); +} + +String CalcMD5(const String& input_file) { + std::ifstream input(input_file, std::ios::binary); + input.seekg(0, input.end); + size_t raw_file_size = input.tellg(); + input.seekg(0, input.beg); + std::vector raw_data(raw_file_size); + input.read(raw_data.data(), raw_file_size); + input.close(); + String md5 = CalcMD5(raw_data.data(), raw_file_size); + return md5; +} + } // namespace infinity diff --git a/src/common/utility/utility.cppm b/src/common/utility/utility.cppm index ab1554e4b2..d84cfeb6f9 100644 --- a/src/common/utility/utility.cppm +++ b/src/common/utility/utility.cppm @@ -41,5 +41,8 @@ bool ParseIPPort(const String &str, String &ip, i64 &port); String StringTransform(const String &source, const String &from, const String &to); -bool CompressDirectory(const String &source_dir, const String &dest_file); +String CalcMD5(const char* input_str, SizeT length); + +String CalcMD5(const String& filename); + } // namespace infinity diff --git a/src/storage/common/snapshot_info.cpp b/src/storage/common/snapshot_info.cpp index b877e1e2ea..690863110a 100644 --- a/src/storage/common/snapshot_info.cpp +++ b/src/storage/common/snapshot_info.cpp @@ -33,6 +33,7 @@ import config; import persistence_manager; import persist_result_handler; import defer_op; +import utility; namespace infinity { @@ -71,6 +72,10 @@ void TableSnapshotInfo::Serialize(const String &save_dir) { Config *config = InfinityContext::instance().config(); PersistenceManager *persistence_manager = InfinityContext::instance().persistence_manager(); + // Create compressed file + String compressed_filename = fmt::format("{}/{}.lz4", save_dir, snapshot_name_); + std::ofstream output_stream = VirtualStore::BeginCompress(compressed_filename); + // Get files Vector original_files = GetFiles(); @@ -122,6 +127,11 @@ void TableSnapshotInfo::Serialize(const String &save_dir) { UnrecoverableError(write_status.message()); } write_file_handle->Sync(); + + Status compress_status = VirtualStore::AddFileCompress(output_stream, dst_file_path); + if (!compress_status.ok()) { + RecoverableError(compress_status); + } } } else { String data_dir = config->DataDir(); @@ -133,36 +143,20 @@ void TableSnapshotInfo::Serialize(const String &save_dir) { if (!copy_status.ok()) { RecoverableError(copy_status); } + + Status compress_status = VirtualStore::AddFileCompress(output_stream, dst_file_path); + if (!compress_status.ok()) { + RecoverableError(compress_status); + } } } - // Compress the directory - String directory = fmt::format("{}/{}", save_dir, snapshot_name_); - String zip_filename = fmt::format("{}/{}.zip", save_dir, snapshot_name_); - String command = fmt::format("zip -r {} {}", directory, zip_filename); - int ret = system(command.c_str()); - if (ret != 0) { - Status status = Status::IOError(fmt::format("Failed to compress directory: {}", directory)); - RecoverableError(status); - } - // Get the MD5 of compress file - String md5_command = fmt::format("md5sum {}", zip_filename); - FILE *md5_fp = popen(md5_command.c_str(), "r"); - if (md5_fp == nullptr) { - Status status = Status::IOError(fmt::format("Failed to get md5 of file: {}", zip_filename)); - RecoverableError(status); - } - char md5_buf[1024]; - if (fgets(md5_buf, sizeof(md5_buf), md5_fp) == nullptr) { - Status status = Status::IOError(fmt::format("Failed to read md5 of file: {}", zip_filename)); - RecoverableError(status); - } - pclose(md5_fp); - String md5 = md5_buf; - md5 = md5.substr(0, md5.find(" ")); - LOG_INFO(fmt::format("MD5: {}", md5)); + VirtualStore::EndCompress(output_stream); + + String md5 = CalcMD5(compressed_filename); // Remove the directory + String directory = fmt::format("{}/{}", save_dir, snapshot_name_); VirtualStore::RemoveDirectory(directory); nlohmann::json json_res; diff --git a/src/storage/io/virtual_store.cpp b/src/storage/io/virtual_store.cpp index 1a51ce3ccb..46c05e77e4 100644 --- a/src/storage/io/virtual_store.cpp +++ b/src/storage/io/virtual_store.cpp @@ -18,6 +18,9 @@ module; #include #include #include +#include +#include +#include #include #include #include @@ -35,6 +38,7 @@ import s3_client_minio; import infinity_context; import object_storage_task; import admin_statement; +import utility; namespace fs = std::filesystem; @@ -450,6 +454,57 @@ i32 VirtualStore::MmapFile(const String &file_path, u8 *&data_ptr, SizeT &data_l return 0; } +std::ofstream VirtualStore::BeginCompress(const String &compressed_file) { + std::ofstream output(compressed_file, std::ios::binary); + return output; +} + +Status VirtualStore::AddFileCompress(std::ofstream &ofstream, const String &input_file) { + std::ifstream input(input_file, std::ios::binary); + if (!input.is_open()) { + return Status::IOError(fmt::format("Unable to open input file: {}", input_file)); + } + + input.seekg(0, input.end); + size_t raw_file_size = input.tellg(); + input.seekg(0, input.beg); + + std::vector raw_data(raw_file_size); + input.read(raw_data.data(), raw_file_size); + input.close(); + + // Write the filename size + SizeT filename_size = input_file.size(); + ofstream.write(reinterpret_cast(&filename_size), sizeof(filename_size)); + + // Write filename + ofstream.write(input_file.c_str(), input_file.size()); + + // Write raw file size + ofstream.write(reinterpret_cast(&raw_file_size), sizeof(raw_file_size)); + + // Write raw file md5 + String md5 = CalcMD5(raw_data.data(), raw_file_size); + ofstream.write(md5.c_str(), MD5_DIGEST_LENGTH); + + size_t max_compressed_size = LZ4_compressBound(raw_file_size); + std::vector compressed_data(max_compressed_size); + + i32 compressed_size = LZ4_compress_default(raw_data.data(), compressed_data.data(), raw_file_size, max_compressed_size); + if (compressed_size < 0) { + return Status::IOError("Compression failed"); + } + + // Write compressed file size + ofstream.write(reinterpret_cast(&compressed_size), sizeof(compressed_size)); + + // Write compressed data + ofstream.write(compressed_data.data(), compressed_size); + return Status::OK(); +} + +void VirtualStore::EndCompress(std::ofstream &ofstream) { ofstream.close(); } + i32 VirtualStore::MunmapFile(const String &file_path) { if (!std::filesystem::path(file_path).is_absolute()) { String error_message = fmt::format("{} isn't absolute path.", file_path); diff --git a/src/storage/io/virtual_store.cppm b/src/storage/io/virtual_store.cppm index 3dc54e622b..5656769f98 100644 --- a/src/storage/io/virtual_store.cppm +++ b/src/storage/io/virtual_store.cppm @@ -70,6 +70,11 @@ public: static String GetParentPath(const String &path); static SizeT GetDirectorySize(const String &path); static String ConcatenatePath(const String &dir_path, const String &file_path); + + static std::ofstream BeginCompress(const String& compressed_file); + static Status AddFileCompress(std::ofstream& ofstream, const String &filename); + static void EndCompress(std::ofstream& ofstream); + static i32 MmapFile(const String &file_path, u8 *&data_ptr, SizeT &data_len); static i32 MunmapFile(const String &file_path); From c89db0bb15f28aad0949a95e45a27ba812375861 Mon Sep 17 00:00:00 2001 From: Jin Hai Date: Sat, 4 Jan 2025 20:55:46 +0800 Subject: [PATCH 9/9] Add snapshot, part4 (#2425) ### What problem does this PR solve? _Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR._ ### Type of change - [x] New Feature (non-breaking change which adds functionality) --------- Signed-off-by: Jin Hai --- src/executor/operator/physical_command.cpp | 4 + src/executor/operator/physical_show.cpp | 240 +++++++++++++++--- src/executor/operator/snapshot/snapshot.cpp | 62 +++++ .../operator/snapshot/snapshot_brief.cpp | 95 +++++++ .../operator/snapshot/snapshot_brief.cppm | 7 +- .../operator/snapshot/table_snapshot.cpp | 3 +- src/storage/common/snapshot_info.cppm | 3 +- src/storage/meta/catalog.cpp | 6 +- src/storage/meta/catalog.cppm | 2 +- src/storage/meta/entry/table_entry.cpp | 4 +- src/storage/meta/entry/table_entry.cppm | 4 +- src/storage/txn/txn.cpp | 3 +- 12 files changed, 382 insertions(+), 51 deletions(-) create mode 100644 src/executor/operator/snapshot/snapshot.cpp create mode 100644 src/executor/operator/snapshot/snapshot_brief.cpp diff --git a/src/executor/operator/physical_command.cpp b/src/executor/operator/physical_command.cpp index 7f6d7c2b53..49e1c5353f 100644 --- a/src/executor/operator/physical_command.cpp +++ b/src/executor/operator/physical_command.cpp @@ -494,6 +494,10 @@ bool PhysicalCommand::Execute(QueryContext *query_context, OperatorState *operat } case SnapshotOp::kDrop: { LOG_INFO(fmt::format("Execute snapshot drop")); + Status snapshot_status = Snapshot::DropSnapshot(query_context, snapshot_name); + if (!snapshot_status.ok()) { + RecoverableError(snapshot_status); + } break; } case SnapshotOp::kRestore: { diff --git a/src/executor/operator/physical_show.cpp b/src/executor/operator/physical_show.cpp index 7cb289b9da..9353803da5 100644 --- a/src/executor/operator/physical_show.cpp +++ b/src/executor/operator/physical_show.cpp @@ -85,6 +85,8 @@ import peer_task; import node_info; import txn_context; import txn_state; +import snapshot_brief; +import command_statement; namespace infinity { @@ -583,7 +585,7 @@ void PhysicalShow::Init() { output_types_->emplace_back(varchar_type); output_types_->emplace_back(varchar_type); output_types_->emplace_back(bigint_type); - output_types_->emplace_back(bigint_type); + output_types_->emplace_back(varchar_type); break; } case ShowStmtType::kShowSnapshot: { @@ -5867,8 +5869,8 @@ void PhysicalShow::ExecuteShowTransaction(QueryContext *query_context, ShowOpera } void PhysicalShow::ExecuteShowTransactionHistory(QueryContext *query_context, ShowOperatorState *operator_state) { - Txn* txn = query_context->GetTxn(); -// txn->AddOperation(MakeShared("ShowTransactionHistory")); + Txn *txn = query_context->GetTxn(); + // txn->AddOperation(MakeShared("ShowTransactionHistory")); TransactionID this_txn_id = txn->TxnID(); TxnManager *txn_manager = query_context->storage()->txn_manager(); Vector> txn_context_histories = txn_manager->GetTxnContextHistories(); @@ -6581,9 +6583,89 @@ void PhysicalShow::ExecuteListSnapshots(QueryContext *query_context, ShowOperato auto varchar_type = MakeShared(LogicalType::kVarchar); auto bigint_type = MakeShared(LogicalType::kBigInt); UniquePtr output_block_ptr = DataBlock::MakeUniquePtr(); - Vector> column_types{varchar_type, varchar_type, varchar_type, bigint_type, bigint_type}; + + Vector> column_types{varchar_type, varchar_type, varchar_type, bigint_type, varchar_type}; output_block_ptr->Init(column_types); + + String snapshot_dir = query_context->global_config()->SnapshotDir(); + Vector snapshot_list = SnapshotBrief::GetSnapshots(snapshot_dir); + + SizeT row_count = 0; + for (auto &snapshot_brief : snapshot_list) { + if (output_block_ptr.get() == nullptr) { + output_block_ptr = DataBlock::MakeUniquePtr(); + output_block_ptr->Init(column_types); + } + + { + // snapshot name + Value value = Value::MakeVarchar(snapshot_brief.snapshot_name_); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[0]); + } + + { + // scope + String scope_str; + switch (snapshot_brief.scope_) { + case SnapshotScope::kTable: { + scope_str = "Table"; + break; + } + case SnapshotScope::kDatabase: { + scope_str = "Database"; + break; + } + case SnapshotScope::kSystem: { + scope_str = "System"; + break; + } + case SnapshotScope::kIgnore: { + scope_str = "Ignore"; + break; + } + default: { + Status status = Status::Unknown("Invalid scope type"); + RecoverableError(status); + } + } + Value value = Value::MakeVarchar(scope_str); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[1]); + } + + { + // snapshot create time + Value value = Value::MakeVarchar(snapshot_brief.create_time_); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[2]); + } + + { + // snapshot commit ts + Value value = Value::MakeBigInt(snapshot_brief.commit_ts_); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[3]); + } + + { + // snapshot size + String snapshot_size_str = Utility::FormatByteSize(snapshot_brief.size_); + Value value = Value::MakeVarchar(snapshot_size_str); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[4]); + } + + ++row_count; + if (row_count == output_block_ptr->capacity()) { + output_block_ptr->Finalize(); + operator_state->output_.emplace_back(std::move(output_block_ptr)); + output_block_ptr = nullptr; + row_count = 0; + } + } + output_block_ptr->Finalize(); operator_state->output_.emplace_back(std::move(output_block_ptr)); return; @@ -6599,37 +6681,125 @@ void PhysicalShow::ExecuteShowSnapshot(QueryContext *query_context, ShowOperator output_block_ptr->Init(column_types); - // { - // SizeT column_id = 0; - // { - // Value value = Value::MakeVarchar("memory_objects"); - // ValueExpression value_expr(value); - // value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); - // } - // - // ++column_id; - // { - // Value value = Value::MakeVarchar(GlobalResourceUsage::GetObjectCountInfo()); - // ValueExpression value_expr(value); - // value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); - // } - // } - // - // { - // SizeT column_id = 0; - // { - // Value value = Value::MakeVarchar("memory_allocation"); - // ValueExpression value_expr(value); - // value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); - // } - // - // ++column_id; - // { - // Value value = Value::MakeVarchar(GlobalResourceUsage::GetRawMemoryInfo()); - // ValueExpression value_expr(value); - // value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); - // } - // } + String snapshot_dir = query_context->global_config()->SnapshotDir(); + Vector snapshot_list = SnapshotBrief::GetSnapshots(snapshot_dir); + + SnapshotBrief snapshot_brief; + for (const auto &ss_brief : snapshot_list) { + if (ss_brief.snapshot_name_ == object_name_.value()) { + snapshot_brief = ss_brief; + } + } + + if (snapshot_brief.scope_ == SnapshotScope::kInvalid) { + Status status = Status::Unknown(fmt::format("can't find snapshot: {}", object_name_.value())); + RecoverableError(status); + } + + { + SizeT column_id = 0; + { + Value value = Value::MakeVarchar("snapshot_name"); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); + } + + ++column_id; + { + Value value = Value::MakeVarchar(snapshot_brief.snapshot_name_); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); + } + } + + { + SizeT column_id = 0; + { + Value value = Value::MakeVarchar("snapshot_scope"); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); + } + + ++column_id; + { + String scope_str; + switch (snapshot_brief.scope_) { + case SnapshotScope::kTable: { + scope_str = "Table"; + break; + } + case SnapshotScope::kDatabase: { + scope_str = "Database"; + break; + } + case SnapshotScope::kSystem: { + scope_str = "System"; + break; + } + case SnapshotScope::kIgnore: { + scope_str = "Ignore"; + break; + } + default: { + Status status = Status::Unknown("Invalid scope type"); + RecoverableError(status); + } + } + + Value value = Value::MakeVarchar(scope_str); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); + } + } + + { + SizeT column_id = 0; + { + Value value = Value::MakeVarchar("create_time"); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); + } + + ++column_id; + { + Value value = Value::MakeVarchar(snapshot_brief.create_time_); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); + } + } + + { + SizeT column_id = 0; + { + Value value = Value::MakeVarchar("commit_timestamp"); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); + } + + ++column_id; + { + Value value = Value::MakeVarchar(std::to_string(snapshot_brief.commit_ts_)); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); + } + } + + { + SizeT column_id = 0; + { + Value value = Value::MakeVarchar("snapshot_size"); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); + } + + ++column_id; + { + String snapshot_size_str = Utility::FormatByteSize(snapshot_brief.size_); + Value value = Value::MakeVarchar(snapshot_size_str); + ValueExpression value_expr(value); + value_expr.AppendToChunk(output_block_ptr->column_vectors[column_id]); + } + } output_block_ptr->Finalize(); operator_state->output_.emplace_back(std::move(output_block_ptr)); diff --git a/src/executor/operator/snapshot/snapshot.cpp b/src/executor/operator/snapshot/snapshot.cpp new file mode 100644 index 0000000000..0b84d2f781 --- /dev/null +++ b/src/executor/operator/snapshot/snapshot.cpp @@ -0,0 +1,62 @@ +// Copyright(C) 2024 InfiniFlow, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module; + +#include + +module snapshot; + +import stl; +import txn; +import query_context; +import table_entry; +import status; +import third_party; +import config; +import virtual_store; +import logger; + +namespace infinity { + +Status Snapshot::DropSnapshot(QueryContext *query_context, const String &snapshot_name) { + + String snapshot_dir = query_context->global_config()->SnapshotDir(); + bool found = false; + for (const auto &entry : std::filesystem::directory_iterator(snapshot_dir)) { + if (entry.is_directory()) { + // Don't search the directory recursively + } else { + // Just the file base name + if (entry.path().stem() == snapshot_name) { + String extension = entry.path().extension(); + if (extension == ".json" or extension == ".lz4") { + VirtualStore::DeleteFile(entry.path().string()); + found = true; + } + } else { + String filename = entry.path().filename(); + LOG_WARN(fmt::format("Invalid snapshot file name: {}", filename)); + } + } + } + + if (!found) { + return Status::NotFound(fmt::format("Snapshot: {} not found", snapshot_name)); + } + + return Status::OK(); +} + +} // namespace infinity diff --git a/src/executor/operator/snapshot/snapshot_brief.cpp b/src/executor/operator/snapshot/snapshot_brief.cpp new file mode 100644 index 0000000000..229f3a9018 --- /dev/null +++ b/src/executor/operator/snapshot/snapshot_brief.cpp @@ -0,0 +1,95 @@ +// Copyright(C) 2024 InfiniFlow, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module; + +#include +#include +#include +#include + +module snapshot_brief; + +import stl; +import status; +import virtual_store; +import local_file_handle; +import infinity_exception; +import third_party; +import logger; + +namespace infinity { + +Vector find_files_with_suffix(const String &path, const String &suffix) { + Vector files; + for (const auto &entry : std::filesystem::directory_iterator(path)) { + if (entry.is_directory()) { + // Don't search the directory recursively + } else { + if (entry.path().extension() == suffix) { + files.emplace_back(entry.path().string()); + } + } + } + return files; +} + +Vector SnapshotBrief::GetSnapshots(const String &dir) { + Vector briefs; + Vector snapshot_meta_array = find_files_with_suffix(dir, ".json"); + for (const String &snapshot_path : snapshot_meta_array) { + try { + auto [snapshot_file_handle, status] = VirtualStore::Open(snapshot_path, FileAccessMode::kRead); + if (!status.ok()) { + UnrecoverableError(status.message()); + } + + i64 file_size = snapshot_file_handle->FileSize(); + String json_str(file_size, 0); + auto [n_bytes, status_read] = snapshot_file_handle->Read(json_str.data(), file_size); + if (!status_read.ok()) { + UnrecoverableError(status_read.message()); + } + if ((SizeT)file_size != n_bytes) { + UnrecoverableError(status_read.message()); + } + + nlohmann::json snapshot_json = nlohmann::json::parse(json_str); + SnapshotBrief snapshot_brief; + snapshot_brief.snapshot_name_ = snapshot_json["snapshot_name"]; + snapshot_brief.scope_ = snapshot_json["snapshot_scope"]; + + snapshot_brief.commit_ts_ = snapshot_json["commit_ts"]; + + std::filesystem::path compressed_file(snapshot_path); + compressed_file.replace_extension("lz4"); + snapshot_brief.size_ = VirtualStore::GetFileSize(compressed_file.string()); + + + struct stat statbuf; + stat(snapshot_path.c_str(), &statbuf); + std::time_t creationTime = statbuf.st_ctime; + std::tm *ptm = std::localtime(&creationTime); + char time_buffer[80]; + std::strftime(time_buffer, sizeof(time_buffer), "%Y-%m-%d %H:%M:%S", ptm); + snapshot_brief.create_time_ = time_buffer; + briefs.emplace_back(snapshot_brief); + } catch (const std::exception &e) { + LOG_WARN(fmt::format("Fail to parse file: {}", snapshot_path)); + } + } + return briefs; +} + +} // namespace infinity diff --git a/src/executor/operator/snapshot/snapshot_brief.cppm b/src/executor/operator/snapshot/snapshot_brief.cppm index df3fc4571b..2b9d1af742 100644 --- a/src/executor/operator/snapshot/snapshot_brief.cppm +++ b/src/executor/operator/snapshot/snapshot_brief.cppm @@ -18,15 +18,18 @@ export module snapshot_brief; import stl; import command_statement; +import status; namespace infinity { export struct SnapshotBrief { String snapshot_name_; // snapshot_name_ - SnapshotScope scope_; // system / db / table snapshot - u64 create_time_; // when create the snapshot + SnapshotScope scope_{SnapshotScope::kInvalid}; // system / db / table snapshot + String create_time_; // when create the snapshot u64 commit_ts_; // txn ts the snapshot created. u64 size_; // total snapshot size + + static Vector GetSnapshots(const String& dir); }; } // namespace infinity diff --git a/src/executor/operator/snapshot/table_snapshot.cpp b/src/executor/operator/snapshot/table_snapshot.cpp index f3a91e96da..26589ad41b 100644 --- a/src/executor/operator/snapshot/table_snapshot.cpp +++ b/src/executor/operator/snapshot/table_snapshot.cpp @@ -35,7 +35,7 @@ Status Snapshot::CreateTableSnapshot(QueryContext *query_context, const String & if (!table_status.ok()) { return table_status; } - SharedPtr table_snapshot = table_entry_ptr->GetSnapshotInfo(); + SharedPtr table_snapshot = table_entry_ptr->GetSnapshotInfo(txn_ptr); table_snapshot->snapshot_name_ = snapshot_name; String snapshot_dir = query_context->global_config()->SnapshotDir(); table_snapshot->Serialize(snapshot_dir); @@ -44,6 +44,5 @@ Status Snapshot::CreateTableSnapshot(QueryContext *query_context, const String & } Status Snapshot::RestoreTableSnapshot() { return Status::OK(); } -Status Snapshot::DropSnapshot(QueryContext *query_context, const String &snapshot_name) { return Status::OK(); } } // namespace infinity \ No newline at end of file diff --git a/src/storage/common/snapshot_info.cppm b/src/storage/common/snapshot_info.cppm index 396d0c3a8b..d55b5eb1ba 100644 --- a/src/storage/common/snapshot_info.cppm +++ b/src/storage/common/snapshot_info.cppm @@ -88,8 +88,9 @@ export struct TableSnapshotInfo : public SnapshotInfo { ColumnID next_column_id_{}; SegmentID next_segment_id_{}; Vector> columns_{}; - Map> segment_snapshots_{}; + Map> table_index_snapshots_{}; + Vector GetFiles() const; void Serialize(const String& save_path); }; diff --git a/src/storage/meta/catalog.cpp b/src/storage/meta/catalog.cpp index 3fc1d2f62b..d04784e004 100644 --- a/src/storage/meta/catalog.cpp +++ b/src/storage/meta/catalog.cpp @@ -309,14 +309,16 @@ Tuple Catalog::GetTableByName(const String &db_name, const return db_entry->GetTableCollection(table_name, txn_id, begin_ts); } -Tuple, Status> Catalog::GetTableSnapshot(const String &db_name, const String &table_name, TransactionID txn_id, TxnTimeStamp begin_ts) { +Tuple, Status> Catalog::GetTableSnapshot(const String &db_name, const String &table_name, Txn *txn_ptr) { + TransactionID txn_id = txn_ptr->TxnID(); + TxnTimeStamp begin_ts = txn_ptr->BeginTS(); auto [table_entry, table_status] = this->GetTableByName(db_name, table_name, txn_id, begin_ts); if (!table_status.ok()) { // Error LOG_ERROR(fmt::format("Fail to get table {} from database: {}, error message: {}.", table_name, db_name, table_status.message())); return {nullptr, table_status}; } - return table_entry->GetSnapshotInfo(begin_ts); + return {table_entry->GetSnapshotInfo(txn_ptr), Status::OK()}; } Tuple, Status> Catalog::GetTableInfo(const String &db_name, const String &table_name, Txn *txn) { diff --git a/src/storage/meta/catalog.cppm b/src/storage/meta/catalog.cppm index 85ce490e8c..c70b460de0 100644 --- a/src/storage/meta/catalog.cppm +++ b/src/storage/meta/catalog.cppm @@ -152,7 +152,7 @@ public: Tuple GetTableByName(const String &db_name, const String &table_name, TransactionID txn_id, TxnTimeStamp begin_ts); - Tuple, Status> GetTableSnapshot(const String &db_name, const String &table_name, TransactionID txn_id, TxnTimeStamp begin_ts); + Tuple, Status> GetTableSnapshot(const String &db_name, const String &table_name, Txn* txn_ptr); Tuple, Status> GetTableInfo(const String &db_name, const String &table_name, Txn *txn); diff --git a/src/storage/meta/entry/table_entry.cpp b/src/storage/meta/entry/table_entry.cpp index 10709dca5e..de2db6072d 100644 --- a/src/storage/meta/entry/table_entry.cpp +++ b/src/storage/meta/entry/table_entry.cpp @@ -265,8 +265,6 @@ Tuple, Status> TableEntry::GetTableIndexInfo(const Str return index_meta->GetTableIndexInfo(std::move(r_lock), txn_id, begin_ts); } -Tuple, Status> TableEntry::GetSnapshotInfo(TxnTimeStamp begin_ts) { return {nullptr, Status::OK()}; } - void TableEntry::RemoveIndexEntry(const String &index_name, TransactionID txn_id) { auto [index_meta, status] = index_meta_map_.GetExistMetaNoLock(index_name, ConflictType::kError); if (!status.ok()) { @@ -1654,7 +1652,7 @@ void TableEntry::DropColumns(const Vector &column_names, TxnTableStore * } } -SharedPtr TableEntry::GetSnapshotInfo() const { +SharedPtr TableEntry::GetSnapshotInfo(Txn* txn_ptr) const { SharedPtr table_snapshot_info = MakeShared(); table_snapshot_info->db_name_ = *GetDBName(); table_snapshot_info->table_name_ = *table_name_; diff --git a/src/storage/meta/entry/table_entry.cppm b/src/storage/meta/entry/table_entry.cppm index 5c80d1a2a1..643572f443 100644 --- a/src/storage/meta/entry/table_entry.cppm +++ b/src/storage/meta/entry/table_entry.cppm @@ -126,8 +126,6 @@ public: Tuple, Status> GetTableIndexInfo(const String &index_name, TransactionID txn_id, TxnTimeStamp begin_ts); - Tuple, Status> GetSnapshotInfo(TxnTimeStamp begin_ts); - void RemoveIndexEntry(const String &index_name, TransactionID txn_id); MetaMap::MapGuard IndexMetaMap() const { return index_meta_map_.GetMetaMap(); } @@ -401,7 +399,7 @@ public: void DropColumns(const Vector &column_names, TxnTableStore *txn_store); - SharedPtr GetSnapshotInfo() const; + SharedPtr GetSnapshotInfo(Txn* txn_ptr) const; }; } // namespace infinity diff --git a/src/storage/txn/txn.cpp b/src/storage/txn/txn.cpp index df5e6df6b8..0a51854d89 100644 --- a/src/storage/txn/txn.cpp +++ b/src/storage/txn/txn.cpp @@ -488,8 +488,7 @@ Tuple, Status> Txn::GetTableInfo(const String &db_name, con Tuple, Status> Txn::GetTableSnapshot(const String &db_name, const String &table_name) { this->CheckTxn(db_name); - TxnTimeStamp begin_ts = this->BeginTS(); - return catalog_->GetTableSnapshot(db_name, table_name, TxnID(), begin_ts); + return catalog_->GetTableSnapshot(db_name, table_name, this); } Status Txn::CreateCollection(const String &, const String &, ConflictType, BaseEntry *&) {