From 1094cfff5c2acb550eb131fd0a206f2eec9fcba5 Mon Sep 17 00:00:00 2001 From: Jin Hai Date: Mon, 30 Dec 2024 09:43:25 +0800 Subject: [PATCH] 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);