diff --git a/presto-native-execution/CMakeLists.txt b/presto-native-execution/CMakeLists.txt index 5bbaf4acf15c6..b49c12a6edf4a 100644 --- a/presto-native-execution/CMakeLists.txt +++ b/presto-native-execution/CMakeLists.txt @@ -123,13 +123,6 @@ include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) find_package(gflags COMPONENTS shared) -find_library(ANTLR4_RUNTIME antlr4-runtime) -find_path( - ANTLR4_RUNTIME_INCLUDE_DIR - NAMES antlr4-runtime.h - PATH_SUFFIXES antlr4-runtime) -include_directories(SYSTEM ${ANTLR4_RUNTIME_INCLUDE_DIR}) - find_library(GLOG glog) find_library(FMT fmt) diff --git a/presto-native-execution/presto_cpp/main/CMakeLists.txt b/presto-native-execution/presto_cpp/main/CMakeLists.txt index 52df8b689ffbc..0a19fc67e0510 100644 --- a/presto-native-execution/presto_cpp/main/CMakeLists.txt +++ b/presto-native-execution/presto_cpp/main/CMakeLists.txt @@ -58,6 +58,7 @@ target_link_libraries( velox_presto_serializer velox_serialization velox_time + velox_type_parser velox_type velox_type_fbhive velox_type_tz @@ -65,7 +66,6 @@ target_link_libraries( velox_window ${RE2} ${FOLLY_WITH_DEPENDENCIES} - ${ANTLR4_RUNTIME} ${GLOG} ${GFLAGS_LIBRARIES} pthread) diff --git a/presto-native-execution/presto_cpp/main/operators/tests/CMakeLists.txt b/presto-native-execution/presto_cpp/main/operators/tests/CMakeLists.txt index 0145cce16c300..4612a95fef36a 100644 --- a/presto-native-execution/presto_cpp/main/operators/tests/CMakeLists.txt +++ b/presto-native-execution/presto_cpp/main/operators/tests/CMakeLists.txt @@ -36,7 +36,6 @@ target_link_libraries( velox_exec gmock gtest - ${ANTLR4_RUNTIME} gtest_main) set_property(TARGET presto_operators_test PROPERTY JOB_POOL_LINK diff --git a/presto-native-execution/presto_cpp/main/tests/CMakeLists.txt b/presto-native-execution/presto_cpp/main/tests/CMakeLists.txt index 7e8eec63c0bcc..af343bd20d845 100644 --- a/presto-native-execution/presto_cpp/main/tests/CMakeLists.txt +++ b/presto-native-execution/presto_cpp/main/tests/CMakeLists.txt @@ -77,13 +77,8 @@ add_test( WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries( - presto_query_runner_test - presto_http - velox_presto_serializer - presto_type_converter - ${ANTLR4_RUNTIME} - velox_dwio_dwrf_writer - velox_exec_test_lib) + presto_query_runner_test presto_http velox_presto_serializer + presto_type_converter velox_dwio_dwrf_writer velox_exec_test_lib) set_property(TARGET presto_query_runner_test PROPERTY JOB_POOL_LINK presto_link_job_pool) diff --git a/presto-native-execution/presto_cpp/main/tests/PrestoQueryRunner.cpp b/presto-native-execution/presto_cpp/main/tests/PrestoQueryRunner.cpp index 3ac0b05278a6b..1398fc5ee5bce 100644 --- a/presto-native-execution/presto_cpp/main/tests/PrestoQueryRunner.cpp +++ b/presto-native-execution/presto_cpp/main/tests/PrestoQueryRunner.cpp @@ -22,11 +22,7 @@ #include "velox/exec/tests/utils/QueryAssertions.h" #include "velox/serializers/PrestoSerializer.h" -// ANTLR defines an INVALID_INDEX macro, and DuckDB has a constant variable of -// the same name. So we have to include TypeParser.h after Velox. -// clang-format off #include "presto_cpp/main/types/TypeParser.h" -// clang-format on using namespace facebook::velox; diff --git a/presto-native-execution/presto_cpp/main/types/.gitattributes b/presto-native-execution/presto_cpp/main/types/.gitattributes deleted file mode 100644 index a31fc157169c0..0000000000000 --- a/presto-native-execution/presto_cpp/main/types/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -antlr/* -merge -antlr/* linguist-generated=true diff --git a/presto-native-execution/presto_cpp/main/types/CMakeLists.txt b/presto-native-execution/presto_cpp/main/types/CMakeLists.txt index 9f3f14e3bf592..17cd249648a0f 100644 --- a/presto-native-execution/presto_cpp/main/types/CMakeLists.txt +++ b/presto-native-execution/presto_cpp/main/types/CMakeLists.txt @@ -9,11 +9,10 @@ # 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. -add_library( - presto_type_converter OBJECT TypeParser.cpp antlr/TypeSignatureLexer.cpp - antlr/TypeSignatureParser.cpp) -target_link_libraries(presto_type_converter velox_type) +add_library(presto_type_converter OBJECT TypeParser.cpp) + +target_link_libraries(presto_type_converter velox_type_parser) add_library(presto_types OBJECT PrestoToVeloxQueryPlan.cpp PrestoToVeloxExpr.cpp PrestoToVeloxSplit.cpp) diff --git a/presto-native-execution/presto_cpp/main/types/Makefile b/presto-native-execution/presto_cpp/main/types/Makefile deleted file mode 100644 index 835d8a9747f57..0000000000000 --- a/presto-native-execution/presto_cpp/main/types/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -# 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 -# -# http://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. -.PHONY: TypeSignature parser format-fix header-fix - -TypeSignature: parser format-fix header-fix - -parser: - antlr -Dlanguage=Cpp -package facebook::presto::type -visitor -no-listener -o antlr TypeSignature.g4 - rm -rf .antlr - find antlr | ../../../velox/scripts/license-header.py --header ../../../license.header -i - - find antlr | ../../../velox/scripts/license-header.py --header ../../../license.header -vk - - -format-fix: - ../../../velox/scripts/check.py format tree antlr --fix - ../../../velox/scripts/check.py format tree antlr - -header-fix: - ../../../velox/scripts/check.py format tree antlr --fix - ../../../velox/scripts/check.py format tree antlr diff --git a/presto-native-execution/presto_cpp/main/types/ParseTypeSignature.h b/presto-native-execution/presto_cpp/main/types/ParseTypeSignature.h deleted file mode 100644 index 97e43f8552924..0000000000000 --- a/presto-native-execution/presto_cpp/main/types/ParseTypeSignature.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 - * - * http://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. - */ -#pragma once -#include "velox/type/Type.h" - -namespace facebook::presto { -facebook::velox::TypePtr parseTypeSignature(const std::string& signature); -} // namespace facebook::presto diff --git a/presto-native-execution/presto_cpp/main/types/PrestoToVeloxExpr.h b/presto-native-execution/presto_cpp/main/types/PrestoToVeloxExpr.h index 719514c0c6744..6e93c675a55f5 100644 --- a/presto-native-execution/presto_cpp/main/types/PrestoToVeloxExpr.h +++ b/presto-native-execution/presto_cpp/main/types/PrestoToVeloxExpr.h @@ -14,12 +14,8 @@ #pragma once #include -// antlr-common.h undefines the EOF macro that external/json/nlohmann/json.hpp -// relies on, so include presto_protcol.h before TypeParser.h -// clang-format off -#include "presto_cpp/presto_protocol/presto_protocol.h" #include "presto_cpp/main/types/TypeParser.h" -// clang-format on +#include "presto_cpp/presto_protocol/presto_protocol.h" #include "velox/core/Expressions.h" namespace facebook::presto { diff --git a/presto-native-execution/presto_cpp/main/types/PrestoToVeloxQueryPlan.cpp b/presto-native-execution/presto_cpp/main/types/PrestoToVeloxQueryPlan.cpp index 53a2fbc1760a1..9371f9fa6d9d7 100644 --- a/presto-native-execution/presto_cpp/main/types/PrestoToVeloxQueryPlan.cpp +++ b/presto-native-execution/presto_cpp/main/types/PrestoToVeloxQueryPlan.cpp @@ -27,17 +27,19 @@ #include "velox/expression/Expr.h" #include "velox/vector/ComplexVector.h" #include "velox/vector/FlatVector.h" -#include "presto_cpp/main/operators/BroadcastWrite.h" -#include "presto_cpp/main/operators/PartitionAndSerialize.h" -#include "presto_cpp/main/operators/ShuffleWrite.h" -#include "presto_cpp/main/operators/ShuffleRead.h" -#include +#include "velox/core/Expressions.h" #include "velox/common/compression/Compression.h" // clang-format on #include #include +#include "presto_cpp/main/operators/BroadcastWrite.h" +#include "presto_cpp/main/operators/PartitionAndSerialize.h" +#include "presto_cpp/main/operators/ShuffleRead.h" +#include "presto_cpp/main/operators/ShuffleWrite.h" +#include "presto_cpp/main/types/TypeParser.h" + using namespace facebook::velox; using namespace facebook::velox::exec; using namespace facebook::velox::connector::hive; diff --git a/presto-native-execution/presto_cpp/main/types/PrestoToVeloxQueryPlan.h b/presto-native-execution/presto_cpp/main/types/PrestoToVeloxQueryPlan.h index daa46b70ebdc2..f570201a5c810 100644 --- a/presto-native-execution/presto_cpp/main/types/PrestoToVeloxQueryPlan.h +++ b/presto-native-execution/presto_cpp/main/types/PrestoToVeloxQueryPlan.h @@ -23,12 +23,8 @@ #include "presto_cpp/main/types/PrestoTaskId.h" #include "presto_cpp/main/types/PrestoToVeloxExpr.h" -// antlr-common.h undefines the EOF macro that external/json/nlohmann/json.hpp -// relies on, so include presto_protcol.h before TypeParser.h -// clang-format off -#include "presto_cpp/presto_protocol/presto_protocol.h" #include "presto_cpp/main/types/TypeParser.h" -// clang-format on +#include "presto_cpp/presto_protocol/presto_protocol.h" namespace facebook::presto { diff --git a/presto-native-execution/presto_cpp/main/types/README.md b/presto-native-execution/presto_cpp/main/types/README.md deleted file mode 100644 index 32d7ae5b4b705..0000000000000 --- a/presto-native-execution/presto_cpp/main/types/README.md +++ /dev/null @@ -1,31 +0,0 @@ -presto_cpp uses antlr4 to parse types. -Details on how to create a lexer and parser using antlr4 are available here: -https://github.com/antlr/antlr4/blob/master/doc/cpp-target.md - -**TypeSignature.g4** file specifies the grammar. Any new rules must be added to this file. -presto_cpp requires the antlr4 **visitor** and does not need the antlr4 **listener**. - -To generate antlr files: - -+ Download https://repo1.maven.org/maven2/org/antlr/antlr4/4.9.3/antlr4-4.9.3-complete.jar -+ Run - - java -jar /antlr4-4.9.3-complete.jar -Dlanguage=Cpp -package facebook::presto::type -visitor -no-listener -o antlr TypeSignature.g4 - -The following files are generated inside the antlr directory: -+ TypeSignature.interp -+ TypeSignature.tokens -+ TypeSignatureBaseVisitor.cpp -+ TypeSignatureBaseVisitor.h -+ TypeSignatureLexer.cpp -+ TypeSignatureLexer.h -+ TypeSignatureLexer.interp -+ TypeSignatureLexer.tokens -+ TypeSignatureParser.cpp -+ TypeSignatureParser.h -+ TypeSignatureVisitor.cpp -+ TypeSignatureVisitor.h - -The generated .cpp and .h files need to be modified as described below: - 1) Invoke 'make header-fix' to include the copyright header in the generated files. - 2) Encapsulate code in the namespace facebook::presto::type. diff --git a/presto-native-execution/presto_cpp/main/types/TypeParser.cpp b/presto-native-execution/presto_cpp/main/types/TypeParser.cpp index 8a9b6a5f04438..47e8ce3592255 100644 --- a/presto-native-execution/presto_cpp/main/types/TypeParser.cpp +++ b/presto-native-execution/presto_cpp/main/types/TypeParser.cpp @@ -14,227 +14,19 @@ #include #include -#include #include "presto_cpp/main/types/TypeParser.h" -#include "presto_cpp/main/types/antlr/TypeSignatureLexer.h" -#include "velox/functions/prestosql/types/HyperLogLogType.h" -#include "velox/functions/prestosql/types/JsonType.h" -#include "velox/functions/prestosql/types/TimestampWithTimeZoneType.h" - -using namespace facebook::velox; +#include "velox/type/parser/TypeParser.h" namespace facebook::presto { -namespace { -class TypeSignatureTypeConverter : public type::TypeSignatureBaseVisitor { - public: - virtual antlrcpp::Any visitStart( - type::TypeSignatureParser::StartContext* ctx) override; - virtual antlrcpp::Any visitNamed_type( - type::TypeSignatureParser::Named_typeContext* ctx) override; - virtual antlrcpp::Any visitType_spec( - type::TypeSignatureParser::Type_specContext* ctx) override; - virtual antlrcpp::Any visitType( - type::TypeSignatureParser::TypeContext* ctx) override; - virtual antlrcpp::Any visitSimple_type( - type::TypeSignatureParser::Simple_typeContext* ctx) override; - virtual antlrcpp::Any visitDecimal_type( - type::TypeSignatureParser::Decimal_typeContext* ctx) override; - virtual antlrcpp::Any visitVariable_type( - type::TypeSignatureParser::Variable_typeContext* ctx) override; - virtual antlrcpp::Any visitType_list( - type::TypeSignatureParser::Type_listContext* ctx) override; - virtual antlrcpp::Any visitRow_type( - type::TypeSignatureParser::Row_typeContext* ctx) override; - virtual antlrcpp::Any visitMap_type( - type::TypeSignatureParser::Map_typeContext* ctx) override; - virtual antlrcpp::Any visitArray_type( - type::TypeSignatureParser::Array_typeContext* ctx) override; - virtual antlrcpp::Any visitFunction_type( - type::TypeSignatureParser::Function_typeContext* ctx) override; - virtual antlrcpp::Any visitIdentifier( - type::TypeSignatureParser::IdentifierContext* ctx) override; -}; - -TypePtr typeFromString(const std::string& typeName) { - auto upper = boost::to_upper_copy(typeName); - - if (upper == "UNKNOWN") { - return UNKNOWN(); - } - - if (upper == TIMESTAMP_WITH_TIME_ZONE()->toString()) { - return TIMESTAMP_WITH_TIME_ZONE(); - } - - if (upper == HYPERLOGLOG()->toString()) { - return HYPERLOGLOG(); - } - - if (upper == JSON()->toString()) { - return JSON(); - } - - if (upper == "INT") { - upper = "INTEGER"; - } else if (upper == "DOUBLE PRECISION") { - upper = "DOUBLE"; - } - - if (upper == INTERVAL_DAY_TIME()->toString()) { - return INTERVAL_DAY_TIME(); - } - - if (upper == INTERVAL_YEAR_MONTH()->toString()) { - return INTERVAL_YEAR_MONTH(); - } - - if (upper == DATE()->toString()) { - return DATE(); - } - - return createScalarType(mapNameToTypeKind(upper)); -} - -struct NamedType { - std::string name; - velox::TypePtr type; -}; - -antlrcpp::Any TypeSignatureTypeConverter::visitStart( - type::TypeSignatureParser::StartContext* ctx) { - NamedType named = visit(ctx->type_spec()).as(); - return named.type; -} - -antlrcpp::Any TypeSignatureTypeConverter::visitType_spec( - type::TypeSignatureParser::Type_specContext* ctx) { - if (ctx->named_type()) { - return visit(ctx->named_type()); - } else { - return NamedType{"", visit(ctx->type()).as()}; - } -} - -antlrcpp::Any TypeSignatureTypeConverter::visitNamed_type( - type::TypeSignatureParser::Named_typeContext* ctx) { - return NamedType{ - visit(ctx->identifier()).as(), - visit(ctx->type()).as()}; -} - -antlrcpp::Any TypeSignatureTypeConverter::visitType( - type::TypeSignatureParser::TypeContext* ctx) { - return visitChildren(ctx); -} - -antlrcpp::Any TypeSignatureTypeConverter::visitSimple_type( - type::TypeSignatureParser::Simple_typeContext* ctx) { - return ctx->WORD() ? typeFromString(ctx->WORD()->getText()) - : typeFromString(ctx->TYPE_WITH_SPACES()->getText()); -} - -antlrcpp::Any TypeSignatureTypeConverter::visitDecimal_type( - type::TypeSignatureParser::Decimal_typeContext* ctx) { - VELOX_USER_CHECK_EQ(2, ctx->NUMBER().size(), "Invalid decimal type"); - - const auto precision = ctx->NUMBER(0)->getText(); - const auto scale = ctx->NUMBER(1)->getText(); - return DECIMAL(std::atoi(precision.c_str()), std::atoi(scale.c_str())); -} - -antlrcpp::Any TypeSignatureTypeConverter::visitVariable_type( - type::TypeSignatureParser::Variable_typeContext* ctx) { - return typeFromString(ctx->WORD()->getText()); -} - -antlrcpp::Any TypeSignatureTypeConverter::visitType_list( - type::TypeSignatureParser::Type_listContext* ctx) { - std::vector types; - for (auto type_spec : ctx->type_spec()) { - types.emplace_back(visit(type_spec).as()); - } - return types; -} - -antlrcpp::Any TypeSignatureTypeConverter::visitRow_type( - type::TypeSignatureParser::Row_typeContext* ctx) { - const auto namedTypes = visit(ctx->type_list()).as>(); - - std::vector names; - std::vector types; - names.reserve(namedTypes.size()); - types.reserve(namedTypes.size()); - for (const auto& namedType : namedTypes) { - names.push_back(namedType.name); - types.push_back(namedType.type); - } - - const TypePtr rowType = ROW(std::move(names), std::move(types)); - return rowType; -} - -antlrcpp::Any TypeSignatureTypeConverter::visitMap_type( - type::TypeSignatureParser::Map_typeContext* ctx) { - const auto keyType = visit(ctx->type()[0]).as(); - const auto valueType = visit(ctx->type()[1]).as(); - const TypePtr mapType = MAP(keyType, valueType); - return mapType; -} -antlrcpp::Any TypeSignatureTypeConverter::visitArray_type( - type::TypeSignatureParser::Array_typeContext* ctx) { - const TypePtr arrayType = ARRAY(visit(ctx->type()).as()); - return arrayType; -} - -antlrcpp::Any TypeSignatureTypeConverter::visitFunction_type( - type::TypeSignatureParser::Function_typeContext* ctx) { - const auto numArgs = ctx->type().size() - 1; - - std::vector argumentTypes; - argumentTypes.reserve(numArgs); - for (auto i = 0; i < numArgs; ++i) { - argumentTypes.push_back(visit(ctx->type()[i]).as()); - } - - auto returnType = visit(ctx->type().back()).as(); - - TypePtr functionType = FUNCTION(std::move(argumentTypes), returnType); - return functionType; -} - -antlrcpp::Any TypeSignatureTypeConverter::visitIdentifier( - type::TypeSignatureParser::IdentifierContext* ctx) { - if (ctx->WORD()) { - return ctx->WORD()->getText(); - } else { - return ctx->QUOTED_ID()->getText().substr( - 1, ctx->QUOTED_ID()->getText().length() - 2); - } -} -} - -TypePtr TypeParser::parse(const std::string& text) const { +velox::TypePtr TypeParser::parse(const std::string& text) const { auto it = cache_.find(text); if (it != cache_.end()) { return it->second; } - antlr4::ANTLRInputStream input(text); - type::TypeSignatureLexer lexer(&input); - antlr4::CommonTokenStream tokens(&lexer); - type::TypeSignatureParser parser(&tokens); - - parser.setErrorHandler(std::make_shared()); - - try { - auto ctx = parser.start(); - TypeSignatureTypeConverter c; - auto result = c.visit(ctx).as(); - cache_.insert({text, result}); - return result; - } catch (const std::exception& e) { - VELOX_USER_FAIL("Failed to parse type [{}]: {}", text, e.what()); - } + auto result = velox::parseType(text); + cache_.insert({text, result}); + return result; } } // namespace facebook::presto diff --git a/presto-native-execution/presto_cpp/main/types/TypeParser.h b/presto-native-execution/presto_cpp/main/types/TypeParser.h index c9c4d0ecacc55..0328f69d3665a 100644 --- a/presto-native-execution/presto_cpp/main/types/TypeParser.h +++ b/presto-native-execution/presto_cpp/main/types/TypeParser.h @@ -16,8 +16,6 @@ #include "velox/type/Type.h" -#include "presto_cpp/main/types/antlr/TypeSignatureBaseVisitor.h" - namespace facebook::presto { class TypeParser { diff --git a/presto-native-execution/presto_cpp/main/types/TypeSignature.g4 b/presto-native-execution/presto_cpp/main/types/TypeSignature.g4 deleted file mode 100644 index 19f9a7babe180..0000000000000 --- a/presto-native-execution/presto_cpp/main/types/TypeSignature.g4 +++ /dev/null @@ -1,113 +0,0 @@ -grammar TypeSignature; - -@parser::header { - #include - #include "presto_cpp/main/types/TypeSignatureTypeConverter.h" -} - -@parser::declarations { - #define Token() (getCurrentToken()->getText()) - #define UpCase(str) (boost::to_upper_copy(str)) - #define isRowToken() (UpCase(Token()) == "ROW") - #define isMapToken() (UpCase(Token()) == "MAP") - #define isArrayToken() (UpCase(Token()) == "ARRAY") - #define isVarToken() (UpCase(Token()) == "VARCHAR" || UpCase(Token()) == "VARBINARY") - #define isDecimalToken() (UpCase(Token()) == "DECIMAL") - #define isFunctionToken() (UpCase(Token()) == "FUNCTION") -} - -start : type_spec EOF ; - -type_spec : - named_type - | type - ; - -named_type : - identifier type - ; - -type : - simple_type - | decimal_type - | variable_type - | array_type - | map_type - | row_type - | function_type - ; - -simple_type : - WORD - | TYPE_WITH_SPACES; - -variable_type : - { isVarToken() }? WORD - | { isVarToken() }? WORD '(' NUMBER* ')' - ; - -decimal_type : - { isDecimalToken() }? WORD '(' NUMBER* ',' NUMBER* ')' - ; - -type_list : - type_spec (',' type_spec)* - ; - -row_type : - { isRowToken() }? WORD '(' type_list ')' ; - -map_type : - { isMapToken() }? WORD '(' type ',' type ')' ; - -array_type : - { isArrayToken() }? WORD '(' type ')' ; - -function_type : - { isFunctionToken() }? WORD '(' type (',' type)* ')' ; - -identifier : - QUOTED_ID - | WORD - ; - -TYPE_WITH_SPACES: - D O U B L E ' ' P R E C I S I O N - | T I M E ' ' W I T H ' ' T I M E ' ' Z O N E - | T I M E S T A M P ' ' W I T H ' ' T I M E ' ' Z O N E - | I N T E R V A L ' ' Y E A R ' ' T O ' ' M O N T H - | I N T E R V A L ' ' D A Y ' ' T O ' ' S E C O N D - ; - -WORD: [A-Za-z_] [A-Za-z0-9_:@]* ; -QUOTED_ID: '"' [A-Za-z0-9_] [ A-Za-z0-9_:@]* '"' ; -NUMBER: [0-9]+ ; - -fragment A:('a'|'A'); -fragment B:('b'|'B'); -fragment C:('c'|'C'); -fragment D:('d'|'D'); -fragment E:('e'|'E'); -fragment F:('f'|'F'); -fragment G:('g'|'G'); -fragment H:('h'|'H'); -fragment I:('i'|'I'); -fragment J:('j'|'J'); -fragment K:('k'|'K'); -fragment L:('l'|'L'); -fragment M:('m'|'M'); -fragment N:('n'|'N'); -fragment O:('o'|'O'); -fragment P:('p'|'P'); -fragment Q:('q'|'Q'); -fragment R:('r'|'R'); -fragment S:('s'|'S'); -fragment T:('t'|'T'); -fragment U:('u'|'U'); -fragment V:('v'|'V'); -fragment W:('w'|'W'); -fragment X:('x'|'X'); -fragment Y:('y'|'Y'); -fragment Z:('z'|'Z'); - -WHITESPACE : [ \t\n] -> skip ; diff --git a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignature.interp b/presto-native-execution/presto_cpp/main/types/antlr/TypeSignature.interp deleted file mode 100644 index b5e6303c1de6a..0000000000000 --- a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignature.interp +++ /dev/null @@ -1,40 +0,0 @@ -token literal names: -null -'(' -')' -',' -null -null -null -null -null - -token symbolic names: -null -null -null -null -TYPE_WITH_SPACES -WORD -QUOTED_ID -NUMBER -WHITESPACE - -rule names: -start -type_spec -named_type -type -simple_type -variable_type -decimal_type -type_list -row_type -map_type -array_type -function_type -identifier - - -atn: -[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 10, 125, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 5, 3, 34, 10, 3, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 46, 10, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 7, 7, 56, 10, 7, 12, 7, 14, 7, 59, 11, 7, 3, 7, 5, 7, 62, 10, 7, 3, 8, 3, 8, 3, 8, 3, 8, 7, 8, 68, 10, 8, 12, 8, 14, 8, 71, 11, 8, 3, 8, 3, 8, 7, 8, 75, 10, 8, 12, 8, 14, 8, 78, 11, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 7, 9, 85, 10, 9, 12, 9, 14, 9, 88, 11, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 7, 13, 116, 10, 13, 12, 13, 14, 13, 119, 11, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 2, 2, 15, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 2, 4, 3, 2, 6, 7, 3, 2, 7, 8, 2, 124, 2, 28, 3, 2, 2, 2, 4, 33, 3, 2, 2, 2, 6, 35, 3, 2, 2, 2, 8, 45, 3, 2, 2, 2, 10, 47, 3, 2, 2, 2, 12, 61, 3, 2, 2, 2, 14, 63, 3, 2, 2, 2, 16, 81, 3, 2, 2, 2, 18, 89, 3, 2, 2, 2, 20, 95, 3, 2, 2, 2, 22, 103, 3, 2, 2, 2, 24, 109, 3, 2, 2, 2, 26, 122, 3, 2, 2, 2, 28, 29, 5, 4, 3, 2, 29, 30, 7, 2, 2, 3, 30, 3, 3, 2, 2, 2, 31, 34, 5, 6, 4, 2, 32, 34, 5, 8, 5, 2, 33, 31, 3, 2, 2, 2, 33, 32, 3, 2, 2, 2, 34, 5, 3, 2, 2, 2, 35, 36, 5, 26, 14, 2, 36, 37, 5, 8, 5, 2, 37, 7, 3, 2, 2, 2, 38, 46, 5, 10, 6, 2, 39, 46, 5, 14, 8, 2, 40, 46, 5, 12, 7, 2, 41, 46, 5, 22, 12, 2, 42, 46, 5, 20, 11, 2, 43, 46, 5, 18, 10, 2, 44, 46, 5, 24, 13, 2, 45, 38, 3, 2, 2, 2, 45, 39, 3, 2, 2, 2, 45, 40, 3, 2, 2, 2, 45, 41, 3, 2, 2, 2, 45, 42, 3, 2, 2, 2, 45, 43, 3, 2, 2, 2, 45, 44, 3, 2, 2, 2, 46, 9, 3, 2, 2, 2, 47, 48, 9, 2, 2, 2, 48, 11, 3, 2, 2, 2, 49, 50, 6, 7, 2, 2, 50, 62, 7, 7, 2, 2, 51, 52, 6, 7, 3, 2, 52, 53, 7, 7, 2, 2, 53, 57, 7, 3, 2, 2, 54, 56, 7, 9, 2, 2, 55, 54, 3, 2, 2, 2, 56, 59, 3, 2, 2, 2, 57, 55, 3, 2, 2, 2, 57, 58, 3, 2, 2, 2, 58, 60, 3, 2, 2, 2, 59, 57, 3, 2, 2, 2, 60, 62, 7, 4, 2, 2, 61, 49, 3, 2, 2, 2, 61, 51, 3, 2, 2, 2, 62, 13, 3, 2, 2, 2, 63, 64, 6, 8, 4, 2, 64, 65, 7, 7, 2, 2, 65, 69, 7, 3, 2, 2, 66, 68, 7, 9, 2, 2, 67, 66, 3, 2, 2, 2, 68, 71, 3, 2, 2, 2, 69, 67, 3, 2, 2, 2, 69, 70, 3, 2, 2, 2, 70, 72, 3, 2, 2, 2, 71, 69, 3, 2, 2, 2, 72, 76, 7, 5, 2, 2, 73, 75, 7, 9, 2, 2, 74, 73, 3, 2, 2, 2, 75, 78, 3, 2, 2, 2, 76, 74, 3, 2, 2, 2, 76, 77, 3, 2, 2, 2, 77, 79, 3, 2, 2, 2, 78, 76, 3, 2, 2, 2, 79, 80, 7, 4, 2, 2, 80, 15, 3, 2, 2, 2, 81, 86, 5, 4, 3, 2, 82, 83, 7, 5, 2, 2, 83, 85, 5, 4, 3, 2, 84, 82, 3, 2, 2, 2, 85, 88, 3, 2, 2, 2, 86, 84, 3, 2, 2, 2, 86, 87, 3, 2, 2, 2, 87, 17, 3, 2, 2, 2, 88, 86, 3, 2, 2, 2, 89, 90, 6, 10, 5, 2, 90, 91, 7, 7, 2, 2, 91, 92, 7, 3, 2, 2, 92, 93, 5, 16, 9, 2, 93, 94, 7, 4, 2, 2, 94, 19, 3, 2, 2, 2, 95, 96, 6, 11, 6, 2, 96, 97, 7, 7, 2, 2, 97, 98, 7, 3, 2, 2, 98, 99, 5, 8, 5, 2, 99, 100, 7, 5, 2, 2, 100, 101, 5, 8, 5, 2, 101, 102, 7, 4, 2, 2, 102, 21, 3, 2, 2, 2, 103, 104, 6, 12, 7, 2, 104, 105, 7, 7, 2, 2, 105, 106, 7, 3, 2, 2, 106, 107, 5, 8, 5, 2, 107, 108, 7, 4, 2, 2, 108, 23, 3, 2, 2, 2, 109, 110, 6, 13, 8, 2, 110, 111, 7, 7, 2, 2, 111, 112, 7, 3, 2, 2, 112, 117, 5, 8, 5, 2, 113, 114, 7, 5, 2, 2, 114, 116, 5, 8, 5, 2, 115, 113, 3, 2, 2, 2, 116, 119, 3, 2, 2, 2, 117, 115, 3, 2, 2, 2, 117, 118, 3, 2, 2, 2, 118, 120, 3, 2, 2, 2, 119, 117, 3, 2, 2, 2, 120, 121, 7, 4, 2, 2, 121, 25, 3, 2, 2, 2, 122, 123, 9, 3, 2, 2, 123, 27, 3, 2, 2, 2, 10, 33, 45, 57, 61, 69, 76, 86, 117] \ No newline at end of file diff --git a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignature.tokens b/presto-native-execution/presto_cpp/main/types/antlr/TypeSignature.tokens deleted file mode 100644 index cc650d2693b03..0000000000000 --- a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignature.tokens +++ /dev/null @@ -1,11 +0,0 @@ -T__0=1 -T__1=2 -T__2=3 -TYPE_WITH_SPACES=4 -WORD=5 -QUOTED_ID=6 -NUMBER=7 -WHITESPACE=8 -'('=1 -')'=2 -','=3 diff --git a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureBaseVisitor.cpp b/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureBaseVisitor.cpp deleted file mode 100644 index d60c4376261ae..0000000000000 --- a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureBaseVisitor.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include "presto_cpp/main/types/TypeParser.h" - -// Generated from TypeSignature.g4 by ANTLR 4.9.3 - -#include "TypeSignatureBaseVisitor.h" - -using namespace facebook::presto::type; diff --git a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureBaseVisitor.h b/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureBaseVisitor.h deleted file mode 100644 index ad848c4fa9704..0000000000000 --- a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureBaseVisitor.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include "presto_cpp/main/types/TypeParser.h" - -// Generated from TypeSignature.g4 by ANTLR 4.9.3 - -#pragma once - -#include "TypeSignatureVisitor.h" -#include "antlr4-runtime.h" - -namespace facebook::presto::type { - -/** - * This class provides an empty implementation of TypeSignatureVisitor, which - * can be extended to create a visitor which only needs to handle a subset of - * the available methods. - */ -class TypeSignatureBaseVisitor : public TypeSignatureVisitor { - public: - virtual antlrcpp::Any visitStart( - TypeSignatureParser::StartContext* ctx) override { - return visitChildren(ctx); - } - - virtual antlrcpp::Any visitType_spec( - TypeSignatureParser::Type_specContext* ctx) override { - return visitChildren(ctx); - } - - virtual antlrcpp::Any visitNamed_type( - TypeSignatureParser::Named_typeContext* ctx) override { - return visitChildren(ctx); - } - - virtual antlrcpp::Any visitType( - TypeSignatureParser::TypeContext* ctx) override { - return visitChildren(ctx); - } - - virtual antlrcpp::Any visitSimple_type( - TypeSignatureParser::Simple_typeContext* ctx) override { - return visitChildren(ctx); - } - - virtual antlrcpp::Any visitVariable_type( - TypeSignatureParser::Variable_typeContext* ctx) override { - return visitChildren(ctx); - } - - virtual antlrcpp::Any visitDecimal_type( - TypeSignatureParser::Decimal_typeContext* ctx) override { - return visitChildren(ctx); - } - - virtual antlrcpp::Any visitType_list( - TypeSignatureParser::Type_listContext* ctx) override { - return visitChildren(ctx); - } - - virtual antlrcpp::Any visitRow_type( - TypeSignatureParser::Row_typeContext* ctx) override { - return visitChildren(ctx); - } - - virtual antlrcpp::Any visitMap_type( - TypeSignatureParser::Map_typeContext* ctx) override { - return visitChildren(ctx); - } - - virtual antlrcpp::Any visitArray_type( - TypeSignatureParser::Array_typeContext* ctx) override { - return visitChildren(ctx); - } - - virtual antlrcpp::Any visitFunction_type( - TypeSignatureParser::Function_typeContext* ctx) override { - return visitChildren(ctx); - } - - virtual antlrcpp::Any visitIdentifier( - TypeSignatureParser::IdentifierContext* ctx) override { - return visitChildren(ctx); - } -}; - -} // namespace facebook::presto::type diff --git a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureLexer.cpp b/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureLexer.cpp deleted file mode 100644 index 4f48301c4882b..0000000000000 --- a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureLexer.cpp +++ /dev/null @@ -1,400 +0,0 @@ -/* - * 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 - * - * http://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. - */ - -// Generated from TypeSignature.g4 by ANTLR 4.9.3 - -#include "TypeSignatureLexer.h" - -using namespace antlr4; - -using namespace facebook::presto::type; - -TypeSignatureLexer::TypeSignatureLexer(CharStream* input) : Lexer(input) { - _interpreter = new atn::LexerATNSimulator( - this, _atn, _decisionToDFA, _sharedContextCache); -} - -TypeSignatureLexer::~TypeSignatureLexer() { - delete _interpreter; -} - -std::string TypeSignatureLexer::getGrammarFileName() const { - return "TypeSignature.g4"; -} - -const std::vector& TypeSignatureLexer::getRuleNames() const { - return _ruleNames; -} - -const std::vector& TypeSignatureLexer::getChannelNames() const { - return _channelNames; -} - -const std::vector& TypeSignatureLexer::getModeNames() const { - return _modeNames; -} - -const std::vector& TypeSignatureLexer::getTokenNames() const { - return _tokenNames; -} - -dfa::Vocabulary& TypeSignatureLexer::getVocabulary() const { - return _vocabulary; -} - -const std::vector TypeSignatureLexer::getSerializedATN() const { - return _serializedATN; -} - -const atn::ATN& TypeSignatureLexer::getATN() const { - return _atn; -} - -// Static vars and initialization. -std::vector TypeSignatureLexer::_decisionToDFA; -atn::PredictionContextCache TypeSignatureLexer::_sharedContextCache; - -// We own the ATN which in turn owns the ATN states. -atn::ATN TypeSignatureLexer::_atn; -std::vector TypeSignatureLexer::_serializedATN; - -std::vector TypeSignatureLexer::_ruleNames = { - "T__0", "T__1", "T__2", "TYPE_WITH_SPACES", - "WORD", "QUOTED_ID", "NUMBER", "A", - "B", "C", "D", "E", - "F", "G", "H", "I", - "J", "K", "L", "M", - "N", "O", "P", "Q", - "R", "S", "T", "U", - "V", "W", "X", "Y", - "Z", "WHITESPACE"}; - -std::vector TypeSignatureLexer::_channelNames = { - "DEFAULT_TOKEN_CHANNEL", - "HIDDEN"}; - -std::vector TypeSignatureLexer::_modeNames = {"DEFAULT_MODE"}; - -std::vector TypeSignatureLexer::_literalNames = { - "", - "'('", - "')'", - "','"}; - -std::vector TypeSignatureLexer::_symbolicNames = { - "", - "", - "", - "", - "TYPE_WITH_SPACES", - "WORD", - "QUOTED_ID", - "NUMBER", - "WHITESPACE"}; - -dfa::Vocabulary TypeSignatureLexer::_vocabulary(_literalNames, _symbolicNames); - -std::vector TypeSignatureLexer::_tokenNames; - -TypeSignatureLexer::Initializer::Initializer() { - // This code could be in a static initializer lambda, but VS doesn't allow - // access to private class members from there. - for (size_t i = 0; i < _symbolicNames.size(); ++i) { - std::string name = _vocabulary.getLiteralName(i); - if (name.empty()) { - name = _vocabulary.getSymbolicName(i); - } - - if (name.empty()) { - _tokenNames.push_back(""); - } else { - _tokenNames.push_back(name); - } - } - - static const uint16_t serializedATNSegment0[] = { - 0x3, 0x608b, 0xa72a, 0x8133, 0xb9ed, 0x417c, 0x3be7, 0x7786, 0x5964, - 0x2, 0xa, 0x109, 0x8, 0x1, 0x4, 0x2, 0x9, 0x2, - 0x4, 0x3, 0x9, 0x3, 0x4, 0x4, 0x9, 0x4, 0x4, - 0x5, 0x9, 0x5, 0x4, 0x6, 0x9, 0x6, 0x4, 0x7, - 0x9, 0x7, 0x4, 0x8, 0x9, 0x8, 0x4, 0x9, 0x9, - 0x9, 0x4, 0xa, 0x9, 0xa, 0x4, 0xb, 0x9, 0xb, - 0x4, 0xc, 0x9, 0xc, 0x4, 0xd, 0x9, 0xd, 0x4, - 0xe, 0x9, 0xe, 0x4, 0xf, 0x9, 0xf, 0x4, 0x10, - 0x9, 0x10, 0x4, 0x11, 0x9, 0x11, 0x4, 0x12, 0x9, - 0x12, 0x4, 0x13, 0x9, 0x13, 0x4, 0x14, 0x9, 0x14, - 0x4, 0x15, 0x9, 0x15, 0x4, 0x16, 0x9, 0x16, 0x4, - 0x17, 0x9, 0x17, 0x4, 0x18, 0x9, 0x18, 0x4, 0x19, - 0x9, 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, 0x2, 0x2, 0x2, 0x101, 0x102, 0x9, 0x1f, - 0x2, 0x2, 0x102, 0x42, 0x3, 0x2, 0x2, 0x2, 0x103, - 0x104, 0x9, 0x20, 0x2, 0x2, 0x104, 0x44, 0x3, 0x2, - 0x2, 0x2, 0x105, 0x106, 0x9, 0x21, 0x2, 0x2, 0x106, - 0x107, 0x3, 0x2, 0x2, 0x2, 0x107, 0x108, 0x8, 0x23, - 0x2, 0x2, 0x108, 0x46, 0x3, 0x2, 0x2, 0x2, 0x7, - 0x2, 0xb9, 0xbf, 0xc7, 0xcf, 0x3, 0x8, 0x2, 0x2, - }; - - _serializedATN.insert( - _serializedATN.end(), - serializedATNSegment0, - serializedATNSegment0 + - sizeof(serializedATNSegment0) / sizeof(serializedATNSegment0[0])); - - atn::ATNDeserializer deserializer; - _atn = deserializer.deserialize(_serializedATN); - - size_t count = _atn.getNumberOfDecisions(); - _decisionToDFA.reserve(count); - for (size_t i = 0; i < count; i++) { - _decisionToDFA.emplace_back(_atn.getDecisionState(i), i); - } -} - -TypeSignatureLexer::Initializer TypeSignatureLexer::_init; diff --git a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureLexer.h b/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureLexer.h deleted file mode 100644 index 4b89f3d8ecafa..0000000000000 --- a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureLexer.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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 - * - * http://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. - */ - -// Generated from TypeSignature.g4 by ANTLR 4.9.3 - -#pragma once - -#include "antlr4-runtime.h" - -namespace facebook::presto::type { - -class TypeSignatureLexer : public antlr4::Lexer { - public: - enum { - T__0 = 1, - T__1 = 2, - T__2 = 3, - TYPE_WITH_SPACES = 4, - WORD = 5, - QUOTED_ID = 6, - NUMBER = 7, - WHITESPACE = 8 - }; - - explicit TypeSignatureLexer(antlr4::CharStream* input); - ~TypeSignatureLexer(); - - virtual std::string getGrammarFileName() const override; - virtual const std::vector& getRuleNames() const override; - - virtual const std::vector& getChannelNames() const override; - virtual const std::vector& getModeNames() const override; - virtual const std::vector& getTokenNames() - const override; // deprecated, use vocabulary instead - virtual antlr4::dfa::Vocabulary& getVocabulary() const override; - - virtual const std::vector getSerializedATN() const override; - virtual const antlr4::atn::ATN& getATN() const override; - - private: - static std::vector _decisionToDFA; - static antlr4::atn::PredictionContextCache _sharedContextCache; - static std::vector _ruleNames; - static std::vector _tokenNames; - static std::vector _channelNames; - static std::vector _modeNames; - - static std::vector _literalNames; - static std::vector _symbolicNames; - static antlr4::dfa::Vocabulary _vocabulary; - static antlr4::atn::ATN _atn; - static std::vector _serializedATN; - - // Individual action functions triggered by action() above. - - // Individual semantic predicate functions triggered by sempred() above. - - struct Initializer { - Initializer(); - }; - static Initializer _init; -}; - -} // namespace facebook::presto::type diff --git a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureLexer.interp b/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureLexer.interp deleted file mode 100644 index 72fdd7db0cc45..0000000000000 --- a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureLexer.interp +++ /dev/null @@ -1,67 +0,0 @@ -token literal names: -null -'(' -')' -',' -null -null -null -null -null - -token symbolic names: -null -null -null -null -TYPE_WITH_SPACES -WORD -QUOTED_ID -NUMBER -WHITESPACE - -rule names: -T__0 -T__1 -T__2 -TYPE_WITH_SPACES -WORD -QUOTED_ID -NUMBER -A -B -C -D -E -F -G -H -I -J -K -L -M -N -O -P -Q -R -S -T -U -V -W -X -Y -Z -WHITESPACE - -channel names: -DEFAULT_TOKEN_CHANNEL -HIDDEN - -mode names: -DEFAULT_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, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 186, 10, 5, 3, 6, 3, 6, 7, 6, 190, 10, 6, 12, 6, 14, 6, 193, 11, 6, 3, 7, 3, 7, 3, 7, 7, 7, 198, 10, 7, 12, 7, 14, 7, 201, 11, 7, 3, 7, 3, 7, 3, 8, 6, 8, 206, 10, 8, 13, 8, 14, 8, 207, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 2, 2, 36, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 2, 19, 2, 21, 2, 23, 2, 25, 2, 27, 2, 29, 2, 31, 2, 33, 2, 35, 2, 37, 2, 39, 2, 41, 2, 43, 2, 45, 2, 47, 2, 49, 2, 51, 2, 53, 2, 55, 2, 57, 2, 59, 2, 61, 2, 63, 2, 65, 2, 67, 2, 69, 10, 3, 2, 34, 5, 2, 67, 92, 97, 97, 99, 124, 6, 2, 50, 60, 66, 92, 97, 97, 99, 124, 6, 2, 50, 59, 67, 92, 97, 97, 99, 124, 7, 2, 34, 34, 50, 60, 66, 92, 97, 97, 99, 124, 3, 2, 50, 59, 4, 2, 67, 67, 99, 99, 4, 2, 68, 68, 100, 100, 4, 2, 69, 69, 101, 101, 4, 2, 70, 70, 102, 102, 4, 2, 71, 71, 103, 103, 4, 2, 72, 72, 104, 104, 4, 2, 73, 73, 105, 105, 4, 2, 74, 74, 106, 106, 4, 2, 75, 75, 107, 107, 4, 2, 76, 76, 108, 108, 4, 2, 77, 77, 109, 109, 4, 2, 78, 78, 110, 110, 4, 2, 79, 79, 111, 111, 4, 2, 80, 80, 112, 112, 4, 2, 81, 81, 113, 113, 4, 2, 82, 82, 114, 114, 4, 2, 83, 83, 115, 115, 4, 2, 84, 84, 116, 116, 4, 2, 85, 85, 117, 117, 4, 2, 86, 86, 118, 118, 4, 2, 87, 87, 119, 119, 4, 2, 88, 88, 120, 120, 4, 2, 89, 89, 121, 121, 4, 2, 90, 90, 122, 122, 4, 2, 91, 91, 123, 123, 4, 2, 92, 92, 124, 124, 4, 2, 11, 12, 34, 34, 2, 245, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 3, 71, 3, 2, 2, 2, 5, 73, 3, 2, 2, 2, 7, 75, 3, 2, 2, 2, 9, 185, 3, 2, 2, 2, 11, 187, 3, 2, 2, 2, 13, 194, 3, 2, 2, 2, 15, 205, 3, 2, 2, 2, 17, 209, 3, 2, 2, 2, 19, 211, 3, 2, 2, 2, 21, 213, 3, 2, 2, 2, 23, 215, 3, 2, 2, 2, 25, 217, 3, 2, 2, 2, 27, 219, 3, 2, 2, 2, 29, 221, 3, 2, 2, 2, 31, 223, 3, 2, 2, 2, 33, 225, 3, 2, 2, 2, 35, 227, 3, 2, 2, 2, 37, 229, 3, 2, 2, 2, 39, 231, 3, 2, 2, 2, 41, 233, 3, 2, 2, 2, 43, 235, 3, 2, 2, 2, 45, 237, 3, 2, 2, 2, 47, 239, 3, 2, 2, 2, 49, 241, 3, 2, 2, 2, 51, 243, 3, 2, 2, 2, 53, 245, 3, 2, 2, 2, 55, 247, 3, 2, 2, 2, 57, 249, 3, 2, 2, 2, 59, 251, 3, 2, 2, 2, 61, 253, 3, 2, 2, 2, 63, 255, 3, 2, 2, 2, 65, 257, 3, 2, 2, 2, 67, 259, 3, 2, 2, 2, 69, 261, 3, 2, 2, 2, 71, 72, 7, 42, 2, 2, 72, 4, 3, 2, 2, 2, 73, 74, 7, 43, 2, 2, 74, 6, 3, 2, 2, 2, 75, 76, 7, 46, 2, 2, 76, 8, 3, 2, 2, 2, 77, 78, 5, 23, 12, 2, 78, 79, 5, 45, 23, 2, 79, 80, 5, 57, 29, 2, 80, 81, 5, 19, 10, 2, 81, 82, 5, 39, 20, 2, 82, 83, 5, 25, 13, 2, 83, 84, 7, 34, 2, 2, 84, 85, 5, 47, 24, 2, 85, 86, 5, 51, 26, 2, 86, 87, 5, 25, 13, 2, 87, 88, 5, 21, 11, 2, 88, 89, 5, 33, 17, 2, 89, 90, 5, 53, 27, 2, 90, 91, 5, 33, 17, 2, 91, 92, 5, 45, 23, 2, 92, 93, 5, 43, 22, 2, 93, 186, 3, 2, 2, 2, 94, 95, 5, 55, 28, 2, 95, 96, 5, 33, 17, 2, 96, 97, 5, 41, 21, 2, 97, 98, 5, 25, 13, 2, 98, 99, 7, 34, 2, 2, 99, 100, 5, 61, 31, 2, 100, 101, 5, 33, 17, 2, 101, 102, 5, 55, 28, 2, 102, 103, 5, 31, 16, 2, 103, 104, 7, 34, 2, 2, 104, 105, 5, 55, 28, 2, 105, 106, 5, 33, 17, 2, 106, 107, 5, 41, 21, 2, 107, 108, 5, 25, 13, 2, 108, 109, 7, 34, 2, 2, 109, 110, 5, 67, 34, 2, 110, 111, 5, 45, 23, 2, 111, 112, 5, 43, 22, 2, 112, 113, 5, 25, 13, 2, 113, 186, 3, 2, 2, 2, 114, 115, 5, 55, 28, 2, 115, 116, 5, 33, 17, 2, 116, 117, 5, 41, 21, 2, 117, 118, 5, 25, 13, 2, 118, 119, 5, 53, 27, 2, 119, 120, 5, 55, 28, 2, 120, 121, 5, 17, 9, 2, 121, 122, 5, 41, 21, 2, 122, 123, 5, 47, 24, 2, 123, 124, 7, 34, 2, 2, 124, 125, 5, 61, 31, 2, 125, 126, 5, 33, 17, 2, 126, 127, 5, 55, 28, 2, 127, 128, 5, 31, 16, 2, 128, 129, 7, 34, 2, 2, 129, 130, 5, 55, 28, 2, 130, 131, 5, 33, 17, 2, 131, 132, 5, 41, 21, 2, 132, 133, 5, 25, 13, 2, 133, 134, 7, 34, 2, 2, 134, 135, 5, 67, 34, 2, 135, 136, 5, 45, 23, 2, 136, 137, 5, 43, 22, 2, 137, 138, 5, 25, 13, 2, 138, 186, 3, 2, 2, 2, 139, 140, 5, 33, 17, 2, 140, 141, 5, 43, 22, 2, 141, 142, 5, 55, 28, 2, 142, 143, 5, 25, 13, 2, 143, 144, 5, 51, 26, 2, 144, 145, 5, 59, 30, 2, 145, 146, 5, 17, 9, 2, 146, 147, 5, 39, 20, 2, 147, 148, 7, 34, 2, 2, 148, 149, 5, 65, 33, 2, 149, 150, 5, 25, 13, 2, 150, 151, 5, 17, 9, 2, 151, 152, 5, 51, 26, 2, 152, 153, 7, 34, 2, 2, 153, 154, 5, 55, 28, 2, 154, 155, 5, 45, 23, 2, 155, 156, 7, 34, 2, 2, 156, 157, 5, 41, 21, 2, 157, 158, 5, 45, 23, 2, 158, 159, 5, 43, 22, 2, 159, 160, 5, 55, 28, 2, 160, 161, 5, 31, 16, 2, 161, 186, 3, 2, 2, 2, 162, 163, 5, 33, 17, 2, 163, 164, 5, 43, 22, 2, 164, 165, 5, 55, 28, 2, 165, 166, 5, 25, 13, 2, 166, 167, 5, 51, 26, 2, 167, 168, 5, 59, 30, 2, 168, 169, 5, 17, 9, 2, 169, 170, 5, 39, 20, 2, 170, 171, 7, 34, 2, 2, 171, 172, 5, 23, 12, 2, 172, 173, 5, 17, 9, 2, 173, 174, 5, 65, 33, 2, 174, 175, 7, 34, 2, 2, 175, 176, 5, 55, 28, 2, 176, 177, 5, 45, 23, 2, 177, 178, 7, 34, 2, 2, 178, 179, 5, 53, 27, 2, 179, 180, 5, 25, 13, 2, 180, 181, 5, 21, 11, 2, 181, 182, 5, 45, 23, 2, 182, 183, 5, 43, 22, 2, 183, 184, 5, 23, 12, 2, 184, 186, 3, 2, 2, 2, 185, 77, 3, 2, 2, 2, 185, 94, 3, 2, 2, 2, 185, 114, 3, 2, 2, 2, 185, 139, 3, 2, 2, 2, 185, 162, 3, 2, 2, 2, 186, 10, 3, 2, 2, 2, 187, 191, 9, 2, 2, 2, 188, 190, 9, 3, 2, 2, 189, 188, 3, 2, 2, 2, 190, 193, 3, 2, 2, 2, 191, 189, 3, 2, 2, 2, 191, 192, 3, 2, 2, 2, 192, 12, 3, 2, 2, 2, 193, 191, 3, 2, 2, 2, 194, 195, 7, 36, 2, 2, 195, 199, 9, 4, 2, 2, 196, 198, 9, 5, 2, 2, 197, 196, 3, 2, 2, 2, 198, 201, 3, 2, 2, 2, 199, 197, 3, 2, 2, 2, 199, 200, 3, 2, 2, 2, 200, 202, 3, 2, 2, 2, 201, 199, 3, 2, 2, 2, 202, 203, 7, 36, 2, 2, 203, 14, 3, 2, 2, 2, 204, 206, 9, 6, 2, 2, 205, 204, 3, 2, 2, 2, 206, 207, 3, 2, 2, 2, 207, 205, 3, 2, 2, 2, 207, 208, 3, 2, 2, 2, 208, 16, 3, 2, 2, 2, 209, 210, 9, 7, 2, 2, 210, 18, 3, 2, 2, 2, 211, 212, 9, 8, 2, 2, 212, 20, 3, 2, 2, 2, 213, 214, 9, 9, 2, 2, 214, 22, 3, 2, 2, 2, 215, 216, 9, 10, 2, 2, 216, 24, 3, 2, 2, 2, 217, 218, 9, 11, 2, 2, 218, 26, 3, 2, 2, 2, 219, 220, 9, 12, 2, 2, 220, 28, 3, 2, 2, 2, 221, 222, 9, 13, 2, 2, 222, 30, 3, 2, 2, 2, 223, 224, 9, 14, 2, 2, 224, 32, 3, 2, 2, 2, 225, 226, 9, 15, 2, 2, 226, 34, 3, 2, 2, 2, 227, 228, 9, 16, 2, 2, 228, 36, 3, 2, 2, 2, 229, 230, 9, 17, 2, 2, 230, 38, 3, 2, 2, 2, 231, 232, 9, 18, 2, 2, 232, 40, 3, 2, 2, 2, 233, 234, 9, 19, 2, 2, 234, 42, 3, 2, 2, 2, 235, 236, 9, 20, 2, 2, 236, 44, 3, 2, 2, 2, 237, 238, 9, 21, 2, 2, 238, 46, 3, 2, 2, 2, 239, 240, 9, 22, 2, 2, 240, 48, 3, 2, 2, 2, 241, 242, 9, 23, 2, 2, 242, 50, 3, 2, 2, 2, 243, 244, 9, 24, 2, 2, 244, 52, 3, 2, 2, 2, 245, 246, 9, 25, 2, 2, 246, 54, 3, 2, 2, 2, 247, 248, 9, 26, 2, 2, 248, 56, 3, 2, 2, 2, 249, 250, 9, 27, 2, 2, 250, 58, 3, 2, 2, 2, 251, 252, 9, 28, 2, 2, 252, 60, 3, 2, 2, 2, 253, 254, 9, 29, 2, 2, 254, 62, 3, 2, 2, 2, 255, 256, 9, 30, 2, 2, 256, 64, 3, 2, 2, 2, 257, 258, 9, 31, 2, 2, 258, 66, 3, 2, 2, 2, 259, 260, 9, 32, 2, 2, 260, 68, 3, 2, 2, 2, 261, 262, 9, 33, 2, 2, 262, 263, 3, 2, 2, 2, 263, 264, 8, 35, 2, 2, 264, 70, 3, 2, 2, 2, 7, 2, 185, 191, 199, 207, 3, 8, 2, 2] \ No newline at end of file diff --git a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureLexer.tokens b/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureLexer.tokens deleted file mode 100644 index cc650d2693b03..0000000000000 --- a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureLexer.tokens +++ /dev/null @@ -1,11 +0,0 @@ -T__0=1 -T__1=2 -T__2=3 -TYPE_WITH_SPACES=4 -WORD=5 -QUOTED_ID=6 -NUMBER=7 -WHITESPACE=8 -'('=1 -')'=2 -','=3 diff --git a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureParser.cpp b/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureParser.cpp deleted file mode 100644 index a4b2bf569a171..0000000000000 --- a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureParser.cpp +++ /dev/null @@ -1,1351 +0,0 @@ -/* - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include "presto_cpp/main/types/TypeParser.h" - -// Generated from TypeSignature.g4 by ANTLR 4.9.3 - -#include "TypeSignatureVisitor.h" - -#include "TypeSignatureParser.h" - -using namespace antlrcpp; -using namespace facebook::presto::type; -using namespace antlr4; - -TypeSignatureParser::TypeSignatureParser(TokenStream* input) : Parser(input) { - _interpreter = new atn::ParserATNSimulator( - this, _atn, _decisionToDFA, _sharedContextCache); -} - -TypeSignatureParser::~TypeSignatureParser() { - delete _interpreter; -} - -std::string TypeSignatureParser::getGrammarFileName() const { - return "TypeSignature.g4"; -} - -const std::vector& TypeSignatureParser::getRuleNames() const { - return _ruleNames; -} - -dfa::Vocabulary& TypeSignatureParser::getVocabulary() const { - return _vocabulary; -} - -//----------------- StartContext -//------------------------------------------------------------------ - -TypeSignatureParser::StartContext::StartContext( - ParserRuleContext* parent, - size_t invokingState) - : ParserRuleContext(parent, invokingState) {} - -TypeSignatureParser::Type_specContext* -TypeSignatureParser::StartContext::type_spec() { - return getRuleContext(0); -} - -tree::TerminalNode* TypeSignatureParser::StartContext::EOF() { - return getToken(TypeSignatureParser::EOF, 0); -} - -size_t TypeSignatureParser::StartContext::getRuleIndex() const { - return TypeSignatureParser::RuleStart; -} - -antlrcpp::Any TypeSignatureParser::StartContext::accept( - tree::ParseTreeVisitor* visitor) { - if (auto parserVisitor = dynamic_cast(visitor)) - return parserVisitor->visitStart(this); - else - return visitor->visitChildren(this); -} - -TypeSignatureParser::StartContext* TypeSignatureParser::start() { - StartContext* _localctx = - _tracker.createInstance(_ctx, getState()); - enterRule(_localctx, 0, TypeSignatureParser::RuleStart); - -#if __cplusplus > 201703L - auto onExit = finally([=, this] { -#else - auto onExit = finally([=] { -#endif - exitRule(); - }); - try { - enterOuterAlt(_localctx, 1); - setState(26); - type_spec(); - setState(27); - match(TypeSignatureParser::EOF); - - } catch (RecognitionException& e) { - _errHandler->reportError(this, e); - _localctx->exception = std::current_exception(); - _errHandler->recover(this, _localctx->exception); - } - - return _localctx; -} - -//----------------- Type_specContext -//------------------------------------------------------------------ - -TypeSignatureParser::Type_specContext::Type_specContext( - ParserRuleContext* parent, - size_t invokingState) - : ParserRuleContext(parent, invokingState) {} - -TypeSignatureParser::Named_typeContext* -TypeSignatureParser::Type_specContext::named_type() { - return getRuleContext(0); -} - -TypeSignatureParser::TypeContext* -TypeSignatureParser::Type_specContext::type() { - return getRuleContext(0); -} - -size_t TypeSignatureParser::Type_specContext::getRuleIndex() const { - return TypeSignatureParser::RuleType_spec; -} - -antlrcpp::Any TypeSignatureParser::Type_specContext::accept( - tree::ParseTreeVisitor* visitor) { - if (auto parserVisitor = dynamic_cast(visitor)) - return parserVisitor->visitType_spec(this); - else - return visitor->visitChildren(this); -} - -TypeSignatureParser::Type_specContext* TypeSignatureParser::type_spec() { - Type_specContext* _localctx = - _tracker.createInstance(_ctx, getState()); - enterRule(_localctx, 2, TypeSignatureParser::RuleType_spec); - -#if __cplusplus > 201703L - auto onExit = finally([=, this] { -#else - auto onExit = finally([=] { -#endif - exitRule(); - }); - try { - setState(31); - _errHandler->sync(this); - switch (getInterpreter()->adaptivePredict( - _input, 0, _ctx)) { - case 1: { - enterOuterAlt(_localctx, 1); - setState(29); - named_type(); - break; - } - - case 2: { - enterOuterAlt(_localctx, 2); - setState(30); - type(); - break; - } - - default: - break; - } - - } catch (RecognitionException& e) { - _errHandler->reportError(this, e); - _localctx->exception = std::current_exception(); - _errHandler->recover(this, _localctx->exception); - } - - return _localctx; -} - -//----------------- Named_typeContext -//------------------------------------------------------------------ - -TypeSignatureParser::Named_typeContext::Named_typeContext( - ParserRuleContext* parent, - size_t invokingState) - : ParserRuleContext(parent, invokingState) {} - -TypeSignatureParser::IdentifierContext* -TypeSignatureParser::Named_typeContext::identifier() { - return getRuleContext(0); -} - -TypeSignatureParser::TypeContext* -TypeSignatureParser::Named_typeContext::type() { - return getRuleContext(0); -} - -size_t TypeSignatureParser::Named_typeContext::getRuleIndex() const { - return TypeSignatureParser::RuleNamed_type; -} - -antlrcpp::Any TypeSignatureParser::Named_typeContext::accept( - tree::ParseTreeVisitor* visitor) { - if (auto parserVisitor = dynamic_cast(visitor)) - return parserVisitor->visitNamed_type(this); - else - return visitor->visitChildren(this); -} - -TypeSignatureParser::Named_typeContext* TypeSignatureParser::named_type() { - Named_typeContext* _localctx = - _tracker.createInstance(_ctx, getState()); - enterRule(_localctx, 4, TypeSignatureParser::RuleNamed_type); - -#if __cplusplus > 201703L - auto onExit = finally([=, this] { -#else - auto onExit = finally([=] { -#endif - exitRule(); - }); - try { - enterOuterAlt(_localctx, 1); - setState(33); - identifier(); - setState(34); - type(); - - } catch (RecognitionException& e) { - _errHandler->reportError(this, e); - _localctx->exception = std::current_exception(); - _errHandler->recover(this, _localctx->exception); - } - - return _localctx; -} - -//----------------- TypeContext -//------------------------------------------------------------------ - -TypeSignatureParser::TypeContext::TypeContext( - ParserRuleContext* parent, - size_t invokingState) - : ParserRuleContext(parent, invokingState) {} - -TypeSignatureParser::Simple_typeContext* -TypeSignatureParser::TypeContext::simple_type() { - return getRuleContext(0); -} - -TypeSignatureParser::Decimal_typeContext* -TypeSignatureParser::TypeContext::decimal_type() { - return getRuleContext(0); -} - -TypeSignatureParser::Variable_typeContext* -TypeSignatureParser::TypeContext::variable_type() { - return getRuleContext(0); -} - -TypeSignatureParser::Array_typeContext* -TypeSignatureParser::TypeContext::array_type() { - return getRuleContext(0); -} - -TypeSignatureParser::Map_typeContext* -TypeSignatureParser::TypeContext::map_type() { - return getRuleContext(0); -} - -TypeSignatureParser::Row_typeContext* -TypeSignatureParser::TypeContext::row_type() { - return getRuleContext(0); -} - -TypeSignatureParser::Function_typeContext* -TypeSignatureParser::TypeContext::function_type() { - return getRuleContext(0); -} - -size_t TypeSignatureParser::TypeContext::getRuleIndex() const { - return TypeSignatureParser::RuleType; -} - -antlrcpp::Any TypeSignatureParser::TypeContext::accept( - tree::ParseTreeVisitor* visitor) { - if (auto parserVisitor = dynamic_cast(visitor)) - return parserVisitor->visitType(this); - else - return visitor->visitChildren(this); -} - -TypeSignatureParser::TypeContext* TypeSignatureParser::type() { - TypeContext* _localctx = - _tracker.createInstance(_ctx, getState()); - enterRule(_localctx, 6, TypeSignatureParser::RuleType); - -#if __cplusplus > 201703L - auto onExit = finally([=, this] { -#else - auto onExit = finally([=] { -#endif - exitRule(); - }); - try { - setState(43); - _errHandler->sync(this); - switch (getInterpreter()->adaptivePredict( - _input, 1, _ctx)) { - case 1: { - enterOuterAlt(_localctx, 1); - setState(36); - simple_type(); - break; - } - - case 2: { - enterOuterAlt(_localctx, 2); - setState(37); - decimal_type(); - break; - } - - case 3: { - enterOuterAlt(_localctx, 3); - setState(38); - variable_type(); - break; - } - - case 4: { - enterOuterAlt(_localctx, 4); - setState(39); - array_type(); - break; - } - - case 5: { - enterOuterAlt(_localctx, 5); - setState(40); - map_type(); - break; - } - - case 6: { - enterOuterAlt(_localctx, 6); - setState(41); - row_type(); - break; - } - - case 7: { - enterOuterAlt(_localctx, 7); - setState(42); - function_type(); - break; - } - - default: - break; - } - - } catch (RecognitionException& e) { - _errHandler->reportError(this, e); - _localctx->exception = std::current_exception(); - _errHandler->recover(this, _localctx->exception); - } - - return _localctx; -} - -//----------------- Simple_typeContext -//------------------------------------------------------------------ - -TypeSignatureParser::Simple_typeContext::Simple_typeContext( - ParserRuleContext* parent, - size_t invokingState) - : ParserRuleContext(parent, invokingState) {} - -tree::TerminalNode* TypeSignatureParser::Simple_typeContext::WORD() { - return getToken(TypeSignatureParser::WORD, 0); -} - -tree::TerminalNode* -TypeSignatureParser::Simple_typeContext::TYPE_WITH_SPACES() { - return getToken(TypeSignatureParser::TYPE_WITH_SPACES, 0); -} - -size_t TypeSignatureParser::Simple_typeContext::getRuleIndex() const { - return TypeSignatureParser::RuleSimple_type; -} - -antlrcpp::Any TypeSignatureParser::Simple_typeContext::accept( - tree::ParseTreeVisitor* visitor) { - if (auto parserVisitor = dynamic_cast(visitor)) - return parserVisitor->visitSimple_type(this); - else - return visitor->visitChildren(this); -} - -TypeSignatureParser::Simple_typeContext* TypeSignatureParser::simple_type() { - Simple_typeContext* _localctx = - _tracker.createInstance(_ctx, getState()); - enterRule(_localctx, 8, TypeSignatureParser::RuleSimple_type); - size_t _la = 0; - -#if __cplusplus > 201703L - auto onExit = finally([=, this] { -#else - auto onExit = finally([=] { -#endif - exitRule(); - }); - try { - enterOuterAlt(_localctx, 1); - setState(45); - _la = _input->LA(1); - if (!(_la == TypeSignatureParser::TYPE_WITH_SPACES - - || _la == TypeSignatureParser::WORD)) { - _errHandler->recoverInline(this); - } else { - _errHandler->reportMatch(this); - consume(); - } - - } catch (RecognitionException& e) { - _errHandler->reportError(this, e); - _localctx->exception = std::current_exception(); - _errHandler->recover(this, _localctx->exception); - } - - return _localctx; -} - -//----------------- Variable_typeContext -//------------------------------------------------------------------ - -TypeSignatureParser::Variable_typeContext::Variable_typeContext( - ParserRuleContext* parent, - size_t invokingState) - : ParserRuleContext(parent, invokingState) {} - -tree::TerminalNode* TypeSignatureParser::Variable_typeContext::WORD() { - return getToken(TypeSignatureParser::WORD, 0); -} - -std::vector -TypeSignatureParser::Variable_typeContext::NUMBER() { - return getTokens(TypeSignatureParser::NUMBER); -} - -tree::TerminalNode* TypeSignatureParser::Variable_typeContext::NUMBER( - size_t i) { - return getToken(TypeSignatureParser::NUMBER, i); -} - -size_t TypeSignatureParser::Variable_typeContext::getRuleIndex() const { - return TypeSignatureParser::RuleVariable_type; -} - -antlrcpp::Any TypeSignatureParser::Variable_typeContext::accept( - tree::ParseTreeVisitor* visitor) { - if (auto parserVisitor = dynamic_cast(visitor)) - return parserVisitor->visitVariable_type(this); - else - return visitor->visitChildren(this); -} - -TypeSignatureParser::Variable_typeContext* -TypeSignatureParser::variable_type() { - Variable_typeContext* _localctx = - _tracker.createInstance(_ctx, getState()); - enterRule(_localctx, 10, TypeSignatureParser::RuleVariable_type); - size_t _la = 0; - -#if __cplusplus > 201703L - auto onExit = finally([=, this] { -#else - auto onExit = finally([=] { -#endif - exitRule(); - }); - try { - setState(59); - _errHandler->sync(this); - switch (getInterpreter()->adaptivePredict( - _input, 3, _ctx)) { - case 1: { - enterOuterAlt(_localctx, 1); - setState(47); - - if (!(isVarToken())) - throw FailedPredicateException(this, " isVarToken() "); - setState(48); - match(TypeSignatureParser::WORD); - break; - } - - case 2: { - enterOuterAlt(_localctx, 2); - setState(49); - - if (!(isVarToken())) - throw FailedPredicateException(this, " isVarToken() "); - setState(50); - match(TypeSignatureParser::WORD); - setState(51); - match(TypeSignatureParser::T__0); - setState(55); - _errHandler->sync(this); - _la = _input->LA(1); - while (_la == TypeSignatureParser::NUMBER) { - setState(52); - match(TypeSignatureParser::NUMBER); - setState(57); - _errHandler->sync(this); - _la = _input->LA(1); - } - setState(58); - match(TypeSignatureParser::T__1); - break; - } - - default: - break; - } - - } catch (RecognitionException& e) { - _errHandler->reportError(this, e); - _localctx->exception = std::current_exception(); - _errHandler->recover(this, _localctx->exception); - } - - return _localctx; -} - -//----------------- Decimal_typeContext -//------------------------------------------------------------------ - -TypeSignatureParser::Decimal_typeContext::Decimal_typeContext( - ParserRuleContext* parent, - size_t invokingState) - : ParserRuleContext(parent, invokingState) {} - -tree::TerminalNode* TypeSignatureParser::Decimal_typeContext::WORD() { - return getToken(TypeSignatureParser::WORD, 0); -} - -std::vector -TypeSignatureParser::Decimal_typeContext::NUMBER() { - return getTokens(TypeSignatureParser::NUMBER); -} - -tree::TerminalNode* TypeSignatureParser::Decimal_typeContext::NUMBER(size_t i) { - return getToken(TypeSignatureParser::NUMBER, i); -} - -size_t TypeSignatureParser::Decimal_typeContext::getRuleIndex() const { - return TypeSignatureParser::RuleDecimal_type; -} - -antlrcpp::Any TypeSignatureParser::Decimal_typeContext::accept( - tree::ParseTreeVisitor* visitor) { - if (auto parserVisitor = dynamic_cast(visitor)) - return parserVisitor->visitDecimal_type(this); - else - return visitor->visitChildren(this); -} - -TypeSignatureParser::Decimal_typeContext* TypeSignatureParser::decimal_type() { - Decimal_typeContext* _localctx = - _tracker.createInstance(_ctx, getState()); - enterRule(_localctx, 12, TypeSignatureParser::RuleDecimal_type); - size_t _la = 0; - -#if __cplusplus > 201703L - auto onExit = finally([=, this] { -#else - auto onExit = finally([=] { -#endif - exitRule(); - }); - try { - enterOuterAlt(_localctx, 1); - setState(61); - - if (!(isDecimalToken())) - throw FailedPredicateException(this, " isDecimalToken() "); - setState(62); - match(TypeSignatureParser::WORD); - setState(63); - match(TypeSignatureParser::T__0); - setState(67); - _errHandler->sync(this); - _la = _input->LA(1); - while (_la == TypeSignatureParser::NUMBER) { - setState(64); - match(TypeSignatureParser::NUMBER); - setState(69); - _errHandler->sync(this); - _la = _input->LA(1); - } - setState(70); - match(TypeSignatureParser::T__2); - setState(74); - _errHandler->sync(this); - _la = _input->LA(1); - while (_la == TypeSignatureParser::NUMBER) { - setState(71); - match(TypeSignatureParser::NUMBER); - setState(76); - _errHandler->sync(this); - _la = _input->LA(1); - } - setState(77); - match(TypeSignatureParser::T__1); - - } catch (RecognitionException& e) { - _errHandler->reportError(this, e); - _localctx->exception = std::current_exception(); - _errHandler->recover(this, _localctx->exception); - } - - return _localctx; -} - -//----------------- Type_listContext -//------------------------------------------------------------------ - -TypeSignatureParser::Type_listContext::Type_listContext( - ParserRuleContext* parent, - size_t invokingState) - : ParserRuleContext(parent, invokingState) {} - -std::vector -TypeSignatureParser::Type_listContext::type_spec() { - return getRuleContexts(); -} - -TypeSignatureParser::Type_specContext* -TypeSignatureParser::Type_listContext::type_spec(size_t i) { - return getRuleContext(i); -} - -size_t TypeSignatureParser::Type_listContext::getRuleIndex() const { - return TypeSignatureParser::RuleType_list; -} - -antlrcpp::Any TypeSignatureParser::Type_listContext::accept( - tree::ParseTreeVisitor* visitor) { - if (auto parserVisitor = dynamic_cast(visitor)) - return parserVisitor->visitType_list(this); - else - return visitor->visitChildren(this); -} - -TypeSignatureParser::Type_listContext* TypeSignatureParser::type_list() { - Type_listContext* _localctx = - _tracker.createInstance(_ctx, getState()); - enterRule(_localctx, 14, TypeSignatureParser::RuleType_list); - size_t _la = 0; - -#if __cplusplus > 201703L - auto onExit = finally([=, this] { -#else - auto onExit = finally([=] { -#endif - exitRule(); - }); - try { - enterOuterAlt(_localctx, 1); - setState(79); - type_spec(); - setState(84); - _errHandler->sync(this); - _la = _input->LA(1); - while (_la == TypeSignatureParser::T__2) { - setState(80); - match(TypeSignatureParser::T__2); - setState(81); - type_spec(); - setState(86); - _errHandler->sync(this); - _la = _input->LA(1); - } - - } catch (RecognitionException& e) { - _errHandler->reportError(this, e); - _localctx->exception = std::current_exception(); - _errHandler->recover(this, _localctx->exception); - } - - return _localctx; -} - -//----------------- Row_typeContext -//------------------------------------------------------------------ - -TypeSignatureParser::Row_typeContext::Row_typeContext( - ParserRuleContext* parent, - size_t invokingState) - : ParserRuleContext(parent, invokingState) {} - -tree::TerminalNode* TypeSignatureParser::Row_typeContext::WORD() { - return getToken(TypeSignatureParser::WORD, 0); -} - -TypeSignatureParser::Type_listContext* -TypeSignatureParser::Row_typeContext::type_list() { - return getRuleContext(0); -} - -size_t TypeSignatureParser::Row_typeContext::getRuleIndex() const { - return TypeSignatureParser::RuleRow_type; -} - -antlrcpp::Any TypeSignatureParser::Row_typeContext::accept( - tree::ParseTreeVisitor* visitor) { - if (auto parserVisitor = dynamic_cast(visitor)) - return parserVisitor->visitRow_type(this); - else - return visitor->visitChildren(this); -} - -TypeSignatureParser::Row_typeContext* TypeSignatureParser::row_type() { - Row_typeContext* _localctx = - _tracker.createInstance(_ctx, getState()); - enterRule(_localctx, 16, TypeSignatureParser::RuleRow_type); - -#if __cplusplus > 201703L - auto onExit = finally([=, this] { -#else - auto onExit = finally([=] { -#endif - exitRule(); - }); - try { - enterOuterAlt(_localctx, 1); - setState(87); - - if (!(isRowToken())) - throw FailedPredicateException(this, " isRowToken() "); - setState(88); - match(TypeSignatureParser::WORD); - setState(89); - match(TypeSignatureParser::T__0); - setState(90); - type_list(); - setState(91); - match(TypeSignatureParser::T__1); - - } catch (RecognitionException& e) { - _errHandler->reportError(this, e); - _localctx->exception = std::current_exception(); - _errHandler->recover(this, _localctx->exception); - } - - return _localctx; -} - -//----------------- Map_typeContext -//------------------------------------------------------------------ - -TypeSignatureParser::Map_typeContext::Map_typeContext( - ParserRuleContext* parent, - size_t invokingState) - : ParserRuleContext(parent, invokingState) {} - -tree::TerminalNode* TypeSignatureParser::Map_typeContext::WORD() { - return getToken(TypeSignatureParser::WORD, 0); -} - -std::vector -TypeSignatureParser::Map_typeContext::type() { - return getRuleContexts(); -} - -TypeSignatureParser::TypeContext* TypeSignatureParser::Map_typeContext::type( - size_t i) { - return getRuleContext(i); -} - -size_t TypeSignatureParser::Map_typeContext::getRuleIndex() const { - return TypeSignatureParser::RuleMap_type; -} - -antlrcpp::Any TypeSignatureParser::Map_typeContext::accept( - tree::ParseTreeVisitor* visitor) { - if (auto parserVisitor = dynamic_cast(visitor)) - return parserVisitor->visitMap_type(this); - else - return visitor->visitChildren(this); -} - -TypeSignatureParser::Map_typeContext* TypeSignatureParser::map_type() { - Map_typeContext* _localctx = - _tracker.createInstance(_ctx, getState()); - enterRule(_localctx, 18, TypeSignatureParser::RuleMap_type); - -#if __cplusplus > 201703L - auto onExit = finally([=, this] { -#else - auto onExit = finally([=] { -#endif - exitRule(); - }); - try { - enterOuterAlt(_localctx, 1); - setState(93); - - if (!(isMapToken())) - throw FailedPredicateException(this, " isMapToken() "); - setState(94); - match(TypeSignatureParser::WORD); - setState(95); - match(TypeSignatureParser::T__0); - setState(96); - type(); - setState(97); - match(TypeSignatureParser::T__2); - setState(98); - type(); - setState(99); - match(TypeSignatureParser::T__1); - - } catch (RecognitionException& e) { - _errHandler->reportError(this, e); - _localctx->exception = std::current_exception(); - _errHandler->recover(this, _localctx->exception); - } - - return _localctx; -} - -//----------------- Array_typeContext -//------------------------------------------------------------------ - -TypeSignatureParser::Array_typeContext::Array_typeContext( - ParserRuleContext* parent, - size_t invokingState) - : ParserRuleContext(parent, invokingState) {} - -tree::TerminalNode* TypeSignatureParser::Array_typeContext::WORD() { - return getToken(TypeSignatureParser::WORD, 0); -} - -TypeSignatureParser::TypeContext* -TypeSignatureParser::Array_typeContext::type() { - return getRuleContext(0); -} - -size_t TypeSignatureParser::Array_typeContext::getRuleIndex() const { - return TypeSignatureParser::RuleArray_type; -} - -antlrcpp::Any TypeSignatureParser::Array_typeContext::accept( - tree::ParseTreeVisitor* visitor) { - if (auto parserVisitor = dynamic_cast(visitor)) - return parserVisitor->visitArray_type(this); - else - return visitor->visitChildren(this); -} - -TypeSignatureParser::Array_typeContext* TypeSignatureParser::array_type() { - Array_typeContext* _localctx = - _tracker.createInstance(_ctx, getState()); - enterRule(_localctx, 20, TypeSignatureParser::RuleArray_type); - -#if __cplusplus > 201703L - auto onExit = finally([=, this] { -#else - auto onExit = finally([=] { -#endif - exitRule(); - }); - try { - enterOuterAlt(_localctx, 1); - setState(101); - - if (!(isArrayToken())) - throw FailedPredicateException(this, " isArrayToken() "); - setState(102); - match(TypeSignatureParser::WORD); - setState(103); - match(TypeSignatureParser::T__0); - setState(104); - type(); - setState(105); - match(TypeSignatureParser::T__1); - - } catch (RecognitionException& e) { - _errHandler->reportError(this, e); - _localctx->exception = std::current_exception(); - _errHandler->recover(this, _localctx->exception); - } - - return _localctx; -} - -//----------------- Function_typeContext -//------------------------------------------------------------------ - -TypeSignatureParser::Function_typeContext::Function_typeContext( - ParserRuleContext* parent, - size_t invokingState) - : ParserRuleContext(parent, invokingState) {} - -tree::TerminalNode* TypeSignatureParser::Function_typeContext::WORD() { - return getToken(TypeSignatureParser::WORD, 0); -} - -std::vector -TypeSignatureParser::Function_typeContext::type() { - return getRuleContexts(); -} - -TypeSignatureParser::TypeContext* -TypeSignatureParser::Function_typeContext::type(size_t i) { - return getRuleContext(i); -} - -size_t TypeSignatureParser::Function_typeContext::getRuleIndex() const { - return TypeSignatureParser::RuleFunction_type; -} - -antlrcpp::Any TypeSignatureParser::Function_typeContext::accept( - tree::ParseTreeVisitor* visitor) { - if (auto parserVisitor = dynamic_cast(visitor)) - return parserVisitor->visitFunction_type(this); - else - return visitor->visitChildren(this); -} - -TypeSignatureParser::Function_typeContext* -TypeSignatureParser::function_type() { - Function_typeContext* _localctx = - _tracker.createInstance(_ctx, getState()); - enterRule(_localctx, 22, TypeSignatureParser::RuleFunction_type); - size_t _la = 0; - -#if __cplusplus > 201703L - auto onExit = finally([=, this] { -#else - auto onExit = finally([=] { -#endif - exitRule(); - }); - try { - enterOuterAlt(_localctx, 1); - setState(107); - - if (!(isFunctionToken())) - throw FailedPredicateException(this, " isFunctionToken() "); - setState(108); - match(TypeSignatureParser::WORD); - setState(109); - match(TypeSignatureParser::T__0); - setState(110); - type(); - setState(115); - _errHandler->sync(this); - _la = _input->LA(1); - while (_la == TypeSignatureParser::T__2) { - setState(111); - match(TypeSignatureParser::T__2); - setState(112); - type(); - setState(117); - _errHandler->sync(this); - _la = _input->LA(1); - } - setState(118); - match(TypeSignatureParser::T__1); - - } catch (RecognitionException& e) { - _errHandler->reportError(this, e); - _localctx->exception = std::current_exception(); - _errHandler->recover(this, _localctx->exception); - } - - return _localctx; -} - -//----------------- IdentifierContext -//------------------------------------------------------------------ - -TypeSignatureParser::IdentifierContext::IdentifierContext( - ParserRuleContext* parent, - size_t invokingState) - : ParserRuleContext(parent, invokingState) {} - -tree::TerminalNode* TypeSignatureParser::IdentifierContext::QUOTED_ID() { - return getToken(TypeSignatureParser::QUOTED_ID, 0); -} - -tree::TerminalNode* TypeSignatureParser::IdentifierContext::WORD() { - return getToken(TypeSignatureParser::WORD, 0); -} - -size_t TypeSignatureParser::IdentifierContext::getRuleIndex() const { - return TypeSignatureParser::RuleIdentifier; -} - -antlrcpp::Any TypeSignatureParser::IdentifierContext::accept( - tree::ParseTreeVisitor* visitor) { - if (auto parserVisitor = dynamic_cast(visitor)) - return parserVisitor->visitIdentifier(this); - else - return visitor->visitChildren(this); -} - -TypeSignatureParser::IdentifierContext* TypeSignatureParser::identifier() { - IdentifierContext* _localctx = - _tracker.createInstance(_ctx, getState()); - enterRule(_localctx, 24, TypeSignatureParser::RuleIdentifier); - size_t _la = 0; - -#if __cplusplus > 201703L - auto onExit = finally([=, this] { -#else - auto onExit = finally([=] { -#endif - exitRule(); - }); - try { - enterOuterAlt(_localctx, 1); - setState(120); - _la = _input->LA(1); - if (!(_la == TypeSignatureParser::WORD - - || _la == TypeSignatureParser::QUOTED_ID)) { - _errHandler->recoverInline(this); - } else { - _errHandler->reportMatch(this); - consume(); - } - - } catch (RecognitionException& e) { - _errHandler->reportError(this, e); - _localctx->exception = std::current_exception(); - _errHandler->recover(this, _localctx->exception); - } - - return _localctx; -} - -bool TypeSignatureParser::sempred( - RuleContext* context, - size_t ruleIndex, - size_t predicateIndex) { - switch (ruleIndex) { - case 5: - return variable_typeSempred( - antlrcpp::downCast(context), predicateIndex); - case 6: - return decimal_typeSempred( - antlrcpp::downCast(context), predicateIndex); - case 8: - return row_typeSempred( - antlrcpp::downCast(context), predicateIndex); - case 9: - return map_typeSempred( - antlrcpp::downCast(context), predicateIndex); - case 10: - return array_typeSempred( - antlrcpp::downCast(context), predicateIndex); - case 11: - return function_typeSempred( - antlrcpp::downCast(context), predicateIndex); - - default: - break; - } - return true; -} - -bool TypeSignatureParser::variable_typeSempred( - Variable_typeContext* _localctx, - size_t predicateIndex) { - switch (predicateIndex) { - case 0: - return isVarToken(); - case 1: - return isVarToken(); - - default: - break; - } - return true; -} - -bool TypeSignatureParser::decimal_typeSempred( - Decimal_typeContext* _localctx, - size_t predicateIndex) { - switch (predicateIndex) { - case 2: - return isDecimalToken(); - - default: - break; - } - return true; -} - -bool TypeSignatureParser::row_typeSempred( - Row_typeContext* _localctx, - size_t predicateIndex) { - switch (predicateIndex) { - case 3: - return isRowToken(); - - default: - break; - } - return true; -} - -bool TypeSignatureParser::map_typeSempred( - Map_typeContext* _localctx, - size_t predicateIndex) { - switch (predicateIndex) { - case 4: - return isMapToken(); - - default: - break; - } - return true; -} - -bool TypeSignatureParser::array_typeSempred( - Array_typeContext* _localctx, - size_t predicateIndex) { - switch (predicateIndex) { - case 5: - return isArrayToken(); - - default: - break; - } - return true; -} - -bool TypeSignatureParser::function_typeSempred( - Function_typeContext* _localctx, - size_t predicateIndex) { - switch (predicateIndex) { - case 6: - return isFunctionToken(); - - default: - break; - } - return true; -} - -// Static vars and initialization. -std::vector TypeSignatureParser::_decisionToDFA; -atn::PredictionContextCache TypeSignatureParser::_sharedContextCache; - -// We own the ATN which in turn owns the ATN states. -atn::ATN TypeSignatureParser::_atn; -std::vector TypeSignatureParser::_serializedATN; - -std::vector TypeSignatureParser::_ruleNames = { - "start", - "type_spec", - "named_type", - "type", - "simple_type", - "variable_type", - "decimal_type", - "type_list", - "row_type", - "map_type", - "array_type", - "function_type", - "identifier"}; - -std::vector TypeSignatureParser::_literalNames = { - "", - "'('", - "')'", - "','"}; - -std::vector TypeSignatureParser::_symbolicNames = { - "", - "", - "", - "", - "TYPE_WITH_SPACES", - "WORD", - "QUOTED_ID", - "NUMBER", - "WHITESPACE"}; - -dfa::Vocabulary TypeSignatureParser::_vocabulary(_literalNames, _symbolicNames); - -std::vector TypeSignatureParser::_tokenNames; - -TypeSignatureParser::Initializer::Initializer() { - for (size_t i = 0; i < _symbolicNames.size(); ++i) { - std::string name = _vocabulary.getLiteralName(i); - if (name.empty()) { - name = _vocabulary.getSymbolicName(i); - } - - if (name.empty()) { - _tokenNames.push_back(""); - } else { - _tokenNames.push_back(name); - } - } - - static const uint16_t serializedATNSegment0[] = { - 0x3, 0x608b, 0xa72a, 0x8133, 0xb9ed, 0x417c, 0x3be7, 0x7786, 0x5964, - 0x3, 0xa, 0x7d, 0x4, 0x2, 0x9, 0x2, 0x4, 0x3, - 0x9, 0x3, 0x4, 0x4, 0x9, 0x4, 0x4, 0x5, 0x9, - 0x5, 0x4, 0x6, 0x9, 0x6, 0x4, 0x7, 0x9, 0x7, - 0x4, 0x8, 0x9, 0x8, 0x4, 0x9, 0x9, 0x9, 0x4, - 0xa, 0x9, 0xa, 0x4, 0xb, 0x9, 0xb, 0x4, 0xc, - 0x9, 0xc, 0x4, 0xd, 0x9, 0xd, 0x4, 0xe, 0x9, - 0xe, 0x3, 0x2, 0x3, 0x2, 0x3, 0x2, 0x3, 0x3, - 0x3, 0x3, 0x5, 0x3, 0x22, 0xa, 0x3, 0x3, 0x4, - 0x3, 0x4, 0x3, 0x4, 0x3, 0x5, 0x3, 0x5, 0x3, - 0x5, 0x3, 0x5, 0x3, 0x5, 0x3, 0x5, 0x3, 0x5, - 0x5, 0x5, 0x2e, 0xa, 0x5, 0x3, 0x6, 0x3, 0x6, - 0x3, 0x7, 0x3, 0x7, 0x3, 0x7, 0x3, 0x7, 0x3, - 0x7, 0x3, 0x7, 0x7, 0x7, 0x38, 0xa, 0x7, 0xc, - 0x7, 0xe, 0x7, 0x3b, 0xb, 0x7, 0x3, 0x7, 0x5, - 0x7, 0x3e, 0xa, 0x7, 0x3, 0x8, 0x3, 0x8, 0x3, - 0x8, 0x3, 0x8, 0x7, 0x8, 0x44, 0xa, 0x8, 0xc, - 0x8, 0xe, 0x8, 0x47, 0xb, 0x8, 0x3, 0x8, 0x3, - 0x8, 0x7, 0x8, 0x4b, 0xa, 0x8, 0xc, 0x8, 0xe, - 0x8, 0x4e, 0x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5, 0x2, 0x71, 0x72, 0x7, 0x5, - 0x2, 0x2, 0x72, 0x74, 0x5, 0x8, 0x5, 0x2, 0x73, - 0x71, 0x3, 0x2, 0x2, 0x2, 0x74, 0x77, 0x3, 0x2, - 0x2, 0x2, 0x75, 0x73, 0x3, 0x2, 0x2, 0x2, 0x75, - 0x76, 0x3, 0x2, 0x2, 0x2, 0x76, 0x78, 0x3, 0x2, - 0x2, 0x2, 0x77, 0x75, 0x3, 0x2, 0x2, 0x2, 0x78, - 0x79, 0x7, 0x4, 0x2, 0x2, 0x79, 0x19, 0x3, 0x2, - 0x2, 0x2, 0x7a, 0x7b, 0x9, 0x3, 0x2, 0x2, 0x7b, - 0x1b, 0x3, 0x2, 0x2, 0x2, 0xa, 0x21, 0x2d, 0x39, - 0x3d, 0x45, 0x4c, 0x56, 0x75, - }; - - _serializedATN.insert( - _serializedATN.end(), - serializedATNSegment0, - serializedATNSegment0 + - sizeof(serializedATNSegment0) / sizeof(serializedATNSegment0[0])); - - atn::ATNDeserializer deserializer; - _atn = deserializer.deserialize(_serializedATN); - - size_t count = _atn.getNumberOfDecisions(); - _decisionToDFA.reserve(count); - for (size_t i = 0; i < count; i++) { - _decisionToDFA.emplace_back(_atn.getDecisionState(i), i); - } -} - -TypeSignatureParser::Initializer TypeSignatureParser::_init; diff --git a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureParser.h b/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureParser.h deleted file mode 100644 index 645eccdf24f22..0000000000000 --- a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureParser.h +++ /dev/null @@ -1,311 +0,0 @@ -/* - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include "presto_cpp/main/types/TypeParser.h" - -// Generated from TypeSignature.g4 by ANTLR 4.9.3 - -#pragma once - -#include "antlr4-runtime.h" - -namespace facebook::presto::type { - -class TypeSignatureParser : public antlr4::Parser { - public: - enum { - T__0 = 1, - T__1 = 2, - T__2 = 3, - TYPE_WITH_SPACES = 4, - WORD = 5, - QUOTED_ID = 6, - NUMBER = 7, - WHITESPACE = 8 - }; - - enum { - RuleStart = 0, - RuleType_spec = 1, - RuleNamed_type = 2, - RuleType = 3, - RuleSimple_type = 4, - RuleVariable_type = 5, - RuleDecimal_type = 6, - RuleType_list = 7, - RuleRow_type = 8, - RuleMap_type = 9, - RuleArray_type = 10, - RuleFunction_type = 11, - RuleIdentifier = 12 - }; - - explicit TypeSignatureParser(antlr4::TokenStream* input); - ~TypeSignatureParser(); - - virtual std::string getGrammarFileName() const override; - virtual const antlr4::atn::ATN& getATN() const override { - return _atn; - }; - virtual const std::vector& getTokenNames() const override { - return _tokenNames; - }; // deprecated: use vocabulary instead. - virtual const std::vector& getRuleNames() const override; - virtual antlr4::dfa::Vocabulary& getVocabulary() const override; - - class StartContext; - class Type_specContext; - class Named_typeContext; - class TypeContext; - class Simple_typeContext; - class Variable_typeContext; - class Decimal_typeContext; - class Type_listContext; - class Row_typeContext; - class Map_typeContext; - class Array_typeContext; - class Function_typeContext; - class IdentifierContext; - - class StartContext : public antlr4::ParserRuleContext { - public: - StartContext(antlr4::ParserRuleContext* parent, size_t invokingState); - virtual size_t getRuleIndex() const override; - Type_specContext* type_spec(); - antlr4::tree::TerminalNode* EOF(); - - virtual antlrcpp::Any accept( - antlr4::tree::ParseTreeVisitor* visitor) override; - }; - - StartContext* start(); - - class Type_specContext : public antlr4::ParserRuleContext { - public: - Type_specContext(antlr4::ParserRuleContext* parent, size_t invokingState); - virtual size_t getRuleIndex() const override; - Named_typeContext* named_type(); - TypeContext* type(); - - virtual antlrcpp::Any accept( - antlr4::tree::ParseTreeVisitor* visitor) override; - }; - - Type_specContext* type_spec(); - - class Named_typeContext : public antlr4::ParserRuleContext { - public: - Named_typeContext(antlr4::ParserRuleContext* parent, size_t invokingState); - virtual size_t getRuleIndex() const override; - IdentifierContext* identifier(); - TypeContext* type(); - - virtual antlrcpp::Any accept( - antlr4::tree::ParseTreeVisitor* visitor) override; - }; - - Named_typeContext* named_type(); - - class TypeContext : public antlr4::ParserRuleContext { - public: - TypeContext(antlr4::ParserRuleContext* parent, size_t invokingState); - virtual size_t getRuleIndex() const override; - Simple_typeContext* simple_type(); - Decimal_typeContext* decimal_type(); - Variable_typeContext* variable_type(); - Array_typeContext* array_type(); - Map_typeContext* map_type(); - Row_typeContext* row_type(); - Function_typeContext* function_type(); - - virtual antlrcpp::Any accept( - antlr4::tree::ParseTreeVisitor* visitor) override; - }; - - TypeContext* type(); - - class Simple_typeContext : public antlr4::ParserRuleContext { - public: - Simple_typeContext(antlr4::ParserRuleContext* parent, size_t invokingState); - virtual size_t getRuleIndex() const override; - antlr4::tree::TerminalNode* WORD(); - antlr4::tree::TerminalNode* TYPE_WITH_SPACES(); - - virtual antlrcpp::Any accept( - antlr4::tree::ParseTreeVisitor* visitor) override; - }; - - Simple_typeContext* simple_type(); - - class Variable_typeContext : public antlr4::ParserRuleContext { - public: - Variable_typeContext( - antlr4::ParserRuleContext* parent, - size_t invokingState); - virtual size_t getRuleIndex() const override; - antlr4::tree::TerminalNode* WORD(); - std::vector NUMBER(); - antlr4::tree::TerminalNode* NUMBER(size_t i); - - virtual antlrcpp::Any accept( - antlr4::tree::ParseTreeVisitor* visitor) override; - }; - - Variable_typeContext* variable_type(); - - class Decimal_typeContext : public antlr4::ParserRuleContext { - public: - Decimal_typeContext( - antlr4::ParserRuleContext* parent, - size_t invokingState); - virtual size_t getRuleIndex() const override; - antlr4::tree::TerminalNode* WORD(); - std::vector NUMBER(); - antlr4::tree::TerminalNode* NUMBER(size_t i); - - virtual antlrcpp::Any accept( - antlr4::tree::ParseTreeVisitor* visitor) override; - }; - - Decimal_typeContext* decimal_type(); - - class Type_listContext : public antlr4::ParserRuleContext { - public: - Type_listContext(antlr4::ParserRuleContext* parent, size_t invokingState); - virtual size_t getRuleIndex() const override; - std::vector type_spec(); - Type_specContext* type_spec(size_t i); - - virtual antlrcpp::Any accept( - antlr4::tree::ParseTreeVisitor* visitor) override; - }; - - Type_listContext* type_list(); - - class Row_typeContext : public antlr4::ParserRuleContext { - public: - Row_typeContext(antlr4::ParserRuleContext* parent, size_t invokingState); - virtual size_t getRuleIndex() const override; - antlr4::tree::TerminalNode* WORD(); - Type_listContext* type_list(); - - virtual antlrcpp::Any accept( - antlr4::tree::ParseTreeVisitor* visitor) override; - }; - - Row_typeContext* row_type(); - - class Map_typeContext : public antlr4::ParserRuleContext { - public: - Map_typeContext(antlr4::ParserRuleContext* parent, size_t invokingState); - virtual size_t getRuleIndex() const override; - antlr4::tree::TerminalNode* WORD(); - std::vector type(); - TypeContext* type(size_t i); - - virtual antlrcpp::Any accept( - antlr4::tree::ParseTreeVisitor* visitor) override; - }; - - Map_typeContext* map_type(); - - class Array_typeContext : public antlr4::ParserRuleContext { - public: - Array_typeContext(antlr4::ParserRuleContext* parent, size_t invokingState); - virtual size_t getRuleIndex() const override; - antlr4::tree::TerminalNode* WORD(); - TypeContext* type(); - - virtual antlrcpp::Any accept( - antlr4::tree::ParseTreeVisitor* visitor) override; - }; - - Array_typeContext* array_type(); - - class Function_typeContext : public antlr4::ParserRuleContext { - public: - Function_typeContext( - antlr4::ParserRuleContext* parent, - size_t invokingState); - virtual size_t getRuleIndex() const override; - antlr4::tree::TerminalNode* WORD(); - std::vector type(); - TypeContext* type(size_t i); - - virtual antlrcpp::Any accept( - antlr4::tree::ParseTreeVisitor* visitor) override; - }; - - Function_typeContext* function_type(); - - class IdentifierContext : public antlr4::ParserRuleContext { - public: - IdentifierContext(antlr4::ParserRuleContext* parent, size_t invokingState); - virtual size_t getRuleIndex() const override; - antlr4::tree::TerminalNode* QUOTED_ID(); - antlr4::tree::TerminalNode* WORD(); - - virtual antlrcpp::Any accept( - antlr4::tree::ParseTreeVisitor* visitor) override; - }; - - IdentifierContext* identifier(); - - virtual bool sempred( - antlr4::RuleContext* _localctx, - size_t ruleIndex, - size_t predicateIndex) override; - bool variable_typeSempred( - Variable_typeContext* _localctx, - size_t predicateIndex); - bool decimal_typeSempred( - Decimal_typeContext* _localctx, - size_t predicateIndex); - bool row_typeSempred(Row_typeContext* _localctx, size_t predicateIndex); - bool map_typeSempred(Map_typeContext* _localctx, size_t predicateIndex); - bool array_typeSempred(Array_typeContext* _localctx, size_t predicateIndex); - bool function_typeSempred( - Function_typeContext* _localctx, - size_t predicateIndex); - - private: - static std::vector _decisionToDFA; - static antlr4::atn::PredictionContextCache _sharedContextCache; - static std::vector _ruleNames; - static std::vector _tokenNames; - - static std::vector _literalNames; - static std::vector _symbolicNames; - static antlr4::dfa::Vocabulary _vocabulary; - static antlr4::atn::ATN _atn; - static std::vector _serializedATN; - -#define Token() (getCurrentToken()->getText()) -#define UpCase(str) (boost::to_upper_copy(str)) -#define isRowToken() (UpCase(Token()) == "ROW") -#define isMapToken() (UpCase(Token()) == "MAP") -#define isArrayToken() (UpCase(Token()) == "ARRAY") -#define isVarToken() \ - (UpCase(Token()) == "VARCHAR" || UpCase(Token()) == "VARBINARY") -#define isDecimalToken() (UpCase(Token()) == "DECIMAL") -#define isFunctionToken() (UpCase(Token()) == "FUNCTION") - - struct Initializer { - Initializer(); - }; - static Initializer _init; -}; - -} // namespace facebook::presto::type diff --git a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureVisitor.cpp b/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureVisitor.cpp deleted file mode 100644 index f4fc07cc6c8a8..0000000000000 --- a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureVisitor.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include "presto_cpp/main/types/TypeParser.h" - -// Generated from TypeSignature.g4 by ANTLR 4.9.3 - -#include "TypeSignatureVisitor.h" - -using namespace facebook::presto::type; diff --git a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureVisitor.h b/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureVisitor.h deleted file mode 100644 index 25ef8e877df60..0000000000000 --- a/presto-native-execution/presto_cpp/main/types/antlr/TypeSignatureVisitor.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include "presto_cpp/main/types/TypeParser.h" - -// Generated from TypeSignature.g4 by ANTLR 4.9.3 - -#pragma once - -#include "TypeSignatureParser.h" -#include "antlr4-runtime.h" - -namespace facebook::presto::type { - -/** - * This class defines an abstract visitor for a parse tree - * produced by TypeSignatureParser. - */ -class TypeSignatureVisitor : public antlr4::tree::AbstractParseTreeVisitor { - public: - /** - * Visit parse trees produced by TypeSignatureParser. - */ - virtual antlrcpp::Any visitStart( - TypeSignatureParser::StartContext* context) = 0; - - virtual antlrcpp::Any visitType_spec( - TypeSignatureParser::Type_specContext* context) = 0; - - virtual antlrcpp::Any visitNamed_type( - TypeSignatureParser::Named_typeContext* context) = 0; - - virtual antlrcpp::Any visitType( - TypeSignatureParser::TypeContext* context) = 0; - - virtual antlrcpp::Any visitSimple_type( - TypeSignatureParser::Simple_typeContext* context) = 0; - - virtual antlrcpp::Any visitVariable_type( - TypeSignatureParser::Variable_typeContext* context) = 0; - - virtual antlrcpp::Any visitDecimal_type( - TypeSignatureParser::Decimal_typeContext* context) = 0; - - virtual antlrcpp::Any visitType_list( - TypeSignatureParser::Type_listContext* context) = 0; - - virtual antlrcpp::Any visitRow_type( - TypeSignatureParser::Row_typeContext* context) = 0; - - virtual antlrcpp::Any visitMap_type( - TypeSignatureParser::Map_typeContext* context) = 0; - - virtual antlrcpp::Any visitArray_type( - TypeSignatureParser::Array_typeContext* context) = 0; - - virtual antlrcpp::Any visitFunction_type( - TypeSignatureParser::Function_typeContext* context) = 0; - - virtual antlrcpp::Any visitIdentifier( - TypeSignatureParser::IdentifierContext* context) = 0; -}; - -} // namespace facebook::presto::type diff --git a/presto-native-execution/presto_cpp/main/types/tests/CMakeLists.txt b/presto-native-execution/presto_cpp/main/types/tests/CMakeLists.txt index bb228681dc881..b11e816d70f1c 100644 --- a/presto-native-execution/presto_cpp/main/types/tests/CMakeLists.txt +++ b/presto-native-execution/presto_cpp/main/types/tests/CMakeLists.txt @@ -27,12 +27,10 @@ target_link_libraries( presto_type_converter presto_types velox_type_fbhive - ${ANTLR4_RUNTIME} velox_hive_partition_function) -add_executable( - presto_expressions_test RowExpressionTest.cpp TypeSignatureTest.cpp - ValuesPipeTest.cpp PlanConverterTest.cpp) +add_executable(presto_expressions_test RowExpressionTest.cpp ValuesPipeTest.cpp + PlanConverterTest.cpp) add_test( NAME presto_expressions_test @@ -42,18 +40,10 @@ add_test( add_dependencies(presto_expressions_test presto_operators presto_protocol presto_types) -# There is not really a better way at this point. Several posts have complained -# about the parser generator not producing a file that finds the includes on the -# default install path. :( -# -target_include_directories(presto_expressions_test SYSTEM - PRIVATE "/usr/local/include/antlr4-runtime") - target_link_libraries( presto_expressions_test gtest gtest_main - $ $ $ $ @@ -73,7 +63,6 @@ target_link_libraries( velox_type Boost::filesystem ${RE2} - ${ANTLR4_RUNTIME} ${FOLLY_WITH_DEPENDENCIES} ${GLOG} ${GFLAGS_LIBRARIES} diff --git a/presto-native-execution/presto_cpp/main/types/tests/TypeSignatureTest.cpp b/presto-native-execution/presto_cpp/main/types/tests/TypeSignatureTest.cpp deleted file mode 100644 index 72832723b546e..0000000000000 --- a/presto-native-execution/presto_cpp/main/types/tests/TypeSignatureTest.cpp +++ /dev/null @@ -1,206 +0,0 @@ -/* - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include - -#include "presto_cpp/main/types/TypeParser.h" -#include "velox/common/base/tests/GTestUtils.h" - -using namespace facebook::velox; - -namespace facebook::presto { -namespace { - -class TestTypeSignature : public ::testing::Test { - public: - TypeParser typeParser; -}; - -TEST_F(TestTypeSignature, booleanType) { - ASSERT_EQ(*typeParser.parse("boolean"), *BOOLEAN()); -} - -TEST_F(TestTypeSignature, integerType) { - ASSERT_EQ(*typeParser.parse("int"), *INTEGER()); - ASSERT_EQ(*typeParser.parse("integer"), *INTEGER()); -} - -TEST_F(TestTypeSignature, varcharType) { - ASSERT_EQ(*typeParser.parse("varchar"), *VARCHAR()); -} - -TEST_F(TestTypeSignature, varbinary) { - ASSERT_EQ(*typeParser.parse("varbinary"), *VARBINARY()); -} - -TEST_F(TestTypeSignature, arrayType) { - ASSERT_EQ(*typeParser.parse("array(bigint)"), *ARRAY(BIGINT())); - - ASSERT_EQ(*typeParser.parse("array(int)"), *ARRAY(INTEGER())); - ASSERT_EQ(*typeParser.parse("array(integer)"), *ARRAY(INTEGER())); - - ASSERT_EQ(*typeParser.parse("array(array(bigint))"), *ARRAY(ARRAY(BIGINT()))); - - ASSERT_EQ(*typeParser.parse("array(array(int))"), *ARRAY(ARRAY(INTEGER()))); -} - -TEST_F(TestTypeSignature, mapType) { - ASSERT_EQ(*typeParser.parse("map(bigint,bigint)"), *MAP(BIGINT(), BIGINT())); - - ASSERT_EQ( - *typeParser.parse("map(bigint,array(bigint))"), - *MAP(BIGINT(), ARRAY(BIGINT()))); - - ASSERT_EQ( - *typeParser.parse("map(bigint,map(bigint,map(varchar,bigint)))"), - *MAP(BIGINT(), MAP(BIGINT(), MAP(VARCHAR(), BIGINT())))); -} - -TEST_F(TestTypeSignature, invalidType) { - VELOX_ASSERT_THROW( - typeParser.parse("blah()"), "Failed to parse type [blah()]"); - - VELOX_ASSERT_THROW( - typeParser.parse("array()"), "Failed to parse type [array()]"); - - VELOX_ASSERT_THROW(typeParser.parse("map()"), "Failed to parse type [map()]"); - - VELOX_ASSERT_THROW(typeParser.parse("x"), "Failed to parse type [x]"); - - // Ensure this is not treated as a row type. - VELOX_ASSERT_THROW( - typeParser.parse("rowxxx(a)"), "Failed to parse type [rowxxx(a)]"); -} - -TEST_F(TestTypeSignature, rowType) { - ASSERT_EQ( - *typeParser.parse("row(a bigint,b varchar,c real)"), - *ROW({"a", "b", "c"}, {BIGINT(), VARCHAR(), REAL()})); - - ASSERT_EQ( - *typeParser.parse("row(a bigint,b array(bigint),c row(a bigint))"), - *ROW( - {"a", "b", "c"}, - {BIGINT(), ARRAY(BIGINT()), ROW({"a"}, {BIGINT()})})); - - ASSERT_EQ( - *typeParser.parse("row(\"12\" bigint,b bigint,c bigint)"), - *ROW({"12", "b", "c"}, {BIGINT(), BIGINT(), BIGINT()})); - - ASSERT_EQ( - *typeParser.parse("row(a varchar(10),b row(a bigint))"), - *ROW({"a", "b"}, {VARCHAR(), ROW({"a"}, {BIGINT()})})); - - ASSERT_EQ( - *typeParser.parse("array(row(col0 bigint,col1 double))"), - *ARRAY(ROW({"col0", "col1"}, {BIGINT(), DOUBLE()}))); - - ASSERT_EQ( - *typeParser.parse("row(col0 array(row(col0 bigint,col1 double)))"), - *ROW({"col0"}, {ARRAY(ROW({"col0", "col1"}, {BIGINT(), DOUBLE()}))})); - - ASSERT_EQ( - *typeParser.parse("row(bigint,varchar)"), *ROW({BIGINT(), VARCHAR()})); - - ASSERT_EQ( - *typeParser.parse("row(bigint,array(bigint),row(a bigint))"), - *ROW({BIGINT(), ARRAY(BIGINT()), ROW({"a"}, {BIGINT()})})); - - ASSERT_EQ( - *typeParser.parse("row(varchar(10),b row(bigint))"), - *ROW({"", "b"}, {VARCHAR(), ROW({BIGINT()})})); - - ASSERT_EQ( - *typeParser.parse("array(row(col0 bigint,double))"), - *ARRAY(ROW({"col0", ""}, {BIGINT(), DOUBLE()}))); - - ASSERT_EQ( - *typeParser.parse("row(col0 array(row(bigint,double)))"), - *ROW({"col0"}, {ARRAY(ROW({BIGINT(), DOUBLE()}))})); - - ASSERT_EQ( - *typeParser.parse("row(double double precision)"), - *ROW({"double"}, {DOUBLE()})); - - ASSERT_EQ(*typeParser.parse("row(double precision)"), *ROW({DOUBLE()})); - - ASSERT_EQ( - *typeParser.parse("RoW(a bigint,b varchar)"), - *ROW({"a", "b"}, {BIGINT(), VARCHAR()})); - - // Field type canonicalization. - ASSERT_EQ(*typeParser.parse("row(col iNt)"), *ROW({"col"}, {INTEGER()})); -} - -TEST_F(TestTypeSignature, typesWithSpaces) { - VELOX_ASSERT_THROW( - typeParser.parse("row(time time with time zone)"), - "Specified element is not found : TIME WITH TIME ZONE"); - - ASSERT_EQ( - *typeParser.parse("row(double double precision)"), - *ROW({"double"}, {DOUBLE()})); - - VELOX_ASSERT_THROW( - typeParser.parse("row(time with time zone)"), - "Specified element is not found : TIME WITH TIME ZONE"); - - ASSERT_EQ(*typeParser.parse("row(double precision)"), *ROW({DOUBLE()})); - - VELOX_ASSERT_THROW( - typeParser.parse("row(array(time with time zone))"), - "Specified element is not found : TIME WITH TIME ZONE"); - - // quoted field names - VELOX_ASSERT_THROW( - typeParser.parse( - "row(\"time with time zone\" time with time zone,\"double\" double)"), - "Specified element is not found : TIME WITH TIME ZONE"); -} - -TEST_F(TestTypeSignature, intervalYearToMonthType) { - ASSERT_EQ( - *typeParser.parse("row(interval interval year to month)"), - *ROW({"interval"}, {INTERVAL_YEAR_MONTH()})); - - ASSERT_EQ( - *typeParser.parse("row(interval year to month)"), - *ROW({INTERVAL_YEAR_MONTH()})); -} - -TEST_F(TestTypeSignature, functionType) { - ASSERT_EQ( - *typeParser.parse("function(bigint,bigint,bigint)"), - *FUNCTION({BIGINT(), BIGINT()}, BIGINT())); - ASSERT_EQ( - *typeParser.parse("function(bigint,array(varchar),varchar)"), - *FUNCTION({BIGINT(), ARRAY(VARCHAR())}, VARCHAR())); -} - -TEST_F(TestTypeSignature, decimalType) { - ASSERT_EQ(*typeParser.parse("decimal(10, 5)"), *DECIMAL(10, 5)); - ASSERT_EQ(*typeParser.parse("decimal(20,10)"), *DECIMAL(20, 10)); - - VELOX_ASSERT_THROW( - typeParser.parse("decimal"), "Failed to parse type [decimal]"); - VELOX_ASSERT_THROW( - typeParser.parse("decimal()"), "Failed to parse type [decimal()]"); - VELOX_ASSERT_THROW( - typeParser.parse("decimal(20)"), "Failed to parse type [decimal(20)]"); - VELOX_ASSERT_THROW( - typeParser.parse("decimal(, 20)"), - "Failed to parse type [decimal(, 20)]"); -} - -} // namespace -} // namespace facebook::presto diff --git a/presto-native-execution/scripts/release-centos-dockerfile/Dockerfile b/presto-native-execution/scripts/release-centos-dockerfile/Dockerfile index 922b72868bc42..e70b081b8c6ba 100644 --- a/presto-native-execution/scripts/release-centos-dockerfile/Dockerfile +++ b/presto-native-execution/scripts/release-centos-dockerfile/Dockerfile @@ -77,12 +77,6 @@ RUN --mount=type=ssh \ set +exu && \ source /opt/rh/gcc-toolset-9/enable && \ set -exu && \ -#----------------------------------------------------------- -#---( START wget valid antlr java runtime -#----------------------------------------------------------- - wget -q 'https://www.antlr.org/download/antlr-4.9.3-complete.jar' -O '/usr/local/lib/antlr-4.9.3-complete.jar' && \ - printf '#!/usr/bin/bash\n\njava -jar /usr/local/lib/antlr-4.9.3-complete.jar "$@"' > '/usr/local/bin/antlr' && \ - chmod +x "/usr/local/bin/antlr" && \ bash "${PRESTODB_HOME}/_repo/presto-native-execution/velox/scripts/setup-adapters.sh" && \ dnf clean all diff --git a/presto-native-execution/scripts/setup-centos.sh b/presto-native-execution/scripts/setup-centos.sh index 4f81c8d13dde5..fcab318540fe4 100755 --- a/presto-native-execution/scripts/setup-centos.sh +++ b/presto-native-execution/scripts/setup-centos.sh @@ -98,15 +98,6 @@ export COMPILER_FLAGS=$(echo -n $(get_cxx_flags $CPU_TARGET)) cmake_install -DBUILD_SHARED_LIBS=ON ) -( - wget https://www.antlr.org/download/antlr4-cpp-runtime-4.9.3-source.zip && - mkdir antlr4-cpp-runtime-4.9.3-source && - cd antlr4-cpp-runtime-4.9.3-source && - unzip ../antlr4-cpp-runtime-4.9.3-source.zip && - cmake_install -DBUILD_SHARED_LIBS=ON - ldconfig -) - ( git clone https://github.com/facebook/fbthrift && cd fbthrift && diff --git a/presto-native-execution/scripts/setup-macos.sh b/presto-native-execution/scripts/setup-macos.sh index 737c3e8ef3bf6..50860440a139e 100755 --- a/presto-native-execution/scripts/setup-macos.sh +++ b/presto-native-execution/scripts/setup-macos.sh @@ -55,16 +55,9 @@ function install_proxygen { cmake_install -DBUILD_TESTS=OFF } -function install_antlr { - github_checkout antlr/antlr4 "4.9.3" - cd runtime/Cpp - cmake_install -DBUILD_TESTS=OFF -} - function install_presto_deps { install_velox_deps run_and_time install_folly - run_and_time install_antlr run_and_time install_six run_and_time install_fizz run_and_time install_wangle diff --git a/presto-native-execution/scripts/setup-ubuntu.sh b/presto-native-execution/scripts/setup-ubuntu.sh index ceb71a7910721..770fbb2874435 100755 --- a/presto-native-execution/scripts/setup-ubuntu.sh +++ b/presto-native-execution/scripts/setup-ubuntu.sh @@ -45,18 +45,6 @@ function install_proxygen { cmake_install -DBUILD_TESTS=OFF } -function install_antlr4 { - cd "${DEPENDENCY_DIR}" - if [ -d "antlr4-cpp-runtime-4.9.3-source" ]; then - rm -rf antlr4-cpp-runtime-4.9.3-source - fi - wget https://www.antlr.org/download/antlr4-cpp-runtime-4.9.3-source.zip -O antlr4-cpp-runtime-4.9.3-source.zip - mkdir antlr4-cpp-runtime-4.9.3-source && cd antlr4-cpp-runtime-4.9.3-source - unzip ../antlr4-cpp-runtime-4.9.3-source.zip - mkdir build && mkdir run && cd build - cmake .. && make "-j${NPROC}" install -} - function install_presto_deps { install_velox_deps run_and_time install_six @@ -64,7 +52,6 @@ function install_presto_deps { run_and_time install_wangle run_and_time install_fbthrift run_and_time install_proxygen - run_and_time install_antlr4 } if [[ $# -ne 0 ]]; then