diff --git a/.gitignore b/.gitignore index 809173ad..e33c5783 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /build* *.user +compile_commands.json diff --git a/.gitmodules b/.gitmodules index d04c15d2..9281db7f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -20,3 +20,6 @@ [submodule "3rd_party/--force"] path = 3rd_party/--force url = https://github.com/vlm/asn1c.git +[submodule "3rd_party/run-clang-format"] + path = 3rd_party/run-clang-format + url = https://github.com/Sarcasm/run-clang-format.git diff --git a/.travis.yml b/.travis.yml index 3681eb09..30133b54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,12 +18,6 @@ matrix: packages: - bison - - env: BUILD_TYPE=Release CXX_STANDARD=11 - compiler: clang - - - env: BUILD_TYPE=Release CXX_STANDARD=11 - compiler: gcc - - env: BUILD_TYPE=Release CXX_STANDARD=17 compiler: clang dist: bionic @@ -32,9 +26,13 @@ matrix: compiler: gcc dist: bionic +branches: + only: + - master + script: - mkdir build - cd build - cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_STANDARD=$CXX_STANDARD - - make - - ctest + - cmake --build . -- -j4 + - ctest -j4 diff --git a/3rd_party/run-clang-format b/3rd_party/run-clang-format new file mode 160000 index 00000000..de6e8ca0 --- /dev/null +++ b/3rd_party/run-clang-format @@ -0,0 +1 @@ +Subproject commit de6e8ca07d171a7f378d379ff252a00f2905e81d diff --git a/CMakeLists.txt b/CMakeLists.txt index 6987ceee..3dbd25a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,18 +1,35 @@ -cmake_minimum_required(VERSION 2.8) -project(fast_ber) +cmake_minimum_required(VERSION 3.0) +project(fast_ber VERSION "0.4") if (NOT DEFINED CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD 11) endif() -add_subdirectory(3rd_party/abseil-cpp) +option(SKIP_TESTING "Skip building tests" OFF) +option(SKIP_AUTO_GENERATION "Use checked in lexer rather than generating with bison" OFF) + +if (NOT ${SKIP_TESTING}) + enable_testing() +endif() + +set(ABSEIL_LIBS absl::base absl::container absl::strings absl::variant absl::optional absl::time absl::flat_hash_set) +if (EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") + include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) + conan_basic_setup() + set(ABSEIL_LIBS absl::absl) + find_package(absl REQUIRED CONFIG) +elseif (EXISTS "${CMAKE_SOURCE_DIR}/3rd_party/abseil-cpp/CMakeLists.txt") + add_subdirectory("3rd_party/abseil-cpp") + set(SKIP_INSTALL TRUE) +else() + find_package(absl REQUIRED) +endif() set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(default_build_type Release) -set(SKIP_AUTO_GENERATION false) # Set to true to avoid bison / asn1c autogeneration (use checked in files instead) set(BENCHMARKS_INCLUDE_ASN1C true) -if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") +if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") add_compile_options("-O3" "-Wall" "-Wextra" "-pedantic" "-Wcast-align" "-Wpointer-arith" "-Wshadow") add_compile_options("-Wfloat-equal" "-Wuninitialized") add_compile_options("-Wno-missing-field-initializers") # Stop spam on g++-4.8 @@ -20,11 +37,17 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER if (CMAKE_BUILD_TYPE MATCHES "Debug") add_compile_options("-g") - # add_compile_options("-fsanitize=address" "-Werror") - # set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address") + if (${FB_ENABLE_SANITIZER}) + message("Enabled sanitizer") + add_compile_options("-fsanitize=address" "-fsanitize=undefined" "-Werror") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address -fsanitize=undefined -static-libsan") + endif() else() - add_definitions("-DNDEBUG") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto") + add_definitions("-DNDEBUG -march=native") + if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + # Link time optimisation. Disabled on clang due to issue on travis + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto") + endif() set(SKIP_AUTO_GENERATION true) endif() else() @@ -38,8 +61,9 @@ else() endif () endif() -enable_testing() add_subdirectory(src) -add_subdirectory(test) -add_subdirectory(sample) -add_subdirectory(benchmarks) +if (DEFINED CMAKE_TESTING_ENABLED) + add_subdirectory(test) + add_subdirectory(sample) + add_subdirectory(benchmarks) +endif() diff --git a/README.md b/README.md index fc137810..2d105add 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# fast_ber ![version](https://img.shields.io/github/tag/samuel-tyler/fast_ber.svg) [![Appveyor status](https://ci.appveyor.com/api/projects/status/github/Samuel-Tyler/fast_ber?branch=master&svg=true)](https://ci.appveyor.com/project/Samuel-Tyler/fast-ber) [![Travis status](https://api.travis-ci.com/Samuel-Tyler/fast_ber.svg?branch=master)](https://travis-ci.com/Samuel-Tyler/fast_ber) ![C++11](https://img.shields.io/badge/language-C%2B%2B11-green.svg) ![C++14](https://img.shields.io/badge/language-C%2B%2B14-green.svg) ![C++17](https://img.shields.io/badge/language-C%2B%2B17-green.svg) ![C++20](https://img.shields.io/badge/language-C%2B%2B20-green.svg) +# fast_ber ![version](https://img.shields.io/github/tag/samuel-tyler/fast_ber.svg) [![Appveyor status](https://ci.appveyor.com/api/projects/status/github/Samuel-Tyler/fast_ber?branch=master&svg=true)](https://ci.appveyor.com/project/Samuel-Tyler/fast-ber) [![Travis status](https://api.travis-ci.com/Samuel-Tyler/fast_ber.svg?branch=master)](https://travis-ci.com/Samuel-Tyler/fast_ber) ![C++11](https://img.shields.io/badge/language-C%2B%2B11-green.svg) ![C++14](https://img.shields.io/badge/language-C%2B%2B14-green.svg) ![C++17](https://img.shields.io/badge/language-C%2B%2B17-green.svg) ![C++20](https://img.shields.io/badge/language-C%2B%2B20-green.svg) ![clang-format](https://github.com/Samuel-Tyler/fast_ber/workflows/clang-format/badge.svg) A performant ASN.1 BER encoding and decoding library written in C++11 ## Introduction @@ -8,7 +8,6 @@ fast_ber is a small, lightweight library for BER encoding and decoding. Fast ber - Simple, modern C++ interface - ASN.1 sequences are represented as POD structs - no private members or complex getters and setters - No exceptions, no RTTI and limited memory allocations (everything is small buffer optimised) -- Header only - View classes are provided for zero copy decoding - Interfaces mimic STL types such as std::string, std::vector and std::optional @@ -18,13 +17,27 @@ fast_ber is a small, lightweight library for BER encoding and decoding. Fast ber - No circular data structures - Size and value constraints are not implemented +### Tools +fast_ber_view can be used to dump the contents of a BER PDU, without requiring a schema. +``` +./build/src/fast_ber_view ./build_gcc/sample/pokemon.ber | jq +{ + "length": 125, + "identifier": { + "class": "Universal", + "tag": "Sequence / Sequence Of" + }, + "content": ... +} +``` + ## Call for Test Data Test data is wanted to improve this project! If you have any test ASN.1 specs or BER files please share them. More test data will improve parsing and help find any issues with the library. ## Example Project `fast_ber` is designed to be easy to consume via CMake. This is demonstrated in [`fast_ber_ldap3`](https://github.com/Samuel-Tyler/fast_ber_ldap3), an example project using `fast_ber` to create and dissect LDAP3 certificates. -## Usage +## Compiler Usage 1. Build the compiler: ``` git submodule update --init diff --git a/appveyor.yml b/appveyor.yml index 2bc3322d..4997c210 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,3 +1,7 @@ +branches: + only: + - master + platform: - x64 @@ -6,7 +10,7 @@ configuration: image: - Visual Studio 2017 - - Visual Studio 2019 +# - Visual Studio 2019 init: - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" (call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64) @@ -16,11 +20,10 @@ before_build: - git submodule update --init - mkdir build - cd build - + build_script: - cmake .. -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" - cmake --build . --config Release test_script: - - ctest -C Release -j 8 - \ No newline at end of file + - ctest -C Release -j 4 diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 109463ec..12c9c7d6 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -1,5 +1,6 @@ project(fast_ber_benchmarks) +include(${CMAKE_SOURCE_DIR}/cmake/fast_ber_generate.cmake) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/autogen) add_custom_command( @@ -11,14 +12,6 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) add_compile_options("-w") # Silence spam from asn1c build endif() -function(fast_ber_generate input_file output_name) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/autogen/${output_name}.hpp - COMMAND fast_ber_compiler ${input_file} ${CMAKE_CURRENT_BINARY_DIR}/autogen/${output_name} - DEPENDS fast_ber_compiler ${input_file} - ) -endfunction(fast_ber_generate) - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/autogen/asn1c) function(asn1c_generate input_file) add_custom_command( @@ -43,6 +36,6 @@ endif() target_include_directories(${PROJECT_NAME} PRIVATE SYSTEM ${CMAKE_SOURCE_DIR}/3rd_party/Catch2/single_include) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/autogen/asn1c) -target_link_libraries(${PROJECT_NAME} fast_ber_lib absl::strings) +target_link_libraries(${PROJECT_NAME} fast_ber_lib) add_test(NAME fast_ber_benchmarks COMMAND ${PROJECT_NAME}) diff --git a/benchmarks/ComponentPerformance.cpp b/benchmarks/ComponentPerformance.cpp index 68923aab..d069f45d 100644 --- a/benchmarks/ComponentPerformance.cpp +++ b/benchmarks/ComponentPerformance.cpp @@ -4,6 +4,16 @@ #include +struct IntegerDefault +{ + constexpr static int get_value() noexcept { return 100; } +}; + +struct StringDefault +{ + constexpr static const char* get_value() noexcept { return "Test string!"; } +}; + const int iterations = 1000000; template @@ -25,7 +35,7 @@ template void component_benchmark_decode(const T& type, const std::string& type_name) { std::array buffer{}; - fast_ber::encode(absl::Span(buffer), type); + fast_ber::EncodeResult encode_result = fast_ber::encode(absl::Span(buffer), type); T decoded_copy; @@ -34,7 +44,7 @@ void component_benchmark_decode(const T& type, const std::string& type_name) { for (int i = 0; i < iterations; i++) { - res = fast_ber::decode(absl::Span(buffer), decoded_copy); + res = fast_ber::decode(absl::Span(buffer.data(), encode_result.length), decoded_copy); } } REQUIRE(res.success); @@ -67,63 +77,95 @@ void component_benchmark_default_construct(const std::string& type_name) TEST_CASE("Component Performance: Encode") { component_benchmark_encode(fast_ber::Integer<>(-99999999), "Integer"); + component_benchmark_encode(fast_ber::Default, IntegerDefault>(-99999999), "Default Integer"); component_benchmark_encode(fast_ber::Boolean<>(true), "Boolean"); component_benchmark_encode(fast_ber::OctetString<>("Test string!"), "OctetString"); + component_benchmark_encode(fast_ber::Default, StringDefault>("Test string!"), + "Default OctetString"); component_benchmark_encode(fast_ber::Null<>(), "Null"); + component_benchmark_encode(fast_ber::Real<>(0.333333333333333314829616256247390992939472198486328125), "Real"); component_benchmark_encode(fast_ber::ObjectIdentifier<>(fast_ber::ObjectIdentifierComponents{1, 2, 840, 113549}), "ObjectIdentifier"); component_benchmark_encode(fast_ber::Optional>("hello!"), "Optional (String)"); component_benchmark_encode(fast_ber::Optional>(500), "Optional (Integer)"); component_benchmark_encode(fast_ber::Optional>(absl::nullopt), "Optional (Empty)"); + component_benchmark_encode(fast_ber::Choice, fast_ber::OctetString<>>>( + fast_ber::OctetString<>("hello!")), + "Choice (String)"); + component_benchmark_encode(fast_ber::Choice, fast_ber::OctetString<>>, + fast_ber::ChoiceId>, + fast_ber::Identifier>>, + fast_ber::StorageMode::dynamic>(fast_ber::OctetString<>("hello!")), + "Choice (String, D)"); component_benchmark_encode( - fast_ber::Choice, fast_ber::OctetString<>>(fast_ber::OctetString<>("hello!")), - "Choice (String)"); - component_benchmark_encode(fast_ber::Choice, fast_ber::OctetString<>>(fast_ber::Integer<>(5)), - "Choice (Integer)"); + fast_ber::Choice, fast_ber::OctetString<>>>(fast_ber::Integer<>(5)), + "Choice (Integer)"); } TEST_CASE("Component Performance: Decode") { component_benchmark_decode(fast_ber::Integer<>(-99999999), "Integer"); + component_benchmark_decode(fast_ber::Default, IntegerDefault>(-99999999), "Default Integer"); component_benchmark_decode(fast_ber::Boolean<>(true), "Boolean"); component_benchmark_decode(fast_ber::OctetString<>("Test string!"), "OctetString"); + component_benchmark_decode(fast_ber::Default, StringDefault>("Test string!"), + "Default OctetString"); component_benchmark_decode(fast_ber::Null<>(), "Null"); + component_benchmark_decode(fast_ber::Real<>(0.333333333333333314829616256247390992939472198486328125), "Real"); component_benchmark_decode(fast_ber::ObjectIdentifier<>(fast_ber::ObjectIdentifierComponents{1, 2, 840, 113549}), "ObjectIdentifier"); component_benchmark_decode(fast_ber::Optional>("hello!"), "Optional (String)"); component_benchmark_decode(fast_ber::Optional>(500), "Optional (Integer)"); component_benchmark_decode(fast_ber::Optional>(absl::nullopt), "Optional (Empty)"); + component_benchmark_decode(fast_ber::Choice, fast_ber::OctetString<>>>( + fast_ber::OctetString<>("hello!")), + "Choice (String)"); + component_benchmark_decode(fast_ber::Choice, fast_ber::OctetString<>>, + fast_ber::ChoiceId>, + fast_ber::Identifier>>, + fast_ber::StorageMode::dynamic>(fast_ber::OctetString<>("hello!")), + "Choice (String, D)"); component_benchmark_decode( - fast_ber::Choice, fast_ber::OctetString<>>(fast_ber::OctetString<>("hello!")), - "Choice (String)"); - component_benchmark_decode(fast_ber::Choice, fast_ber::OctetString<>>(fast_ber::Integer<>(5)), - "Choice (Integer)"); + fast_ber::Choice, fast_ber::OctetString<>>>(fast_ber::Integer<>(5)), + "Choice (Integer)"); } TEST_CASE("Component Performance: Object Construction") { component_benchmark_construct>(-99999999, "Integer"); + component_benchmark_construct, IntegerDefault>>(-99999999, "Default Integer"); component_benchmark_construct>(true, "Boolean"); component_benchmark_construct>("Test string!", "OctetString"); + component_benchmark_construct, StringDefault>>("Test string!", + "Default String"); component_benchmark_construct>(fast_ber::Null<>{}, "Null"); + component_benchmark_construct>(0.333333333333333314829616256247390992939472198486328125, "Real"); component_benchmark_construct>(fast_ber::ObjectIdentifierComponents{1, 2, 840, 113549}, "ObjectIdentifier"); component_benchmark_construct>>("hello!", "Optional (String)"); component_benchmark_construct>>(500, "Optional (Integer)"); component_benchmark_construct>>(absl::nullopt, "Optional (Empty)"); - component_benchmark_construct, fast_ber::OctetString<>>>( + component_benchmark_construct, fast_ber::OctetString<>>>>( fast_ber::OctetString<>("hello!"), "Choice (String)"); - component_benchmark_construct, fast_ber::OctetString<>>>( + component_benchmark_construct, fast_ber::OctetString<>>, + fast_ber::ChoiceId>, fast_ber::Identifier>>, + fast_ber::StorageMode::dynamic>>(fast_ber::OctetString<>("hello!"), "Choice (String, D)"); + component_benchmark_construct, fast_ber::OctetString<>>>>( fast_ber::Integer<>(5), "Choice (Integer)"); } TEST_CASE("Component Performance: Default Construction") { component_benchmark_default_construct>("Integer"); + component_benchmark_default_construct, IntegerDefault>>("Default Int"); component_benchmark_default_construct>("Boolean"); component_benchmark_default_construct>("OctetString"); + component_benchmark_default_construct, StringDefault>>("Default Str"); component_benchmark_default_construct>("Null"); + component_benchmark_default_construct>("Real"); component_benchmark_default_construct>("ObjectId"); component_benchmark_default_construct>>("Optional"); - component_benchmark_default_construct, fast_ber::OctetString<>>>("Choice"); + component_benchmark_default_construct< + fast_ber::Choice, fast_ber::OctetString<>>>>("Choice"); } diff --git a/benchmarks/PerformanceTests.cpp b/benchmarks/PerformanceTests.cpp index e9b8869a..d785c644 100644 --- a/benchmarks/PerformanceTests.cpp +++ b/benchmarks/PerformanceTests.cpp @@ -133,7 +133,7 @@ TEST_CASE("Benchmark: Decode Performance") { bool success = false; - BENCHMARK("fast_ber - decode " + std::to_string(large_test_collection_packet.size()) + " byte packet") + BENCHMARK("fast_ber - 1,000,000 x decode " + std::to_string(large_test_collection_packet.size()) + "B pdu") { for (int i = 0; i < iterations; i++) { @@ -148,7 +148,7 @@ TEST_CASE("Benchmark: Decode Performance") #ifdef INCLUDE_ASN1C asn_dec_rval_t rval = {}; - BENCHMARK("asn1c - decode " + std::to_string(large_test_collection_packet.size()) + " byte packet") + BENCHMARK("asn1c - 1,000,000 x decode " + std::to_string(large_test_collection_packet.size()) + "B pdu") { for (int i = 0; i < iterations; i++) { @@ -162,7 +162,7 @@ TEST_CASE("Benchmark: Decode Performance") REQUIRE(rval.code == RC_OK); #endif - BENCHMARK("fast_ber - decode " + std::to_string(small_test_collection_packet.size()) + " byte packet") + BENCHMARK("fast_ber - 1,000,000 x decode " + std::to_string(small_test_collection_packet.size()) + "B pdu") { for (int i = 0; i < iterations; i++) { @@ -176,7 +176,7 @@ TEST_CASE("Benchmark: Decode Performance") REQUIRE(success); #ifdef INCLUDE_ASN1C - BENCHMARK("asn1c - decode " + std::to_string(small_test_collection_packet.size()) + " byte packet") + BENCHMARK("asn1c - 1,000,000 x decode " + std::to_string(small_test_collection_packet.size()) + "B pdu") { for (int i = 0; i < iterations; i++) { @@ -212,9 +212,9 @@ TEST_CASE("Benchmark: Encode Performance") fast_ber::Integer<>(-42), fast_ber::SequenceOf>{}}, fast_ber::Simple::Child>{ 999999999, fast_ber::SequenceOf>{the, second, child, long_string}}, - decltype(collection.the_choice){absl::in_place_index_t<1>(), "I chose a string!"}}; + decltype(collection.the_choice){fast_ber::in_place_index_t<1>(), "I chose a string!"}}; - BENCHMARK("fast_ber - encode") + BENCHMARK("fast_ber - 1,000,000 x encode " + std::to_string(fast_ber::encoded_length(collection)) + "B pdu") { for (int i = 0; i < iterations; i++) { @@ -249,7 +249,7 @@ TEST_CASE("Benchmark: Encode Performance") asn1c_collection.the_choice.present = the_choice_PR_goodbye; OCTET_STRING_fromString(&asn1c_collection.the_choice.choice.goodbye, "I chose a string!"); - BENCHMARK("asn1c - encode") + BENCHMARK("asn1c - 1,000,000 x encode " + std::to_string(fast_ber::encoded_length(collection)) + "B pdu") { for (int i = 0; i < iterations; i++) { @@ -286,7 +286,7 @@ TEST_CASE("Benchmark: Object Construction Performance") const std::string second = "second"; const std::string child = "child"; - BENCHMARK("fast_ber - construct") + BENCHMARK("fast_ber - 1,000,000 x construct data") { for (int i = 0; i < iterations; i++) { @@ -299,12 +299,12 @@ TEST_CASE("Benchmark: Object Construction Performance") -42, fast_ber::SequenceOf>{}}, fast_ber::Simple::Child>{ 999999999, fast_ber::SequenceOf>{the, second, child, long_string}}, - decltype(collection.the_choice){absl::in_place_index_t<1>(), "I chose a string!"}}; + decltype(collection.the_choice){fast_ber::in_place_index_t<1>(), "I chose a string!"}}; } } #ifdef INCLUDE_ASN1C - BENCHMARK("asn1c - construct") + BENCHMARK("asn1c - 1,000,000 x construct data") { for (int i = 0; i < iterations; i++) { @@ -369,10 +369,10 @@ TEST_CASE("Benchmark: Calculate Encoded Length Performance") fast_ber::Integer<>(-42), fast_ber::SequenceOf>{}}, fast_ber::Simple::Child>{ 999999999, fast_ber::SequenceOf>{the, second, child, long_string}}, - decltype(collection.the_choice){absl::in_place_index_t<1>(), "I chose a string!"}}; + decltype(collection.the_choice){fast_ber::in_place_index_t<1>(), "I chose a string!"}}; size_t encoded_length = 0; - BENCHMARK("fast_ber - calculate encoded length") + BENCHMARK("fast_ber - 1,000,000 x encoded length") { for (int i = 0; i < iterations; i++) { diff --git a/benchmarks/history/results_v0.2-73-gc6655d1.txt b/benchmarks/history/results_v0.2-73-gc6655d1.txt new file mode 100644 index 00000000..f60832bf --- /dev/null +++ b/benchmarks/history/results_v0.2-73-gc6655d1.txt @@ -0,0 +1,126 @@ + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +fast_ber_benchmarks is a Catch v2.4.1 host application. +Run with -? for options + +------------------------------------------------------------------------------- +Component Performance: Encode +------------------------------------------------------------------------------- +/home/styler/git/fast_ber/benchmarks/ComponentPerformance.cpp:67 +............................................................................... + +benchmark name iters elapsed ns average +------------------------------------------------------------------------------- +fast_ber - encode Integer 1 460575 460.575 µs +fast_ber - encode Boolean 1 515376 515.376 µs +fast_ber - encode OctetString 10000 4978 0 ns +fast_ber - encode Null 1 388767 388.767 µs +fast_ber - encode ObjectIdentifier 10000 7749 0 ns +fast_ber - encode Optional (String) 10000 21448 2 ns +fast_ber - encode Optional (Integer) 1 371377 371.377 µs +fast_ber - encode Optional (Empty) 1 378639 378.639 µs +fast_ber - encode Choice (String) 1 14983 14.983 µs +fast_ber - encode Choice (Integer) 10000 19813 1 ns + +------------------------------------------------------------------------------- +Component Performance: Decode +------------------------------------------------------------------------------- +/home/styler/git/fast_ber/benchmarks/ComponentPerformance.cpp:85 +............................................................................... + +benchmark name iters elapsed ns average +------------------------------------------------------------------------------- +fast_ber - decode Integer 1 3146632 3.14663 ms +fast_ber - decode Boolean 1 3252004 3.252 ms +fast_ber - decode OctetString 1 16726965 16.727 ms +fast_ber - decode Null 1 14981 14.981 µs +fast_ber - decode ObjectIdentifier 1 15858095 15.8581 ms +fast_ber - decode Optional (String) 1 25950858 25.9509 ms +fast_ber - decode Optional (Integer) 1 4935738 4.93574 ms +fast_ber - decode Optional (Empty) 1 2283447 2.28345 ms +fast_ber - decode Choice (String) 1 52020709 52.0207 ms +fast_ber - decode Choice (Integer) 1 38877559 38.8776 ms + +------------------------------------------------------------------------------- +Component Performance: Object Construction +------------------------------------------------------------------------------- +/home/styler/git/fast_ber/benchmarks/ComponentPerformance.cpp:103 +............................................................................... + +benchmark name iters elapsed ns average +------------------------------------------------------------------------------- +fast_ber - construct Integer 1 11844153 11.8442 ms +fast_ber - construct Boolean 10000 3964 0 ns +fast_ber - construct OctetString 1 19587422 19.5874 ms +fast_ber - construct Null 10000 3929 0 ns +fast_ber - construct ObjectIdentifier 1 37351100 37.3511 ms +fast_ber - construct Optional (String) 1 20681561 20.6816 ms +fast_ber - construct Optional (Integer) 1 11134676 11.1347 ms +fast_ber - construct Optional (Empty) 10000 4019 0 ns +fast_ber - construct Choice (String) 1 24750730 24.7507 ms +fast_ber - construct Choice (Integer) 1 14988 14.988 µs + +------------------------------------------------------------------------------- +Component Performance: Default Construction +------------------------------------------------------------------------------- +/home/styler/git/fast_ber/benchmarks/ComponentPerformance.cpp:120 +............................................................................... + +benchmark name iters elapsed ns average +------------------------------------------------------------------------------- +fast_ber - dflt construct Integer 10000 4134 0 ns +fast_ber - dflt construct Boolean 10000 4059 0 ns +fast_ber - dflt construct OctetString 10000 4001 0 ns +fast_ber - dflt construct Null 10000 4040 0 ns +fast_ber - dflt construct ObjectId 10000 4074 0 ns +fast_ber - dflt construct Optional 10000 4069 0 ns +fast_ber - dflt construct Choice 1 14983 14.983 µs + +------------------------------------------------------------------------------- +Benchmark: Decode Performance +------------------------------------------------------------------------------- +/home/styler/git/fast_ber/benchmarks/PerformanceTests.cpp:132 +............................................................................... + +benchmark name iters elapsed ns average +------------------------------------------------------------------------------- +fast_ber - decode 2107 byte packet 1 539384429 539.384 ms +asn1c - decode 2107 byte packet 1 5130738816 5.13074 s +fast_ber - decode 64 byte packet 1 209394677 209.395 ms +asn1c - decode 64 byte packet 1 2706407447 2.70641 s + +------------------------------------------------------------------------------- +Benchmark: Encode Performance +------------------------------------------------------------------------------- +/home/styler/git/fast_ber/benchmarks/PerformanceTests.cpp:194 +............................................................................... + +benchmark name iters elapsed ns average +------------------------------------------------------------------------------- +fast_ber - encode 1 214658186 214.658 ms +asn1c - encode 1 8031415662 8.03142 s + +------------------------------------------------------------------------------- +Benchmark: Object Construction Performance +------------------------------------------------------------------------------- +/home/styler/git/fast_ber/benchmarks/PerformanceTests.cpp:280 +............................................................................... + +benchmark name iters elapsed ns average +------------------------------------------------------------------------------- +fast_ber - construct 1 806860719 806.861 ms +asn1c - construct 1 490988757 490.989 ms + +------------------------------------------------------------------------------- +Benchmark: Calculate Encoded Length Performance +------------------------------------------------------------------------------- +/home/styler/git/fast_ber/benchmarks/PerformanceTests.cpp:351 +............................................................................... + +benchmark name iters elapsed ns average +------------------------------------------------------------------------------- +fast_ber - calculate encoded length 1 15169923 15.1699 ms + +=============================================================================== +All tests passed (29 assertions in 8 test cases) + diff --git a/cmake/fast_ber_config.cmake.in b/cmake/fast_ber_config.cmake.in new file mode 100644 index 00000000..848b3d59 --- /dev/null +++ b/cmake/fast_ber_config.cmake.in @@ -0,0 +1,6 @@ +@PACKAGE_INIT@ + +if(NOT TARGET fast_ber::fast_ber_lib) + include(${CMAKE_CURRENT_LIST_DIR}/fast_ber_targets.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/fast_ber_generate.cmake) +endif() diff --git a/cmake/fast_ber_generate.cmake b/cmake/fast_ber_generate.cmake new file mode 100644 index 00000000..179f973c --- /dev/null +++ b/cmake/fast_ber_generate.cmake @@ -0,0 +1,8 @@ +function(fast_ber_generate input_file output_name) + file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/autogen) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/autogen/${output_name}.hpp + COMMAND fast_ber::fast_ber_compiler ${input_file} ${CMAKE_CURRENT_BINARY_DIR}/autogen/${output_name} + DEPENDS fast_ber::fast_ber_compiler ${input_file} + ) +endfunction(fast_ber_generate) diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 00000000..f3aebb29 --- /dev/null +++ b/conanfile.py @@ -0,0 +1,33 @@ +from conans import ConanFile, CMake, tools +import os + +class FastberConan(ConanFile): + name = "fast_ber" + version = "0.4" + license = "Boost Software License 1.0" + author = "Samuel Tyler" + url = "https://github.com/Samuel-Tyler/fast_ber" + description = "A performant ASN.1 BER encoding and decoding library written in C++11" + topics = ("ASN", "ASN1", "ASN.1", "BER", "Serialization") + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False]} + default_options = {"shared": False} + generators = ("cmake", "cmake_find_package_multi") + requires = "abseil/20200205" + scm = {"type": "git", "url": url, "revision": "master", "subfolder": name} + + def build(self): + cmake = CMake(self) + cmake.definitions["SKIP_TESTING"] = True + cmake.definitions["SKIP_AUTO_GENERATION"] = True + cmake.configure(source_folder=self.name) + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + self.env_info.PATH = os.path.join(self.package_folder, "bin") + diff --git a/include/fast_ber/ber_types/All.hpp b/include/fast_ber/ber_types/All.hpp index 8eb3c0fc..7825bb93 100644 --- a/include/fast_ber/ber_types/All.hpp +++ b/include/fast_ber/ber_types/All.hpp @@ -9,6 +9,7 @@ #include "Choice.hpp" #include "Date.hpp" #include "DateTime.hpp" +#include "Default.hpp" #include "Duration.hpp" #include "EmbeddedPDV.hpp" #include "Enumerated.hpp" diff --git a/include/fast_ber/ber_types/Any.hpp b/include/fast_ber/ber_types/Any.hpp index 804731bd..61befe0e 100644 --- a/include/fast_ber/ber_types/Any.hpp +++ b/include/fast_ber/ber_types/Any.hpp @@ -7,7 +7,7 @@ namespace fast_ber { template -using Any = - Choice, Boolean<>, CharacterString<>, Date<>, DateTime<>, Duration<>, GeneralizedTime<>, Integer<>, - Null<>, ObjectIdentifier<>, OctetString<>, Real<>, Time<>, TimeOfDay<>, UTCTime<>, VisibleString<>>; +using Any = Choice< + Choices, Boolean<>, CharacterString<>, Date<>, DateTime<>, Duration<>, GeneralizedTime<>, Integer<>, + Null<>, ObjectIdentifier<>, OctetString<>, Real<>, Time<>, TimeOfDay<>, UTCTime<>, VisibleString<>>>; } diff --git a/include/fast_ber/ber_types/Boolean.hpp b/include/fast_ber/ber_types/Boolean.hpp index deed9f18..6ef73d80 100644 --- a/include/fast_ber/ber_types/Boolean.hpp +++ b/include/fast_ber/ber_types/Boolean.hpp @@ -22,29 +22,28 @@ template > class Boolean { public: - Boolean() noexcept : Boolean(false) {} + Boolean() noexcept = default; Boolean(bool val) noexcept { assign(val); } template Boolean(const Boolean& rhs) noexcept; - explicit Boolean(BerView& view) noexcept { assign_ber(view); } - explicit Boolean(absl::Span ber_data) noexcept { assign_ber(ber_data); } + explicit Boolean(BerView view) noexcept { decode(view); } // Implicit conversion to bool - operator bool() const noexcept { return value(); } - bool value() const noexcept { return static_cast(m_data[1]); } + operator bool() const noexcept { return value(); } + bool value() const noexcept { return static_cast(m_data.back()); } + absl::Span ber() const { return absl::Span(m_data); } Boolean& operator=(bool rhs) noexcept; template Boolean& operator=(const Boolean& rhs) noexcept; - Boolean& operator=(const BerView& rhs) noexcept; - void assign(bool val) noexcept; + + void assign(bool val) noexcept; template - void assign(const Boolean& rhs) noexcept; - size_t assign_ber(const BerView& rhs) noexcept; - size_t assign_ber(absl::Span buffer) noexcept; + void assign(const Boolean& rhs) noexcept; - EncodeResult encode_content_and_length(absl::Span buffer) const noexcept; - constexpr size_t encoded_content_and_length_length() const noexcept { return m_data.size(); } + constexpr static size_t encoded_length() noexcept; + EncodeResult encode(absl::Span buffer) const noexcept; + DecodeResult decode(BerView input) noexcept; using AsnId = Identifier; @@ -52,13 +51,14 @@ class Boolean friend class Boolean; private: - std::array m_data; + std::array m_data = encoded_header(); }; // namespace fast_ber template template -Boolean::Boolean(const Boolean& rhs) noexcept : m_data(rhs.m_data) +Boolean::Boolean(const Boolean& rhs) noexcept { + m_data.back() = rhs.m_data.back(); } template @@ -72,78 +72,60 @@ template template inline Boolean& Boolean::operator=(const Boolean& rhs) noexcept { - assign(rhs); - return *this; -} - -template -inline Boolean& Boolean::operator=(const BerView& rhs) noexcept -{ - assign_ber(rhs); - + m_data.back() = rhs.m_data.back(); return *this; } template inline void Boolean::assign(bool val) noexcept { - m_data = {0x1, static_cast(val ? 0xFF : 0x00)}; + m_data.back() = static_cast(val ? 0xFF : 0x00); } template template inline void Boolean::assign(const Boolean& rhs) noexcept { - m_data = rhs.m_data; -} - -template -inline size_t Boolean::assign_ber(const BerView& rhs) noexcept -{ - if (!rhs.is_valid() || rhs.construction() != Construction::primitive || rhs.content_length() != 1) - { - return 0; - } - - m_data = {0x1, static_cast((*(rhs.content_data()) == 0) ? 0x00 : 0xFF)}; - return 2 + rhs.identifier_length(); + m_data.back() = rhs.m_data.back(); } template -inline size_t Boolean::assign_ber(absl::Span buffer) noexcept +constexpr size_t Boolean::encoded_length() noexcept { - return assign_ber(BerView(buffer)); + return fast_ber::encoded_length(1, Identifier{}); } template -inline EncodeResult Boolean::encode_content_and_length(absl::Span buffer) const noexcept +EncodeResult Boolean::encode(absl::Span output) const noexcept { - if (buffer.size() < m_data.size()) + if (output.size() < this->ber().size()) { return EncodeResult{false, 0}; } - buffer[0] = m_data[0]; - buffer[1] = m_data[1]; - return EncodeResult{true, m_data.size()}; + std::memcpy(output.data(), this->ber().data(), this->ber().size()); + return EncodeResult{true, this->ber().size()}; } template -constexpr size_t encoded_length(const Boolean& object) noexcept +DecodeResult Boolean::decode(BerView input) noexcept { - return encoded_length(object.encoded_content_and_length_length(), Identifier{}); -} - -template -EncodeResult encode(absl::Span output, const Boolean& object) noexcept -{ - return encode_impl(output, object, Identifier{}); -} + if (!has_correct_header(input, Identifier{}, Construction::primitive)) + { + return DecodeResult{false}; + } -template -DecodeResult decode(BerViewIterator& input, Boolean& output) noexcept -{ - return decode_impl(input, output, Identifier{}); + if (Identifier::depth() == 1 && input.content_length() == 1) + { + m_data.back() = *input.content_data(); + return DecodeResult{true}; + } + if (Identifier::depth() == 2 && input.begin()->content_length() == 1) + { + m_data.back() = *input.begin()->content_data(); + return DecodeResult{true}; + } + return DecodeResult{false}; } template diff --git a/include/fast_ber/ber_types/Choice.hpp b/include/fast_ber/ber_types/Choice.hpp index f1c986e8..a5ce362e 100644 --- a/include/fast_ber/ber_types/Choice.hpp +++ b/include/fast_ber/ber_types/Choice.hpp @@ -7,6 +7,7 @@ #include "fast_ber/ber_types/Class.hpp" #include "fast_ber/ber_types/Tag.hpp" #include "fast_ber/util/DecodeHelpers.hpp" +#include "fast_ber/util/DynamicVariant.hpp" #include "fast_ber/util/EncodeHelpers.hpp" #include @@ -15,49 +16,74 @@ namespace fast_ber { -inline bool is_an_identifier_choice(Class, Tag) { return false; } +inline constexpr bool is_an_identifier_choice(Class, Tag) { return false; } template -bool is_an_identifier_choice(Class class_, Tag tag, Identifier id, Identifiers... ids) +constexpr bool is_an_identifier_choice(Class class_, Tag tag, Identifier id, Identifiers... ids) { - if (id.check_id_match(class_, tag)) - { - return true; - } - - return is_an_identifier_choice(class_, tag, ids...); + return id.check_id_match(class_, tag) ? true : is_an_identifier_choice(class_, tag, ids...); } template struct ChoiceId { - static std::tuple choice_ids() { return {}; }; constexpr static bool check_id_match(Class c, Tag t) { return is_an_identifier_choice(c, t, Identifiers{}...); } }; template -bool is_choid_id(T) +struct IsChoiceId : std::false_type { - return false; -} +}; -template -bool is_choid_id(ChoiceId) +template +struct IsChoiceId> : std::true_type { - return true; -} +}; template -size_t wrap_with_ber_header_length(size_t content_length, ChoiceId) +struct OuterIdentifierT> { - return content_length; -} + using Type = ChoiceId; +}; -template -EncodeResult wrap_with_ber_header(absl::Span, size_t content_length, ChoiceId, size_t = 0) +template +struct Choices { - return EncodeResult{true, content_length}; -} + using DefaultIdentifier = ChoiceId>...>; +}; + +template +struct Choice; + +template +struct ChoiceImplementation +{ +}; + +template +struct ChoiceImplementation, StorageMode::static_> +{ + using Type = absl::variant; + + template + using InPlaceIndex = absl::in_place_index_t; + + template + using InPlaceType = absl::in_place_type_t; +}; + +template +struct ChoiceImplementation, StorageMode::dynamic> +{ + using Type = dynamic::DynamicVariant; + + template + using InPlaceIndex = dynamic::in_place_index_t; + + template + using InPlaceType = dynamic::in_place_type_t; +}; inline void print(std::ostream&) noexcept {} @@ -76,55 +102,397 @@ void print(std::ostream& os, Identifier id, Identifiers... ids) noexcept template inline std::ostream& operator<<(std::ostream& os, const ChoiceId&) noexcept { - os << "ChoiceId("; + os << "["; print(os, Identifiers{}...); - return os << ")"; + return os << "]"; +} + +struct in_place_t +{ + explicit in_place_t() = default; +}; + +static constexpr in_place_t in_place{}; + +template +struct in_place_type_t +{ + explicit in_place_type_t() = default; +}; + +template +struct in_place_index_t +{ + explicit in_place_index_t() = default; +}; + +template +struct variant_size; + +template +struct variant_size, Identifier, storage>> + : std::integral_constant +{ +}; + +template +struct variant_alternative; + +template +struct variant_alternative, Identifier, storage>> +{ + using type = dynamic::detail::TypeAtIndex; +}; + +template +using variant_alternative_t = typename variant_alternative::type; + +template +constexpr bool holds_alternative(const Choice, Identifier, storage>& v) noexcept +{ + return v.index() == dynamic::detail::IndexOf::value; } -template -struct TaggedChoice : public absl::variant +template +T& get(Choice, Identifier, StorageMode::static_>& v) { - using Base = absl::variant; - using Base::Base; - using Base::operator=; + return absl::get(v.base()); +} - Base& base() { return *static_cast(this); } - const Base& base() const { return *static_cast(this); } +template +T&& get(Choice, Identifier, StorageMode::static_>&& v) +{ + return absl::get(v.base()); +} - TaggedChoice() : Base() {} - TaggedChoice(const TaggedChoice& rhs) = default; - TaggedChoice(TaggedChoice&& rhs) = default; +template +const T& get(const Choice, Identifier, StorageMode::static_>& v) +{ + return absl::get(v.base()); +} - TaggedChoice& operator=(const TaggedChoice& rhs) = default; +template +const T&& get(const Choice, Identifier, StorageMode::static_>&& v) +{ + return absl::get(v.base()); +} - bool operator==(const TaggedChoice& rhs) const { return this->base() == rhs.base(); } - bool operator!=(const TaggedChoice& rhs) const { return this->base() != rhs.base(); } +template +variant_alternative_t, Identifier, StorageMode::static_>>& +get(Choice, Identifier, StorageMode::static_>& v) +{ + return absl::get(v.base()); +} +template +variant_alternative_t, Identifier, StorageMode::static_>>&& +get(Choice, Identifier, StorageMode::static_>&& v) +{ + return absl::get(v.base()); +} + +template +const variant_alternative_t, Identifier, StorageMode::static_>>& +get(const Choice, Identifier, StorageMode::static_>& v) +{ + return absl::get(v.base()); +} + +template +const variant_alternative_t, Identifier, StorageMode::static_>>&& +get(const Choice, Identifier, StorageMode::static_>&& v) +{ + return absl::get(v.base()); +} + +template +T&& get(Choice, Identifier, StorageMode::dynamic>&& v) +{ + return fast_ber::dynamic::get(v.base()); +} + +template +const T& get(const Choice, Identifier, StorageMode::dynamic>& v) +{ + return fast_ber::dynamic::get(v.base()); +} + +template +const T&& get(const Choice, Identifier, StorageMode::dynamic>&& v) +{ + return fast_ber::dynamic::get(v.base()); +} + +template +variant_alternative_t, Identifier, StorageMode::dynamic>>& +get(Choice, Identifier, StorageMode::dynamic>& v) +{ + return fast_ber::dynamic::get(v.base()); +} + +template +variant_alternative_t, Identifier, StorageMode::dynamic>>&& +get(Choice, Identifier, StorageMode::dynamic>&& v) +{ + return fast_ber::dynamic::get(v.base()); +} + +template +const variant_alternative_t, Identifier, StorageMode::dynamic>>& +get(const Choice, Identifier, StorageMode::dynamic>& v) +{ + return fast_ber::dynamic::get(v.base()); +} + +template +const variant_alternative_t, Identifier, StorageMode::dynamic>>&& +get(const Choice, Identifier, StorageMode::dynamic>&& v) +{ + return fast_ber::dynamic::get(v.base()); +} + +template +constexpr typename std::add_pointer< + variant_alternative_t, Identifier, StorageMode::static_>>>::type +get_if(Choice, Identifier, StorageMode::static_>* v) noexcept +{ + return v ? absl::get_if(&(v->base())) : nullptr; +} + +template +constexpr typename std::add_pointer< + const variant_alternative_t, Identifier, StorageMode::static_>>>::type +get_if(const Choice, Identifier, StorageMode::static_>* v) noexcept +{ + return v ? absl::get_if(&(v->base())) : nullptr; +} + +template +constexpr typename std::add_pointer::type +get_if(Choice, Identifier, StorageMode::static_>* v) noexcept +{ + return v ? absl::get_if(&(v->base())) : nullptr; +} + +template +constexpr typename std::add_pointer::type +get_if(const Choice, Identifier, StorageMode::static_>* v) noexcept +{ + return v ? absl::get_if(&(v->base())) : nullptr; +} + +template +constexpr typename std::add_pointer< + variant_alternative_t, Identifier, StorageMode::dynamic>>>::type +get_if(Choice, Identifier, StorageMode::dynamic>* v) noexcept +{ + return v ? fast_ber::dynamic::get_if(&(v->base())) : nullptr; +} + +template +constexpr typename std::add_pointer< + const variant_alternative_t, Identifier, StorageMode::dynamic>>>::type +get_if(const Choice, Identifier, StorageMode::dynamic>* v) noexcept +{ + return v ? fast_ber::dynamic::get_if(&(v->base())) : nullptr; +} + +template +constexpr typename std::add_pointer::type +get_if(Choice, Identifier, StorageMode::dynamic>* v) noexcept +{ + return v ? fast_ber::dynamic::get_if(&(v->base())) : nullptr; +} + +template +constexpr typename std::add_pointer::type +get_if(const Choice, Identifier, StorageMode::dynamic>* v) noexcept +{ + return v ? fast_ber::dynamic::get_if(&(v->base())) : nullptr; +} + +template +struct Choice, Identifier, storage> +{ + using Implementation = ChoiceImplementation, storage>; + typename Implementation::Type& base() { return m_base; } + const typename Implementation::Type& base() const { return m_base; } + + template + using ToType = typename dynamic::DynamicVariant::template ToType; template - bool operator==(const T& rhs) const + using ExactlyOnce = typename dynamic::DynamicVariant::template ExactlyOnce; + template + using AcceptedIndex = typename dynamic::DynamicVariant::template AcceptedIndex; + template + using AcceptedType = typename dynamic::DynamicVariant::template AcceptedType; + + public: + Choice() = default; + ~Choice() = default; + Choice(const Choice& other) = default; + Choice(Choice&& other) noexcept : m_base(std::move(other.m_base)) {} + Choice& operator=(const Choice& other) = default; + Choice& operator =(Choice&& other) noexcept + { + m_base = std::move(other.m_base); + return *this; + }; + + template , Choice>::value && + ExactlyOnce>::value && + std::is_constructible, T&&>::value>> + Choice(T&& t) noexcept(std::is_nothrow_constructible, T&&>::value) + : m_base(typename Implementation::template InPlaceType>{}, t) { - return base() == rhs; + assert(holds_alternative>(*this)); } - template - bool operator!=(const T& rhs) const + + template ::value && std::is_constructible::value>> + explicit Choice(in_place_type_t, Args&&... args) + : m_base(typename Implementation::template InPlaceType{}, std::forward(args)...) + { + assert(holds_alternative(*this)); + } + + template ::value && + std::is_constructible&, Args&&...>::value>> + explicit Choice(in_place_type_t, std::initializer_list il, Args&&... args) + : m_base(typename Implementation::template InPlaceType{}, il, std::forward(args)...) + { + assert(holds_alternative(*this)); + } + + template , Args&&...>::value>> + explicit Choice(in_place_index_t, Args&&... args) + : m_base(typename Implementation::template InPlaceIndex{}, std::forward(args)...) + { + assert(index() == i); + } + + template < + size_t i, typename U, typename... Args, + typename = absl::enable_if_t, std::initializer_list&, Args&&...>::value>> + explicit Choice(in_place_index_t, std::initializer_list il, Args&&... args) + : m_base(typename Implementation::template InPlaceIndex{}, il, std::forward(args)...) + + { + assert(index() == i); + } + + template , Choice>::value>> + absl::enable_if_t>::value && std::is_constructible, T&&>::value && + std::is_assignable&, T&&>::value, + Choice&> + operator=(T&& t) noexcept(std::is_nothrow_assignable&, T&&>::value&& + std::is_nothrow_constructible, T&&>::value) + { + m_base.template emplace>(std::forward(t)); + return *this; + } + + template ::value && ExactlyOnce::value>> + T& emplace(Args&&... args) + { + return m_base.template emplace(std::forward(args)...); + } + + template &, Args...>::value && + ExactlyOnce::value>> + T& emplace(std::initializer_list il, Args&&... args) + { + return m_base.template emplace(il, std::forward(args)...); + } + + template + absl::enable_if_t, Args...>::value, + variant_alternative_t&> + emplace(Args&&... args) + { + return m_base.template emplace(std::forward(args)...); + } + + template + absl::enable_if_t< + std::is_constructible, std::initializer_list&, Args...>::value, + variant_alternative_t&> + emplace(std::initializer_list il, Args&&... args) { - return base() != rhs; + return m_base.template emplace(il, std::forward(args)...); } + constexpr bool valueless_by_exception() const noexcept { return m_base.valueless_by_exception(); } + + constexpr std::size_t index() const noexcept { return m_base.index(); } + + void swap(Choice& rhs) noexcept { return m_base.swap(rhs.base()); } + + size_t encoded_length() const noexcept; + EncodeResult encode(absl::Span buffer) const noexcept; + DecodeResult decode(BerView input) noexcept; + using AsnId = Identifier; + + private: + typename Implementation::Type m_base; }; -template -using Choice = TaggedChoice, Identifier...>, T0, Args...>; +template +bool operator==(const Choice, Identifier, storage>& a, + const Choice, Identifier, storage>& b) +{ + return a.base() == b.base(); +} + +template +bool operator!=(const Choice, Identifier, storage>& a, + const Choice, Identifier, storage>& b) +{ + return a.base() != b.base(); +} -template -using variant_size = absl::variant_size; +template +bool operator<(const Choice, Identifier, storage>& a, + const Choice, Identifier, storage>& b) +{ + return a.base() < b.base(); +} + +template +bool operator>(const Choice, Identifier, storage>& a, + const Choice, Identifier, storage>& b) +{ + return a.base() > b.base(); +} + +template +bool operator<=(const Choice, Identifier, storage>& a, + const Choice, Identifier, storage>& b) +{ + return a.base() <= b.base(); +} + +template +bool operator>=(const Choice, Identifier, storage>& a, + const Choice, Identifier, storage>& b) +{ + return a.base() >= b.base(); +} -template -using variant_alternative = absl::variant_alternative; +template +auto visit(Visitor&& vis, const Choice, Identifier, StorageMode::dynamic>& variant) + -> decltype(fast_ber::dynamic::visit(vis, variant.base())) +{ + return fast_ber::dynamic::visit(vis, variant.base()); +} -template -auto visit(Visitor&& vis, const TaggedChoice& variant) +template +auto visit(Visitor&& vis, const Choice, Identifier, StorageMode::static_>& variant) -> decltype(absl::visit(vis, variant.base())) { return absl::visit(vis, variant.base()); @@ -139,28 +507,44 @@ struct LengthVisitor } }; -template -size_t encoded_length(const TaggedChoice& choice) noexcept +template ::value, int> = 0> +size_t encoded_length_impl(const Choice, Identifier, storage>& choice) noexcept { LengthVisitor visit; - return wrap_with_ber_header_length(fast_ber::visit(visit, choice), Identifier{}); + return encoded_length(fast_ber::visit(visit, choice), Identifier{}); } -template ::value, int> = 0> +size_t encoded_length_impl(const Choice, Identifier, storage>& choice) noexcept +{ + LengthVisitor visit; + return fast_ber::visit(visit, choice); +} + +template +size_t Choice, Identifier, storage>::encoded_length() const noexcept +{ + return encoded_length_impl(*this); +} + +template ::type = 0> -EncodeResult encode_if(const absl::Span&, const TaggedChoice&) noexcept +EncodeResult encode_if(absl::Span, const Choice, Identifier, storage>&) noexcept { // No substitutions found, fail return EncodeResult{false, 0}; } -template ::type = 0> -EncodeResult encode_if(const absl::Span& buffer, const TaggedChoice& choice) noexcept +EncodeResult encode_if(absl::Span buffer, + const Choice, Identifier, storage>& choice) noexcept { if (choice.index() == index) { - const auto* child = absl::get_if(&choice); + const auto* child = fast_ber::get_if(&choice); assert(child); return encode(buffer, *child); @@ -171,52 +555,68 @@ EncodeResult encode_if(const absl::Span& buffer, const TaggedChoice -EncodeResult encode_choice(const absl::Span& buffer, - const TaggedChoice& choice) noexcept +template +EncodeResult encode_choice(absl::Span buffer, + const Choice, Identifier, storage>& choice) noexcept { - constexpr auto depth = static_cast(fast_ber::variant_size>::value); + constexpr size_t depth = sizeof...(Variants); return encode_if<0, depth>(buffer, choice); } -template -EncodeResult encode(const absl::Span& buffer, const TaggedChoice& choice) noexcept +template ::value, int> = 0> +EncodeResult encode_impl(absl::Span buffer, + const Choice, Identifier, storage>& choice) noexcept { - if (is_choid_id(Identifier{})) + constexpr size_t header_length_guess = encoded_length(0, Identifier{}); + auto child_buffer = buffer; + if (buffer.length() < header_length_guess) { - return encode_choice(buffer, choice); + return EncodeResult{false, 0}; } - - const auto header_length_guess = 2; - auto child_buffer = buffer; child_buffer.remove_prefix(header_length_guess); - const EncodeResult& inner_encode_result = encode_choice(child_buffer, choice); + EncodeResult inner_encode_result = encode_choice(child_buffer, choice); if (!inner_encode_result.success) { return inner_encode_result; } + return wrap_with_ber_header(buffer, inner_encode_result.length, Identifier{}, header_length_guess); } -template ::type = 0> -DecodeResult decode_if(BerViewIterator&, TaggedChoice&) noexcept +template ::value, int> = 0> +EncodeResult encode_impl(absl::Span buffer, + const Choice, Identifier, storage>& choice) noexcept +{ + return encode_choice(buffer, choice); +} + +template +EncodeResult Choice, Identifier, storage>::encode(absl::Span buffer) const noexcept +{ + return encode_impl(buffer, *this); +} + +template = 0> +DecodeResult decode_if(BerView, Choice, Identifier, storage>&) noexcept { // No substitutions found, fail return DecodeResult{false}; } -template ::type = 0> -DecodeResult decode_if(BerViewIterator& input, TaggedChoice& output) noexcept +template = 0> +DecodeResult decode_if(BerView input, Choice, ID, storage>& output) noexcept { - using T = typename fast_ber::variant_alternative>::type; + using T = typename fast_ber::variant_alternative, ID>>::type; - if (Identifier::check_id_match(input->class_(), input->tag())) + if (Identifier::check_id_match(input.class_(), input.tag())) { - T* child = &output.template emplace(); - return decode(input, *child); + T& child = output.template emplace(); + return child.decode(input); } else { @@ -224,35 +624,46 @@ DecodeResult decode_if(BerViewIterator& input, TaggedChoice& ou } } -template -DecodeResult decode(BerViewIterator& input, TaggedChoice& output) noexcept +template ::value, int> = 0> +DecodeResult decode_impl(BerView input, Choice, Identifier, storage>& output) noexcept { - constexpr auto depth = fast_ber::variant_size::type>::value; - if (is_choid_id(Identifier{})) + if (!input.is_valid()) { - const DecodeResult result = decode_if<0, depth>(input, output); - ++input; - return result; + return DecodeResult{false}; } - if (!input->is_valid() || !Identifier::check_id_match(input->class_(), input->tag())) + constexpr auto depth = sizeof...(Variants); + return decode_if<0, depth>(input, output); +} + +template ::value, int> = 0> +DecodeResult decode_impl(BerView input, Choice, Identifier, storage>& output) noexcept +{ + if (!has_correct_header(input, Identifier{}, Construction::constructed)) { return DecodeResult{false}; } - auto child = input->begin(); + BerViewIterator child = (Identifier::depth() == 1) ? input.begin() : input.begin()->begin(); if (!child->is_valid()) { return DecodeResult{false}; } - const DecodeResult result = decode_if<0, depth>(child, output); - ++input; - return result; + constexpr auto depth = sizeof...(Variants); + return decode_if<0, depth>(*child, output); +} + +template +DecodeResult Choice, Identifier, storage>::decode(BerView input) noexcept +{ + return decode_impl(input, *this); } -template -std::ostream& operator<<(std::ostream& os, const TaggedChoice& variant); +template +std::ostream& operator<<(std::ostream& os, const Choice, Identifier, storage>& variant); struct OsVisitor { @@ -265,8 +676,8 @@ struct OsVisitor std::ostream& os; }; -template -std::ostream& operator<<(std::ostream& os, const TaggedChoice& variant) +template +std::ostream& operator<<(std::ostream& os, const Choice, Identifier, storage>& variant) { OsVisitor visitor{os}; diff --git a/include/fast_ber/ber_types/Class.hpp b/include/fast_ber/ber_types/Class.hpp index cbcdb230..c086ce6b 100644 --- a/include/fast_ber/ber_types/Class.hpp +++ b/include/fast_ber/ber_types/Class.hpp @@ -14,11 +14,14 @@ enum class Class private_ = 3 }; -constexpr inline Class get_class(uint8_t first_byte) { return static_cast(first_byte >> 6); } +constexpr size_t class_offset = 6; +constexpr size_t class_mask = 0xC0; + +constexpr inline Class get_class(uint8_t first_byte) { return static_cast(first_byte >> class_offset); } constexpr inline uint8_t add_class(uint8_t first_byte, Class class_) { - return static_cast((static_cast(class_) << 6) | (first_byte & 0x3F)); + return static_cast((static_cast(class_) << class_offset) | (first_byte & ~class_mask)); } inline std::ostream& operator<<(std::ostream& os, const Class& c) noexcept diff --git a/include/fast_ber/ber_types/Construction.hpp b/include/fast_ber/ber_types/Construction.hpp index 98ba4d9f..dc37acfe 100644 --- a/include/fast_ber/ber_types/Construction.hpp +++ b/include/fast_ber/ber_types/Construction.hpp @@ -12,15 +12,19 @@ enum class Construction constructed = 1 }; +constexpr size_t construction_offset = 5; +constexpr size_t construction_mask = 0x20; + constexpr inline Construction get_construction(uint8_t first_byte) { - return (first_byte & 0x20) ? Construction::constructed : Construction::primitive; + return (first_byte & construction_mask) ? Construction::constructed : Construction::primitive; } constexpr inline uint8_t add_construction(uint8_t first_byte, Construction construction) { - return static_cast((static_cast(construction) << 5) | (first_byte & 0xDF)); + return static_cast((static_cast(construction) << construction_offset) | + (first_byte & ~construction_mask)); } inline std::ostream& operator<<(std::ostream& os, const Construction& c) noexcept diff --git a/include/fast_ber/ber_types/Default.hpp b/include/fast_ber/ber_types/Default.hpp new file mode 100644 index 00000000..8aa24e82 --- /dev/null +++ b/include/fast_ber/ber_types/Default.hpp @@ -0,0 +1,249 @@ +#pragma once + +#include "fast_ber/util/DecodeHelpers.hpp" +#include "fast_ber/util/EncodeHelpers.hpp" + +#include "absl/strings/string_view.h" +#include "absl/types/optional.h" + +#include + +namespace fast_ber +{ + +template +struct Default +{ + static_assert(std::is_constructible::value, "Must be convertible"); + + Default() noexcept = default; + Default(const Default& rhs); + Default(Default&& rhs) noexcept; + Default(BerView view) { decode(view); } + + Default(const T& val) : m_item((m_default == val) ? absl::optional() : absl::optional(val)) {} + template + Default(const T2& val) : m_item((DefaultValue::get_value() == val) ? absl::optional() : absl::optional(val)) + { + } + + Default(const char* val) : Default(absl::string_view(val)) // Avoid pointer comparisons for const char* + { + } + + ~Default() noexcept = default; + + Default& operator=(const Default&); + Default& operator=(Default&&) noexcept; + Default& operator=(const T& val); + template + Default& operator=(const T2& val); + Default& operator=(const char* val); + + const T& get() const noexcept { return is_default() ? m_default : *m_item; } + decltype(T{}.value()) value() const noexcept(T{}.value()) { return get()->value(); } + bool is_default() const noexcept { return !m_item; } + void set_to_default() noexcept { m_item = absl::nullopt; } + + size_t encoded_length() const noexcept; + EncodeResult encode(absl::Span buffer) const noexcept; + DecodeResult decode(BerView input) noexcept; + + private: + absl::optional m_item; + const T m_default = T(DefaultValue::get_value()); +}; + +template +struct IdentifierType> +{ + using type = Identifier; +}; + +template +Default::Default(const Default& rhs) : m_item(rhs.m_item) +{ +} + +template +Default::Default(Default&& rhs) noexcept : m_item(std::move(rhs.m_item)) +{ +} + +template +Default& Default::operator=(const Default& rhs) +{ + m_item = rhs.m_item; + return *this; +} + +template +Default& Default::operator=(Default&& rhs) noexcept +{ + m_item = std::move(rhs.m_item); + return *this; +} + +template +template +Default& Default::operator=(const T2& val) +{ + if (DefaultValue::get_value() == val) + { + m_item = absl::nullopt; + } + else + { + m_item = val; + } + return *this; +} + +template +Default& Default::operator=(const T& val) +{ + if (m_default == val) + { + m_item = absl::nullopt; + } + else + { + m_item = val; + } + return *this; +} + +// Avoid pointer comparisons for const char* +template +Default& Default::operator=(const char* val) +{ + *this = absl::string_view(val); + return *this; +} + +template +size_t Default::encoded_length() const noexcept +{ + if (is_default()) + { + return 0; + } + else + { + return m_item->encoded_length(); + } +} + +template +EncodeResult Default::encode(absl::Span buffer) const noexcept +{ + if (is_default()) + { + return {true, 0}; + } + else + { + return m_item->encode(buffer); + } +} + +template +DecodeResult Default::decode(BerView input) noexcept +{ + if (input.is_valid() && Identifier::check_id_match(input.class_(), input.tag())) + { + m_item = T(); + return m_item->decode(input); + } + else if (!input.is_valid()) + { + this->set_to_default(); + return DecodeResult{true}; + } + else + { + return DecodeResult{false}; + } +} + +template +DecodeResult decode(BerViewIterator& input, Default& output) noexcept +{ + if (input->is_valid() && Identifier::check_id_match(input->class_(), input->tag())) + { + return output.decode(*input); + } + else + { + output.set_to_default(); + return DecodeResult{true}; + } +} + +template +std::ostream& operator<<(std::ostream& os, const Default& default_type) +{ + return os << default_type.get(); +} + +template +bool operator==(const Default& lhs, const T2& rhs) +{ + return lhs.get() == rhs; +} + +template +bool operator==(const T& lhs, const Default& rhs) +{ + return lhs == rhs.get(); +} + +template +bool operator==(const Default& lhs, const Default& rhs) +{ + return lhs.get() == rhs.get(); +} + +template +bool operator==(const Default& lhs, const char* rhs) +{ + return lhs.get() == absl::string_view(rhs); +} + +template +bool operator==(const char* lhs, const Default& rhs) +{ + return absl::string_view(lhs) == rhs.get(); +} + +template +bool operator!=(const Default& lhs, const T2& rhs) +{ + return !(lhs == rhs); +} + +template +bool operator!=(const T& lhs, const Default& rhs) +{ + return !(lhs == rhs); +} + +template +bool operator!=(const Default& lhs, const Default& rhs) +{ + return !(lhs == rhs); +} + +template +bool operator!=(const Default& lhs, const char* rhs) +{ + return !(lhs == rhs); +} + +template +bool operator!=(const char* lhs, const Default& rhs) +{ + return !(lhs == rhs); +} + +} // namespace fast_ber diff --git a/include/fast_ber/ber_types/Enumerated.hpp b/include/fast_ber/ber_types/Enumerated.hpp index 35cd39ec..0a09663a 100644 --- a/include/fast_ber/ber_types/Enumerated.hpp +++ b/include/fast_ber/ber_types/Enumerated.hpp @@ -20,7 +20,7 @@ class Enumerated { assign(rhs); } - explicit Enumerated(absl::Span ber_data) noexcept { assign_ber(ber_data); } + explicit Enumerated(absl::Span ber_data) noexcept { decode(ber_data); } using Values = EnumeratedType; @@ -46,45 +46,45 @@ class Enumerated return !(*this == rhs); } - bool operator==(EnumeratedType rhs) const { return this->value() == rhs; } - bool operator!=(EnumeratedType rhs) const { return !(*this == rhs); } + bool operator==(EnumeratedType rhs) const noexcept { return this->value() == rhs; } + bool operator!=(EnumeratedType rhs) const noexcept { return !(*this == rhs); } template void assign(const Enumerated& rhs) noexcept { m_val.assign(rhs.m_val); } - void assign(EnumeratedType val) noexcept { m_val.assign(static_cast(val)); } - size_t assign_ber(const BerView& rhs) noexcept { return m_val.assign_ber(rhs); } + void assign(EnumeratedType val) noexcept { m_val.assign(static_cast(val)); } using AsnId = Identifier; template friend class Enumerated; - const Integer& container() const noexcept { return m_val; } - Integer& container() noexcept { return m_val; } + size_t encoded_length() const noexcept; + EncodeResult encode(absl::Span output) const noexcept; + DecodeResult decode(BerView input) noexcept; private: Integer m_val; }; template -size_t encoded_length(const Enumerated& object) +size_t Enumerated::encoded_length() const noexcept { - return encoded_length(object.container()); + return this->m_val.encoded_length(); } template -EncodeResult encode(absl::Span output, const Enumerated& object) +EncodeResult Enumerated::encode(absl::Span output) const noexcept { - return encode(output, object.container()); + return this->m_val.encode(output); } template -DecodeResult decode(BerViewIterator& input, Enumerated& output) noexcept +DecodeResult Enumerated::decode(BerView input) noexcept { - return decode(input, output.container()); + return this->m_val.decode(input); } template diff --git a/include/fast_ber/ber_types/GeneralizedTime.hpp b/include/fast_ber/ber_types/GeneralizedTime.hpp index c84a84b8..5ffbe312 100644 --- a/include/fast_ber/ber_types/GeneralizedTime.hpp +++ b/include/fast_ber/ber_types/GeneralizedTime.hpp @@ -1,8 +1,8 @@ #pragma once -#include "fast_ber/util/BerLengthAndContentContainer.hpp" #include "fast_ber/util/DecodeHelpers.hpp" #include "fast_ber/util/EncodeHelpers.hpp" +#include "fast_ber/util/FixedIdBerContainer.hpp" #include "absl/strings/string_view.h" #include "absl/time/time.h" @@ -35,17 +35,24 @@ class GeneralizedTime std::string string() const; TimeFormat format() const; - size_t assign_ber(const BerView& view) noexcept; - size_t encoded_content_and_length_length() const noexcept { return m_contents.content_and_length_length(); } - EncodeResult encode_content_and_length(absl::Span buffer) const noexcept; - + GeneralizedTime() noexcept { set_time(absl::Time()); } + GeneralizedTime(const GeneralizedTime&) = default; + GeneralizedTime(GeneralizedTime&&) noexcept = default; GeneralizedTime(const absl::Time& time) { set_time(time); } - GeneralizedTime() { set_time(absl::Time()); } + explicit GeneralizedTime(BerView view) { decode(view); } + ~GeneralizedTime() noexcept = default; + + GeneralizedTime& operator=(const GeneralizedTime&) = default; + GeneralizedTime& operator=(GeneralizedTime&&) noexcept = default; + + size_t encoded_length() const noexcept; + EncodeResult encode(absl::Span buffer) const noexcept; + DecodeResult decode(BerView buffer) noexcept; using AsnId = Identifier; private: - BerLengthAndContentContainer m_contents; + FixedIdBerContainer m_contents; }; template @@ -85,7 +92,8 @@ void GeneralizedTime::set_time(const absl::Time& time, int timezone_ std::string time_str = absl::FormatTime(g_universal_time_with_time_zone_format, time, absl::UTCTimeZone()); std::string timezone_extension = std::string(5, '\0'); - snprintf(&timezone_extension[0], timezone_extension.length() + 1, "%c%2.2d%2.2d", + snprintf(&timezone_extension[0], timezone_extension.length() + 1, + "%c%2.2d%2.2d", // NOLINT(cppcoreguidelines-pro-type-vararg) (timezone_offset_minutes >= 0) ? '+' : '-', std::abs(timezone_offset_minutes) / 60, std::abs(timezone_offset_minutes) % 60); time_str += timezone_extension; @@ -152,41 +160,26 @@ std::string GeneralizedTime::string() const } template -size_t GeneralizedTime::assign_ber(const BerView& view) noexcept +size_t GeneralizedTime::encoded_length() const noexcept { - if (!view.is_valid() || view.construction() != Construction::primitive) - { - return false; - } - if (view.content_length() < minimum_timestamp_length || view.content_length() > max_timestamp_length) - { - return false; - } - return m_contents.assign(view); + return this->m_contents.ber().length(); } template -EncodeResult GeneralizedTime::encode_content_and_length(absl::Span buffer) const noexcept +EncodeResult GeneralizedTime::encode(absl::Span output) const noexcept { - return m_contents.content_and_length_to_raw(buffer); + return this->m_contents.encode(output); } template -size_t encoded_length(const GeneralizedTime& object) +DecodeResult GeneralizedTime::decode(BerView view) noexcept { - return encoded_length(object.encoded_content_and_length_length(), Identifier{}); -} - -template -EncodeResult encode(absl::Span output, const GeneralizedTime& object) -{ - return encode_impl(output, object, Identifier{}); -} - -template -DecodeResult decode(BerViewIterator& input, GeneralizedTime& output) noexcept -{ - return decode_impl(input, output, Identifier{}); + DecodeResult res = m_contents.decode(view); + if (m_contents.content_length() < minimum_timestamp_length || m_contents.content_length() > max_timestamp_length) + { + return DecodeResult{false}; + } + return res; } template diff --git a/include/fast_ber/ber_types/Identifier.hpp b/include/fast_ber/ber_types/Identifier.hpp index b08c15ac..e4239938 100644 --- a/include/fast_ber/ber_types/Identifier.hpp +++ b/include/fast_ber/ber_types/Identifier.hpp @@ -5,34 +5,114 @@ #include "fast_ber/ber_types/Tag.hpp" #include "fast_ber/util/Definitions.hpp" -#include +#include #include namespace fast_ber { +struct RuntimeId +{ + constexpr RuntimeId(Class c, Tag t) : m_class(c), m_tag(t) {} + constexpr RuntimeId(UniversalTag t) : m_class(Class::universal), m_tag(static_cast(t)) {} + + constexpr Class class_() const { return m_class; } + constexpr Tag tag() const { return m_tag; } + + constexpr bool operator==(const RuntimeId& rhs) const { return m_class == rhs.m_class && m_tag == rhs.m_tag; } + constexpr bool operator!=(const RuntimeId& rhs) const { return !(*this == rhs); } + + private: + Class m_class; + Tag m_tag; +}; + +// Any class or tag is valid +template +struct Id +{ + constexpr static Class class_() { return class_1; } + constexpr static Tag tag() { return tag_1; } + + constexpr static size_t depth() { return 1; } + constexpr static bool check_id_match(Class c, Tag t) { return c == class_() && t == tag(); } +}; + template struct DoubleId { - constexpr static bool check_id_match(Class c, Tag t) { return c == class_() && t == tag(); } constexpr static Class class_() { return OuterId::class_(); } constexpr static Tag tag() { return OuterId::tag(); } constexpr static OuterId outer_id() { return {}; } constexpr static InnerId inner_id() { return {}; } + + constexpr static size_t depth() { return 2; } + constexpr static bool check_id_match(Class c, Tag t) { return c == class_() && t == tag(); } }; -// Any class or tag is valid template -struct Id +bool operator==(Id lhs, const RuntimeId& rhs) { - constexpr static bool check_id_match(Class c, Tag t) { return c == class_() && t == tag(); } - constexpr static Class class_() { return class_1; } - constexpr static Tag tag() { return tag_1; } -}; + return lhs.class_() == rhs.class_() && lhs.tag() == rhs.tag(); +} + +template +bool operator!=(Id lhs, const RuntimeId& rhs) +{ + return !(lhs == rhs); +} + +template +bool operator==(const RuntimeId& lhs, Id rhs) +{ + return lhs.class_() == rhs.class_() && lhs.tag() == rhs.tag(); +} + +template +bool operator!=(const RuntimeId& lhs, Id rhs) +{ + return !(lhs == rhs); +} // Class is always universal template -using ExplicitId = Id; +using ExplicitId = Id; + +template +struct InnerIdentifierT; + +template +struct OuterIdentifierT; + +template +struct InnerIdentifierT> +{ + using Type = InnerId; +}; + +template +struct InnerIdentifierT> +{ + using Type = Id; +}; + +template +struct OuterIdentifierT> +{ + using Type = OuterId; +}; + +template +struct OuterIdentifierT> +{ + using Type = Id; +}; + +template +using InnerIdentifier = typename InnerIdentifierT::Type; + +template +using OuterIdentifier = typename OuterIdentifierT::Type; template constexpr InnerId inner_identifier(DoubleId) @@ -46,6 +126,18 @@ constexpr Id inner_identifier(Id) return {}; } +template +constexpr OuterId outer_identifier(DoubleId) +{ + return {}; +} + +template +constexpr Id outer_identifier(Id) +{ + return {}; +} + template struct IdentifierType { @@ -55,21 +147,26 @@ struct IdentifierType template using Identifier = typename IdentifierType::type; -template -std::ostream& operator<<(std::ostream& os, const Id& id) noexcept +inline std::ostream& operator<<(std::ostream& os, RuntimeId id) noexcept { if (id.class_() == Class::universal) { - UniversalTag tag = static_cast(id.tag()); - return os << "Identifier(" << id.class_() << ", " << tag << ")"; + auto tag = static_cast(id.tag()); + return os << R"({ "class": ")" << id.class_() << R"(", "tag": ")" << tag << "\"}"; } - return os << "Identifier(" << id.class_() << ", " << id.tag() << ")"; + return os << R"({ "class": ")" << id.class_() << R"(", "tag": )" << id.tag() << "}"; +} + +template +std::ostream& operator<<(std::ostream& os, Id id) noexcept +{ + return os << RuntimeId{id.class_(), id.tag()}; } template -std::ostream& operator<<(std::ostream& os, const DoubleId& id) noexcept +std::ostream& operator<<(std::ostream& os, DoubleId id) noexcept { - return os << "DoubleIdentifier(" << id.outer_id() << ", " << id.inner_id() << ")"; + return os << "{ \"outer\": " << id.outer_id() << ", \"inner\": " << id.inner_id() << "}"; } } // namespace fast_ber diff --git a/include/fast_ber/ber_types/Integer.hpp b/include/fast_ber/ber_types/Integer.hpp index e9dd1cb6..4b8cc4c7 100644 --- a/include/fast_ber/ber_types/Integer.hpp +++ b/include/fast_ber/ber_types/Integer.hpp @@ -8,6 +8,7 @@ #include "fast_ber/util/EncodeHelpers.hpp" #include "fast_ber/util/EncodeIdentifiers.hpp" #include "fast_ber/util/Extract.hpp" +#include "fast_ber/util/SmallFixedIdBerContainer.hpp" #include #include @@ -26,29 +27,26 @@ template > class Integer { public: - Integer() noexcept : m_data{0x01, 0x00} {} + Integer() noexcept : m_contents{{0x00}, ConstructionMethod::construct_with_provided_content} {} Integer(int64_t num) noexcept { assign(num); } - Integer(BerView& view) noexcept { assign_ber(view); } + Integer(BerView view) noexcept { decode(view); } template Integer(const Integer& rhs) noexcept; - explicit Integer(absl::Span ber_data) noexcept { assign_ber(ber_data); } - int64_t value() const noexcept; - Integer& operator=(int64_t rhs) noexcept; + Integer& operator=(int64_t rhs) noexcept; template Integer& operator=(const Integer& rhs) noexcept; - Integer& operator=(const BerView& rhs) noexcept; template - bool operator==(const Integer& rhs) const + bool operator==(const Integer& rhs) const noexcept { return this->value() == rhs.value(); } template - bool operator!=(const Integer& rhs) const + bool operator!=(const Integer& rhs) const noexcept { return !(*this == rhs); } @@ -61,26 +59,17 @@ class Integer void assign(int64_t val) noexcept; template - void assign(const Integer& rhs) noexcept; - size_t assign_ber(const BerView& rhs) noexcept; - size_t assign_ber(absl::Span buffer) noexcept; + void assign(const Integer& rhs) noexcept; - size_t encoded_content_and_length_length() const noexcept { return encoded_length(); } - EncodeResult encode_content_and_length(absl::Span buffer) const noexcept; + size_t encoded_length() const noexcept { return m_contents.ber_length(); } + EncodeResult encode(absl::Span buffer) const noexcept { return m_contents.encode(buffer); } + DecodeResult decode(BerView rhs) noexcept { return m_contents.decode(rhs); } template friend class Integer; private: - void set_content_length(uint64_t length) noexcept - { - assert(length <= std::numeric_limits::max()); - m_data[0] = static_cast(length); - } - uint8_t content_length() const noexcept { return m_data[0]; } - size_t encoded_length() const noexcept { return 1 + content_length(); } - - std::array m_data; + SmallFixedIdBerContainer m_contents; }; inline bool decode_integer(absl::Span input, int64_t& output) noexcept @@ -99,7 +88,7 @@ inline bool decode_integer(absl::Span input, int64_t& output) noe output = 0; } - std::array buffer; + std::array buffer{}; const auto offset = sizeof(int64_t) - input.size(); memcpy(buffer.data(), &output, sizeof(int64_t)); for (size_t i = 0; i < input.size(); i++) @@ -113,7 +102,7 @@ inline bool decode_integer(absl::Span input, int64_t& output) noe inline size_t encode_integer(absl::Span output, int64_t input) noexcept { - std::array buffer; + std::array buffer{}; std::memcpy(buffer.data(), &input, sizeof(int64_t)); std::reverse(buffer.begin(), buffer.end()); @@ -142,19 +131,19 @@ inline size_t encode_integer(absl::Span output, int64_t input) noexcept } } - size_t encoded_length = sizeof(int64_t) - to_skip; - if (output.size() < encoded_length) + size_t encoded_len = sizeof(int64_t) - to_skip; + if (output.size() < encoded_len) { return 0; } - std::memcpy(output.data(), buffer.data() + to_skip, encoded_length); - return encoded_length; + std::memcpy(output.data(), buffer.data() + to_skip, encoded_len); + return encoded_len; } template template -Integer::Integer(const Integer& rhs) noexcept : m_data(rhs.m_data) +Integer::Integer(const Integer& rhs) noexcept : m_contents(rhs.m_contents) { } @@ -162,7 +151,7 @@ template inline int64_t Integer::value() const noexcept { int64_t ret = 0; - decode_integer(absl::MakeSpan(m_data.data() + 1, content_length()), ret); + decode_integer(m_contents.content(), ret); return ret; } @@ -184,66 +173,22 @@ inline Integer& Integer::operator=(const Integer inline void Integer::assign(int64_t val) noexcept { - set_content_length(encode_integer(absl::Span(m_data.data() + 1, m_data.size() - 1), val)); + m_contents.resize_content(encode_integer(absl::Span(m_contents.content_data(), sizeof(int64_t)), val)); } template template inline void Integer::assign(const Integer& rhs) noexcept { - m_data = rhs.m_data; -} - -template -inline size_t Integer::assign_ber(const BerView& view) noexcept -{ - if (!view.is_valid() || view.construction() != Construction::primitive) - { - return false; - } - if (view.ber_length() - view.identifier_length() > m_data.size()) - { - return false; - } - - std::copy(view.ber_data() + view.identifier_length(), view.ber_data() + view.ber_length(), m_data.begin()); - return view.ber_length(); -} - -template -inline size_t Integer::assign_ber(absl::Span buffer) noexcept -{ - return assign_ber(BerView(buffer)); -} - -template -inline EncodeResult Integer::encode_content_and_length(absl::Span buffer) const noexcept -{ - if (buffer.size() < encoded_length()) - { - return EncodeResult{false, 0}; - } - - std::copy(m_data.begin(), m_data.begin() + encoded_length(), buffer.data()); - return EncodeResult{true, encoded_length()}; -} - -template -size_t encoded_length(const Integer& object) noexcept -{ - return encoded_length(object.encoded_content_and_length_length(), Identifier{}); -} - -template -EncodeResult encode(absl::Span output, const Integer& object) noexcept -{ - return encode_impl(output, object, Identifier{}); + m_contents = rhs.m_contents; } template DecodeResult decode(BerViewIterator& input, Integer& output) noexcept { - return decode_impl(input, output, Identifier{}); + DecodeResult res = output.decode(*input); + ++input; + return res; } template diff --git a/include/fast_ber/ber_types/Null.hpp b/include/fast_ber/ber_types/Null.hpp index 7346a1e7..92d66a6f 100644 --- a/include/fast_ber/ber_types/Null.hpp +++ b/include/fast_ber/ber_types/Null.hpp @@ -21,9 +21,21 @@ class Null Null(const Null&) noexcept = default; Null(Null&&) noexcept = default; explicit Null(std::nullptr_t) noexcept {} + explicit Null(BerView view) { decode(view); } + ~Null() = default; + + template + Null(const Null&) noexcept + { + } Null& operator=(const Null&) = default; - Null& operator=(Null&&) = default; + Null& operator=(Null&&) noexcept = default; + template + Null& operator=(const Null&) noexcept + { + return *this; + } template bool operator==(const Null&) const noexcept @@ -35,73 +47,54 @@ class Null { return false; } - std::nullptr_t value() { return nullptr; } + std::nullptr_t value() { return nullptr; } + absl::Span ber() const { return absl::Span(m_data); } - size_t assign_ber(const BerView& rhs) noexcept; - size_t assign_ber(absl::Span buffer) noexcept { return assign_ber(BerView(buffer)); } - EncodeResult encode_content_and_length(absl::Span buffer) const noexcept; + constexpr static size_t encoded_length() noexcept; + EncodeResult encode(absl::Span buffer) const noexcept; + DecodeResult decode(BerView buffer) noexcept; using AsnId = Identifier; + + private: + std::array m_data = encoded_header(); }; template -size_t Null::assign_ber(const BerView& rhs) noexcept +constexpr size_t Null::encoded_length() noexcept { - if (rhs.is_valid()) - { - return rhs.ber_length(); - } - else - { - return 0; - } + return fast_ber::encoded_length(0, Identifier{}); } template -EncodeResult Null::encode_content_and_length(absl::Span buffer) const noexcept +EncodeResult Null::encode(absl::Span output) const noexcept { - if (buffer.length() > 0) - { - buffer[0] = 0x00; - return EncodeResult{true, 1}; - } - else + if (output.size() < this->m_data.size()) { return EncodeResult{false, 0}; } -} -template -constexpr size_t encoded_length(const Null&) -{ - return encoded_length(1, Identifier{}); + std::memcpy(output.data(), m_data.data(), this->m_data.size()); + return EncodeResult{true, this->m_data.size()}; } template -EncodeResult encode(absl::Span output, const Null& object) +DecodeResult Null::decode(BerView input) noexcept { - return encode_impl(output, object, Identifier{}); -} - -template -DecodeResult decode(BerViewIterator& input, Null& output) noexcept -{ - return decode_impl(input, output, Identifier{}); -} - -template -EncodeResult encode_content_and_length(absl::Span output, const Null& object) noexcept -{ - return object.encode_content_and_length(output); -} - -template -DecodeResult decode_content_and_length(BerViewIterator& input, Null& output) noexcept -{ - (void)input; - (void)output; + if (!has_correct_header(input, Identifier{}, Construction::primitive)) + { + return DecodeResult{false}; + } - return {}; + if (Identifier::depth() == 1 && input.content_length() == 0) + { + return DecodeResult{true}; + } + if (Identifier::depth() == 2 && input.begin()->content_length() == 0) + { + return DecodeResult{true}; + } + return DecodeResult{false}; } template diff --git a/include/fast_ber/ber_types/ObjectIdentifier.hpp b/include/fast_ber/ber_types/ObjectIdentifier.hpp index b9b4f406..30331643 100644 --- a/include/fast_ber/ber_types/ObjectIdentifier.hpp +++ b/include/fast_ber/ber_types/ObjectIdentifier.hpp @@ -1,8 +1,8 @@ #pragma once -#include "fast_ber/util/BerLengthAndContentContainer.hpp" #include "fast_ber/util/DecodeHelpers.hpp" #include "fast_ber/util/EncodeHelpers.hpp" +#include "fast_ber/util/FixedIdBerContainer.hpp" #include "absl/container/inlined_vector.h" #include "absl/types/span.h" @@ -24,23 +24,22 @@ template > class ObjectIdentifier { public: - ObjectIdentifier() noexcept = default; - ObjectIdentifier(const ObjectIdentifier& rhs) noexcept = default; - ObjectIdentifier(ObjectIdentifier&& rhs) noexcept = default; + ObjectIdentifier() noexcept = default; + ObjectIdentifier(const ObjectIdentifier& rhs) = default; + ObjectIdentifier(ObjectIdentifier&& rhs) noexcept = default; ObjectIdentifier(const ObjectIdentifierComponents& oid) noexcept { assign(oid); } ObjectIdentifier(const std::initializer_list& oid) noexcept { assign(ObjectIdentifierComponents(oid)); } + explicit ObjectIdentifier(BerView view) { decode(view); } + ~ObjectIdentifier() noexcept = default; - ObjectIdentifier& operator=(const BerView& view) noexcept; ObjectIdentifier& operator=(const ObjectIdentifierComponents& rhs) noexcept; - ObjectIdentifier& operator=(absl::Span buffer) noexcept; ObjectIdentifier& operator=(const ObjectIdentifier&) = default; - ObjectIdentifier& operator=(ObjectIdentifier&&) = default; + ObjectIdentifier& operator=(ObjectIdentifier&&) noexcept = default; - bool operator==(const ObjectIdentifier& rhs) const noexcept - { - return this->m_contents == rhs.m_contents; - } - bool operator!=(const ObjectIdentifier& rhs) const noexcept { return !(*this == rhs); } + template + bool operator==(const ObjectIdentifier& rhs) const noexcept; + template + bool operator!=(const ObjectIdentifier& rhs) const noexcept; bool operator==(const ObjectIdentifierComponents& rhs) const noexcept { return this->value() == rhs; } bool operator!=(const ObjectIdentifierComponents& rhs) const noexcept { return !(*this == rhs); } @@ -49,18 +48,16 @@ class ObjectIdentifier ObjectIdentifierComponents value() const noexcept; - bool assign(const ObjectIdentifierComponents& oid) noexcept; - size_t assign_ber(const BerView& view) noexcept; - size_t assign_ber(const BerContainer& container) noexcept; - size_t assign_ber(absl::Span buffer) noexcept; + bool assign(const ObjectIdentifierComponents& oid) noexcept; - size_t encoded_content_and_length_length() const noexcept { return m_contents.content_and_length_length(); } - EncodeResult encode_content_and_length(absl::Span buffer) const noexcept; + size_t encoded_length() const noexcept; + EncodeResult encode(absl::Span buffer) const noexcept; + DecodeResult decode(BerView buffer) noexcept; using AsnId = Identifier; private: - BerLengthAndContentContainer m_contents; + FixedIdBerContainer m_contents; }; inline size_t encoded_object_id_length(const ObjectIdentifierComponents& input) noexcept @@ -217,23 +214,24 @@ inline size_t get_number_of_components(absl::Span input) noexcept } template -ObjectIdentifier& ObjectIdentifier::operator=(const BerView& view) noexcept +ObjectIdentifier& ObjectIdentifier::operator=(const ObjectIdentifierComponents& rhs) noexcept { - assign_ber(view); + assign(rhs); return *this; } + template -ObjectIdentifier& ObjectIdentifier::operator=(const ObjectIdentifierComponents& rhs) noexcept +template +bool ObjectIdentifier::operator==(const ObjectIdentifier& rhs) const noexcept { - assign(rhs); - return *this; + return this->m_contents.content() == rhs.m_contents.content(); } template -ObjectIdentifier& ObjectIdentifier::operator=(absl::Span buffer) noexcept +template +bool ObjectIdentifier::operator!=(const ObjectIdentifier& rhs) const noexcept { - assign_ber(buffer); - return *this; + return !(*this == rhs); } template @@ -287,47 +285,21 @@ bool ObjectIdentifier::assign(const ObjectIdentifierComponents& oid) } template -size_t ObjectIdentifier::assign_ber(const BerView& view) noexcept -{ - m_contents.assign(view); - return 1; -} - -template -size_t ObjectIdentifier::assign_ber(const BerContainer& container) noexcept -{ - m_contents.assign(container); - return 1; -} - -template -size_t ObjectIdentifier::assign_ber(absl::Span buffer) noexcept -{ - return m_contents.assign(buffer); -} - -template -EncodeResult ObjectIdentifier::encode_content_and_length(absl::Span buffer) const noexcept -{ - return m_contents.content_and_length_to_raw(buffer); -} - -template -size_t encoded_length(const ObjectIdentifier& object) +size_t ObjectIdentifier::encoded_length() const noexcept { - return encoded_length(object.encoded_content_and_length_length(), Identifier{}); + return this->m_contents.ber_length(); } template -EncodeResult encode(absl::Span output, const ObjectIdentifier& object) +EncodeResult ObjectIdentifier::encode(absl::Span output) const noexcept { - return encode_impl(output, object, Identifier{}); + return this->m_contents.encode(output); } template -DecodeResult decode(BerViewIterator& input, ObjectIdentifier& output) noexcept +DecodeResult ObjectIdentifier::decode(BerView input) noexcept { - return decode_impl(input, output, Identifier{}); + return this->m_contents.decode(input); } } // namespace fast_ber diff --git a/include/fast_ber/ber_types/Optional.hpp b/include/fast_ber/ber_types/Optional.hpp index b56d08ec..8ec3b91c 100644 --- a/include/fast_ber/ber_types/Optional.hpp +++ b/include/fast_ber/ber_types/Optional.hpp @@ -44,11 +44,16 @@ struct Optional : public OptionalImplementation::Type const Implementation& base() const { return *static_cast(this); } - Optional() = default; + Optional() noexcept = default; Optional(const Optional& rhs) = default; - Optional(Optional&& rhs) = default; + Optional(Optional&& rhs) noexcept; Optional& operator=(const Optional& rhs) = default; - Optional& operator=(Optional&& rhs) = default; + Optional& operator =(Optional&& rhs) noexcept; + ~Optional() noexcept = default; + + size_t encoded_length() const noexcept; + EncodeResult encode(absl::Span buffer) const noexcept; + DecodeResult decode(BerView input) noexcept; }; template @@ -58,11 +63,23 @@ struct IdentifierType> }; template -size_t encoded_length(const Optional& optional_type) noexcept +Optional::Optional(Optional&& rhs) noexcept : Implementation(std::move(rhs)) +{ +} + +template +Optional& Optional::operator=(Optional&& rhs) noexcept { - if (optional_type.has_value()) + this->Implementation::operator=(std::move(rhs)); + return *this; +} + +template +size_t Optional::encoded_length() const noexcept +{ + if (this->has_value()) { - return encoded_length(*optional_type); + return (*this)->encoded_length(); } else { @@ -71,11 +88,11 @@ size_t encoded_length(const Optional& optional_type) noexcept } template -EncodeResult encode(absl::Span buffer, const Optional& optional_type) noexcept +EncodeResult Optional::encode(absl::Span buffer) const noexcept { - if (optional_type.has_value()) + if (this->has_value()) { - return encode(buffer, *optional_type); + return (*this)->encode(buffer); } else { @@ -86,7 +103,7 @@ EncodeResult encode(absl::Span buffer, const Optional& optional_ template DecodeResult decode(BerViewIterator& input, Optional& output) noexcept { - if (input->is_valid() && input->tag() == Identifier::tag() && input->class_() == Identifier::class_()) + if (input->is_valid() && Identifier::check_id_match(input->class_(), input->tag())) { output.emplace(); return decode(input, *output); @@ -98,6 +115,25 @@ DecodeResult decode(BerViewIterator& input, Optional& output) noexcept } } +template +DecodeResult Optional::decode(BerView input) noexcept +{ + if (input.is_valid() && Identifier::check_id_match(input.class_(), input.tag())) + { + this->emplace(); + return (*this)->decode(input); + } + else if (!input.is_valid()) + { + *this = empty; + return DecodeResult{true}; + } + else + { + return DecodeResult{false}; + } +} + template std::ostream& operator<<(std::ostream& os, const Optional& optional) { diff --git a/include/fast_ber/ber_types/Real.hpp b/include/fast_ber/ber_types/Real.hpp index 049c7f56..794e3e95 100644 --- a/include/fast_ber/ber_types/Real.hpp +++ b/include/fast_ber/ber_types/Real.hpp @@ -1,54 +1,649 @@ #pragma once +#include "absl/base/internal/endian.h" +#include "absl/strings/numbers.h" +#include "absl/types/span.h" #include "fast_ber/util/BerView.hpp" +#include "fast_ber/util/DecodeHelpers.hpp" #include "fast_ber/util/EncodeHelpers.hpp" +#include "fast_ber/util/SmallFixedIdBerContainer.hpp" + +#include +#include +#include +#include +#include namespace fast_ber { +namespace detail +{ +constexpr size_t MaxEncodedLength = 100; +} // namespace detail + +inline bool decode_real(absl::Span input, double& output) noexcept; +inline bool decode_real_special(absl::Span input, double& output) noexcept; +inline bool decode_real_binary(absl::Span input, double& output) noexcept; +bool decode_real_decimal(absl::Span input, double& output) noexcept; // In .cpp due to +inline bool check_real_binary(absl::Span input) noexcept; +inline size_t encode_real(absl::Span output, double input) noexcept; + template > class Real { public: - Real() noexcept : m_data{} {} + Real() noexcept : m_contents{} {} Real(double num) noexcept { assign(num); } - Real(BerView& view) noexcept { assign_ber(view); } + Real(BerView view) noexcept { decode(view); } + template + Real(const Real& rhs) noexcept; + + explicit operator double() const noexcept { return value(); } + double value() const noexcept; - explicit Real(absl::Span ber_data) noexcept { assign_ber(ber_data); } + Real& operator=(double rhs) noexcept; + Real& operator=(const BerView& rhs) noexcept; + template + Real& operator=(const Real& rhs) noexcept; + + void assign(double val) noexcept; + void assign(const Real& rhs) noexcept; + + bool operator==(const Real& rhs) const noexcept; + bool operator!=(const Real& rhs) const noexcept { return !(*this == rhs); } + + size_t encoded_length() const noexcept; + EncodeResult encode(absl::Span output) const noexcept; + DecodeResult decode(BerView input) noexcept; + + using AsnId = Identifier; - // Implicit conversion to double - operator double() const noexcept { return value(); } - double value() const noexcept; + template + friend class Real; - Real& operator=(double rhs) noexcept; - Real& operator=(const Real& rhs) noexcept; - Real& operator=(const BerView& rhs) noexcept; - void assign(double val) noexcept; - void assign(const Real& rhs) noexcept; - size_t assign_ber(const BerView& rhs) noexcept; - size_t assign_ber(absl::Span buffer) noexcept; + private: + SmallFixedIdBerContainer m_contents; +}; - bool operator==(const Real&) const +/** + * Checks that real binary value conforms to Real ASN.1 specification + * @param input BER encoded real binary value to check + * @return true on success, false on failure + */ +inline bool check_real_binary(absl::Span input) noexcept +{ + /* Minimal binary construction is: | control | exponent | number | => length is 3 bytes minimum + * Check that base bits are not set to the reserved value, see X690 Clause 8.5.7.4 + * */ + if (input.length() > 3 && (input[0] & 0x30) != 0x30) { - // TODO: fuzzy equality here + /* X690 Clause 8.5.7.4 */ + size_t exponent_len = (input[0] & 0x03) + 1; + size_t exponent_offset = 1; + + /* X690 Clause 8.5.7.4.d: we should get something like this: + * | control | exponent_len | exponent_1 | ... | exponent_N | number | + * */ + if (exponent_len == 4) + { + exponent_len = static_cast(input[1]); + exponent_offset = 2; + } + + /* Check that exponent length is valid or does not overflow input */ + if (exponent_len == 0 || (exponent_len + exponent_offset) >= input.length()) + { + return false; + } + + /* Check that the exponent does not start with 9 identical bits */ + if (exponent_len > 1) + { + uint8_t first_byte = input[exponent_offset]; + uint8_t second_byte = input[exponent_offset + 1]; + if ((first_byte == 0xFF && (second_byte & 0x80) != 0) || (first_byte == 0x00 && (second_byte & 0x80) == 0)) + { + /* The exponent begins with 9 identical bits */ + return false; + } + } + + /* Check that the mantissa is not zero */ + for (size_t i = exponent_len + exponent_offset; i < input.length(); ++i) + { + if (input[i] != 0) + return true; + } + } + + return false; +} + +/** + * Decodes a real value into a double + * @param input BER encoded real value + * @param output decoded special value + * @return true on success, false on failure + */ +inline bool decode_real(absl::Span input, double& output) noexcept +{ + bool res = false; + + /* X690 Clause 8.5.2: it is the value Plus Zero */ + if (input.length() == 0) + { + output = 0.0; + res = true; + } + /* X690 Clause 8.5.7: it is a Binary value */ + else if ((input[0] & 0x80) >> 7) + { + res = decode_real_binary(input, output); + } + /* X690 Clause 8.5.8: it is a Decimal value */ + else if ((input[0] & 0xC0) >> 6 == 0) + { + res = decode_real_decimal(input, output); + } + /* X690 Clause 8.5.9: it is a Special Real Value */ + else if ((input[0] & 0xC0) >> 6 == 1) + { + res = decode_real_special(input, output); + } + + return res; +} + +/** + * Decodes a real special value + * @param input BER encoded real special value + * @param output decoded special value + * @return true on success, false on failure + */ +inline bool decode_real_special(absl::Span input, double& output) noexcept +{ + bool res = false; + + if (input.length() == 1) + { + switch (input[0]) + { + /* Plus infinity value*/ + case 0x40: + output = std::numeric_limits::infinity(); + res = true; + break; + /* Minus infinity value */ + case 0x41: + output = -std::numeric_limits::infinity(); + res = true; + break; + /* Not A Number value */ + case 0x42: + output = std::numeric_limits::quiet_NaN(); + res = true; + break; + /* Minus Zero value */ + case 0x43: + output = -0.0; + res = true; + break; + /* Unknown value */ + default: + break; + } + } + + return res; +} + +/** + * Decodes a real binary value + * @param input BER encoded real binary value + * @param output decoded binary value + * @return true on success, false on failure + */ +inline bool decode_real_binary(absl::Span input, double& output) noexcept +{ + if (!check_real_binary(input)) + { + return false; + } + + size_t exponent_len = (input[0] & 0x03) + 1; + size_t exponent_offset = 1; + + /* X690 Clause 8.5.7.4.d */ + if (exponent_len == 4) + { + exponent_len = static_cast(input[1]); + exponent_offset = 2; + } + + /* Verify that the exponent fits into an int */ + if (exponent_len > sizeof(int)) + { + return false; + } + + /* Get exponent sign */ + int exponent = (input[exponent_offset] & 0x80) ? -1 : 0; + + /* X690 Clause 8.5.7.1 */ + int mantissa_sign = ((input[0] & 0x40) >> 6) & 0x01; + + /* X690 Clause 8.5.7.2 */ + int base = (input[0] & 0x30) >> 4; + + /* X690 Clause 8.5.7.3 */ + int factor = (input[0] & 0x0C) >> 2; + + /* Read exponent */ + for (size_t i = 0; i < exponent_offset; ++i) + { + exponent = (exponent << 8) | input[exponent_offset + i]; + } + + /* Convert base 8 exponent to base 2 */ + if (base == 1) + { + if (exponent > 0 ? exponent <= std::numeric_limits::max() / 3 + : exponent >= std::numeric_limits::min() / 3) + { + exponent *= 3; + } + else + { + return false; + } + } + /* Convert base 16 exponent to base 2 */ + if (base == 2) + { + if (exponent > 0 ? exponent <= std::numeric_limits::max() / 4 + : exponent >= std::numeric_limits::min() / 4) + { + exponent *= 4; + } + else + { + return false; + } + } + + /* Apply binary factor */ + if (exponent <= (std::numeric_limits::max() - factor)) + { + exponent += factor; + } + else + { + return false; + } + + /* If exponent overflows, check */ + if (exponent < -0xFFFFFF || exponent > 0xFFFFFF) + { + /* Exponent too large for a double */ + if (exponent >= 0) + { + output = + mantissa_sign == 0 ? std::numeric_limits::infinity() : -std::numeric_limits::infinity(); + } + /* Exponent too small for a double */ + else + { + output = mantissa_sign == 0 ? 0.0 : -0.0; + } + return true; } - bool operator!=(const Real& rhs) const { return !(*this == rhs); } - EncodeResult encode_content_and_length(absl::Span buffer) const noexcept; + /* Get Mantissa into a buffer + * One more byte is read because there could be a 3 or 4 bits shift, see X690 Clause 8.5.7 + * */ + std::array double_bytes = {}; + size_t mantissa_offset = exponent_len + exponent_offset; + size_t mantissa_len = input.length() - mantissa_offset; - using AsnId = Identifier; + /* Skip leading zeros */ + while (mantissa_len > 1 && input[mantissa_offset] == 0) + { + mantissa_offset++; + mantissa_len--; + } - private: - void set_content_length(uint64_t length) noexcept + /* Put mantissa into bytes 1 to 7 and adapt the exponent */ + for (size_t i = 0; i < 8; i++) { - assert(length <= std::numeric_limits::max()); - m_data[0] = static_cast(length); + if (i < mantissa_len) + { + double_bytes[i + 1] = input[mantissa_offset + i]; + } } - uint8_t content_length() const noexcept { return m_data[0]; } - size_t encoded_length() const noexcept { return 1 + content_length(); } - std::array m_data; -}; + /* IEEE 754 double format is: | 1 bit Sign | 11 bits exponent | 52 bits mantissa | + * Exponent bias is 2^(k-1) - 1 where k = exponent size in bits. Here bias = 1023 + * Add mantissa size to the bias to get an exponent corresponding to the mantissa + * bias = 1023 + 52 = 1075 + * */ + exponent += ((mantissa_len - 7) << 3) + 1075; + + /* For a normalized value, the mantissa size is 52 bits with an implicit hidden bit which equals 1 + * Set double_bytes to have b0001 in the first 4 bits of the first double byte + * See X690 Clause 8.5.7 */ + if ((double_bytes[1] & 0xE0) != 0 && exponent < 0x7FF) + { + /* Mantissa is too big - shift right up to 3 bits */ + int shift = 0; + unsigned int first_byte = double_bytes[1]; + + /* Adapt exponent */ + while ((first_byte & 0xE0) != 0 && exponent < (0x7FF - shift)) + { + first_byte >>= 1; + shift++; + } + exponent += shift; + + /* Adapt double bytes */ + for (int j = 7; j > 0; --j) + { + unsigned int next_byte_shifted = static_cast(double_bytes[j - 1]) << 8; + double_bytes[j] = (next_byte_shifted | double_bytes[j]) >> shift; + } + } + else if ((double_bytes[1] & 0xF0) == 0 && exponent > 0) + { + /* Mantissa is too small - shift left up to 4 bits */ + int shift = 8; + unsigned int first_byte = double_bytes[1]; + + /* Adapt exponent */ + while ((first_byte & 0xF0) == 0 && exponent > (8 - shift)) + { + exponent -= 8 - shift; + } + + for (int j = 1; j < 8; ++j) + { + unsigned int first_byte_shifted = static_cast(double_bytes[j]) << 8; + double_bytes[j] = (first_byte_shifted | double_bytes[j + 1]) >> shift; + } + } + + /* Verify that exponent does not overflow after modification */ + if (exponent >= 0x7FF || exponent <= -55) + { + /* Exponent too large for a double */ + if (exponent >= 0) + { + output = + mantissa_sign == 0 ? std::numeric_limits::infinity() : -std::numeric_limits::infinity(); + } + else + { + /* Exponent too small for a double */ + output = mantissa_sign == 0 ? 0.0 : -0.0; + } + + return true; + } + + /* Normalize the value if necessary */ + if (exponent <= 0) + { + /* correct the exponent to shift one bit more right */ + --exponent; + + /* Shift the mantissa right until exponent is 0 */ + int shift = (-exponent) >> 3; + for (int j = 7; j > shift; --j) + { + double_bytes[j] = double_bytes[j - shift]; + } + for (int j = shift; j > 0; --j) + { + double_bytes[j] = 0; + } + /* shift right bit by bit */ + shift = -exponent & 0x07; + for (int j = 7; j > 0; --j) + { + unsigned int next_byte_shifted = static_cast(double_bytes[j - 1]) << 8; + double_bytes[j] = (next_byte_shifted | double_bytes[j]) >> shift; + } + + /* exponent for a denormalized value */ + exponent = 0; + } + + /* Finally add the mantissa sign and the exponent to the double bytes */ + double_bytes[0] = (mantissa_sign << 7) | (exponent >> 4); + double_bytes[1] = (exponent << 4) | (double_bytes[1] & 0x0F); + +#ifdef ABSL_IS_LITTLE_ENDIAN + /* Reverse bytes if needed */ + std::reverse(double_bytes.begin(), double_bytes.end() - 1); +#endif + + memcpy(&output, double_bytes.data(), sizeof(double)); + return true; +} + +inline size_t encode_real(absl::Span output, double input) noexcept +{ + std::array buffer; + std::memcpy(buffer.data(), &input, sizeof(double)); + buffer.back() = 0; + +#ifdef ABSL_IS_LITTLE_ENDIAN + /* Reverse bytes if needed */ + std::reverse(buffer.begin(), buffer.end() - 1); +#endif + + unsigned int sign = buffer[0] >> 7; + size_t encoded_length = 0; + int exponent = (buffer[0] & 0x7F) << 4 | (buffer[1] >> 4); + + /* Remove exponent */ + buffer[1] &= 0x0F; + + if (exponent == 0x7FF) + { + if (std::all_of(buffer.begin() + 1, buffer.end(), [](uint8_t elem) { return elem == 0; })) + { + if (sign == 0) + { + /* Plus infinity */ + output[0] = 0x40; + } + else + { + /* Minus infinity */ + output[0] = 0x41; + } + } + else + { + /* Not a number value */ + output[0] = 0x42; + } + + return 1; + } + else if (exponent == 0) + { + if (std::all_of(buffer.begin() + 1, buffer.end(), [](uint8_t elem) { return elem == 0; })) + { + if (sign == 0) + { + /* Zero value - nothing to do */ + return 0; + } + else + { + /* Minus zero */ + output[0] = 0x43; + return 1; + } + } + else + { + /* Denormalized value - shift left 1 bit at a time */ + for (size_t i = 1; i < buffer.size() - 1; ++i) + { + unsigned int current_byte_shifted = static_cast(buffer[i]) << 8; + buffer[i] = (current_byte_shifted | buffer[i + 1]) >> 7; + } + exponent -= 1075; + } + } + else + { + /* Normalized value, implicit first bit */ + buffer[1] |= 0x10; + exponent -= 1075; + } + + /* Encode a binary real value into BER format */ + if (-128 <= exponent && exponent <= 127) + { + /* exponent on 1 byte */ + encoded_length = 1 + 1 + 7; + + /* Control byte bits: | 1 | S | BB | FF | EE | + * S = sign + * BB = base 2 = 00 + * FF = 0 = 00 + * EE = 1 byte = 00 + * */ + output[0] = static_cast(0x80 | (sign << 6)); + + /* Assign exponent */ + output[1] = static_cast(exponent); + } + else + { + /* exponent on two signed bytes */ + encoded_length = 1 + 2 + 7; + + /* Control byte bits: | 1 | S | BB | FF | EE | + * S = sign + * BB = base 2 = 00 + * FF = 0 = 00 + * EE = 2 bytes = 01 + * */ + output[0] = static_cast(0x81 | (sign << 6)); + + /* Assign exponent */ + output[1] = static_cast(exponent >> 8); + output[2] = static_cast(exponent & 0xFF); + } + + /* Mantissa on 7 bytes */ + for (size_t i = 1; i < 8; ++i) + { + output[encoded_length + i - 8] = buffer[i]; + } + + return encoded_length; +} + +template +template +Real::Real(const Real& rhs) noexcept : m_contents(rhs.m_contents) +{ +} + +template +inline double Real::value() const noexcept +{ + double ret = 0; + decode_real(m_contents.content(), ret); + return ret; +} + +template +inline Real& Real::operator=(double rhs) noexcept +{ + assign(rhs); + return *this; +} + +template +template +inline Real& Real::operator=(const Real& rhs) noexcept +{ + assign(rhs); + return *this; +} + +template +inline void Real::assign(double val) noexcept +{ + m_contents.resize_content( + encode_real(absl::Span(m_contents.content_data(), detail::MaxEncodedLength), val)); +} + +template +inline void Real::assign(const Real& rhs) noexcept +{ + m_contents = rhs.m_contents; +} + +template +inline bool Real::operator==(const Real& rhs) const noexcept +{ + /* Inspired from https://www.embeddeduse.com/2019/08/26/qt-compare-two-floats/ */ + const double lhs_value = this->value(); + const double rhs_value = rhs.value(); + + /* Cannot compare NAN */ + if (std::isnan(lhs_value) || std::isnan(rhs_value)) + { + return false; + } + + /* According to https://www.gnu.org/software/libc/manual/html_node/Infinity-and-NaN.html + * In comparison operations, positive infinity is larger than all values except itself and NaN */ + if (std::isinf(lhs_value) && std::isinf(rhs_value)) + { + return std::signbit(lhs_value) == std::signbit(rhs_value); + } + + if (std::abs(lhs_value - rhs_value) <= std::numeric_limits::epsilon()) + { + return true; + } + + return std::abs(lhs_value - rhs_value) <= + std::numeric_limits::epsilon() * std::max(std::abs(lhs_value), std::abs(rhs_value)); +} + +template +size_t Real::encoded_length() const noexcept +{ + return m_contents.ber_length(); +} + +template +EncodeResult Real::encode(absl::Span output) const noexcept +{ + return m_contents.encode(output); +} + +template +DecodeResult Real::decode(BerView input) noexcept +{ + return m_contents.decode(input); +} + +template +std::ostream& operator<<(std::ostream& os, const Real& object) noexcept +{ + return os << object.value(); +} } // namespace fast_ber diff --git a/include/fast_ber/ber_types/Sequence.hpp b/include/fast_ber/ber_types/Sequence.hpp index e102c25c..26148141 100644 --- a/include/fast_ber/ber_types/Sequence.hpp +++ b/include/fast_ber/ber_types/Sequence.hpp @@ -1,88 +1,3 @@ #pragma once -#include "absl/types/span.h" -#include "fast_ber/ber_types/Class.hpp" -#include "fast_ber/ber_types/Construction.hpp" -#include "fast_ber/ber_types/Identifier.hpp" -#include "fast_ber/util/DecodeHelpers.hpp" -#include "fast_ber/util/EncodeHelpers.hpp" -#include "fast_ber/util/EncodeIdentifiers.hpp" - -#include // For std::memmove -#include - -namespace fast_ber -{ - -inline EncodeResult encode_sequence_combine_impl(absl::Span&, size_t encoding_length) noexcept -{ - return EncodeResult{true, encoding_length}; -} - -template -EncodeResult encode_sequence_combine_impl(absl::Span& output, size_t encoding_length, const T& object, - const Args&... args) noexcept -{ - const EncodeResult result = encode(output, object); - if (!result.success) - { - std::cerr << "Failed encoding packet, id = " << Identifier{} << std::endl; - return EncodeResult{false, result.length}; - } - - output.remove_prefix(result.length); - encoding_length += result.length; - return encode_sequence_combine_impl(output, encoding_length, args...); -} - -template -EncodeResult encode_sequence_combine(const absl::Span output, ID id, const Args&... args) noexcept -{ - auto encoding_output = output; - size_t header_length_guess = 2; - encoding_output.remove_prefix(header_length_guess); - EncodeResult result = encode_sequence_combine_impl(encoding_output, 0, args...); - if (!result.success) - { - return result; - } - - return wrap_with_ber_header(output, result.length, id, header_length_guess); -} - -inline DecodeResult decode_sequence_combine_impl(BerViewIterator&, const char*) noexcept { return DecodeResult{true}; } - -template -DecodeResult decode_sequence_combine_impl(BerViewIterator& input, const char* parent_name, T& object, - Args&&... args) noexcept -{ - DecodeResult result = decode(input, object); - if (!result.success) - { - std::cerr << "Error decoding " << parent_name << ": could not decode field with identifier " << Identifier{} - << "\n"; - return DecodeResult{false}; - } - return decode_sequence_combine_impl(input, parent_name, args...); -} - -template -DecodeResult decode_sequence_combine(const BerView& input, const char* parent_name, ID id, Args&&... args) noexcept -{ - if (!input.is_valid()) - { - std::cerr << "Error decoding " << parent_name << ": Input is not valid ber\n"; - return DecodeResult{false}; - } - if (input.tag() != val(id.tag())) - { - std::cerr << "Error decoding " << parent_name << ": Expected identifier = " << id << " got " << val(input.tag()) - << "\n"; - return DecodeResult{false}; - } - - auto iterator = input.begin(); - return decode_sequence_combine_impl(iterator, parent_name, args...); -} - -} // namespace fast_ber +// All functionality generated by compiler diff --git a/include/fast_ber/ber_types/SequenceOf.hpp b/include/fast_ber/ber_types/SequenceOf.hpp index f9d4ed40..b97f4f15 100644 --- a/include/fast_ber/ber_types/SequenceOf.hpp +++ b/include/fast_ber/ber_types/SequenceOf.hpp @@ -1,9 +1,12 @@ #pragma once -#include "fast_ber/ber_types/Sequence.hpp" +#include "fast_ber/util/DecodeHelpers.hpp" +#include "fast_ber/util/Definitions.hpp" +#include "fast_ber/util/EncodeHelpers.hpp" #include "absl/container/inlined_vector.h" +#include #include #include @@ -37,36 +40,74 @@ struct SequenceOf : public SequenceOfImplementation::Type using Implementation = typename SequenceOfImplementation::Type; using Implementation::Implementation; - SequenceOf() = default; + SequenceOf() = default; + SequenceOf(const SequenceOf&) = default; + SequenceOf(SequenceOf&&) noexcept; SequenceOf(const Implementation& t) : Implementation(t) {} - SequenceOf(Implementation&& t) : Implementation(std::move(t)) {} + SequenceOf(Implementation&& t) noexcept : Implementation(std::move(t)) {} template - SequenceOf(const SequenceOf& t) : Implementation(t) + SequenceOf(const SequenceOf& t) : Implementation(t.begin(), t.end()) { } + ~SequenceOf() noexcept = default; + + SequenceOf& operator=(const SequenceOf&) = default; + SequenceOf& operator =(SequenceOf&&) noexcept; + + size_t encoded_length() const noexcept; + EncodeResult encode(absl::Span buffer) const noexcept; + DecodeResult decode(BerView input) noexcept; using AsnId = I; }; template -size_t encoded_length(const SequenceOf& sequence) noexcept +SequenceOf::SequenceOf(SequenceOf&& rhs) noexcept : Implementation(std::move(rhs)) +{ +} + +template +SequenceOf& SequenceOf::operator=(SequenceOf&& rhs) noexcept +{ + Implementation::operator=(rhs); + return *this; +} + +template +bool operator==(const SequenceOf& lhs, const SequenceOf& rhs) noexcept +{ + return lhs.size() == rhs.size() && std::equal(lhs.begin(), lhs.end(), rhs.begin()); +} + +template +bool operator!=(const SequenceOf& lhs, const SequenceOf& rhs) noexcept { - const size_t content_length = std::accumulate(sequence.begin(), sequence.end(), size_t(0), - [](size_t count, const T& t) { return count + encoded_length(t); }); - return wrap_with_ber_header_length(content_length, I{}); + return !(lhs == rhs); } template -EncodeResult encode(const absl::Span buffer, const SequenceOf& sequence) noexcept +size_t SequenceOf::encoded_length() const noexcept { - const size_t header_length_guess = 2; - auto content_buffer = buffer; - size_t combined_length = 0; + const size_t content_length = std::accumulate(this->begin(), this->end(), size_t(0), + [](size_t count, const T& t) { return count + t.encoded_length(); }); + return fast_ber::encoded_length(content_length, I{}); +} +template +EncodeResult SequenceOf::encode(const absl::Span buffer) const noexcept +{ + constexpr size_t header_length_guess = fast_ber::encoded_length(0, I{}); + auto content_buffer = buffer; + size_t combined_length = 0; + if (content_buffer.length() < header_length_guess) + { + return EncodeResult{false, 0}; + } content_buffer.remove_prefix(header_length_guess); - for (const T& element : sequence) + + for (const T& element : *this) { - const auto element_encode_result = encode(content_buffer, element); + const auto element_encode_result = element.encode(content_buffer); if (!element_encode_result.success) { return {false, 0}; @@ -79,29 +120,32 @@ EncodeResult encode(const absl::Span buffer, const SequenceOf& } template -DecodeResult decode(BerViewIterator& input, SequenceOf& output) noexcept +DecodeResult SequenceOf::decode(BerView input) noexcept { - output.clear(); - if (!(input->is_valid() && input->tag() == I::tag() && input->class_() == I::class_() && - input->construction() == Construction::constructed)) + this->clear(); + if (!has_correct_header(input, I{}, Construction::constructed)) { return DecodeResult{false}; } - auto child = input->begin(); - constexpr Identifier child_id; - - while (child->is_valid() && child->tag() == val(child_id.tag())) + BerView child_range = (I::depth() == 1) ? input : *input.begin(); + for (const BerView child : child_range) { - output.emplace_back(T{}); - bool success = decode(child, output.back()).success; - if (!success) + constexpr Identifier child_id; + if (child_id.check_id_match(child.class_(), child.tag())) + { + this->emplace_back(); + bool success = this->back().decode(child).success; + if (!success) + { + return DecodeResult{false}; + } + } + else { return DecodeResult{false}; } } - ++input; - return DecodeResult{true}; } diff --git a/include/fast_ber/ber_types/Set.hpp b/include/fast_ber/ber_types/Set.hpp index 4ef51d1d..cdd3af64 100644 --- a/include/fast_ber/ber_types/Set.hpp +++ b/include/fast_ber/ber_types/Set.hpp @@ -1,50 +1,3 @@ #pragma once #include "fast_ber/ber_types/Sequence.hpp" - -namespace fast_ber -{ - -// Sets can be encoded in any order, but choosing the same as Sequences is the most logical -template -EncodeResult encode_set_combine(const absl::Span output, ID id, const Args&... args) noexcept -{ - return encode_sequence_combine(output, id, args...); -} - -inline DecodeResult decode_set_combine_impl(BerViewIterator&, const char*) noexcept { return DecodeResult{true}; } - -template -DecodeResult decode_set_combine_impl(BerViewIterator& input, const char* parent_name, T& object, - Args&&... args) noexcept -{ - DecodeResult result = decode(input, object); - if (!result.success) - { - std::cerr << "Error decoding " << parent_name << ": could not decode field with identifier " << Identifier{} - << "\n"; - return DecodeResult{false}; - } - return decode_set_combine_impl(input, parent_name, args...); -} - -template -DecodeResult decode_set_combine(const BerView& input, const char* parent_name, ID id, Args&&... args) noexcept -{ - if (!input.is_valid()) - { - std::cerr << "Error decoding " << parent_name << ": Input is not valid ber\n"; - return DecodeResult{false}; - } - if (input.tag() != val(id.tag())) - { - std::cerr << "Error decoding " << parent_name << ": Expected identifier = " << id << " got " << val(input.tag()) - << "\n"; - return DecodeResult{false}; - } - - auto iterator = input.begin(); - return decode_set_combine_impl(iterator, parent_name, args...); -} - -} // namespace fast_ber diff --git a/include/fast_ber/ber_types/StringImpl.hpp b/include/fast_ber/ber_types/StringImpl.hpp index 9de9047b..eab0a053 100644 --- a/include/fast_ber/ber_types/StringImpl.hpp +++ b/include/fast_ber/ber_types/StringImpl.hpp @@ -1,13 +1,14 @@ #pragma once -#include "fast_ber/util/BerLengthAndContentContainer.hpp" #include "fast_ber/util/DecodeHelpers.hpp" #include "fast_ber/util/EncodeHelpers.hpp" +#include "fast_ber/util/FixedIdBerContainer.hpp" #include "absl/strings/string_view.h" #include "absl/types/span.h" #include +#include #include namespace fast_ber @@ -30,16 +31,15 @@ class StringImpl StringImpl(const char* input_data) noexcept { assign(absl::string_view(input_data)); } StringImpl(const std::string& input_data) noexcept { assign(absl::string_view(input_data)); } + StringImpl(absl::string_view input_data) noexcept { assign(input_data); } explicit StringImpl(absl::Span input_data) noexcept { assign(input_data); } - explicit StringImpl(const BerView& view) noexcept { assign_ber(view); } - explicit StringImpl(const BerContainer& container) noexcept { assign_ber(container); } + explicit StringImpl(BerView view) noexcept { decode(view); } template StringImpl& operator=(const StringImpl& rhs) noexcept; - StringImpl& operator=(const BerView& view) noexcept; - StringImpl& operator=(const BerContainer& rhs) noexcept; StringImpl& operator=(const char* rhs) noexcept; StringImpl& operator=(const std::string& rhs) noexcept; + StringImpl& operator=(absl::string_view rhs) noexcept; StringImpl& operator=(absl::Span buffer) noexcept; bool operator==(absl::string_view view) const noexcept { return absl::string_view(*this) == view; } @@ -69,25 +69,22 @@ class StringImpl std::string value() const noexcept { return std::string(c_str(), length()); } template - void assign(const StringImpl& rhs) noexcept; - void assign(absl::string_view buffer) noexcept; - void assign(absl::Span buffer) noexcept; - size_t assign_ber(const BerView& view) noexcept; - size_t assign_ber(const BerContainer& container) noexcept; - size_t assign_ber(absl::Span buffer) noexcept; - void resize(size_t i) noexcept { m_contents.resize_content(i); } - - EncodeResult encode_content_and_length(absl::Span buffer) const noexcept; + void assign(const StringImpl& rhs) noexcept; + void assign(absl::string_view buffer) noexcept; + void assign(absl::Span buffer) noexcept; + void resize(size_t i) noexcept { m_contents.resize_content(i); } template friend class StringImpl; using AsnId = Identifier; - const BerLengthAndContentContainer& container() const noexcept { return m_contents; } + size_t encoded_length() const noexcept { return m_contents.ber().length(); } + EncodeResult encode(absl::Span output) const noexcept { return m_contents.encode(output); } + DecodeResult decode(BerView input) noexcept { return m_contents.decode(input); } private: - BerLengthAndContentContainer m_contents; + FixedIdBerContainer m_contents; }; // namespace fast_ber template @@ -117,6 +114,13 @@ StringImpl& StringImpl::operator=(const std::s return *this; } +template +StringImpl& StringImpl::operator=(absl::string_view rhs) noexcept +{ + assign(rhs); + return *this; +} + template template StringImpl& StringImpl::operator=(const StringImpl& rhs) noexcept @@ -146,7 +150,14 @@ bool StringImpl::operator==(const char* rhs) const noexcept template std::ostream& operator<<(std::ostream& os, const StringImpl& str) noexcept { - return os << '"' << absl::string_view(str) << '"'; + if (std::all_of(str.begin(), str.end(), [](char c) { return std::isprint(c); })) + { + return os << '"' << absl::string_view(str) << '"'; + } + else + { + return os << "\"binary data\""; + } } template @@ -168,57 +179,4 @@ void StringImpl::assign(const StringImpl& rh assign(rhs.span()); } -template -size_t StringImpl::assign_ber(const BerView& view) noexcept -{ - if (!view.is_valid() || view.construction() != Construction::primitive) - { - return false; - } - m_contents.assign(view); - return 1; -} - -template -size_t StringImpl::assign_ber(const BerContainer& container) noexcept -{ - if (!container.is_valid() || container.construction() != Construction::primitive) - { - return false; - } - m_contents.assign(container); - return 1; -} - -template -size_t StringImpl::assign_ber(absl::Span buffer) noexcept -{ - m_contents.assign(buffer); - return 1; -} - -template -EncodeResult StringImpl::encode_content_and_length(absl::Span buffer) const noexcept -{ - return m_contents.content_and_length_to_raw(buffer); -} - -template -size_t encoded_length(const StringImpl& object) noexcept -{ - return encoded_length(object.container().content_and_length_length(), Identifier{}); -} - -template -EncodeResult encode(absl::Span output, const StringImpl& object) -{ - return encode_impl(output, object, Identifier{}); -} - -template -DecodeResult decode(BerViewIterator& input, StringImpl& output) noexcept -{ - return decode_impl(input, output, Identifier{}); -} - } // namespace fast_ber diff --git a/include/fast_ber/ber_types/Tag.hpp b/include/fast_ber/ber_types/Tag.hpp index 8590bc66..07724011 100644 --- a/include/fast_ber/ber_types/Tag.hpp +++ b/include/fast_ber/ber_types/Tag.hpp @@ -47,7 +47,7 @@ enum class UniversalTag : Tag }; template -constexpr int val(T t) noexcept +constexpr typename std::underlying_type::type as_underlying(T t) noexcept { return static_cast(t); } diff --git a/include/fast_ber/compiler/Dependencies.hpp b/include/fast_ber/compiler/Dependencies.hpp deleted file mode 100644 index 7dc88f9b..00000000 --- a/include/fast_ber/compiler/Dependencies.hpp +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once - -#include "fast_ber/compiler/CompilerTypes.hpp" - -std::vector depends_on(const AnyType&); -std::vector depends_on(const BitStringType&); -std::vector depends_on(const BooleanType&); -std::vector depends_on(const CharacterStringType&); -std::vector depends_on(const ChoiceType); -std::vector depends_on(const DateType&); -std::vector depends_on(const DateTimeType&); -std::vector depends_on(const DurationType&); -std::vector depends_on(const EmbeddedPDVType&); -std::vector depends_on(const EnumeratedType&); -std::vector depends_on(const ExternalType&); -std::vector depends_on(const GeneralizedTimeType&); -std::vector depends_on(const InstanceOfType&); -std::vector depends_on(const IntegerType&); -std::vector depends_on(const IRIType&); -std::vector depends_on(const NullType&); -std::vector depends_on(const ObjectClassFieldType&); -std::vector depends_on(const ObjectDescriptorType&); -std::vector depends_on(const ObjectIdentifierType&); -std::vector depends_on(const OctetStringType&); -std::vector depends_on(const RealType&); -std::vector depends_on(const RelativeIRIType&); -std::vector depends_on(const RelativeOIDType&); -std::vector depends_on(const SequenceType& sequence); -std::vector depends_on(const SequenceOfType& sequence); -std::vector depends_on(const SetType& set); -std::vector depends_on(const SetOfType& set); -std::vector depends_on(const PrefixedType&); -std::vector depends_on(const TimeType&); -std::vector depends_on(const TimeOfDayType&); -std::vector depends_on(const UTCTimeType&); -std::vector depends_on(const DefinedType&); -std::vector depends_on(const BuiltinType& type); -std::vector depends_on(const Type& type); - -std::vector dependencies(const Type& type); -std::vector dependencies(const Assignment& assignment); diff --git a/include/fast_ber/compiler/Identifier.hpp b/include/fast_ber/compiler/Identifier.hpp deleted file mode 100644 index 6dcb3c76..00000000 --- a/include/fast_ber/compiler/Identifier.hpp +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once - -#include "fast_ber/compiler/CompilerTypes.hpp" -#include "fast_ber/compiler/ResolveType.hpp" -#include "fast_ber/compiler/TypeAsString.hpp" - -TaggingInfo identifier(const AnyType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const BitStringType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const BooleanType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const CharacterStringType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const ChoiceType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const DateType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const DateTimeType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const DurationType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const EmbeddedPDVType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const EnumeratedType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const ExternalType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const GeneralizedTimeType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const InstanceOfType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const IntegerType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const IRIType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const NullType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const ObjectClassFieldType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const ObjectDescriptorType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const ObjectIdentifierType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const OctetStringType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const RealType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const RelativeIRIType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const RelativeOIDType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const SequenceType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const SequenceOfType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const SetType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const SetOfType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const PrefixedType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const TaggedType& tagged_type, const Module&, const Asn1Tree&); -TaggingInfo identifier(const TimeType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const TimeOfDayType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const UTCTimeType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const DefinedType&, const Module&, const Asn1Tree&); -TaggingInfo identifier(const BuiltinType& type, const Module&, const Asn1Tree&); -TaggingInfo identifier(const Type& type, const Module&, const Asn1Tree&); diff --git a/include/fast_ber/compiler/TypeAsString.hpp b/include/fast_ber/compiler/TypeAsString.hpp deleted file mode 100644 index ae8c8616..00000000 --- a/include/fast_ber/compiler/TypeAsString.hpp +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#include "fast_ber/compiler/CompilerTypes.hpp" - -std::string type_as_string(const AnyType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const BitStringType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const BooleanType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const CharacterStringType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const ChoiceType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const DateType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const DateTimeType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const DurationType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const EmbeddedPDVType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const EnumeratedType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const ExternalType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const GeneralizedTimeType& type, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const InstanceOfType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const IntegerType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const IRIType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const NullType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const ObjectClassFieldType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const ObjectDescriptorType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const ObjectIdentifierType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const OctetStringType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const RealType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const RelativeIRIType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const RelativeOIDType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const SequenceType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const SequenceOfType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const SetType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const SetOfType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const PrefixedType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const TimeType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const TimeOfDayType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const UTCTimeType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const DefinedType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const BuiltinType&, const Module&, const Asn1Tree&, const std::string& = {}); -std::string type_as_string(const Type&, const Module&, const Asn1Tree&, const std::string& = {}); diff --git a/include/fast_ber/util/Alias.hpp b/include/fast_ber/util/Alias.hpp index c9c71358..622b63b2 100644 --- a/include/fast_ber/util/Alias.hpp +++ b/include/fast_ber/util/Alias.hpp @@ -9,8 +9,7 @@ X() = default; \ X(const X&) = default; \ X(X&&) = default; \ - X& operator=(const X&) = default; \ - using AsnId = fast_ber::Identifier; \ + X& operator=(const X&) = default; \ AliasedType& get_base() { return *this; } \ const AliasedType& get_base() const { return *this; } \ } diff --git a/include/fast_ber/util/BerContainer.hpp b/include/fast_ber/util/BerContainer.hpp index 63d1a0c6..09950d8f 100644 --- a/include/fast_ber/util/BerContainer.hpp +++ b/include/fast_ber/util/BerContainer.hpp @@ -20,22 +20,23 @@ enum class ConstructionMethod }; // Owning container of a ber packet. Contents may or may not be valid. Memory is stored in a small buffer optimized -// vector. Can be constructed directly from encoded ber memory (assign_ber) or by specifiyng the desired contents +// vector. Can be constructed directly from encoded ber memory (decode) or by specifiyng the desired contents // (assign_contents) class BerContainer { public: BerContainer() noexcept; - BerContainer(const BerView& input_view) noexcept { assign(input_view); } - BerContainer(const BerContainer& container) noexcept { assign(container); } + BerContainer(const BerView input_view) noexcept { decode(input_view); } + BerContainer(const BerContainer& container) noexcept { decode(container.view()); } + BerContainer(BerContainer&& container) noexcept { decode(container.view()); } BerContainer(absl::Span input_data, ConstructionMethod method) noexcept; BerContainer(Construction input_construction, Class input_class, Tag input_tag, absl::Span input_content) noexcept; + ~BerContainer() noexcept = default; - BerContainer& operator=(const BerView& input_view) noexcept; + BerContainer& operator=(const BerView input_view) noexcept; BerContainer& operator=(const BerContainer& input_container) noexcept; - bool assign(const BerView& input_view) noexcept; - bool assign(const BerContainer& container) noexcept; + BerContainer& operator=(BerContainer&& input_container) noexcept; void assign_content(const absl::Span input_content) noexcept; void assign_content(Construction input_construction, Class input_class, Tag input_tag, @@ -59,12 +60,10 @@ class BerContainer const uint8_t* ber_data() const noexcept { return m_view.ber_data(); } size_t ber_length() const noexcept { return m_view.ber_length(); } - const BerView& view() const noexcept { return m_view; } + const BerView view() const noexcept { return m_view; } EncodeResult encode(absl::Span buffer) const noexcept; - DecodeResult decode(BerViewIterator& input_data) noexcept; - EncodeResult encode_content_and_length(absl::Span buffer) const noexcept; - DecodeResult decode_content_and_length(BerViewIterator& input_data) noexcept; + DecodeResult decode(const BerView input_data) noexcept; private: absl::InlinedVector m_data; @@ -72,12 +71,12 @@ class BerContainer }; inline BerContainer::BerContainer() noexcept - : m_data{0x80, 0x00}, m_view(absl::MakeSpan(m_data.begin(), m_data.size()), 0, 1, 2, 0) + : m_data{0x00, 0x00}, m_view(absl::MakeSpan(m_data.data(), m_data.size()), 0, 2, 0) { } inline BerContainer::BerContainer(absl::Span input_data, ConstructionMethod method) noexcept - : m_data(input_data.begin(), input_data.end()), m_view(absl::MakeSpan(m_data.begin(), m_data.size())) + : m_data(input_data.begin(), input_data.end()), m_view(absl::MakeSpan(m_data.data(), m_data.size())) { if (method == ConstructionMethod::construct_with_provided_content) { @@ -85,7 +84,7 @@ inline BerContainer::BerContainer(absl::Span input_data, Construc } else if (method == ConstructionMethod::construct_from_ber_packet) { - assign(input_data); + decode(input_data); } else { @@ -99,50 +98,30 @@ inline BerContainer::BerContainer(Construction input_construction, Class input_c assign_content(input_construction, input_class, input_tag, input_content); } -inline BerContainer& BerContainer::operator=(const BerView& input_view) noexcept -{ - assign(input_view); - return *this; -} - inline BerContainer& BerContainer::operator=(const BerContainer& container) noexcept { - assign(container); + m_data = container.m_data; + m_view.assign(m_data, container.tag(), container.header_length(), container.content_length()); return *this; } -inline bool BerContainer::assign(const BerView& input_view) noexcept -{ - if (!input_view.is_valid()) - { - m_data = {}; - m_view.assign(absl::Span(m_data)); - assert(!m_view.is_valid()); - return false; - } - - m_data.assign(input_view.ber().begin(), input_view.ber().end()); - m_view.assign(absl::MakeSpan(m_data.data(), m_data.size()), input_view.tag(), input_view.identifier_length(), - input_view.header_length(), input_view.content_length()); - - return m_view.is_valid(); -} - -inline bool BerContainer::assign(const BerContainer& input_container) noexcept +inline BerContainer& BerContainer::operator=(BerContainer&& container) noexcept { - return assign(input_container.view()); + m_data = std::move(container.m_data); + m_view.assign(m_data, container.tag(), container.header_length(), container.content_length()); + return *this; } inline void BerContainer::assign_content(const absl::Span input_content) noexcept { m_data.resize(15 + input_content.size()); - m_data[0] = 0x80; // No identifier provided, use a tag of 0 + m_data[0] = 0x00; // No identifier provided, use a tag of 0 size_t new_header_length = 1 + encode_length(absl::Span(m_data.data() + 1, m_data.size() - 1), input_content.size()); m_data.resize(new_header_length + input_content.length()); std::copy(input_content.data(), input_content.end(), m_data.data() + new_header_length); - m_view.assign(m_data, 0, 1, new_header_length, input_content.size()); + m_view.assign(m_data, 0, new_header_length, input_content.size()); assert(m_view.is_valid()); } @@ -163,7 +142,7 @@ inline void BerContainer::assign_content(Construction input_construction, Class inline void BerContainer::resize_content(size_t size) { - std::array length_buffer; + std::array length_buffer{}; size_t old_header_length = view().header_length(); size_t old_size = view().content_length(); @@ -183,40 +162,20 @@ inline void BerContainer::resize_content(size_t size) inline EncodeResult BerContainer::encode(absl::Span buffer) const noexcept { return m_view.encode(buffer); } -inline DecodeResult BerContainer::decode(BerViewIterator& input_data) noexcept +inline DecodeResult BerContainer::decode(const BerView input_view) noexcept { - bool success = assign(*input_data); - ++input_data; - return DecodeResult{success}; -} - -inline EncodeResult BerContainer::encode_content_and_length(absl::Span buffer) const noexcept -{ - return m_view.encode_content_and_length(buffer); -} - -inline DecodeResult BerContainer::decode_content_and_length(BerViewIterator& input_data) noexcept -{ - if (!input_data->is_valid()) + if (!input_view.is_valid()) { + m_data = {}; + m_view.assign(absl::Span(m_data)); + assert(!m_view.is_valid()); return DecodeResult{false}; } - if (!m_view.is_valid()) - { - *this = BerContainer(); - } - - m_data.resize(input_data->content_length() + identifier_length()); - std::copy(input_data->content().begin(), input_data->content().end(), m_data.data() + identifier_length()); - m_view.assign(absl::MakeSpan(m_data.begin(), m_data.size())); - - if (!m_view.is_valid()) - { - return DecodeResult{false}; - } + m_data.assign(input_view.ber().begin(), input_view.ber().end()); + m_view.assign(absl::MakeSpan(m_data.data(), m_data.size()), input_view.tag(), input_view.header_length(), + input_view.content_length()); - ++input_data; return DecodeResult{true}; } diff --git a/include/fast_ber/util/BerLengthAndContentContainer.hpp b/include/fast_ber/util/BerLengthAndContentContainer.hpp deleted file mode 100644 index 9129af03..00000000 --- a/include/fast_ber/util/BerLengthAndContentContainer.hpp +++ /dev/null @@ -1,128 +0,0 @@ -#pragma once - -#include "fast_ber/util/BerContainer.hpp" -#include "fast_ber/util/EncodeHelpers.hpp" - -#include "absl/container/inlined_vector.h" -#include "absl/types/span.h" - -namespace fast_ber -{ - -// Owning container of a ber packet's content and length. Contents are always valid. Memory is stored in a small -// buffer optimized vector. Can be constructed directly from encoded ber memory (assign_ber) or by specifiyng the -// desired contents (assign_contents) -class BerLengthAndContentContainer -{ - public: - BerLengthAndContentContainer() noexcept : m_data{0}, m_content_offset{1} {} - BerLengthAndContentContainer(const BerView& view) noexcept { assign(view); } - BerLengthAndContentContainer(const BerLengthAndContentContainer& container) noexcept - : m_data{container.m_data}, m_content_offset{container.m_content_offset} - { - } - BerLengthAndContentContainer( - absl::Span data, - ConstructionMethod method = ConstructionMethod::construct_with_provided_content) noexcept; - - bool operator==(const BerLengthAndContentContainer& rhs) const noexcept { return m_data == rhs.m_data; } - bool operator!=(const BerLengthAndContentContainer& rhs) const noexcept { return !(*this == rhs); } - - BerLengthAndContentContainer& operator=(const BerView& view) noexcept; - BerLengthAndContentContainer& operator=(const BerLengthAndContentContainer& container) noexcept; - size_t assign(const BerView& view) noexcept; - size_t assign(const BerContainer& container) noexcept; - - void assign_content(const absl::Span input_content) noexcept; - void resize_content(size_t size) noexcept; - - absl::Span content() noexcept { return absl::MakeSpan(content_data(), content_length()); } - absl::Span content() const noexcept { return absl::MakeSpan(content_data(), content_length()); } - uint8_t* content_data() noexcept { return m_data.data() + m_content_offset; } - const uint8_t* content_data() const noexcept { return m_data.data() + m_content_offset; } - size_t content_length() const noexcept { return m_data.size() - m_content_offset; } - - size_t content_and_length_length() const noexcept { return m_data.size(); } - DecodeResult from_raw(const absl::Span data) noexcept; - EncodeResult content_and_length_to_raw(absl::Span buffer) const noexcept; - DecodeResult content_and_length_from_raw(const absl::Span data) noexcept; - - private: - absl::InlinedVector m_data; - size_t m_content_offset; -}; - -inline BerLengthAndContentContainer& BerLengthAndContentContainer::operator=(const BerView& view) noexcept -{ - assign(view); - return *this; -} - -inline BerLengthAndContentContainer& BerLengthAndContentContainer:: - operator=(const BerLengthAndContentContainer& container) noexcept -{ - this->m_data = container.m_data; - this->m_content_offset = container.m_content_offset; - return *this; -} - -inline size_t BerLengthAndContentContainer::assign(const BerView& view) noexcept -{ - if (!view.is_valid()) - { - return false; - } - - m_content_offset = view.header_length() - view.identifier_length(); - const size_t length_and_content_length = view.content_length() + m_content_offset; - - m_data.assign(view.ber_data() + view.identifier_length(), - view.ber_data() + view.identifier_length() + length_and_content_length); - return view.identifier_length() + length_and_content_length; -} - -inline size_t BerLengthAndContentContainer::assign(const BerContainer& container) noexcept -{ - return assign(container.view()); -} - -inline void BerLengthAndContentContainer::assign_content(const absl::Span input_content) noexcept -{ - m_data.resize(15); - m_content_offset = encode_length(absl::Span(m_data), input_content.size()); - - m_data.resize(m_content_offset + input_content.size()); - std::copy(input_content.data(), input_content.end(), m_data.data() + m_content_offset); -} - -inline void BerLengthAndContentContainer::resize_content(size_t size) noexcept -{ - size_t old_content_offset = m_content_offset; - size_t old_size = m_data.size() - m_content_offset; - m_content_offset = encoded_length_length(size); - - m_data.resize(m_content_offset + size); - if (m_content_offset != old_content_offset) - { - std::memmove(m_data.data() + m_content_offset, m_data.data() + old_content_offset, std::min(old_size, size)); - } - encode_length(absl::MakeSpan(m_data), size); -} - -inline DecodeResult BerLengthAndContentContainer::from_raw(const absl::Span data) noexcept -{ - return DecodeResult{assign(BerView(data)) > 0}; -} - -inline EncodeResult BerLengthAndContentContainer::content_and_length_to_raw(absl::Span buffer) const noexcept -{ - if (buffer.size() < m_data.size()) - { - return EncodeResult{false, 0}; - } - - std::memcpy(buffer.data(), m_data.data(), m_data.size()); - return EncodeResult{true, m_data.size()}; -} - -} // namespace fast_ber diff --git a/include/fast_ber/util/BerView.hpp b/include/fast_ber/util/BerView.hpp index c05e7eb6..4cd75901 100644 --- a/include/fast_ber/util/BerView.hpp +++ b/include/fast_ber/util/BerView.hpp @@ -23,23 +23,24 @@ enum class End class BerView { public: - BerView() noexcept = default; + constexpr BerView() noexcept = default; BerView(absl::Span input_ber_data) noexcept { assign(input_ber_data); } BerView(absl::Span input_ber_data, size_t input_header_length, size_t input_content_length) noexcept; - BerView(absl::Span input_ber_data, Tag input_tag, size_t input_tag_length, - size_t input_header_length, size_t content_length) noexcept; + BerView(absl::Span input_ber_data, Tag input_tag, size_t input_header_length, + size_t content_length) noexcept; void assign(absl::Span input_ber_data) noexcept; void assign(absl::Span input_ber_data, size_t input_header_length, size_t input_content_length) noexcept; - void assign(absl::Span input_ber_data, Tag input_tag, size_t input_tag_length, - size_t input_header_length, size_t content_length) noexcept; + void assign(absl::Span input_ber_data, Tag input_tag, size_t input_header_length, + size_t content_length) noexcept; - bool is_valid() const noexcept { return m_valid; } + bool is_valid() const noexcept { return m_data != nullptr; } Construction construction() const noexcept { return get_construction(m_data[0]); } + RuntimeId identifier() const { return {class_(), tag()}; } Class class_() const noexcept { return get_class(m_data[0]); } Tag tag() const noexcept { return m_tag; } - size_t identifier_length() const noexcept { return m_id_length; } + size_t identifier_length() const noexcept { return encoded_tag_length(tag()); } size_t header_length() const noexcept { return m_header_length; } absl::Span content() const noexcept { return absl::MakeSpan(content_data(), m_content_length); } @@ -53,15 +54,12 @@ class BerView BerViewIterator end() const noexcept; EncodeResult encode(absl::Span buffer) const noexcept; - EncodeResult encode_content_and_length(absl::Span buffer) const noexcept; private: - const uint8_t* m_data; - Tag m_tag; - size_t m_id_length; // Also length field offset - size_t m_header_length; // Also content offset - size_t m_content_length; - bool m_valid{false}; + const uint8_t* m_data = nullptr; + Tag m_tag = 0; + size_t m_header_length = 0; // Also content offset + size_t m_content_length = 0; }; class MutableBerView : public BerView @@ -70,16 +68,17 @@ class MutableBerView : public BerView MutableBerView() noexcept : BerView() {} MutableBerView(absl::Span data) noexcept : BerView(data) {} MutableBerView(absl::Span a, size_t b, size_t c) : BerView(a, b, c) {} - MutableBerView(absl::Span a, Tag b, size_t c, size_t d, size_t e) noexcept : BerView(a, b, c, d, e) - { - } + MutableBerView(absl::Span a, Tag b, size_t c, size_t d) noexcept : BerView(a, b, c, d) {} BerViewIterator cbegin() const noexcept; BerViewIterator cend() const noexcept; MutableBerViewIterator begin() noexcept; MutableBerViewIterator end() noexcept; - uint8_t* content_data() noexcept { return const_cast(BerView::content_data()); } + uint8_t* content_data() noexcept + { + return const_cast(BerView::content_data()); // NOLINT(cppcoreguidelines-pro-type-const-cast) + } const uint8_t* content_data() const noexcept { return BerView::content_data(); } absl::Span content() noexcept { return absl::MakeSpan(content_data(), BerView::content().size()); } absl::Span content() const noexcept { return BerView::content(); } @@ -88,23 +87,18 @@ class MutableBerView : public BerView class BerViewIterator { public: - BerViewIterator(absl::Span buffer) noexcept : m_buffer(buffer), m_view(buffer) - { - if (!m_view.is_valid()) - { - buffer = absl::Span(); - } - } + BerViewIterator(absl::Span buffer) noexcept : m_buffer(buffer), m_view(buffer) {} BerViewIterator(End) noexcept : m_buffer(), m_view() {} BerViewIterator& operator++() noexcept { - m_buffer.remove_prefix(m_view.ber_length()); - m_view.assign(m_buffer); if (!m_view.is_valid()) { - m_buffer = absl::Span(); + assert(m_view.ber_length() == 0); } + m_buffer.remove_prefix(m_view.ber_length()); + m_view.assign(m_buffer); + return *this; } @@ -113,7 +107,7 @@ class BerViewIterator friend bool operator==(const BerViewIterator& lhs, const BerViewIterator& rhs) noexcept { - if (lhs.m_buffer.empty() && rhs.m_buffer.empty()) + if (!lhs.m_view.is_valid() && !rhs.m_view.is_valid()) { return true; } @@ -139,23 +133,18 @@ class BerViewIterator class MutableBerViewIterator { public: - MutableBerViewIterator(absl::Span buffer) noexcept : m_buffer(buffer), m_view(buffer) - { - if (!m_view.is_valid()) - { - buffer = absl::Span(); - } - } + MutableBerViewIterator(absl::Span buffer) noexcept : m_buffer(buffer), m_view(buffer) {} MutableBerViewIterator(End) noexcept : m_buffer(), m_view() {} MutableBerViewIterator& operator++() noexcept { - m_buffer.remove_prefix(m_view.ber_length()); - m_view.assign(m_buffer); if (!m_view.is_valid()) { - m_buffer = absl::Span(); + assert(m_view.ber_length() == 0); } + m_buffer.remove_prefix(m_view.ber_length()); + m_view.assign(m_buffer); + return *this; } @@ -164,7 +153,7 @@ class MutableBerViewIterator friend bool operator==(const MutableBerViewIterator& lhs, const MutableBerViewIterator& rhs) noexcept { - if (lhs.m_buffer.empty() && rhs.m_buffer.empty()) + if (!lhs.m_view.is_valid() && !rhs.m_view.is_valid()) { return true; } @@ -196,15 +185,14 @@ inline BerView::BerView(absl::Span input_ber_data, size_t input_h assign(input_ber_data, input_header_length, input_content_length); } -inline BerView::BerView(absl::Span input_ber_data, Tag input_tag, size_t input_tag_length, - size_t input_header_length, size_t input_content_length) noexcept +inline BerView::BerView(absl::Span input_ber_data, Tag input_tag, size_t input_header_length, + size_t input_content_length) noexcept { - assign(input_ber_data, input_tag, input_tag_length, input_header_length, input_content_length); + assign(input_ber_data, input_tag, input_header_length, input_content_length); } inline void BerView::assign(absl::Span input_ber_data) noexcept { - m_valid = false; size_t input_content_length = 0; size_t input_tag_length = extract_tag(input_ber_data, m_tag); @@ -214,35 +202,31 @@ inline void BerView::assign(absl::Span input_ber_data) noexcept if (input_tag_length == 0 || input_len_length == 0 || input_complete_length > input_ber_data.length()) { - m_id_length = 0; m_header_length = 0; m_content_length = 0; + m_data = nullptr; return; } m_data = input_ber_data.data(); - m_id_length = input_tag_length; m_header_length = input_header_length; m_content_length = input_content_length; - m_valid = true; } inline void BerView::assign(absl::Span input_ber_data, size_t input_header_length, size_t input_content_length) noexcept { - size_t input_tag_length = extract_tag(input_ber_data, m_tag); - assign(input_ber_data, m_tag, input_tag_length, input_header_length, input_content_length); + extract_tag(input_ber_data, m_tag); + assign(input_ber_data, m_tag, input_header_length, input_content_length); } -inline void BerView::assign(absl::Span input_ber_data, Tag input_tag, size_t input_tag_length, - size_t input_header_length, size_t input_content_length) noexcept +inline void BerView::assign(absl::Span input_ber_data, Tag input_tag, size_t input_header_length, + size_t input_content_length) noexcept { m_data = input_ber_data.data(); - m_id_length = input_tag_length; m_header_length = input_header_length; m_content_length = input_content_length; m_tag = input_tag; - m_valid = true; } inline BerViewIterator BerView::begin() const noexcept { return BerViewIterator{content()}; } @@ -263,17 +247,6 @@ inline EncodeResult BerView::encode(absl::Span buffer) const noexcept return EncodeResult{true, ber_length()}; } -inline EncodeResult BerView::encode_content_and_length(absl::Span buffer) const noexcept -{ - auto ber_span = this->ber(); - ber_span.remove_prefix(identifier_length()); - if (ber_span.size() > buffer.size()) - { - return EncodeResult{false, 0}; - } - - std::memcpy(buffer.data(), ber_span.data(), ber_span.size()); - return EncodeResult{true, ber_span.length()}; -} +std::ostream& operator<<(std::ostream& os, BerView view) noexcept; } // namespace fast_ber diff --git a/include/fast_ber/util/DecodeHelpers.hpp b/include/fast_ber/util/DecodeHelpers.hpp index aa9b126d..0b9a6782 100644 --- a/include/fast_ber/util/DecodeHelpers.hpp +++ b/include/fast_ber/util/DecodeHelpers.hpp @@ -12,49 +12,38 @@ struct DecodeResult bool success; }; -template -DecodeResult decode_impl(BerViewIterator& input, T& output, Id id) noexcept +template +DecodeResult decode(absl::Span input, T& output) noexcept { - if (!input->is_valid() || val(id.tag()) != input->tag()) - { - return DecodeResult{false}; - } + return output.decode(BerView(input)); +} - bool success = output.assign_ber(*input) > 0; - ++input; - return DecodeResult{success}; +template +DecodeResult decode(BerView input, T& output) noexcept +{ + return output.decode(input); } -template -DecodeResult decode_impl(BerViewIterator& input, T& output, DoubleId id) noexcept +template +DecodeResult decode(BerViewIterator& input, T& output) noexcept { - if (!input->is_valid() || val(id.tag()) != input->tag()) - { - return DecodeResult{false}; - } - - BerView inner = input->content(); - BerViewIterator iter = input->content(); - if (!decode_impl(iter, output, id.inner_id()).success) - { - return DecodeResult{false}; - } - - bool success = output.assign_ber(inner) > 0; + DecodeResult res = output.decode(*input); ++input; - return DecodeResult{success}; + return res; } -template -DecodeResult decode(absl::Span input, T& output) noexcept +template +bool has_correct_header(BerView input, Id, Construction construction) { - BerViewIterator iter(input); - if (!iter->is_valid()) - { - return DecodeResult{false}; - } + return input.is_valid() && input.class_() == class_ && input.tag() == tag && input.construction() == construction; +} - return decode(iter, output); +template +bool has_correct_header(BerView input, DoubleId, Construction construction) +{ + return input.is_valid() && input.identifier() == Identifier1{} && + input.construction() == Construction::constructed && input.begin()->is_valid() && + input.begin()->identifier() == Identifier2{} && input.begin()->construction() == construction; } } // namespace fast_ber diff --git a/include/fast_ber/util/DynamicOptional.hpp b/include/fast_ber/util/DynamicOptional.hpp index c3805602..ecd55b1c 100644 --- a/include/fast_ber/util/DynamicOptional.hpp +++ b/include/fast_ber/util/DynamicOptional.hpp @@ -13,12 +13,13 @@ template class DynamicOptional { public: - DynamicOptional() = default; + DynamicOptional() noexcept = default; DynamicOptional(const DynamicOptional& rhs) : m_val(nullptr) { *this = rhs; } - DynamicOptional(DynamicOptional&&) = default; - DynamicOptional(Empty) {} + DynamicOptional(DynamicOptional&&) noexcept = default; + DynamicOptional(Empty) noexcept {} DynamicOptional(const T& t) : m_val(new T(t)) {} DynamicOptional(T&& t) : m_val(new T(std::move(t))) {} + ~DynamicOptional() noexcept = default; template () { return m_val.get(); } diff --git a/include/fast_ber/util/DynamicVariant.hpp b/include/fast_ber/util/DynamicVariant.hpp new file mode 100644 index 00000000..0a998c0b --- /dev/null +++ b/include/fast_ber/util/DynamicVariant.hpp @@ -0,0 +1,634 @@ +#pragma once + +#include "fast_ber/util/DynamicVariantHelpers.hpp" + +#include "absl/meta/type_traits.h" + +#include +#include +#include +#include +#include + +namespace fast_ber +{ +namespace dynamic +{ + +struct in_place_t +{ + explicit in_place_t() = default; +}; + +static constexpr in_place_t in_place{}; + +template +struct in_place_type_t +{ + explicit in_place_type_t() = default; +}; + +template +struct in_place_index_t +{ + explicit in_place_index_t() = default; +}; + +struct BadVariantAccess : public std::exception +{ + const char* what() const noexcept override { return "Bad variant access;"; } +}; + +template ...>::value, int> = 0> +void swap(DynamicVariant& v, DynamicVariant& w) noexcept(noexcept(v.swap(w))) +{ + v.swap(w); +} + +template +struct variant_size; + +template +struct variant_size> : std::integral_constant +{ +}; + +template +struct variant_size : variant_size +{ +}; + +template +struct variant_size : variant_size +{ +}; + +template +struct variant_size : variant_size +{ +}; + +template +struct variant_alternative; + +template +struct variant_alternative> +{ + using type = detail::TypeAtIndex; +}; + +template +struct variant_alternative +{ + using type = const typename variant_alternative::type; +}; + +template +struct variant_alternative +{ + using type = volatile typename variant_alternative::type; +}; + +template +struct variant_alternative +{ + using type = const volatile typename variant_alternative::type; +}; + +template +using variant_alternative_t = typename variant_alternative::type; + +template +constexpr bool holds_alternative(const DynamicVariant& v) noexcept +{ + return v.index() == detail::IndexOf::value; +} + +template +T& get(DynamicVariant& v) +{ + if (v.index() != detail::IndexOf::value) + { + throw BadVariantAccess(); + } + return v.template value(); +} + +template +T&& get(DynamicVariant&& v) +{ + if (v.index() != detail::IndexOf::value) + { + throw BadVariantAccess(); + } + return v.template value(); +} + +template +const T& get(const DynamicVariant& v) +{ + if (v.index() != detail::IndexOf::value) + { + throw BadVariantAccess(); + } + return v.template value(); +} + +template +const T&& get(const DynamicVariant&& v) +{ + if (v.index() != detail::IndexOf::value) + { + throw BadVariantAccess(); + } + return v.template value(); +} + +template +variant_alternative_t>& get(DynamicVariant& v) +{ + if (v.index() != I) + { + throw BadVariantAccess(); + } + return v.template value>>(); +} + +template +variant_alternative_t>&& get(DynamicVariant&& v) +{ + if (v.index() != I) + { + throw BadVariantAccess(); + } + return v.template value>>(); +} + +template +const variant_alternative_t>& get(const DynamicVariant& v) +{ + if (v.index() != I) + { + throw BadVariantAccess(); + } + return v.template value>>(); +} + +template +const variant_alternative_t>&& get(const DynamicVariant&& v) +{ + if (v.index() != I) + { + throw BadVariantAccess(); + } + return v.template value>>(); +} + +template +constexpr typename std::add_pointer>>::type +get_if(DynamicVariant* v) noexcept +{ + return (v != nullptr && v->index() == I) ? std::addressof(fast_ber::dynamic::get(*v)) : nullptr; +} + +template +constexpr typename std::add_pointer>>::type +get_if(const DynamicVariant* v) noexcept +{ + return (v != nullptr && v->index() == I) ? std::addressof(fast_ber::dynamic::get(*v)) : nullptr; +} + +template +constexpr typename std::add_pointer::type get_if(DynamicVariant* v) noexcept +{ + return fast_ber::dynamic::get_if::value>(v); +} + +template +constexpr typename std::add_pointer::type get_if(const DynamicVariant* v) noexcept +{ + return fast_ber::dynamic::get_if::value>(v); +} + +template ::type = 0> +[[noreturn]] auto visit_impl(Visitor&& vis, const DynamicVariant& variant) + -> decltype(vis(get<0>(variant))) +{ + assert("Not reachable"); + throw 0; +} + +template ::type = 0> +auto visit_impl(Visitor&& vis, DynamicVariant& variant) -> decltype(vis(get<0>(variant))) +{ + if (index == variant.index()) + { + return vis(get(variant)); + } + return visit_impl(vis, variant); +} + +template ::type = 0> +auto visit_impl(Visitor&& vis, const DynamicVariant& variant) -> decltype(vis(get<0>(variant))) +{ + if (index == variant.index()) + { + return vis(get(variant)); + } + return visit_impl(vis, variant); +} + +template +auto visit(Visitor&& vis, Variants&&... vars) -> decltype(visit_impl<0>(vis, vars...)) +{ + return visit_impl<0>(vis, vars...); +} + +template ::type = 0> +[[noreturn]] auto visit_binary_impl(Visitor&& vis, const DynamicVariant& a, + const DynamicVariant& b) -> decltype(vis(get<0>(a), get<0>(b))) +{ + assert("Not reachable"); + throw 0; +} + +template ::type = 0> +auto visit_binary_impl(Visitor&& vis, const DynamicVariant& a, + const DynamicVariant& b) -> decltype(vis(get<0>(a), get<0>(b))) +{ + if (index == a.index()) + { + return vis(get(a), get(b)); + } + return visit_binary_impl(vis, a, b); +} + +template +auto visit_binary(Visitor&& vis, const DynamicVariant& a, const DynamicVariant& b) + -> decltype(visit_binary_impl<0>(vis, a, b)) +{ + assert(a.index() == b.index()); + return visit_binary_impl<0>(vis, a, b); +} + +struct CopyVisitor +{ + template + void* operator()(const T& t) const + { + return new T(t); + } +}; + +struct DeleteVisitor +{ + template + void operator()(T& t) const + { + delete &t; + } +}; + +template +class DynamicVariant +{ + static_assert(absl::conjunction...>::value, + "Attempted to instantiate a variant containing a non-object " + "type."); + static_assert(absl::conjunction>...>::value, + "Attempted to instantiate a variant containing an array type."); + + struct Nothing + { + }; + + template + struct ToTypeImpl + { + using type = Nothing; + }; + + template + struct ToTypeImpl + { + using type = variant_alternative_t; + }; + + public: + template + using ToType = typename ToTypeImpl::type; + template + using ExactlyOnce = detail::ExactlyOnce; + template + using AcceptedIndex = detail::AcceptedIndex; + template + using AcceptedType = ToType::value>; + + DynamicVariant() noexcept : m_data(new ToType<0>()) {} + DynamicVariant(const DynamicVariant& other) + : m_index(other.m_index), m_data(fast_ber::dynamic::visit(CopyVisitor{}, other)) + { + } + DynamicVariant(DynamicVariant&& other) noexcept : m_index(std::move(other.m_index)), m_data(std::move(other.m_data)) + { + other.m_data = nullptr; + } + + template , DynamicVariant>::value>, + typename = absl::enable_if_t>::value && + std::is_constructible, T&&>::value>> + DynamicVariant(T&& t) noexcept(std::is_nothrow_constructible, T&&>::value) + : m_index(detail::IndexOf, Types...>::value), m_data(new AcceptedType(t)) + { + assert(holds_alternative>(*this)); + } + + template ::value && std::is_constructible::value>> + explicit DynamicVariant(in_place_type_t, Args&&... args) + : m_index(detail::IndexOf::value), m_data(new T(std::forward(args)...)) + + { + assert(holds_alternative(*this)); + } + + template ::value && + std::is_constructible&, Args&&...>::value>> + explicit DynamicVariant(in_place_type_t, std::initializer_list il, Args&&... args) + : m_index(detail::IndexOf::value), m_data(new T(il, args...)) + { + assert(holds_alternative(*this)); + } + + template , Args&&...>::value>> + explicit DynamicVariant(in_place_index_t, Args&&... args) + : m_index(i), m_data(new ToType(std::forward(args)...)) + { + assert(index() == i); + } + + template < + size_t i, typename U, typename... Args, + typename = absl::enable_if_t, std::initializer_list&, Args&&...>::value>> + explicit DynamicVariant(in_place_index_t, std::initializer_list il, Args&&... args) + : m_index(i), m_data(new ToType(il, std::forward(args)...)) + + { + assert(index() == i); + } + + ~DynamicVariant() + { + if (!valueless_by_exception() && m_data != nullptr) + { + fast_ber::dynamic::visit(DeleteVisitor(), *this); + } + } + + DynamicVariant& operator=(const DynamicVariant& other) + { + if (!valueless_by_exception() && m_data != nullptr) + { + fast_ber::dynamic::visit(DeleteVisitor(), *this); + } + m_index = other.m_index; + m_data = fast_ber::dynamic::visit(CopyVisitor(), other); + + return *this; + } + + DynamicVariant& operator=(DynamicVariant&& other) noexcept + { + if (!valueless_by_exception() && m_data != nullptr) + { + fast_ber::dynamic::visit(DeleteVisitor(), *this); + } + m_index = other.m_index; + m_data = other.m_data; + + other.m_data = nullptr; + return *this; + } + + template , DynamicVariant>::value && + ExactlyOnce>::value && + std::is_constructible, T&&>::value && + std::is_assignable&, T&&>::value>> + DynamicVariant& operator=(T&& t) noexcept(std::is_nothrow_assignable&, T&&>::value&& + std::is_nothrow_constructible, T&&>::value) + { + if (!valueless_by_exception() && m_data != nullptr) + { + fast_ber::dynamic::visit(DeleteVisitor(), *this); + } + m_index = AcceptedIndex::value; + m_data = new AcceptedType(std::move(t)); + return *this; + } + + template ::value && ExactlyOnce::value>> + T& emplace(Args&&... args) + { + if (!valueless_by_exception() && m_data != nullptr) + { + fast_ber::dynamic::visit(DeleteVisitor(), *this); + } + m_index = AcceptedIndex::value; + m_data = new AcceptedType(std::forward(args)...); + + assert(holds_alternative(*this)); + return *static_cast(m_data); + } + + template &, Args...>::value && + ExactlyOnce::value>> + T& emplace(std::initializer_list il, Args&&... args) + { + if (!valueless_by_exception() && m_data != nullptr) + { + fast_ber::dynamic::visit(DeleteVisitor(), *this); + } + m_index = AcceptedIndex::value; + m_data = new T(std::forward(il, args)...); + + assert(holds_alternative(*this)); + return *static_cast(m_data); + } + + template + absl::enable_if_t, Args...>::value, + variant_alternative_t&> + emplace(Args&&... args) + { + static_assert(i < sizeof...(Types), "The index should be in [0, number of alternatives)"); + + if (!valueless_by_exception() && m_data != nullptr) + { + fast_ber::dynamic::visit(DeleteVisitor(), *this); + } + + try + { + m_index = i; + m_data = new ToType(std::forward(args)...); + } + catch (...) + { + m_index = variant_npos; + throw; + } + assert(index() == i); + return get(*this); + } + + template + absl::enable_if_t< + std::is_constructible, std::initializer_list&, Args...>::value, + variant_alternative_t&> + emplace(std::initializer_list il, Args&&... args) + { + static_assert(i < sizeof...(Types), "The index should be in [0, number of alternatives)"); + + if (!valueless_by_exception() && m_data != nullptr) + { + fast_ber::dynamic::visit(DeleteVisitor(), *this); + } + + try + { + m_index = i; + m_data = new ToType(std::forward(il, args)...); + } + catch (...) + { + m_index = variant_npos; + throw; + } + assert(index() == i); + return get(*this); + } + + constexpr bool valueless_by_exception() const noexcept { return m_index == variant_npos; } + + constexpr std::size_t index() const noexcept { return m_index; } + + void swap(DynamicVariant& rhs) noexcept + { + std::swap(m_index, rhs.m_index); + std::swap(m_data, rhs.m_data); + } + + template + T& value() + { + return *reinterpret_cast(m_data); + } + + template + const T& value() const + { + return *reinterpret_cast(m_data); + } + + private: + size_t m_index{0}; + void* m_data; +}; // namespace fast_ber + +static_assert(std::is_copy_constructible>::value, ""); +static_assert(std::is_move_constructible>::value, ""); +static_assert(std::is_copy_assignable>::value, ""); +static_assert(std::is_move_assignable>::value, ""); + +struct Equals +{ + template + bool operator()(const T& lhs, const T& rhs) + { + return lhs == rhs; + } +}; + +struct LessThan +{ + template + bool operator()(const T& lhs, const T& rhs) + { + return lhs == rhs; + } +}; + +struct GreaterThan +{ + template + bool operator()(const T& lhs, const T& rhs) + { + return lhs > rhs; + } +}; + +struct LessThanOrEquals +{ + template + bool operator()(const T& lhs, const T& rhs) + { + return lhs <= rhs; + } +}; + +struct GreaterThanOrEquals +{ + template + bool operator()(const T& lhs, const T& rhs) + { + return lhs >= rhs; + } +}; + +template +bool operator==(const DynamicVariant& a, const DynamicVariant& b) +{ + return (a.index() == b.index()) && visit_binary(Equals(), a, b); +} + +template +bool operator!=(const DynamicVariant& a, const DynamicVariant& b) +{ + return (a.index() != b.index()) || !visit_binary(Equals(), a, b); +} + +template +bool operator<(const DynamicVariant& a, const DynamicVariant& b) +{ + return (a.index() != b.index()) ? (a.index() + 1) < (b.index() + 1) : visit_binary(LessThan(), a, b); +} + +template +bool operator>(const DynamicVariant& a, const DynamicVariant& b) +{ + return (a.index() != b.index()) ? (a.index() + 1) > (b.index() + 1) : visit_binary(GreaterThan(), a, b); +} + +template +bool operator<=(const DynamicVariant& a, const DynamicVariant& b) +{ + return (a.index() != b.index()) ? (a.index() + 1) < (b.index() + 1) : visit_binary(LessThanOrEquals(), a, b); +} + +template +bool operator>=(const DynamicVariant& a, const DynamicVariant& b) +{ + return (a.index() != b.index()) ? (a.index() + 1) > (b.index() + 1) : visit_binary(GreaterThanOrEquals(), a, b); +} + +} // namespace dynamic +} // namespace fast_ber diff --git a/include/fast_ber/util/DynamicVariantHelpers.hpp b/include/fast_ber/util/DynamicVariantHelpers.hpp new file mode 100644 index 00000000..f1f49dd3 --- /dev/null +++ b/include/fast_ber/util/DynamicVariantHelpers.hpp @@ -0,0 +1,113 @@ +#pragma once + +#include +#include +#include + +#include + +namespace fast_ber +{ + +namespace dynamic +{ + +template +class DynamicVariant; + +static constexpr size_t variant_npos = size_t(-1); + +namespace detail +{ + +template +struct ImaginaryFun; + +template +struct ImaginaryFun, i> +{ + static void Run() = delete; +}; + +template +struct ImaginaryFun, i> : ImaginaryFun, i + 1> +{ + using ImaginaryFun, i + 1>::Run; + + static std::integral_constant Run(const H&, std::integral_constant); + static std::integral_constant Run(H&&, std::integral_constant); +}; + +template +using FunType = decltype(ImaginaryFun::Run(std::declval(), {})); + +template +struct AcceptedIndex : std::integral_constant +{ +}; + +template +struct AcceptedIndex::Run(std::declval(), {}))>> + : decltype(ImaginaryFun::Run(std::declval(), {})) +{ +}; + +static_assert(AcceptedIndex>::value == variant_npos, ""); +static_assert(AcceptedIndex>::value != variant_npos, ""); +static_assert(AcceptedIndex>::value == 0, ""); +static_assert(AcceptedIndex>::value == 2, ""); + +template +struct TupleCount; + +template +struct TupleCount> : std::integral_constant +{ +}; + +template +struct TupleCount> + : std::integral_constant>::value + std::is_same::value> +{ +}; + +template +struct ExactlyOnce : std::integral_constant>::value == 1> +{ +}; + +template +struct TypeAtIndexImpl; + +template +struct TypeAtIndexImpl<0, T0, Tn...> +{ + using Type = typename std::remove_reference::type; +}; + +template +struct TypeAtIndexImpl +{ + using Type = typename TypeAtIndexImpl::Type; +}; + +template +using TypeAtIndex = typename TypeAtIndexImpl::Type; + +static_assert(std::is_same, int>::value, ""); +static_assert(std::is_same, char>::value, ""); + +template +struct IndexOf : std::integral_constant +{ +}; + +template +struct IndexOf + : std::integral_constant::value ? 0 : IndexOf::value + 1> +{ +}; + +} // namespace detail +} // namespace dynamic +} // namespace fast_ber diff --git a/include/fast_ber/util/EncodeHelpers.hpp b/include/fast_ber/util/EncodeHelpers.hpp index 57a45bdb..011d9efc 100644 --- a/include/fast_ber/util/EncodeHelpers.hpp +++ b/include/fast_ber/util/EncodeHelpers.hpp @@ -2,6 +2,7 @@ #include "fast_ber/ber_types/Identifier.hpp" #include "fast_ber/util/Definitions.hpp" +#include "fast_ber/util/EncodeIdentifiers.hpp" #include "absl/types/span.h" @@ -17,104 +18,80 @@ struct EncodeResult size_t length; }; -// Creates a BER header with provided ID around the data currently in the buffer -// The data of interest should be located in the buffer, with length "content_length" - -// A offset if the data in the buffer can specified by "content_offset" -// Building the data at a specfic content_offset will remove the need for moving memory after the header -// has been added. -// Reasonable guesses for content_offset: -// 2 for single tagged, 4 for double tagged -// These are the samllest ID lengths, optimising for small sized ber headers. - template -constexpr size_t wrap_with_ber_header_length(size_t content_length, Id id) +EncodeResult encode_header(absl::Span buffer, size_t content_length, Id id, Construction construction) { - return encoded_header_length(Construction::primitive, id.class_(), id.tag(), content_length) + content_length; + size_t header_length = encode_header(buffer, construction, id.class_(), id.tag(), content_length); + if (header_length == 0) + { + return EncodeResult{false, 0}; + } + return EncodeResult{true, header_length + content_length}; } -template -constexpr size_t wrap_with_ber_header_length(size_t content_length, DoubleId id) + +template +std::array encoded_header() noexcept { - return wrap_with_ber_header_length(wrap_with_ber_header_length(content_length, id.inner_id()), id.outer_id) + - content_length; + std::array data = {}; + encode_header(absl::Span(data), content_length, Identifier{}, Construction::primitive); + return data; } template -EncodeResult wrap_with_ber_header(absl::Span buffer, size_t content_length, DoubleId id, - size_t content_offset = 0) +EncodeResult encode_header(absl::Span buffer, size_t content_length, DoubleId id, + Construction construction) { - constexpr auto tag = id.tag(); - constexpr auto class_ = id.class_(); + size_t inner_header_length = encoded_header_length(content_length, id.inner_id()); + size_t outer_header_length = encoded_header_length(inner_header_length + content_length, id.outer_id()); - size_t header_length = encoded_header_length(Construction::constructed, class_, tag, content_length); - if (header_length + content_length > buffer.length()) + if (buffer.size() < outer_header_length + inner_header_length + content_length) { return EncodeResult{false, 0}; } - assert(buffer.length() >= content_length + content_offset); + auto inner = buffer; + inner.remove_prefix(outer_header_length); - if (content_offset != header_length) - { - std::memmove(buffer.data() + header_length, buffer.data() + content_offset, content_length); - } - encode_header(absl::MakeSpan(buffer.data(), buffer.size()), Construction::constructed, class_, tag, content_length); - return EncodeResult{true, header_length + content_length}; + encode_header(inner, content_length, id.inner_id(), construction); + return encode_header(buffer, inner_header_length + content_length, id.outer_id(), Construction::constructed); } -template -EncodeResult wrap_with_ber_header(absl::Span buffer, size_t content_length, Id, - size_t content_offset = 0) -{ - constexpr auto tag = Id::tag(); - constexpr auto class_ = Id::class_(); +// Creates a BER header with provided ID around the data currently in the buffer +// The data of interest should be located in the buffer, with length "content_length" + +// An offset if the data in the buffer can specified by "content_offset" +// Building the data at a specfic content_offset will remove the need for moving memory after the header +// has been added. - size_t header_length = encoded_header_length(Construction::constructed, class_, tag, content_length); +template +EncodeResult wrap_with_ber_header(absl::Span buffer, size_t content_length, Identifier id, + size_t content_offset = 0, Construction construction = Construction::constructed) +{ + size_t header_length = encoded_header_length(content_length, id); if (header_length + content_length > buffer.length()) { return EncodeResult{false, 0}; } assert(buffer.length() >= content_length + content_offset); - if (content_offset != header_length) { std::memmove(buffer.data() + header_length, buffer.data() + content_offset, content_length); } - encode_header(absl::MakeSpan(buffer.data(), buffer.size()), Construction::constructed, class_, tag, content_length); - return EncodeResult{true, header_length + content_length}; + return encode_header(buffer, content_length, id, construction); } -template -EncodeResult encode_impl(absl::Span output, const T& object, Id id) +template +constexpr size_t encoded_length(const T& object) noexcept { - size_t id_length = encode_identifier(output, Construction::primitive, id.class_(), id.tag()); - if (id_length == 0) - { - return EncodeResult{false, 0}; - } - assert(id_length <= output.size()); - - output.remove_prefix(id_length); - - EncodeResult encode_res = object.encode_content_and_length(output); - encode_res.length += id_length; - return encode_res; + return object.encoded_length(); } -template -EncodeResult encode_impl(absl::Span output, const T& object, DoubleId id) +template +EncodeResult encode(absl::Span output, const T& object) noexcept { - const auto header_length_guess = 2; - auto inner_buffer = output; - inner_buffer.remove_prefix(header_length_guess); - EncodeResult inner_encoding = encode_impl(inner_buffer, object, id.inner_id()); - if (!inner_encoding.success) - { - return EncodeResult{false, 0}; - } - - return wrap_with_ber_header(output, inner_encoding.length, id, header_length_guess); + return object.encode(output); } } // namespace fast_ber diff --git a/include/fast_ber/util/EncodeIdentifiers.hpp b/include/fast_ber/util/EncodeIdentifiers.hpp index 2df1a336..2747aaca 100644 --- a/include/fast_ber/util/EncodeIdentifiers.hpp +++ b/include/fast_ber/util/EncodeIdentifiers.hpp @@ -12,23 +12,23 @@ namespace fast_ber // Encode ber tag in provided buffer // Return the size of the encoded tag field or zero on fail -inline size_t encode_tag(absl::Span output, Tag tag) noexcept; -inline size_t encode_tag(absl::Span output, UniversalTag tag) noexcept; -inline size_t encoded_tag_length(Tag tag) noexcept; -inline size_t encoded_tag_length(UniversalTag tag) noexcept; +inline size_t encode_tag(absl::Span output, Tag tag) noexcept; +inline size_t encode_tag(absl::Span output, UniversalTag tag) noexcept; +constexpr inline size_t encoded_tag_length(Tag tag) noexcept; +constexpr inline size_t encoded_tag_length(UniversalTag tag) noexcept; // Encode ber identifier octets // Return the size of the encoded tag field or zero on fail inline size_t encode_identifier(absl::Span output, Construction construction, Class class_, Tag tag) noexcept; inline size_t encode_identifier(absl::Span output, Construction construction, Class class_, UniversalTag tag) noexcept; -inline size_t encoded_identifier_length(Construction construction, Class class_, Tag tag) noexcept; -inline size_t encoded_identifier_length(Construction construction, Class class_, UniversalTag tag) noexcept; +constexpr inline size_t encoded_identifier_length(Construction construction, Class class_, Tag tag) noexcept; +constexpr inline size_t encoded_identifier_length(Construction construction, Class class_, UniversalTag tag) noexcept; // Encode ber length octets // Return the size of the encoded tag field or zero on fail -inline size_t encode_length(absl::Span output, uint64_t length) noexcept; -inline size_t encoded_length_length(size_t length) noexcept; +inline size_t encode_length(absl::Span output, uint64_t length) noexcept; +constexpr inline size_t encoded_length_length(size_t length) noexcept; // Encode a ber header consisting of construction, class, tag and size // Return the size of the encoded header or zero on fail @@ -36,15 +36,26 @@ inline size_t encode_header(absl::Span output, Construction constructio size_t length) noexcept; inline size_t encode_header(absl::Span output, Construction construction, Class class_, UniversalTag tag, size_t length) noexcept; -inline size_t encoded_header_length(Construction construction, Class class_, Tag tag, size_t length) noexcept; -inline size_t encoded_header_length(Construction construction, Class class_, UniversalTag tag, size_t length) noexcept; +constexpr inline size_t encoded_header_length(Construction construction, Class class_, Tag tag, size_t length) noexcept; +constexpr inline size_t encoded_header_length(Construction construction, Class class_, UniversalTag tag, + size_t length) noexcept; + +template +constexpr size_t encoded_header_length(size_t content_length, Id id) noexcept; +template +constexpr size_t encoded_header_length(size_t content_length, DoubleId id) noexcept; template constexpr size_t encoded_length(Id id); template -constexpr size_t encoded_length(size_t content_and_length_length, Id id); +constexpr size_t encoded_length(size_t content_length, Id id); +template +constexpr size_t encoded_length(size_t content_length, DoubleId id); +template +constexpr size_t encoded_length_from_id_and_length(size_t content_and_length_length, Id id); template -constexpr size_t encoded_length(size_t content_and_length_length, DoubleId, Id> id); +constexpr size_t encoded_length_from_id_and_length(size_t content_and_length_length, + DoubleId, Id> id); constexpr inline uint8_t add_short_tag(uint8_t first_byte, Tag tag) noexcept { @@ -86,31 +97,32 @@ inline size_t encode_tag(absl::Span output, Tag tag) noexcept return 0; } } -inline size_t encode_tag(absl::Span output, UniversalTag tag) noexcept { return encode_tag(output, val(tag)); } -inline size_t encoded_tag_length(Tag tag) noexcept +inline size_t encode_tag(absl::Span output, UniversalTag tag) noexcept { - if (tag < 0) - { - return 0; - } - - if (tag <= 30) - { - return 1; - } - else - { - for (size_t i = 1;; i++) - { - tag /= 0x80; - if (tag == 0) - { - return i + 1; - } - } - } + return encode_tag(output, as_underlying(tag)); +} +constexpr inline size_t encoded_tag_length(Tag tag) noexcept +{ + return (tag < 0ll) ? 0 + : (tag <= 30ll) + ? 1 + : (tag < 128ll) + ? 2 + : (tag < 16384ll) ? 3 + : (tag < 2097152ll) + ? 4 + : (tag < 268435456ll) + ? 5 + : (tag < 34359738368ll) + ? 6 + : (tag < 4398046511104ll) + ? 7 + : (tag < 562949953421312ll) + ? 8 + : (tag < 72057594037927936) ? 9 : 10; } -inline size_t encoded_tag_length(UniversalTag tag) noexcept { return encoded_tag_length(val(tag)); } + +constexpr inline size_t encoded_tag_length(UniversalTag tag) noexcept { return encoded_tag_length(as_underlying(tag)); } constexpr inline uint8_t encode_short_identifier(Construction construction, Class class_, Tag tag) { @@ -118,13 +130,13 @@ constexpr inline uint8_t encode_short_identifier(Construction construction, Clas } constexpr inline uint8_t encode_short_identifier(Construction construction, Class class_, UniversalTag tag) { - return add_short_tag(add_class(add_construction(0, construction), class_), val(tag)); + return add_short_tag(add_class(add_construction(0, construction), class_), as_underlying(tag)); } inline size_t encode_identifier(absl::Span output, Construction construction, Class class_, Tag tag) noexcept { if (output.size() < 1) { - return false; + return 0; } output[0] = 0; @@ -137,10 +149,13 @@ inline size_t encode_identifier(absl::Span output, Construction constru inline size_t encode_identifier(absl::Span output, Construction construction, Class class_, UniversalTag tag) noexcept { - return encode_identifier(output, construction, class_, val(tag)); + return encode_identifier(output, construction, class_, as_underlying(tag)); +} +constexpr inline size_t encoded_identifier_length(Construction, Class, Tag tag) noexcept +{ + return encoded_tag_length(tag); } -inline size_t encoded_identifier_length(Construction, Class, Tag tag) noexcept { return encoded_tag_length(tag); } -inline size_t encoded_identifier_length(Construction, Class, UniversalTag tag) noexcept +constexpr inline size_t encoded_identifier_length(Construction, Class, UniversalTag tag) noexcept { return encoded_tag_length(tag); } @@ -231,44 +246,22 @@ inline size_t encode_length(absl::Span output, uint64_t length) noexcep return 0; } -inline size_t encoded_length_length(size_t length) noexcept + +constexpr inline size_t encoded_length_length(size_t length) noexcept { - if (length < 0x80) - { - return 1; - } - else if (length <= 0xFF) - { - return 2; - } - else if (length <= 0xFFFF) - { - return 3; - } - else if (length <= 0xFFFFFF) - { - return 4; - } - else if (length <= 0xFFFFFFFF) - { - return 5; - } - else if (length <= 0xFFFFFFFFFF) - { - return 6; - } - else if (length <= 0xFFFFFFFFFFFF) - { - return 7; - } - else if (length <= 0xFFFFFFFFFFFFFF) - { - return 8; - } - else - { - return 9; - } + return (length < 0x80) + ? 1 + : (length <= 0xFF) + ? 2 + : (length <= 0xFFFF) + ? 3 + : (length <= 0xFFFFFF) + ? 4 + : (length <= 0xFFFFFFFF) + ? 5 + : (length <= 0xFFFFFFFFFF) + ? 6 + : (length <= 0xFFFFFFFFFFFF) ? 7 : (length <= 0xFFFFFFFFFFFFFF) ? 8 : 9; } inline size_t encode_header(absl::Span output, Construction construction, Class class_, Tag tag, @@ -293,35 +286,63 @@ inline size_t encode_header(absl::Span output, Construction constructio inline size_t encode_header(absl::Span output, Construction construction, Class class_, UniversalTag tag, size_t length) noexcept { - return encode_header(output, construction, class_, val(tag), length); + return encode_header(output, construction, class_, as_underlying(tag), length); } -inline size_t encoded_header_length(Construction construction, Class class_, Tag tag, size_t length) noexcept +constexpr inline size_t encoded_header_length(Construction construction, Class class_, Tag tag, size_t length) noexcept { return encoded_identifier_length(construction, class_, tag) + encoded_length_length(length); } -inline size_t encoded_header_length(Construction construction, Class class_, UniversalTag tag, size_t length) noexcept +constexpr inline size_t encoded_header_length(Construction construction, Class class_, UniversalTag tag, + size_t length) noexcept { return encoded_identifier_length(construction, class_, tag) + encoded_length_length(length); } template -constexpr size_t encoded_length(Id id) +constexpr size_t encoded_header_length(size_t content_length, Id) noexcept +{ + return encoded_identifier_length(Construction::primitive, class_, tag) + encoded_length_length(content_length); +} + +template +constexpr size_t encoded_header_length(size_t content_length, DoubleId) noexcept +{ + return encoded_header_length(encoded_length(content_length, Identifier2{}), Identifier1{}) + + encoded_header_length(content_length, Identifier2{}); +} + +template +constexpr size_t encoded_length(Id) +{ + return encoded_identifier_length(Construction::primitive, class_, tag); +} + +template +constexpr size_t encoded_length(size_t content_length, Id) +{ + return encoded_header_length(content_length, Id{}) + content_length; +} + +template +constexpr size_t encoded_length(size_t content_length, DoubleId) { - return encoded_identifier_length(Construction::primitive, id.class_(), id.tag()); + return encoded_length(encoded_length(content_length, Identifier2{}), Identifier1{}); } template -constexpr size_t encoded_length(size_t content_and_length_length, Id id) +constexpr size_t encoded_length_from_id_and_length(size_t content_and_length_length, Id id) { return content_and_length_length + encoded_length(id); } template -constexpr size_t encoded_length(size_t content_and_length_length, DoubleId, Id> id) +constexpr size_t encoded_length_from_id_and_length(size_t content_and_length_length, + DoubleId, Id> id) { - return encoded_length(encoded_length_length(encoded_length(content_and_length_length, id.inner_id())) + - encoded_length(content_and_length_length, id.inner_id()), - id.outer_id()); + return encoded_length_from_id_and_length( + encoded_length_length(encoded_length_from_id_and_length(content_and_length_length, id.inner_id())) + + encoded_length_from_id_and_length(content_and_length_length, id.inner_id()), + id.outer_id()); } } // namespace fast_ber diff --git a/include/fast_ber/util/FixedIdBerContainer.hpp b/include/fast_ber/util/FixedIdBerContainer.hpp new file mode 100644 index 00000000..91fe981f --- /dev/null +++ b/include/fast_ber/util/FixedIdBerContainer.hpp @@ -0,0 +1,240 @@ +#pragma once + +#include "fast_ber/ber_types/Identifier.hpp" +#include "fast_ber/util/BerContainer.hpp" +#include "fast_ber/util/BerView.hpp" +#include "fast_ber/util/DecodeHelpers.hpp" +#include "fast_ber/util/EncodeHelpers.hpp" + +#include "absl/container/inlined_vector.h" +#include "absl/types/span.h" + +#include + +namespace fast_ber +{ + +// Owning container of a ber packet. Contents may or may not be valid. Memory is stored in a small buffer optimized +// vector. Can be constructed directly from encoded ber memory (decode()) or by specifiyng the desired contents +// (assign_contents) + +template +class FixedIdBerContainer +{ + public: + FixedIdBerContainer() noexcept; + FixedIdBerContainer(const FixedIdBerContainer& rhs); + FixedIdBerContainer(FixedIdBerContainer&& rhs) noexcept; + FixedIdBerContainer(BerView input_view) noexcept { decode(input_view); } + FixedIdBerContainer(absl::Span input_data, ConstructionMethod method) noexcept; + FixedIdBerContainer(Construction input_construction, Class input_class, Tag input_tag, + absl::Span input_content) noexcept; + template + FixedIdBerContainer(const FixedIdBerContainer& rhs); + ~FixedIdBerContainer() noexcept = default; + + FixedIdBerContainer& operator=(BerView input_view) noexcept; + FixedIdBerContainer& operator=(const FixedIdBerContainer& input_container); + FixedIdBerContainer& operator=(FixedIdBerContainer&& input_container) noexcept; + template + FixedIdBerContainer& operator=(const FixedIdBerContainer& rhs); + + void assign_content(const absl::Span input_content) noexcept; + void resize_content(size_t size); + + constexpr static Class class_() noexcept { return Identifier::class_(); } + constexpr static Tag tag() noexcept { return Identifier::tag(); } + + absl::Span content() noexcept { return absl::MakeSpan(content_data(), m_content_length); } + absl::Span content() const noexcept { return absl::MakeSpan(content_data(), m_content_length); } + uint8_t* content_data() noexcept { return m_data.data() + m_data.size() - m_content_length; } + const uint8_t* content_data() const noexcept { return m_data.data() + m_data.size() - m_content_length; } + size_t content_length() const noexcept { return m_content_length; } + + absl::Span ber() const noexcept { return absl::MakeSpan(m_data.begin(), m_data.end()); } + const uint8_t* ber_data() const noexcept { return m_data.data(); } + size_t ber_length() const noexcept { return m_data.size(); } + + bool operator==(const FixedIdBerContainer& rhs) const { return content() == rhs.content(); } + bool operator!=(const FixedIdBerContainer& rhs) const { return !(*this == rhs); } + + BerView view() const noexcept { return BerView(m_data); } + + size_t encoded_length() const noexcept { return m_data.size(); } + EncodeResult encode(absl::Span buffer) const noexcept; + DecodeResult decode(BerView view) noexcept; + + private: + template + DecodeResult decode_impl(BerView input_view, Id) noexcept; + template + DecodeResult decode_impl(BerView input_view, DoubleId) noexcept; + + absl::InlinedVector m_data; + size_t m_content_length{0}; +}; + +template +FixedIdBerContainer::FixedIdBerContainer() noexcept : m_data() +{ + m_data.resize(fast_ber::encoded_length(0, Identifier{})); + encode_header(absl::Span(m_data), 0, Identifier{}, Construction::primitive); +} + +template +FixedIdBerContainer::FixedIdBerContainer(const FixedIdBerContainer& rhs) + : m_data(rhs.m_data), m_content_length(rhs.m_content_length) +{ +} + +template +FixedIdBerContainer::FixedIdBerContainer(FixedIdBerContainer&& rhs) noexcept + : m_data(std::move(rhs.m_data)), m_content_length(std::move(rhs.m_content_length)) +{ +} + +template +FixedIdBerContainer::FixedIdBerContainer(absl::Span input_data, + ConstructionMethod method) noexcept + : m_data() +{ + if (method == ConstructionMethod::construct_with_provided_content) + { + assign_content(input_data); + } + else if (method == ConstructionMethod::construct_from_ber_packet) + { + decode(input_data); + } + else + { + assert(0); + } +} + +template +FixedIdBerContainer::FixedIdBerContainer(Construction input_construction, Class input_class, Tag input_tag, + absl::Span input_content) noexcept +{ + assign_content(input_construction, input_class, input_tag, input_content); +} + +template +template +FixedIdBerContainer::FixedIdBerContainer(const FixedIdBerContainer& rhs) +{ + assign_content(rhs.content()); +} + +template +FixedIdBerContainer& FixedIdBerContainer::operator=(BerView input_view) noexcept +{ + decode(input_view); + return *this; +} + +template +FixedIdBerContainer& FixedIdBerContainer:: + operator=(const FixedIdBerContainer& rhs) +{ + m_data = rhs.m_data; + m_content_length = rhs.m_content_length; + return *this; +} + +template +FixedIdBerContainer& FixedIdBerContainer:: + operator=(FixedIdBerContainer&& rhs) noexcept +{ + m_data = std::move(rhs.m_data); + m_content_length = std::move(rhs.m_content_length); + return *this; +} + +template +template +FixedIdBerContainer& FixedIdBerContainer:: + operator=(const FixedIdBerContainer& rhs) +{ + assign_content(rhs.content()); + return *this; +} + +template +template +DecodeResult FixedIdBerContainer::decode_impl(BerView input_view, Id id) noexcept +{ + if (!has_correct_header(input_view, id, Construction::primitive)) + { + return DecodeResult{false}; + } + + m_data.assign(input_view.ber().begin(), input_view.ber().end()); + m_content_length = input_view.content_length(); + return DecodeResult{true}; +} + +template +template +DecodeResult FixedIdBerContainer::decode_impl(BerView input_view, + DoubleId id) noexcept +{ + if (!has_correct_header(input_view, id, Construction::primitive)) + { + return DecodeResult{false}; + } + + m_data.assign(input_view.ber().begin(), input_view.ber().end()); + m_content_length = input_view.begin()->content_length(); + return DecodeResult{true}; +} + +template +void FixedIdBerContainer::assign_content(const absl::Span input_content) noexcept +{ + const size_t encoded_len = fast_ber::encoded_length(input_content.length(), Identifier{}); + const size_t header_len = encoded_len - input_content.length(); + + m_data.resize(encoded_len); + std::memcpy(m_data.data() + header_len, input_content.data(), input_content.length()); + encode_header(absl::Span(m_data), input_content.size(), Identifier{}, Construction::primitive); + m_content_length = input_content.length(); + + assert(view().is_valid()); +} + +template +void FixedIdBerContainer::resize_content(size_t size) +{ + size_t old_header_length = m_data.size() - content_length(); + size_t new_header_length = encoded_header_length(size, Identifier{}); + + m_data.resize(new_header_length + size); + std::memmove(m_data.data() + new_header_length, m_data.data() + old_header_length, + std::min(m_content_length, size)); + + encode_header(absl::Span(m_data), size, Identifier{}, Construction::primitive); + m_content_length = size; + + assert(view().is_valid()); +} + +template +EncodeResult FixedIdBerContainer::encode(absl::Span buffer) const noexcept +{ + if (buffer.size() < m_data.size()) + { + return EncodeResult{false, 0}; + } + + memcpy(buffer.data(), m_data.data(), m_data.size()); + return EncodeResult{true, m_data.size()}; +} + +template +DecodeResult FixedIdBerContainer::decode(BerView view) noexcept +{ + return decode_impl(view, Identifier{}); +} + +} // namespace fast_ber diff --git a/include/fast_ber/util/FixedTagBerContainer.hpp b/include/fast_ber/util/FixedTagBerContainer.hpp deleted file mode 100644 index 3113326a..00000000 --- a/include/fast_ber/util/FixedTagBerContainer.hpp +++ /dev/null @@ -1,201 +0,0 @@ -#pragma once - -#include "fast_ber/ber_types/Identifier.hpp" -#include "fast_ber/util/BerContainer.hpp" -#include "fast_ber/util/BerView.hpp" -#include "fast_ber/util/EncodeIdentifiers.hpp" - -#include "absl/container/inlined_vector.h" -#include "absl/types/span.h" - -#include - -namespace fast_ber -{ - -// Owning container of a ber packet. Contents may or may not be valid. Memory is stored in a small buffer optimized -// vector. Can be constructed directly from encoded ber memory (assign_ber) or by specifiyng the desired contents -// (assign_contents) - -template -class FixedIdBerContainer -{ - public: - FixedIdBerContainer() noexcept; - FixedIdBerContainer(const FixedIdBerContainer&) = default; - FixedIdBerContainer(FixedIdBerContainer&&) = default; - FixedIdBerContainer(const BerView& input_view) noexcept { assign_ber(input_view); } - FixedIdBerContainer(absl::Span input_data, ConstructionMethod method) noexcept; - FixedIdBerContainer(Construction input_construction, Class input_class, Tag input_tag, - absl::Span input_content) noexcept; - - FixedIdBerContainer& operator=(const BerView& input_view) noexcept; - FixedIdBerContainer& operator=(const FixedIdBerContainer& input_container) noexcept; - size_t assign_ber(const BerView& input_view) noexcept; - size_t assign_ber(const FixedIdBerContainer& container) noexcept; - size_t assign_ber(const absl::Span input_data) noexcept; - void assign_content(const absl::Span input_content) noexcept; - void assign_content(Construction input_construction, Class input_class, Tag input_tag, - absl::Span input_content) noexcept; - void resize_content(size_t size); - - constexpr static Class class_() noexcept { return Identifier::class_(); } - constexpr static Tag tag() noexcept { return Identifier::tag(); } - - absl::Span content() noexcept { return absl::MakeSpan(content_data(), m_content_length); } - absl::Span content() const noexcept { return absl::MakeSpan(content_data(), m_content_length); } - uint8_t* content_data() noexcept { return m_data[m_data.size() - m_content_length]; } - const uint8_t* content_data() const noexcept { return m_data[m_data.size() - m_content_length]; } - size_t content_length() const noexcept { return m_view.content_length(); } - - absl::Span encoded() const noexcept { return absl::MakeSpan(m_data.begin(), m_data.end()); } - const uint8_t* ber_data() const noexcept { return m_data.data(); } - size_t ber_length() const noexcept { return m_data.length(); } - - BerView view() const noexcept { return BerView(m_data.begin(), m_data.end()); } - - size_t encode(absl::Span buffer) const noexcept { return m_view.encode(buffer); } - size_t encode_content_and_length(absl::Span buffer) const noexcept; - - private: - absl::InlinedVector m_data; - size_t m_content_length; -}; - -template -FixedIdBerContainer::FixedIdBerContainer() noexcept - : m_data{0x80, 0x00}, m_view(absl::MakeSpan(m_data.begin(), m_data.size()), 0, 1, 2, 0) -{ -} - -template -FixedIdBerContainer::FixedIdBerContainer(absl::Span input_data, - ConstructionMethod method) noexcept - : m_data(input_data.begin(), input_data.end()), m_view(absl::MakeSpan(m_data.begin(), m_data.size())) -{ - if (method == ConstructionMethod::construct_with_provided_content) - { - assign_content(input_data); - } - else if (method == ConstructionMethod::construct_from_ber_packet) - { - assign_ber(input_data); - } - else - { - assert(0); - } -} - -template -FixedIdBerContainer::FixedIdBerContainer(Construction input_construction, Class input_class, Tag input_tag, - absl::Span input_content) noexcept -{ - assign_content(input_construction, input_class, input_tag, input_content); -} - -template -FixedIdBerContainer& FixedIdBerContainer::operator=(const BerView& input_view) noexcept -{ - assign_ber(input_view); - return *this; -} - -template -FixedIdBerContainer& FixedIdBerContainer::operator=(const FixedIdBerContainer& container) noexcept -{ - assign_ber(container); - return *this; -} - -template -size_t FixedIdBerContainer::assign_ber(const BerView& input_view) noexcept -{ - if (!input_view.is_valid()) - { - return false; - } - - m_data.assign(input_view.ber().begin(), input_view.ber().end()); - m_view.assign(absl::MakeSpan(m_data.data(), m_data.size()), input_view.tag(), input_view.identifier_length(), - input_view.header_length(), input_view.content_length()); - - return input_view.ber_length(); -} - -template -size_t FixedIdBerContainer::assign_ber(const FixedIdBerContainer& input_container) noexcept -{ - return assign_ber(input_container.view()); -} -template -size_t FixedIdBerContainer::assign_ber(const absl::Span input_data) noexcept -{ - m_data.assign(input_data.begin(), input_data.end()); - m_view.assign(absl::MakeSpan(m_data.begin(), m_data.size())); - - if (!m_view.is_valid()) - { - return 0; - } - return ber_length(); -} - -template -void FixedIdBerContainer::assign_content(const absl::Span input_content) noexcept -{ - m_data.resize(15 + input_content.size()); - m_data[0] = 0x80; // No identifier provided, use a tag of 0 - size_t new_header_length = - 1 + encode_length(absl::Span(m_data.data() + 1, m_data.size() - 1), input_content.size()); - - m_data.resize(new_header_length + input_content.length()); - std::copy(input_content.data(), input_content.end(), m_data.data() + new_header_length); - m_view.assign(m_data, 0, 1, new_header_length, input_content.size()); - - assert(m_view.is_valid()); -} - -template -void FixedIdBerContainer::assign_content(Construction input_construction, Class input_class, Tag input_tag, - absl::Span input_content) noexcept -{ - m_data.resize(30 + input_content.size()); - size_t input_header_length = encode_header(absl::MakeSpan(m_data.data(), m_data.size()), input_construction, - input_class, input_tag, input_content.size()); - - m_data.resize(input_header_length + input_content.length()); - std::copy(input_content.data(), input_content.end(), m_data.data() + input_header_length); - m_view.assign(m_data, input_header_length, input_content.size()); - - assert(m_view.is_valid()); -} - -template -void FixedIdBerContainer::resize_content(size_t size) -{ - std::array length_buffer; - - size_t old_header_length = view().header_length(); - size_t old_size = view().content_length(); - size_t new_length_offset = view().identifier_length(); - size_t new_length_length = encode_length(absl::MakeSpan(length_buffer), size); - size_t new_header_length = new_length_offset + new_length_length; - size_t new_complete_length = new_header_length + size; - - m_data.resize(new_complete_length); - std::memmove(m_data.data() + new_header_length, m_data.data() + old_header_length, std::min(old_size, size)); - std::copy(length_buffer.data(), length_buffer.data() + new_length_length, m_data.data() + new_length_offset); - m_view.assign(absl::MakeSpan(m_data.data(), m_data.size()), new_header_length, size); - - assert(new_length_length != 0); - assert(m_view.is_valid()); -} - -template -size_t FixedIdBerContainer::encode_content_and_length(absl::Span buffer) const noexcept -{ - return m_view.encode_content_and_length(buffer); -} - -} // namespace fast_ber diff --git a/include/fast_ber/util/Helpers.hpp b/include/fast_ber/util/Helpers.hpp new file mode 100644 index 00000000..fc33b4ae --- /dev/null +++ b/include/fast_ber/util/Helpers.hpp @@ -0,0 +1,12 @@ +#include "absl/types/span.h" + +#include + +namespace fast_ber +{ +void print_to_file(absl::Span data, const std::string& filename) +{ + std::ofstream file(filename); + file.write(reinterpret_cast(data.data()), data.length()); +} +} // namespace fast_ber diff --git a/include/fast_ber/util/SmallFixedIdBerContainer.hpp b/include/fast_ber/util/SmallFixedIdBerContainer.hpp new file mode 100644 index 00000000..a1291081 --- /dev/null +++ b/include/fast_ber/util/SmallFixedIdBerContainer.hpp @@ -0,0 +1,223 @@ +#pragma once + +#include "fast_ber/ber_types/Identifier.hpp" +#include "fast_ber/util/BerContainer.hpp" +#include "fast_ber/util/BerView.hpp" +#include "fast_ber/util/DecodeHelpers.hpp" +#include "fast_ber/util/EncodeHelpers.hpp" + +#include "absl/container/inlined_vector.h" +#include "absl/types/span.h" + +#include + +namespace fast_ber +{ + +// Owning container of a ber packet. Contents may or may not be valid. Memory is stored in a small buffer optimized +// vector. Can be constructed directly from encoded ber memory (decode()) or by specifiyng the desired contents +// (assign_contents) + +template +class SmallFixedIdBerContainer +{ + public: + constexpr static size_t max_possible_content_length = + (Identifier::depth() == 2) ? 128 - encoded_header_length(0, inner_identifier(Identifier{})) : 128; + + static_assert(max_content_length <= max_possible_content_length, "Content length must fit in one byte"); + + SmallFixedIdBerContainer() noexcept {} + SmallFixedIdBerContainer(const BerView input_view) noexcept { decode(input_view); } + SmallFixedIdBerContainer(absl::Span input_data, ConstructionMethod method) noexcept; + SmallFixedIdBerContainer(Construction input_construction, Class input_class, Tag input_tag, + absl::Span input_content) noexcept; + template + SmallFixedIdBerContainer(const SmallFixedIdBerContainer& rhs) noexcept + { + assign_content(rhs.content()); + } + + SmallFixedIdBerContainer& operator=(const BerView input_view) noexcept; + template + SmallFixedIdBerContainer& + operator=(const SmallFixedIdBerContainer& rhs) noexcept; + + void assign_content(const absl::Span input_content) noexcept; + void resize_content(size_t size); + + constexpr static Class class_() noexcept { return Identifier::class_(); } + constexpr static Tag tag() noexcept { return Identifier::tag(); } + + absl::Span content() noexcept { return absl::MakeSpan(content_data(), content_length()); } + absl::Span content() const noexcept { return absl::MakeSpan(content_data(), content_length()); } + uint8_t* content_data() noexcept { return m_data.data() + m_header_length; } + const uint8_t* content_data() const noexcept { return m_data.data() + m_header_length; } + size_t content_length() const noexcept { return m_data[m_header_length - 1]; } + + absl::Span ber() const noexcept { return absl::MakeSpan(ber_data(), ber_length()); } + const uint8_t* ber_data() const noexcept { return m_data.data(); } + size_t ber_length() const noexcept { return m_header_length + content_length(); } + + bool operator==(const SmallFixedIdBerContainer& rhs) const noexcept { return content() == rhs.content(); } + bool operator!=(const SmallFixedIdBerContainer& rhs) const noexcept { return !(*this == rhs); } + + BerView view() const noexcept { return BerView(m_data); } + + EncodeResult encode(absl::Span buffer) const noexcept; + DecodeResult decode(BerView view) noexcept; + + private: + template + DecodeResult decode_impl(const BerView input_view, Id) noexcept; + template + DecodeResult decode_impl(const BerView input_view, DoubleId) noexcept; + void set_content_length(size_t length) noexcept; + + constexpr static size_t m_header_length = encoded_header_length(0, Identifier{}); + std::array m_data = [] { + std::array data{}; + encode_header(absl::Span(data), 0, Identifier{}, Construction::primitive); + return data; + }(); +}; + +template +SmallFixedIdBerContainer::SmallFixedIdBerContainer(absl::Span input_data, + ConstructionMethod method) noexcept +{ + if (method == ConstructionMethod::construct_with_provided_content) + { + assign_content(input_data); + } + else if (method == ConstructionMethod::construct_from_ber_packet) + { + decode(input_data); + } + else + { + assert(0); + } +} + +template +SmallFixedIdBerContainer::SmallFixedIdBerContainer( + Construction input_construction, Class input_class, Tag input_tag, absl::Span input_content) noexcept +{ + assign_content(input_construction, input_class, input_tag, input_content); +} + +template +SmallFixedIdBerContainer& SmallFixedIdBerContainer:: + operator=(const BerView input_view) noexcept +{ + decode(input_view); + return *this; +} + +template +template +SmallFixedIdBerContainer& SmallFixedIdBerContainer:: + operator=(const SmallFixedIdBerContainer& rhs) noexcept +{ + assign_content(rhs.content()); + return *this; +} + +template +template +DecodeResult SmallFixedIdBerContainer::decode_impl(const BerView input_view, + Id id) noexcept +{ + if (!(input_view.is_valid() && input_view.identifier() == id && + input_view.construction() == Construction::primitive && input_view.content_length() <= max_content_length)) + { + return DecodeResult{false}; + } + + std::memcpy(m_data.data() + m_header_length, input_view.content_data(), input_view.content_length()); + set_content_length(input_view.content_length()); + + return DecodeResult{true}; +} + +template +template +DecodeResult +SmallFixedIdBerContainer::decode_impl(const BerView input_view, + DoubleId) noexcept +{ + if (!(input_view.is_valid() && input_view.identifier() == Identifier1{} && + input_view.construction() == Construction::constructed && input_view.begin()->is_valid() && + input_view.begin()->identifier() == Identifier2{} && + input_view.begin()->construction() == Construction::primitive && + input_view.begin()->content_length() <= max_content_length)) + { + + return DecodeResult{false}; + } + + std::memcpy(m_data.data() + m_header_length, input_view.begin()->content_data(), + input_view.begin()->content_length()); + set_content_length(input_view.begin()->content_length()); + + return DecodeResult{true}; +} + +template +void SmallFixedIdBerContainer::assign_content( + const absl::Span input_content) noexcept +{ + assert(input_content.length() <= max_content_length); + + std::memcpy(m_data.data() + m_header_length, input_content.data(), input_content.length()); + set_content_length(input_content.length()); + + assert(view().is_valid()); +} + +template +void SmallFixedIdBerContainer::resize_content(size_t size) +{ + assert(size <= max_content_length); + + set_content_length(size); + + assert(view().is_valid()); +} + +template +void SmallFixedIdBerContainer::set_content_length(size_t length) noexcept +{ + assert(length <= max_content_length); + + m_data[m_header_length - 1] = static_cast(length); + + if (Identifier::depth() == 2) + { + m_data[encoded_header_length(0, outer_identifier(Identifier{})) - 1] = + static_cast(encoded_length(length, inner_identifier(Identifier{}))); + } + + assert(content_length() == length); +} + +template +EncodeResult SmallFixedIdBerContainer::encode(absl::Span buffer) const noexcept +{ + if (buffer.size() < ber_length()) + { + return EncodeResult{false, 0}; + } + + memcpy(buffer.data(), ber_data(), ber_length()); + return EncodeResult{true, ber_length()}; +} + +template +DecodeResult SmallFixedIdBerContainer::decode(BerView view) noexcept +{ + return decode_impl(view, Identifier{}); +} + +} // namespace fast_ber diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index 7505081a..41b23465 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -1,6 +1,8 @@ aux_source_directory(encode ENCODE_SRC) aux_source_directory(decode DECODE_SRC) +include(${CMAKE_SOURCE_DIR}/cmake/fast_ber_generate.cmake) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/autogen) fast_ber_generate(${CMAKE_SOURCE_DIR}/testfiles/pokemon.asn pokemon) diff --git a/sample/encode/main.cpp b/sample/encode/main.cpp index 29b1a5fc..e051d494 100644 --- a/sample/encode/main.cpp +++ b/sample/encode/main.cpp @@ -6,7 +6,7 @@ int main() { - fast_ber::Pokemon::Team<> team = {"Sam's Team"}; + fast_ber::Pokemon::Team<> team = {"Sam's Team", {}}; fast_ber::Pokemon::Pokemon<> muchlax = {"Munchlax", "Big Eater", fast_ber::Pokemon::Type<>::Values::normal, "Thick Fat, Pickup", "Fighting", 105}; fast_ber::Pokemon::Pokemon<> piplup = {"Piplup", "Penguin", fast_ber::Pokemon::Type<>::Values::water, diff --git a/script/do_clang_format.sh b/script/do_clang_format.sh new file mode 100755 index 00000000..ffb85d9b --- /dev/null +++ b/script/do_clang_format.sh @@ -0,0 +1,4 @@ +find ../include ../src/compiler/include -name '*hpp' -exec clang-format -i {} \; +find ../src ../include ../test ../sample ../benchmarks -name '*cpp' -exec clang-format -i {} \; + +python ../3rd_party/run-clang-format/run-clang-format.py -r ../include ../src ../test ../sample ../benchmarks --exclude '*asn_compiler.hpp' diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index aa45e4bc..cde94fb9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,3 @@ -project(fast_ber) - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/autogen) if(NOT SKIP_AUTO_GENERATION) @@ -26,20 +24,106 @@ else() configure_file(${CMAKE_SOURCE_DIR}/src/compiler/autogen_copy/asn_compiler.hpp ${CMAKE_CURRENT_BINARY_DIR}/autogen/asn_compiler.hpp COPYONLY) endif() -add_library(fast_ber_lib empty) -target_include_directories(fast_ber_lib INTERFACE ../include ${CMAKE_CURRENT_BINARY_DIR}) + aux_source_directory(compiler SRC_LIST) -add_executable(${PROJECT_NAME}_compiler ${SRC_LIST} ${CMAKE_CURRENT_BINARY_DIR}/autogen/asn_compiler.hpp) +add_library(fast_ber_lib STATIC util/BerView.cpp ber_types/Real.cpp) +add_library(fast_ber_compiler_lib STATIC ${SRC_LIST} ${CMAKE_CURRENT_BINARY_DIR}/autogen/asn_compiler.hpp) +add_executable(fast_ber_compiler compiler_main/CompilerMain.cpp) +add_executable(fast_ber_view view/view.cpp) -target_link_libraries(fast_ber_lib absl::base absl::container absl::strings absl::variant absl::optional absl::time) -target_link_libraries(${PROJECT_NAME}_compiler fast_ber_lib absl_str_format) +target_include_directories(fast_ber_lib PUBLIC + $ + $) +target_include_directories(fast_ber_compiler_lib PUBLIC + $ + ${CMAKE_CURRENT_BINARY_DIR}) -# CMake function to generate c++ include files from a given ASN1 input -function(fast_ber_generate input_file output_name) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/autogen/${output_name}.hpp - COMMAND fast_ber_compiler ${input_file} ${CMAKE_CURRENT_BINARY_DIR}/autogen/${output_name} - DEPENDS fast_ber_compiler ${input_file} - ) -endfunction(fast_ber_generate) +target_link_libraries(fast_ber_lib PUBLIC ${ABSEIL_LIBS}) +target_link_libraries(fast_ber_compiler_lib PUBLIC ${ABSEIL_LIBS}) +target_link_libraries(fast_ber_compiler fast_ber_compiler_lib) +target_link_libraries(fast_ber_view fast_ber_lib) + +add_library(fast_ber::fast_ber_lib ALIAS fast_ber_lib) +add_executable(fast_ber::fast_ber_compiler ALIAS fast_ber_compiler) +add_executable(fast_ber::fast_ber_view ALIAS fast_ber_view) + +# Installation to end of file +if (SKIP_INSTALL) + return() +endif() + +include(GNUInstallDirs) +include(CMakePackageConfigHelpers) +include(CTest) + +set(FAST_BER_CMAKE_CONFIG_DESTINATION "${CMAKE_INSTALL_LIBDIR}/fast_ber") + +configure_package_config_file( + ${CMAKE_SOURCE_DIR}/cmake/fast_ber_config.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/fast_ber-config.cmake + INSTALL_DESTINATION + ${FAST_BER_CMAKE_CONFIG_DESTINATION} +) + +install( + TARGETS + fast_ber_lib + EXPORT + fast_ber_targets + DESTINATION + ${CMAKE_INSTALL_LIBDIR} +) + +install( + TARGETS + fast_ber_compiler + fast_ber_view + EXPORT + fast_ber_targets + DESTINATION + ${CMAKE_INSTALL_BINDIR} +) + +install( + EXPORT + fast_ber_targets + NAMESPACE + fast_ber:: + DESTINATION + ${FAST_BER_CMAKE_CONFIG_DESTINATION} +) + +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/fast_ber-config-version.cmake" + COMPATIBILITY + SameMajorVersion +) + +install( + DIRECTORY + "${CMAKE_SOURCE_DIR}/include/" + DESTINATION + "${CMAKE_INSTALL_INCLUDEDIR}" +) + +install( + FILES + "${CMAKE_CURRENT_BINARY_DIR}/fast_ber-config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/fast_ber-config-version.cmake" + DESTINATION + ${FAST_BER_CMAKE_CONFIG_DESTINATION} +) + +install( + FILES + "${CMAKE_SOURCE_DIR}/cmake/fast_ber_generate.cmake" + DESTINATION + ${FAST_BER_CMAKE_CONFIG_DESTINATION} +) + +if(${CMAKE_VERSION} VERSION_LESS "3.12.0") + set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) +endif() +set(CPACK_PACKAGE_CONTACT "https://github.com/Samuel-Tyler/fast_ber/") +include(CPack) diff --git a/src/ber_types/Real.cpp b/src/ber_types/Real.cpp new file mode 100644 index 00000000..011a35b1 --- /dev/null +++ b/src/ber_types/Real.cpp @@ -0,0 +1,37 @@ +#include "fast_ber/ber_types/Real.hpp" + +#include + +namespace fast_ber +{ + +const std::regex g_iso_6093_nr1{"^[ ]*[+-]?[0-9]+$"}; +const std::regex g_iso_6093_nr2{"^[ ]*[+-]?([0-9]+[\\.\\,]{1}[0-9]*|[0-9]*[\\.\\,]{1}[0-9]+)$"}; +const std::regex g_iso_6093_nr3{"^[ ]*[+-]?([0-9]+[\\.\\,]{1}[0-9]*|[0-9]*[\\.\\,]{1}[0-9]+)[Ee][+-]?[0-9]+$"}; + +/** + * Decodes a real decimal value + * @param input BER encoded real decimal value + * @param output decoded decimal value + * @return true on success, false on failure + */ +bool decode_real_decimal(absl::Span input, double& output) noexcept +{ + std::string iso_6093_value(reinterpret_cast(&input[1]), input.length() - 1); + + /* Check that string matches the iso 6093 NR1/NR2/NR3 forms */ + if (std::regex_match(iso_6093_value, g_iso_6093_nr1) || std::regex_match(iso_6093_value, g_iso_6093_nr2) || + std::regex_match(iso_6093_value, g_iso_6093_nr3)) + { + /* Replace potential comma by a dot */ + std::replace(iso_6093_value.begin(), iso_6093_value.end(), ',', '.'); + + return absl::SimpleAtod(iso_6093_value, &output); + } + else + { + return false; + } +} + +} // namespace fast_ber diff --git a/src/compile_commands.json b/src/compile_commands.json deleted file mode 100644 index b5cb6a73..00000000 --- a/src/compile_commands.json +++ /dev/null @@ -1,75 +0,0 @@ -[ -{ - "arguments": [ - "clang", - "-c", - "-m64", - "-target", - "x86_64-linux-gnu", - "-std=gnu++14", - "-fcxx-exceptions", - "-fexceptions", - "-DBOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING=(39, 1, true, \"T = \")", - "-fPIC", - "-I", - "/home/styler/git/fast_ber/src/SYSTEM", - "-I", - "/home/styler/git/fast_ber/src/../3rd_party/abseil-cpp", - "-I", - "/home/styler/git/fast_ber/src/../include", - "-I", - "/home/styler/git/fast_ber/build-src-Desktop_Qt_5_11_2_GCC_64bit-Default", - "-x", - "c++-header", - "/home/styler/git/fast_ber/build-src-Desktop_Qt_5_11_2_GCC_64bit-Default/autogen/asn_compiler.hpp" - ], - "directory": "/home/styler/git/fast_ber/build-src-Desktop_Qt_5_11_2_GCC_64bit-Default", - "file": "/home/styler/git/fast_ber/build-src-Desktop_Qt_5_11_2_GCC_64bit-Default/autogen/asn_compiler.hpp" -}, -{ - "arguments": [ - "clang++", - "-c", - "-m64", - "-target", - "x86_64-linux-gnu", - "-std=gnu++14", - "-fcxx-exceptions", - "-fexceptions", - "-DBOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING=(39, 1, true, \"T = \")", - "-fPIC", - "-I", - "/home/styler/git/fast_ber/src/SYSTEM", - "-I", - "/home/styler/git/fast_ber/src/../3rd_party/abseil-cpp", - "-I", - "/home/styler/git/fast_ber/src/../include", - "-I", - "/home/styler/git/fast_ber/build-src-Desktop_Qt_5_11_2_GCC_64bit-Default", - "-x", - "c++", - "/home/styler/git/fast_ber/src/compiler/CompilerMain.cpp" - ], - "directory": "/home/styler/git/fast_ber/build-src-Desktop_Qt_5_11_2_GCC_64bit-Default", - "file": "/home/styler/git/fast_ber/src/compiler/CompilerMain.cpp" -}, -{ - "arguments": [ - "clang++", - "-c", - "-m64", - "-target", - "x86_64-linux-gnu", - "-std=gnu++14", - "-fcxx-exceptions", - "-fexceptions", - "-DBOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING=(39, 1, true, \"T = \")", - "-fPIC", - "-x", - "c++", - "/home/styler/git/fast_ber/src/empty.cpp" - ], - "directory": "/home/styler/git/fast_ber/build-src-Desktop_Qt_5_11_2_GCC_64bit-Default", - "file": "/home/styler/git/fast_ber/src/empty.cpp" -} -] \ No newline at end of file diff --git a/src/compiler/CompilerTypes.cpp b/src/compiler/CompilerTypes.cpp index 6ef3c950..b6278108 100644 --- a/src/compiler/CompilerTypes.cpp +++ b/src/compiler/CompilerTypes.cpp @@ -6,7 +6,7 @@ SetOfType::SetOfType(bool a, std::unique_ptr&& b, std::unique_ptr(new NamedType(*rhs.named_type)) : nullptr; type = rhs.type ? std::unique_ptr(new Type(*rhs.type)) : nullptr; + storage = rhs.storage; return *this; } SequenceOfType::SequenceOfType(bool a, std::unique_ptr&& b, std::unique_ptr&& c) @@ -23,7 +24,7 @@ SequenceOfType::SequenceOfType(bool a, std::unique_ptr&& b, std::uniq SequenceOfType::SequenceOfType(const SequenceOfType& rhs) : has_name(rhs.has_name), named_type(rhs.named_type ? std::unique_ptr(new NamedType(*rhs.named_type)) : nullptr), - type(rhs.type ? new Type(*rhs.type) : nullptr) + type(rhs.type ? new Type(*rhs.type) : nullptr), storage(rhs.storage) { } SequenceOfType& SequenceOfType::operator=(const SequenceOfType& rhs) @@ -31,6 +32,7 @@ SequenceOfType& SequenceOfType::operator=(const SequenceOfType& rhs) has_name = rhs.has_name; named_type = rhs.named_type ? std::unique_ptr(new NamedType(*rhs.named_type)) : nullptr; type = rhs.type ? std::unique_ptr(new Type(*rhs.type)) : nullptr; + storage = rhs.storage; return *this; } @@ -152,6 +154,8 @@ static const std::unordered_set reserved_keywords = { "IA5String", "IRI", "ISO646String", + "Id", + "Identifier", "InstanceOf", "Integer", "Null", @@ -177,8 +181,9 @@ static const std::unordered_set reserved_keywords = { "UniversalString", "VideotexString", "VisibleString", - "Id", - "Identifier"}; + "decode", + "encode", + "encoded_length"}; // Switch asn '-' for C++ '_' // Rename any names which are reserved in C++ @@ -223,13 +228,27 @@ std::string to_string(Class class_, bool abbreviated) return "Class::private_"; } - return "UknownClass"; + return "Unknown Class"; +} + +std::string to_string(StorageMode mode) +{ + switch (mode) + { + case StorageMode::static_: + return "StorageMode::static_"; + case StorageMode::small_buffer_optimised: + return "StorageMode::small_buffer_optimised"; + case StorageMode::dynamic: + return "StorageMode::dynamic"; + } + + return "Unknown StorageMode"; } -std::string make_type_optional(const std::string& type, const Asn1Tree& tree) +std::string make_type_optional(const std::string& type, StorageMode mode) { - return "Optional<" + type + - (tree.is_circular ? std::string(", StorageMode::dynamic") : std::string(", StorageMode::static_")) + ">"; + return "Optional<" + type + ", " + to_string(mode) + ">"; } bool is_any(const Type& type) @@ -290,6 +309,18 @@ bool is_integer(const Type& type) absl::holds_alternative(absl::get(type)); } +bool is_octet_string(const Type& type) +{ + return absl::holds_alternative(type) && + absl::holds_alternative(absl::get(type)); +} + +bool is_boolean(const Type& type) +{ + return absl::holds_alternative(type) && + absl::holds_alternative(absl::get(type)); +} + bool is_oid(const Type& type) { return absl::holds_alternative(type) && diff --git a/src/compiler/DartConfiguration.tcl b/src/compiler/DartConfiguration.tcl new file mode 100644 index 00000000..1eec5c7b --- /dev/null +++ b/src/compiler/DartConfiguration.tcl @@ -0,0 +1,115 @@ +# This file is configured by CMake automatically as DartConfiguration.tcl +# If you choose not to use CMake, this file may be hand configured, by +# filling in the required variables. + + +# Configuration directories and files +SourceDirectory: /home/styler/git/fast_ber/src +BuildDirectory: /home/styler/git/fast_ber/src/compiler + +# Where to place the cost data store +CostDataFile: + +# Site is something like machine.domain, i.e. pragmatic.crd +Site: styler + +# Build name is osname-revision-compiler, i.e. Linux-2.4.2-2smp-c++ +BuildName: Linux-c++ + +# Subprojects +LabelsForSubprojects: + +# Submission information +IsCDash: +CDashVersion: +QueryCDashVersion: +DropSite: +DropLocation: +DropSiteUser: +DropSitePassword: +DropSiteMode: +DropMethod: http +TriggerSite: +ScpCommand: /usr/bin/scp + +# Dashboard start time +NightlyStartTime: 00:00:00 EDT + +# Commands for the build/test/submit cycle +ConfigureCommand: "/usr/bin/cmake" "/home/styler/git/fast_ber/src" +MakeCommand: /usr/bin/cmake --build . --config "${CTEST_CONFIGURATION_TYPE}" -- -i +DefaultCTestConfigurationType: Release + +# version control +UpdateVersionOnly: + +# CVS options +# Default is "-d -P -A" +CVSCommand: CVSCOMMAND-NOTFOUND +CVSUpdateOptions: -d -A -P + +# Subversion options +SVNCommand: /usr/bin/svn +SVNOptions: +SVNUpdateOptions: + +# Git options +GITCommand: /usr/bin/git +GITInitSubmodules: +GITUpdateOptions: +GITUpdateCustom: + +# Perforce options +P4Command: P4COMMAND-NOTFOUND +P4Client: +P4Options: +P4UpdateOptions: +P4UpdateCustom: + +# Generic update command +UpdateCommand: +UpdateOptions: +UpdateType: + +# Compiler info +Compiler: /usr/bin/c++ +CompilerVersion: 8.3.0 + +# Dynamic analysis (MemCheck) +PurifyCommand: +ValgrindCommand: +ValgrindCommandOptions: +MemoryCheckType: +MemoryCheckSanitizerOptions: +MemoryCheckCommand: MEMORYCHECK_COMMAND-NOTFOUND +MemoryCheckCommandOptions: +MemoryCheckSuppressionFile: + +# Coverage +CoverageCommand: /usr/bin/gcov +CoverageExtraFlags: -l + +# Cluster commands +SlurmBatchCommand: SLURM_SBATCH_COMMAND-NOTFOUND +SlurmRunCommand: SLURM_SRUN_COMMAND-NOTFOUND + +# Testing options +# TimeOut is the amount of time in seconds to wait for processes +# to complete during testing. After TimeOut seconds, the +# process will be summarily terminated. +# Currently set to 25 minutes +TimeOut: 1500 + +# During parallel testing CTest will not start a new test if doing +# so would cause the system load to exceed this value. +TestLoad: + +UseLaunchers: +CurlOptions: +# warning, if you add new options here that have to do with submit, +# you have to update cmCTestSubmitCommand.cxx + +# For CTest submissions that timeout, these options +# specify behavior for retrying the submission +CTestSubmitRetryDelay: 5 +CTestSubmitRetryCount: 3 diff --git a/src/compiler/Dependencies.cpp b/src/compiler/Dependencies.cpp index 1d49d7da..0f80a693 100644 --- a/src/compiler/Dependencies.cpp +++ b/src/compiler/Dependencies.cpp @@ -1,11 +1,11 @@ #include "fast_ber/compiler/Dependencies.hpp" -std::vector depends_on(const BitStringType&) { return {}; } -std::vector depends_on(const BooleanType&) { return {}; } -std::vector depends_on(const CharacterStringType&) { return {}; } -std::vector depends_on(const ChoiceType choice) +std::vector depends_on(const BitStringType&) { return {}; } +std::vector depends_on(const BooleanType&) { return {}; } +std::vector depends_on(const CharacterStringType&) { return {}; } +std::vector depends_on(const ChoiceType choice) { - std::vector depends; + std::vector depends; for (const auto& named_type : choice.choices) { const auto& additional = depends_on(named_type.type); @@ -13,36 +13,44 @@ std::vector depends_on(const ChoiceType choice) } return depends; } -std::vector depends_on(const AnyType&) { return {}; } -std::vector depends_on(const DateType&) { return {}; } -std::vector depends_on(const DateTimeType&) { return {}; } -std::vector depends_on(const DurationType&) { return {}; } -std::vector depends_on(const EmbeddedPDVType&) { return {}; } -std::vector depends_on(const EnumeratedType&) { return {}; } -std::vector depends_on(const ExternalType&) { return {}; } -std::vector depends_on(const GeneralizedTimeType&) { return {}; } -std::vector depends_on(const InstanceOfType&) { return {}; } -std::vector depends_on(const IntegerType&) { return {}; } -std::vector depends_on(const IRIType&) { return {}; } -std::vector depends_on(const NullType&) { return {}; } -std::vector depends_on(const ObjectClassFieldType&) { return {}; } -std::vector depends_on(const ObjectDescriptorType&) { return {}; } -std::vector depends_on(const ObjectIdentifierType&) { return {}; } -std::vector depends_on(const OctetStringType&) { return {}; } -std::vector depends_on(const RealType&) { return {}; } -std::vector depends_on(const RelativeIRIType&) { return {}; } -std::vector depends_on(const RelativeOIDType&) { return {}; } -std::vector depends_on(const SequenceType& sequence) +std::vector depends_on(const AnyType&) { return {}; } +std::vector depends_on(const DateType&) { return {}; } +std::vector depends_on(const DateTimeType&) { return {}; } +std::vector depends_on(const DurationType&) { return {}; } +std::vector depends_on(const EmbeddedPDVType&) { return {}; } +std::vector depends_on(const EnumeratedType&) { return {}; } +std::vector depends_on(const ExternalType&) { return {}; } +std::vector depends_on(const GeneralizedTimeType&) { return {}; } +std::vector depends_on(const InstanceOfType&) { return {}; } +std::vector depends_on(const IntegerType&) { return {}; } +std::vector depends_on(const IRIType&) { return {}; } +std::vector depends_on(const NullType&) { return {}; } +std::vector depends_on(const ObjectClassFieldType&) { return {}; } +std::vector depends_on(const ObjectDescriptorType&) { return {}; } +std::vector depends_on(const ObjectIdentifierType&) { return {}; } +std::vector depends_on(const OctetStringType&) { return {}; } +std::vector depends_on(const RealType&) { return {}; } +std::vector depends_on(const RelativeIRIType&) { return {}; } +std::vector depends_on(const RelativeOIDType&) { return {}; } +std::vector depends_on(const SequenceType& sequence) { - std::vector depends; + std::vector depends; for (const ComponentType& component : sequence.components) { const auto& additional = depends_on(component.named_type.type); depends.insert(depends.end(), additional.begin(), additional.end()); + + if (component.default_value && + absl::holds_alternative(component.default_value->value_selection) && + !is_enumerated(component.named_type.type)) + { + const DefinedValue& defined = absl::get(component.default_value->value_selection); + depends.push_back(Dependency{defined.reference, absl::nullopt}); + } } return depends; } -std::vector depends_on(const SequenceOfType& sequence) +std::vector depends_on(const SequenceOfType& sequence) { if (sequence.has_name) { @@ -51,11 +59,11 @@ std::vector depends_on(const SequenceOfType& sequence) else { return depends_on(*sequence.type); - }; + } } -std::vector depends_on(const SetType& set) +std::vector depends_on(const SetType& set) { - std::vector depends; + std::vector depends; for (const ComponentType& component : set.components) { const auto& additional = depends_on(component.named_type.type); @@ -63,7 +71,7 @@ std::vector depends_on(const SetType& set) } return depends; } -std::vector depends_on(const SetOfType& set) +std::vector depends_on(const SetOfType& set) { if (set.has_name) { @@ -71,51 +79,43 @@ std::vector depends_on(const SetOfType& set) } else { - return {depends_on(*set.type)}; + return depends_on(*set.type); }; } -std::vector depends_on(const PrefixedType& prefixed_type) +std::vector depends_on(const PrefixedType& prefixed_type) { return depends_on(prefixed_type.tagged_type->type); } -std::vector depends_on(const TimeType&) { return {}; } -std::vector depends_on(const TimeOfDayType&) { return {}; } -std::vector depends_on(const UTCTimeType&) { return {}; } -std::vector depends_on(const DefinedType& defined) +std::vector depends_on(const TimeType&) { return {}; } +std::vector depends_on(const TimeOfDayType&) { return {}; } +std::vector depends_on(const UTCTimeType&) { return {}; } +std::vector depends_on(const DefinedType& defined) { - std::vector depends{defined.type_reference}; - - for (const Type& paramater : defined.parameters) - { - const std::vector param_depends = depends_on(paramater); - depends.insert(depends.end(), param_depends.begin(), param_depends.end()); - } - - return depends; + return {{defined.type_reference, defined.module_reference}}; } struct DependsOnHelper { template - std::vector operator()(const T& t) + std::vector operator()(const T& t) { return depends_on(t); } }; -static DependsOnHelper depends_on_helper; -std::vector depends_on(const BuiltinType& type) { return absl::visit(depends_on_helper, type); } -std::vector depends_on(const Type& type) { return absl::visit(depends_on_helper, type); } -std::vector depends_on(const Value& value) +static DependsOnHelper depends_on_helper; +std::vector depends_on(const BuiltinType& type) { return absl::visit(depends_on_helper, type); } +std::vector depends_on(const Type& type) { return absl::visit(depends_on_helper, type); } +std::vector depends_on(const Value& value) { if (absl::holds_alternative(value.value_selection)) { - return {absl::get(value.value_selection).reference}; + return {{absl::get(value.value_selection).reference, {}}}; }; return {}; } -std::vector dependencies(const Type& type) { return depends_on(type); } -std::vector dependencies(const Assignment& assignment) +std::vector dependencies(const Type& type) { return depends_on(type); } +std::vector dependencies(const Assignment& assignment) { if (absl::holds_alternative(assignment.specific)) { @@ -131,3 +131,27 @@ std::vector dependencies(const Assignment& assignment) } return {}; } + +// Finds dependencies, and dependencies of dependencies. Stops if dependency has already been found +// Limited to single module +void get_dependencies_recursive(const std::string& type_name, const std::string& module_name, + const std::unordered_map& assignment_map, + absl::flat_hash_set& depends) +{ + if (assignment_map.count(type_name) == 0) + { + throw std::runtime_error("Unknown item in get_dependencies_recursive :" + type_name); + } + + for (const Dependency& dependency : assignment_map.find(type_name)->second.depends_on) + { + if (!dependency.module_reference || dependency.module_reference == module_name) + { + if (depends.count(dependency) == 0) + { + depends.insert(dependency); + get_dependencies_recursive(dependency.name, module_name, assignment_map, depends); + } + } + } +} diff --git a/src/compiler/Identifier.cpp b/src/compiler/Identifier.cpp index e6190c01..918c4e97 100644 --- a/src/compiler/Identifier.cpp +++ b/src/compiler/Identifier.cpp @@ -1,136 +1,161 @@ #include "fast_ber/compiler/Identifier.hpp" #include "fast_ber/compiler/ResolveType.hpp" +#include "absl/container/flat_hash_set.h" + TaggingInfo identifier(const AnyType&, const Module&, const Asn1Tree&) { - std::string id = "fast_ber::ChoiceId<" - "fast_ber::Id, fast_ber::Id," - "fast_ber::Id, fast_ber::Id," - "fast_ber::Id, fast_ber::Id," - "fast_ber::Id, fast_ber::Id," - "fast_ber::Id, fast_ber::Id," - "fast_ber::Id, fast_ber::Id," - "fast_ber::Id, fast_ber::Id," - "fast_ber::Id, fast_ber::Id>"; - return TaggingInfo{{}, id, true}; + TaggingInfo info; + info.is_default_tagged = true; + + info.choice_ids = {Identifier(UniversalTag::bit_string), + Identifier(UniversalTag::boolean), + Identifier(UniversalTag::character_string), + Identifier(UniversalTag::generalized_time), + Identifier(UniversalTag::integer), + Identifier(UniversalTag::null), + Identifier(UniversalTag::object_identifier), + Identifier(UniversalTag::octet_string), + Identifier(UniversalTag::real), + Identifier(UniversalTag::utc_time), + Identifier(UniversalTag::visible_string)}; + return info; } TaggingInfo identifier(const BitStringType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(UniversalTag::bit_string), {}, true}; } TaggingInfo identifier(const BooleanType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(UniversalTag::boolean), {}, true}; } TaggingInfo identifier(const CharacterStringType& type, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(universal_tag(type)), {}, true}; } TaggingInfo identifier(const ChoiceType& choice, const Module& module, const Asn1Tree& tree) { - std::string id = "ChoiceId<"; - bool first = true; + TaggingInfo info; + info.is_default_tagged = true; + + if (module.tagging_default == TaggingMode::automatic) + { + for (size_t i = 0; i < choice.choices.size(); i++) + { + info.choice_ids.push_back(Identifier{Class::context_specific, static_cast(i)}); + } + } + else + { + for (const NamedType& named_type : choice.choices) + { + auto ids = outer_identifiers(named_type.type, module, tree); + info.choice_ids.insert(info.choice_ids.end(), ids.begin(), ids.end()); + } + } - for (const NamedType& named_type : choice.choices) + absl::flat_hash_set outer_ids; + for (const Identifier& id : info.outer_tags()) { - if (!first) + if (outer_ids.count(id) > 0) { - id += ", "; + throw std::runtime_error("Duplicate identifier in choice " + id.name()); } - id += identifier(named_type.type, module, tree).name(); - first = false; + + outer_ids.insert(id); } - id += ">"; - return TaggingInfo{{}, id, true}; + return info; } TaggingInfo identifier(const DateType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + assert("Not implemented"); + return {}; } TaggingInfo identifier(const DateTimeType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + assert("Not implemented"); + return {}; } TaggingInfo identifier(const DurationType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + assert("Not implemented"); + return {}; } TaggingInfo identifier(const EmbeddedPDVType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(UniversalTag::embedded_pdv), {}, true}; } TaggingInfo identifier(const EnumeratedType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(UniversalTag::enumerated), {}, true}; } TaggingInfo identifier(const ExternalType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(UniversalTag::external), {}, true}; } TaggingInfo identifier(const GeneralizedTimeType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(UniversalTag::generalized_time), {}, true}; } TaggingInfo identifier(const InstanceOfType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(UniversalTag::instance_of), {}, true}; } TaggingInfo identifier(const IntegerType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(UniversalTag::integer), {}, true}; } TaggingInfo identifier(const IRIType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + assert("Not implemented"); + return {}; } TaggingInfo identifier(const NullType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(UniversalTag::null), {}, true}; } TaggingInfo identifier(const ObjectClassFieldType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + assert("Not implemented"); + return {}; } TaggingInfo identifier(const ObjectDescriptorType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(UniversalTag::object_descriptor), {}, true}; } TaggingInfo identifier(const ObjectIdentifierType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(UniversalTag::object_identifier), {}, true}; } TaggingInfo identifier(const OctetStringType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(UniversalTag::octet_string), {}, true}; } TaggingInfo identifier(const RealType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; -} -TaggingInfo identifier(const RelativeIRIType&, const Module&, const Asn1Tree&) -{ - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(UniversalTag::real), {}, true}; } +TaggingInfo identifier(const RelativeIRIType&, const Module&, const Asn1Tree&) { return TaggingInfo{{}, {}, {}, true}; } TaggingInfo identifier(const RelativeOIDType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(UniversalTag::relative_oid), {}, true}; } TaggingInfo identifier(const SequenceType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(UniversalTag::sequence), {}, true}; } TaggingInfo identifier(const SequenceOfType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(UniversalTag::sequence_of), {}, true}; } TaggingInfo identifier(const SetType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(UniversalTag::set), {}, true}; } TaggingInfo identifier(const SetOfType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(UniversalTag::set_of), {}, true}; } TaggingInfo identifier(const PrefixedType& prefixed, const Module& current_module, const Asn1Tree& tree) { @@ -139,8 +164,7 @@ TaggingInfo identifier(const PrefixedType& prefixed, const Module& current_modul } TaggingInfo identifier(const TaggedType& tagged_type, const Module& current_module, const Asn1Tree& tree) { - std::string tag = ""; - bool is_explicit = false; + bool is_explicit = false; if (tagged_type.tagging_mode == TaggingMode::explicit_) { is_explicit = true; @@ -154,27 +178,31 @@ TaggingInfo identifier(const TaggedType& tagged_type, const Module& current_modu is_explicit = (current_module.tagging_default == TaggingMode::explicit_ || current_module.tagging_default == TaggingMode::automatic); } + const TaggingInfo& child_tag = identifier(tagged_type.type, current_module, tree); if (is_explicit || child_tag.outer_tag) { - return TaggingInfo{Identifier{tagged_type.tag.class_, tagged_type.tag.tag_number}, child_tag.inner_tag, false}; + return TaggingInfo{ + Identifier(tagged_type.tag.class_, tagged_type.tag.tag_number), child_tag.inner_tag, {}, false}; } else { - return TaggingInfo{{}, Identifier{tagged_type.tag.class_, tagged_type.tag.tag_number}.name(), false}; + return TaggingInfo{{}, Identifier(tagged_type.tag.class_, tagged_type.tag.tag_number), {}, false}; } } TaggingInfo identifier(const TimeType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + assert("Not implemented"); + return {}; } TaggingInfo identifier(const TimeOfDayType&, const Module&, const Asn1Tree&) { - return TaggingInfo{{}, "ExplicitId", true}; + return TaggingInfo{{}, Identifier(UniversalTag::utc_time), {}, true}; } struct IdentifierHelper @@ -190,8 +218,11 @@ struct IdentifierHelper TaggingInfo identifier(const DefinedType& defined, const Module& current_module, const Asn1Tree& tree) { - const Type& resolved_type = type(resolve(tree, current_module.module_reference, defined)); - return identifier(resolved_type, current_module, tree); + const Type& resolved_type = type(resolve(tree, current_module.module_reference, defined)); + const Module& mod = find_module(tree, current_module, defined); + const TaggingInfo info = identifier(resolved_type, mod, tree); + + return info; } TaggingInfo identifier(const BuiltinType& type, const Module& current_module, const Asn1Tree& tree) { @@ -203,3 +234,200 @@ TaggingInfo identifier(const Type& type, const Module& current_module, const Asn IdentifierHelper tag_helper{current_module, tree}; return absl::visit(tag_helper, type); } + +std::vector outer_identifiers(const AnyType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::bit_string), + Identifier(UniversalTag::boolean), + Identifier(UniversalTag::character_string), + Identifier(UniversalTag::generalized_time), + Identifier(UniversalTag::integer), + Identifier(UniversalTag::null), + Identifier(UniversalTag::object_identifier), + Identifier(UniversalTag::octet_string), + Identifier(UniversalTag::real), + Identifier(UniversalTag::utc_time), + Identifier(UniversalTag::visible_string)}; +} +std::vector outer_identifiers(const BitStringType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::bit_string)}; +} +std::vector outer_identifiers(const BooleanType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::boolean)}; +} +std::vector outer_identifiers(const CharacterStringType& type, const Module&, const Asn1Tree&) +{ + return {Identifier(universal_tag(type))}; +} +std::vector outer_identifiers(const ChoiceType& choice, const Module& module, const Asn1Tree& tree) +{ + std::vector ids; + if (module.tagging_default == TaggingMode::automatic) + { + for (size_t i = 0; i < choice.choices.size(); i++) + { + ids.push_back(Identifier{Class::context_specific, static_cast(i)}); + } + } + else + { + for (const NamedType& named_type : choice.choices) + { + auto child_ids = outer_identifiers(named_type.type, module, tree); + ids.insert(ids.end(), child_ids.begin(), child_ids.end()); + } + } + return ids; +} + +std::vector outer_identifiers(const DateType&, const Module&, const Asn1Tree&) +{ + assert("Not implemented"); + return {}; +} +std::vector outer_identifiers(const DateTimeType&, const Module&, const Asn1Tree&) +{ + assert("Not implemented"); + return {}; +} +std::vector outer_identifiers(const DurationType&, const Module&, const Asn1Tree&) +{ + assert("Not implemented"); + return {}; +} +std::vector outer_identifiers(const EmbeddedPDVType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::embedded_pdv)}; +} +std::vector outer_identifiers(const EnumeratedType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::enumerated)}; +} +std::vector outer_identifiers(const ExternalType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::external)}; +} +std::vector outer_identifiers(const GeneralizedTimeType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::generalized_time)}; +} +std::vector outer_identifiers(const InstanceOfType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::instance_of)}; +} +std::vector outer_identifiers(const IntegerType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::integer)}; +} +std::vector outer_identifiers(const IRIType&, const Module&, const Asn1Tree&) +{ + assert("Not implemented"); + return {}; +} +std::vector outer_identifiers(const NullType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::null)}; +} +std::vector outer_identifiers(const ObjectClassFieldType&, const Module&, const Asn1Tree&) +{ + assert("Not implemented"); + return {}; +} +std::vector outer_identifiers(const ObjectDescriptorType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::object_descriptor)}; +} +std::vector outer_identifiers(const ObjectIdentifierType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::object_identifier)}; +} +std::vector outer_identifiers(const OctetStringType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::octet_string)}; +} +std::vector outer_identifiers(const RealType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::real)}; +} +std::vector outer_identifiers(const RelativeIRIType&, const Module&, const Asn1Tree&) +{ + assert("Not implemented"); + return {}; +} +std::vector outer_identifiers(const RelativeOIDType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::relative_oid)}; +} +std::vector outer_identifiers(const SequenceType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::sequence)}; +} +std::vector outer_identifiers(const SequenceOfType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::sequence_of)}; +} +std::vector outer_identifiers(const SetType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::set)}; +} +std::vector outer_identifiers(const SetOfType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::set_of)}; +} +std::vector outer_identifiers(const PrefixedType& prefixed, const Module& current_module, + const Asn1Tree& tree) +{ + assert(prefixed.tagged_type); + return outer_identifiers(*prefixed.tagged_type, current_module, tree); +} +std::vector outer_identifiers(const TaggedType& tagged_type, const Module&, const Asn1Tree&) +{ + return {Identifier(tagged_type.tag.class_, tagged_type.tag.tag_number)}; +} +std::vector outer_identifiers(const TimeType&, const Module&, const Asn1Tree&) +{ + assert("Not implemented"); + return {}; +} +std::vector outer_identifiers(const TimeOfDayType&, const Module&, const Asn1Tree&) +{ + assert("Not implemented"); + return {}; +} +std::vector outer_identifiers(const UTCTimeType&, const Module&, const Asn1Tree&) +{ + return {Identifier(UniversalTag::utc_time)}; +} + +struct OuterIdentifierHelper +{ + template + std::vector operator()(const T& t) const + { + return outer_identifiers(t, current_module, tree); + } + const Module& current_module; + const Asn1Tree& tree; +}; + +std::vector outer_identifiers(const DefinedType& defined, const Module& current_module, + const Asn1Tree& tree) +{ + const Type& resolved_type = type(resolve(tree, current_module.module_reference, defined)); + const Module& mod = find_module(tree, current_module, defined); + const std::vector ids = outer_identifiers(resolved_type, mod, tree); + + return ids; +} +std::vector outer_identifiers(const BuiltinType& type, const Module& current_module, const Asn1Tree& tree) +{ + OuterIdentifierHelper tag_helper{current_module, tree}; + return absl::visit(tag_helper, type); +} +std::vector outer_identifiers(const Type& type, const Module& current_module, const Asn1Tree& tree) +{ + OuterIdentifierHelper tag_helper{current_module, tree}; + return absl::visit(tag_helper, type); +} diff --git a/src/compiler/ObjectClass.cpp b/src/compiler/ObjectClass.cpp index 9124416c..b221fee4 100644 --- a/src/compiler/ObjectClass.cpp +++ b/src/compiler/ObjectClass.cpp @@ -184,12 +184,13 @@ void remove_object_classes(Asn1Tree& tree, const std::set& object_c { for (Import& import : module.imports) { - import.imports.erase(std::remove_if(import.imports.begin(), import.imports.end(), - [&](const std::string& imported_name) { - return is_defined_object_class(import.module_reference, - imported_name, object_class_names); - }), - import.imports.end()); + import.imported_types.erase(std::remove_if(import.imported_types.begin(), import.imported_types.end(), + [&](const std::string& imported_name) { + return is_defined_object_class(import.module_reference, + imported_name, + object_class_names); + }), + import.imported_types.end()); } } } @@ -251,7 +252,7 @@ std::set get_object_class_names(const Asn1Tree& tree) { for (const Import& import : module.imports) { - for (const std::string& imported_name : import.imports) + for (const std::string& imported_name : import.imported_types) { if (is_defined_object_class(import.module_reference, imported_name, object_class_names)) { diff --git a/src/compiler/ReorderAssignments.cpp b/src/compiler/ReorderAssignments.cpp index f82b358e..2bd9a464 100644 --- a/src/compiler/ReorderAssignments.cpp +++ b/src/compiler/ReorderAssignments.cpp @@ -1,8 +1,8 @@ #include "fast_ber/compiler/ReorderAssignments.hpp" #include "fast_ber/compiler/Dependencies.hpp" +#include "fast_ber/compiler/Logging.hpp" #include "fast_ber/compiler/ResolveType.hpp" - -#include +#include "fast_ber/compiler/TypeAsString.hpp" #include #include #include @@ -129,10 +129,10 @@ void resolve_components_of(Asn1Tree& tree) } } -void resolve_dependencies(const std::unordered_map& assignment_infos, const std::string& name, - std::unordered_set& assigned_names, +void resolve_dependencies(std::unordered_map& assignment_infos, const std::string& name, + const Asn1Tree& tree, const Module& module, std::unordered_set& assigned_names, std::unordered_set& visited_names, - std::vector& ordered_assignment_infos, bool& is_circular) + std::vector& ordered_assignment_infos) { const auto& assign_iter = assignment_infos.find(name); if (assign_iter == assignment_infos.end()) @@ -140,6 +140,8 @@ void resolve_dependencies(const std::unordered_map& ass throw std::runtime_error("Reference to undefined type: " + name); } + Assignment& assignment = assign_iter->second; + if (assigned_names.count(name) == 1) { // Already assigned @@ -148,18 +150,170 @@ void resolve_dependencies(const std::unordered_map& ass if (visited_names.count(name) == 1) { - std::cerr << "Warning: Circular dependency when trying to resolve dependencies of " << name << std::endl; - is_circular = true; - return; + throw std::runtime_error("Circular dependency when trying to resolve dependencies of " + name); } visited_names.insert(name); - const Assignment& assignment = assign_iter->second; - for (const std::string& dependency : assignment.depends_on) + auto is_circular = [&](const std::vector& depends) -> bool { + absl::flat_hash_set complete_depends; + for (const Dependency& dependency : depends) + { + // If circular dependancy, use dynamic storage. Else, resolve and use static storage + get_dependencies_recursive(dependency.name, module.module_reference, assignment_infos, complete_depends); + } + + return std::any_of(complete_depends.begin(), complete_depends.end(), + [&](const Dependency& depend) { return depend.name == name; }); + }; + + if (is_type(assignment) && + (is_choice(type(assignment)) || is_set_of(type(assignment)) || is_sequence_of(type(assignment)))) { - resolve_dependencies(assignment_infos, dependency, assigned_names, visited_names, ordered_assignment_infos, - is_circular); + // If circular dependancy, use dynamic storage. Else, resolve and use static storage + if (is_circular({Dependency{name, module.module_reference}})) + { + // As type is now dynamic it doesn't have any dependencies + assignment_infos[name].depends_on = {}; + + if (is_choice(type(assignment))) + { + ChoiceType& choice = absl::get(absl::get(type(assignment))); + choice.storage = StorageMode::dynamic; + + // Also mark self referential children as dynamic (Sizeof choice cannot yet be determined) + // TODO: should only be dynamic if refer to choice + for (NamedType& child : choice.choices) + { + Type& child_type = + is_prefixed(child.type) + ? absl::get(absl::get(child.type)).tagged_type->type + : child.type; + + if (is_set_of(child_type)) + { + absl::get(absl::get(child_type)).storage = StorageMode::dynamic; + } + if (is_sequence_of(child_type)) + { + absl::get(absl::get(child_type)).storage = StorageMode::dynamic; + } + } + } + else if (is_set_of(type(assignment))) + { + absl::get(absl::get(type(assignment))).storage = StorageMode::dynamic; + } + else if (is_sequence_of(type(assignment))) + { + absl::get(absl::get(type(assignment))).storage = StorageMode::dynamic; + } + std::cout << "Type " << name << " has circular dependencies, seting dynamic storage policy" << std::endl; + } + else + { + for (const Dependency& dependency : assignment.depends_on) + { + if (dependency.module_reference && dependency.module_reference != module.module_reference) + { + continue; + } + + resolve_dependencies(assignment_infos, dependency.name, tree, module, assigned_names, visited_names, + ordered_assignment_infos); + } + } + } + else if (is_type(assignment) && is_sequence(type(assignment))) + { + SequenceType& sequence = absl::get(absl::get(type(assignment))); + for (ComponentType& component : sequence.components) + { + if (component.default_value) + { + for (const Dependency& dependency : depends_on(component.named_type.type)) + { + resolve_dependencies(assignment_infos, dependency.name, tree, module, assigned_names, visited_names, + ordered_assignment_infos); + } + + if (absl::holds_alternative(component.default_value->value_selection) && + !is_enumerated(resolve_type(tree, module.module_reference, component.named_type).type)) + { + const DefinedValue& defined = absl::get(component.default_value->value_selection); + resolve_dependencies(assignment_infos, defined.reference, tree, module, assigned_names, + visited_names, ordered_assignment_infos); + } + } + // If circular dependancy, use dynamic storage. Else, resolve and use static storage + else if (component.is_optional && is_circular(depends_on(component.named_type.type))) + { + std::cout << "Optional member[" << component.named_type.name << "] of [" << name + << "] has circular dependencies, seting dynamic storage policy" << std::endl; + + component.optional_storage = StorageMode::dynamic; + } + else + { + for (const Dependency& dependency : depends_on(component.named_type.type)) + { + resolve_dependencies(assignment_infos, dependency.name, tree, module, assigned_names, visited_names, + ordered_assignment_infos); + } + } + } + } + else if (is_type(assignment) && is_set(type(assignment))) + { + SetType& sequence = absl::get(absl::get(type(assignment))); + for (ComponentType& component : sequence.components) + { + if (component.default_value) + { + for (const Dependency& dependency : depends_on(component.named_type.type)) + { + resolve_dependencies(assignment_infos, dependency.name, tree, module, assigned_names, visited_names, + ordered_assignment_infos); + } + + if (absl::holds_alternative(component.default_value->value_selection) && + !is_enumerated(resolve_type(tree, module.module_reference, component.named_type).type)) + { + const DefinedValue& defined = absl::get(component.default_value->value_selection); + resolve_dependencies(assignment_infos, defined.reference, tree, module, assigned_names, + visited_names, ordered_assignment_infos); + } + } + // If circular dependancy, use dynamic storage. Else, resolve and use static storage + else if (component.is_optional && is_circular(depends_on(component.named_type.type))) + { + std::cout << "Optional member[" << component.named_type.name << "] of [" << name + << "] has circular dependencies, seting dynamic storage policy" << std::endl; + + component.optional_storage = StorageMode::dynamic; + } + else + { + for (const Dependency& dependency : depends_on(component.named_type.type)) + { + resolve_dependencies(assignment_infos, dependency.name, tree, module, assigned_names, visited_names, + ordered_assignment_infos); + } + } + } + } + else + { + for (const Dependency& dependency : assignment.depends_on) + { + if (dependency.module_reference && dependency.module_reference != module.module_reference) + { + continue; + } + + resolve_dependencies(assignment_infos, dependency.name, tree, module, assigned_names, visited_names, + ordered_assignment_infos); + } } ordered_assignment_infos.push_back(assignment); @@ -168,8 +322,8 @@ void resolve_dependencies(const std::unordered_map& ass // Reorder assignments, defining // Should be able to detect missing assignments and circular dependencies -std::vector reorder_assignments(std::vector& assignments, const std::vector& imports, - bool& is_circular) +std::vector reorder_assignments(std::vector& assignments, const Asn1Tree& tree, + const Module& module) { std::unordered_map assignment_map; assignment_map.reserve(assignments.size()); @@ -182,22 +336,13 @@ std::vector reorder_assignments(std::vector& assignments std::unordered_set assigned_names; std::unordered_set visited_names; - for (const Import& import : imports) - { - for (const std::string& import_name : import.imports) - { - assignment_map[import_name] = Assignment{}; - assigned_names.insert(import_name); - } - } - std::vector ordered_assignments; ordered_assignments.reserve(assignments.size()); - for (const std::pair& assignment : assignment_map) + for (const Assignment& assignment : assignments) { - resolve_dependencies(assignment_map, assignment.first, assigned_names, visited_names, ordered_assignments, - is_circular); + resolve_dependencies(assignment_map, assignment.name, tree, module, assigned_names, visited_names, + ordered_assignments); } if (assignments.size() != ordered_assignments.size()) @@ -220,7 +365,7 @@ void find_nested_structs(const Module& module, Type& type, std::vector split_imports(const Asn1Tree& tree, std::vector assignments, + const std::vector& imports) +{ + for (const Import& module_import : imports) + { + for (const std::string& import : module_import.imported_types) + { + log_debug(tree, "Importing type " + import + " <- " + module_import.module_reference + "." + import); + + assignments.push_back( + Assignment{import, TypeAssignment{DefinedType{module_import.module_reference, import, {}}}, {}, {}}); + } + + /* for (const std::string& import : module_import.imported_values) + { + log_debug(tree, "Importing type " + import + " <- " + module_import.module_reference + "." + import); + + assignments.push_back( + Assignment{import, ValueAssignment{DefinedType{module_import.module_reference, import, {}}}, {}, + {}}); + }*/ + } + return assignments; +} + // Statements such as integer type definitions can introduce new statements, such as value assignments std::vector split_definitions(const std::vector& assignments) { diff --git a/src/compiler/ResolveType.cpp b/src/compiler/ResolveType.cpp index 0b0e4c27..3003f7e3 100644 --- a/src/compiler/ResolveType.cpp +++ b/src/compiler/ResolveType.cpp @@ -1,27 +1,86 @@ #include "fast_ber/compiler/ResolveType.hpp" -Assignment& resolve(Asn1Tree& tree, Module& module, const std::string& reference) +Module& find_module(Asn1Tree& tree, const std::string& module_reference) { - for (Assignment& assignemnt : module.assignments) + for (Module& module : tree.modules) { - if (assignemnt.name == reference) + if (module.module_reference == module_reference) { - return assignemnt; + return module; } } + throw std::runtime_error("Module does not exist " + module_reference); +} - for (const Import& import : module.imports) +const Module& find_module(const Asn1Tree& tree, const std::string& module_reference) +{ + for (const Module& module : tree.modules) { - for (const std::string& imported_reference : import.imports) + if (module.module_reference == module_reference) { - if (imported_reference == reference) + return module; + } + } + throw std::runtime_error("Module does not exist " + module_reference); +} + +Module& find_module(Asn1Tree& tree, Module& current_module, const DefinedType& defined) +{ + const std::string& module_reference = + (defined.module_reference) ? *defined.module_reference : current_module.module_reference; + + for (Module& module : tree.modules) + { + if (module.module_reference == module_reference) + { + for (const Assignment& assignment : module.assignments) + { + if (assignment.name == defined.type_reference) + { + return module; + } + } + } + } + + throw std::runtime_error("Reference to undefined object: " + current_module.module_reference + "." + + defined.type_reference); +} + +const Module& find_module(const Asn1Tree& tree, const Module& current_module, const DefinedType& defined) +{ + const std::string& module_reference = + (defined.module_reference) ? *defined.module_reference : current_module.module_reference; + + for (const Module& module : tree.modules) + { + if (module.module_reference == module_reference) + { + for (const Assignment& assignment : module.assignments) { - return resolve(tree, import.module_reference, reference); + if (assignment.name == defined.type_reference) + { + return module; + } } } } - throw std::runtime_error("Reference to undefined object: " + reference); + throw std::runtime_error("Reference to undefined object: " + current_module.module_reference + "." + + defined.type_reference); +} + +Assignment& resolve(Asn1Tree&, Module& module, const std::string& reference) +{ + for (Assignment& assignemnt : module.assignments) + { + if (assignemnt.name == reference) + { + return assignemnt; + } + } + + throw std::runtime_error("Reference to undefined object: " + module.module_reference + "." + reference); } Assignment& resolve(Asn1Tree& tree, const std::string& module_reference, const std::string& reference) @@ -51,7 +110,7 @@ Assignment& resolve(Asn1Tree& tree, const std::string& current_module_reference, throw std::runtime_error("Reference to undefined object: " + module_reference + "." + defined.type_reference); } -const Assignment& resolve(const Asn1Tree& tree, const Module& module, const std::string& reference) +const Assignment& resolve(const Asn1Tree&, const Module& module, const std::string& reference) { for (const Assignment& assignemnt : module.assignments) { @@ -61,18 +120,7 @@ const Assignment& resolve(const Asn1Tree& tree, const Module& module, const std: } } - for (const Import& import : module.imports) - { - for (const std::string& imported_reference : import.imports) - { - if (imported_reference == reference) - { - return resolve(tree, import.module_reference, reference); - } - } - } - - throw std::runtime_error("Reference to undefined object: " + reference); + throw std::runtime_error("Reference to undefined object: " + module.module_reference + "." + reference); } const Assignment& resolve(const Asn1Tree& tree, const std::string& module_reference, const std::string& reference) @@ -102,26 +150,53 @@ const Assignment& resolve(const Asn1Tree& tree, const std::string& current_modul throw std::runtime_error("Reference to undefined object: " + module_reference + "." + defined.type_reference); } -bool exists(const Asn1Tree& tree, const Module& module, const std::string& reference) +NamedType resolve_type(const Asn1Tree& tree, const std::string& current_module_reference, + const DefinedType& original_defined) { - for (const Assignment& assignemnt : module.assignments) + DefinedType defined = original_defined; + std::string module = current_module_reference; + while (true) { - if (assignemnt.name == reference) + assert(std::isupper(defined.type_reference[0])); + const Assignment& assignment = resolve(tree, module, defined); + if (!is_type(assignment)) { - return true; + throw std::runtime_error("Defined must be a type in this context! " + original_defined.type_reference); } + if (is_defined(type(assignment))) + { + if (defined.module_reference) + { + module = *defined.module_reference; + } + defined = absl::get(type(assignment)); + } + else + { + return NamedType{assignment.name, type(assignment)}; + } + } +} + +NamedType resolve_type(const Asn1Tree& tree, const std::string& current_module_reference, const NamedType& type_info) +{ + if (is_defined(type_info.type)) + { + return resolve_type(tree, current_module_reference, absl::get(type_info.type)); } + return type_info; +} - for (const Import& import : module.imports) +bool exists(const Asn1Tree&, const Module& module, const std::string& reference) +{ + for (const Assignment& assignemnt : module.assignments) { - for (const std::string& imported_reference : import.imports) + if (assignemnt.name == reference) { - if (imported_reference == reference) - { - return exists(tree, import.module_reference, reference); - } + return true; } } + return false; } diff --git a/src/compiler/TypeAsString.cpp b/src/compiler/TypeAsString.cpp index 6bd7b8b7..81b77f08 100644 --- a/src/compiler/TypeAsString.cpp +++ b/src/compiler/TypeAsString.cpp @@ -1,6 +1,15 @@ #include "fast_ber/compiler/TypeAsString.hpp" + #include "fast_ber/compiler/Identifier.hpp" #include "fast_ber/compiler/ResolveType.hpp" +#include "fast_ber/compiler/ValueAsString.hpp" +#include "fast_ber/compiler/ValueType.hpp" + +#include "absl/container/flat_hash_set.h" + +#include + +thread_local static size_t id_counter = 0; template std::string identifier_template_params(const Type&, const Module&, const Asn1Tree&, @@ -9,41 +18,248 @@ std::string identifier_template_params(const Type&, const Module&, const Asn1Tre return "<" + identifier_override + ">"; } -std::string type_as_string(const AnyType& type, const Module& module, const Asn1Tree& tree, +template +std::string collection_as_string(const Collection& collection, const Module& module, const Asn1Tree& tree, + const std::string& type_name, const std::string& identifier_override, + const std::string& collection_name) +{ + std::string res = " {\n"; + + bool has_defaults; + for (const ComponentType& component : collection.components) + { + if (component.default_value) + { + std::string name = component.named_type.name; + name[0] = std::toupper(name[0]); + res += " struct DefaultValue" + name + " { constexpr static " + + value_type(component.named_type.type, module, tree, component.named_type.name, {}) + + " get_value() noexcept { return " + + value_as_string(resolve_type(tree, module.module_reference, component.named_type), + *component.default_value) + + "; } };\n"; + has_defaults = true; + } + } + if (has_defaults) + { + res += "\n\n"; + } + + int64_t tag_counter = 0; + + for (const ComponentType& component : collection.components) + { + std::string component_type; + if (is_set(component.named_type.type) || is_sequence(component.named_type.type)) + { + const std::string id_template_param = "Identifier" + std::to_string(id_counter++); + component_type = + type_as_string(component.named_type.type, module, tree, component.named_type.name + "_type"); + + res += create_template_definition( + {id_template_param + " = ExplicitId"}); + res += "struct " + component.named_type.name + "_type " + component_type; + } + } + + std::vector component_types; + + for (const ComponentType& component : collection.components) + { + std::string component_type; + + if (is_set(component.named_type.type) || is_sequence(component.named_type.type)) + { + component_type = component.named_type.name + "_type<> "; + } + else if (!is_prefixed(component.named_type.type) && module.tagging_default == TaggingMode::automatic) + { + component_type = type_as_string(component.named_type.type, module, tree, "", + Identifier(Class::context_specific, tag_counter++).name()); + } + else + { + component_type = type_as_string(component.named_type.type, module, tree); + } + + if (component.is_optional) + { + component_type = make_type_optional(component_type, component.optional_storage); + } + else if (component.default_value) + { + std::string name = component.named_type.name; + name[0] = std::toupper(name[0]); + name = "DefaultValue" + name; + component_type = "Default<" + component_type + ", " + name + ">"; + } + res += " " + component_type + " " + component.named_type.name + ";\n"; + component_types.push_back(component_type); + } + + res += "\n\n"; + res += " " + type_name + "() noexcept {}\n"; + if (collection.components.size() > 0) + { + bool is_first = true; + if (collection.components.size() == 1) + { + res += " explicit " + type_name + "("; + } + else + { + res += " " + type_name + "("; + } + for (size_t i = 0; i < collection.components.size(); i++) + { + if (!is_first) + { + res += ", "; + } + res += "const " + component_types[i] + "& t" + std::to_string(i); + is_first = false; + } + size_t counter = 0; + res += ")\n"; + for (const ComponentType& component : collection.components) + { + res += " "; + if (counter == 0) + { + res += ": "; + } + else + { + res += ", "; + } + + res += component.named_type.name + "(t" + std::to_string(counter) + ")\n"; + counter++; + } + res += " {}\n"; + } + bool is_first = true; + res += " template \n"; + res += " " + type_name + "(const " + type_name + "& rhs)\n"; + for (const ComponentType& component : collection.components) + { + res += " "; + if (is_first) + { + res += ": "; + } + else + { + res += ", "; + } + + res += component.named_type.name + "(rhs." + component.named_type.name + ")\n"; + is_first = false; + } + if (collection.components.size() == 0) + { + res += " {(void)rhs;}\n"; + } + else + { + res += " {}\n"; + } + + is_first = true; + res += " template \n"; + res += " " + type_name + "(" + type_name + "&& rhs) noexcept\n"; + for (const ComponentType& component : collection.components) + { + res += " "; + if (is_first) + { + res += ": "; + } + else + { + res += ", "; + } + + res += component.named_type.name + "(std::move(rhs." + component.named_type.name + "))\n"; + is_first = false; + } + if (collection.components.size() == 0) + { + res += " {(void)rhs;}\n"; + } + else + { + res += " {}\n"; + } + + res += "\n template \n"; + res += " " + type_name + "& operator=(const " + type_name + "& rhs)\n"; + res += " {\n"; + if (collection.components.size() == 0) + { + res += " (void)rhs;\n"; + } + for (const ComponentType& component : collection.components) + { + res += " " + component.named_type.name + " = rhs." + component.named_type.name + ";\n"; + } + res += " return *this;\n"; + res += " }\n"; + + res += " template \n"; + res += " " + type_name + "& operator=(" + type_name + "&& rhs) noexcept\n"; + res += " {\n"; + if (collection.components.size() == 0) + { + res += " (void)rhs;\n"; + } + for (const ComponentType& component : collection.components) + { + res += " " + component.named_type.name + " = std::move(rhs." + component.named_type.name + ");\n"; + } + res += " return *this;\n"; + res += " }\n"; + res += " size_t encoded_length() const noexcept;\n"; + res += " EncodeResult encode(absl::Span) const noexcept;\n"; + res += " DecodeResult decode(BerView) noexcept;\n"; + res += " using AsnId = Identifier;\n"; + res += "};\n"; + + if (!identifier(collection, module, tree).is_default_tagged || !identifier_override.empty()) + { + throw std::runtime_error(collection_name + " must be default tagged"); + } + return res; +} + +std::string type_as_string(const AnyType& type, const Module& module, const Asn1Tree& tree, const std::string&, const std::string& identifier_override) { return "Any" + identifier_template_params(type, module, tree, identifier_override); } -std::string type_as_string(const BitStringType& type, const Module& module, const Asn1Tree& tree, +std::string type_as_string(const BitStringType& type, const Module& module, const Asn1Tree& tree, const std::string&, const std::string& identifier_override) { return "BitString" + identifier_template_params(type, module, tree, identifier_override); } -std::string type_as_string(const BooleanType& type, const Module& module, const Asn1Tree& tree, +std::string type_as_string(const BooleanType& type, const Module& module, const Asn1Tree& tree, const std::string&, const std::string& identifier_override) { return "Boolean" + identifier_template_params(type, module, tree, identifier_override); } std::string type_as_string(const CharacterStringType& type, const Module& module, const Asn1Tree& tree, - const std::string& identifier_override) + const std::string&, const std::string& identifier_override) { return to_string(type) + identifier_template_params(type, module, tree, identifier_override); } -std::string type_as_string(const ChoiceType& choice, const Module& module, const Asn1Tree& tree, +std::string type_as_string(const ChoiceType& choice, const Module& module, const Asn1Tree& tree, const std::string&, const std::string& identifier_override) { + std::string res = "Choice previous_optional_ids; + absl::optional previous_optional_type; + for (const ComponentType& component : sequence.components) { - const std::string id_template_param = "Identifier" + std::to_string(id_counter++); - component_type = type_as_string(component.named_type.type, module, tree); - - res += create_template_definition({id_template_param + " = ExplicitId"}); - res += "struct " + component.named_type.name + "_type " + component_type; - res += " " + component.named_type.name + "_type<> " + component.named_type.name + ";\n"; - } - else - { - if (!is_prefixed(component.named_type.type) && module.tagging_default == TaggingMode::automatic) + if (component.is_optional || component.default_value) { - component_type = type_as_string(component.named_type.type, module, tree, - "Id"); + auto outer_ids = identifier(component.named_type.type, module, tree).outer_tags(); + + for (const Identifier& previous_optional_id : previous_optional_ids) + { + if (previous_optional_type && previous_optional_id == outer_ids.front()) + { + throw std::runtime_error("SEQUENCE " + type_name + + " is ambiguous, two optional values in a row with same ID [" + + component.named_type.name + "] [" + *previous_optional_type + "] [" + + outer_ids.front().name() + "]"); + } + } + previous_optional_ids = std::move(outer_ids); + previous_optional_type = component.named_type.name; } else { - component_type = type_as_string(component.named_type.type, module, tree); + previous_optional_type = absl::nullopt; + previous_optional_ids.clear(); } - - if (component.is_optional) - { - component_type = make_type_optional(component_type, tree); - } - res += " " + component_type + " " + component.named_type.name + ";\n"; } } - - res += " using AsnId = Identifier;\n"; - res += "};\n"; - - if (!identifier(sequence, module, tree).is_default_tagged || !identifier_override.empty()) - { - throw std::runtime_error("Sequence must be default tagged"); - } - - return res; + return collection_as_string(sequence, module, tree, type_name, identifier_override, "sequence"); } std::string type_as_string(const SequenceOfType& sequence, const Module& module, const Asn1Tree& tree, - const std::string& identifier_override) + const std::string&, const std::string& identifier_override) { const Type& type = sequence.has_name ? sequence.named_type->type : *sequence.type; if (is_sequence(type) || is_set(type) || is_enumerated(type)) @@ -238,68 +457,34 @@ std::string type_as_string(const SequenceOfType& sequence, const Module& module, res += ", " + identifier_override; } - if (tree.is_circular) - { - res += ", StorageMode::dynamic"; - } - else - { - res += ", StorageMode::small_buffer_optimised"; - } - + res += ", " + to_string(sequence.storage); res += ">"; + return res; } -std::string type_as_string(const SetType& set, const Module& module, const Asn1Tree& tree, +std::string type_as_string(const SetType& set, const Module& module, const Asn1Tree& tree, const std::string& type_name, const std::string& identifier_override) { - std::string res = " {\n"; - - size_t tag_counter = 0; - for (const ComponentType& component : set.components) + if (module.tagging_default != TaggingMode::automatic) { - std::string component_type; - - if (is_set(component.named_type.type) || is_sequence(component.named_type.type)) + absl::flat_hash_set ids; + for (const ComponentType& component : set.components) { - const std::string id_template_param = "Identifier" + std::to_string(id_counter++); - component_type = type_as_string(component.named_type.type, module, tree); - - res += create_template_definition({id_template_param + " = ExplicitId"}); - res += "struct " + component.named_type.name + "_type " + component_type; - res += " " + component.named_type.name + "_type<> " + component.named_type.name + ";\n"; - } - else - { - if (!is_prefixed(component.named_type.type) && module.tagging_default == TaggingMode::automatic) + auto outer_ids = identifier(component.named_type.type, module, tree).outer_tags(); + for (const Identifier& id : outer_ids) { - component_type = type_as_string(component.named_type.type, module, tree, - "Id"); + if (ids.count(id) > 0) + { + throw std::runtime_error("Identifier " + id.name() + " occurs more than once in SET " + type_name); + } + ids.insert(id); } - else - { - component_type = type_as_string(component.named_type.type, module, tree); - } - - if (component.is_optional) - { - component_type = make_type_optional(component_type, tree); - } - res += " " + component_type + " " + component.named_type.name + ";\n"; } } - res += " using AsnId = Identifier;\n"; - res += "};\n"; - - if (!identifier(set, module, tree).is_default_tagged || !identifier_override.empty()) - { - throw std::runtime_error("Set must be default tagged"); - } - - return res; + return collection_as_string(set, module, tree, type_name, identifier_override, "set"); } -std::string type_as_string(const SetOfType& set, const Module& module, const Asn1Tree& tree, +std::string type_as_string(const SetOfType& set, const Module& module, const Asn1Tree& tree, const std::string&, const std::string& identifier_override) { const Type& type = set.has_name ? set.named_type->type : *set.type; @@ -309,15 +494,22 @@ std::string type_as_string(const SetOfType& set, const Module& module, const Asn } std::string res = "SetOf<" + type_as_string(type, module, tree); - if (!identifier_override.empty()) + if (identifier_override.empty()) + { + res += ", ExplicitId"; + } + else { res += ", " + identifier_override; } + + res += ", " + to_string(set.storage); res += ">"; + return res; } std::string type_as_string(const PrefixedType& prefixed_type, const Module& module, const Asn1Tree& tree, - const std::string& identifier_override) + const std::string&, const std::string& identifier_override) { auto id = identifier(prefixed_type, module, tree).name(); if (!identifier_override.empty()) @@ -331,44 +523,40 @@ std::string type_as_string(const PrefixedType& prefixed_type, const Module& modu throw std::runtime_error("PrefixedType must not be a structure or enum"); } - return type_as_string(prefixed_type.tagged_type->type, module, tree, id); + return type_as_string(prefixed_type.tagged_type->type, module, tree, "", id); } -std::string type_as_string(const TimeType& type, const Module& module, const Asn1Tree& tree, +std::string type_as_string(const TimeType& type, const Module& module, const Asn1Tree& tree, const std::string&, const std::string& identifier_override) { return "Time" + identifier_template_params(type, module, tree, identifier_override); } -std::string type_as_string(const TimeOfDayType& type, const Module& module, const Asn1Tree& tree, +std::string type_as_string(const TimeOfDayType& type, const Module& module, const Asn1Tree& tree, const std::string&, const std::string& identifier_override) { return "TimeOfDay" + identifier_template_params(type, module, tree, identifier_override); } -std::string type_as_string(const UTCTimeType& type, const Module& module, const Asn1Tree& tree, +std::string type_as_string(const UTCTimeType& type, const Module& module, const Asn1Tree& tree, const std::string&, const std::string& identifier_override) { return "UTCTime" + identifier_template_params(type, module, tree, identifier_override); } std::string type_as_string(const DefinedType& defined_type, const Module& module, const Asn1Tree& tree, - const std::string& identifier_override) + const std::string&, const std::string& identifier_override) { - if (identifier_override.empty()) + const std::string& assigned_type = + (defined_type.module_reference ? *defined_type.module_reference + "::" : std::string("")) + + defined_type.type_reference; + + if (!identifier_override.empty()) { - return defined_type.type_reference + "<>"; + return assigned_type + "<" + identifier_override + ">"; } - - const Type& referenced = type(resolve(tree, module.module_reference, defined_type)); - if (is_set(referenced) || is_sequence(referenced)) + else { - if (!identifier_override.empty()) - { - return defined_type.type_reference + "<" + identifier_override + ">"; - } - else - { - return defined_type.type_reference + "<" + identifier(referenced, module, tree).name() + ">"; - } + // const Type& referenced = resolve_type(tree, module.module_reference, defined_type); + const Type& referenced = type(resolve(tree, module.module_reference, defined_type)); + return assigned_type + "<" + identifier(referenced, module, tree).name() + ">"; } - return defined_type.type_reference + "<" + identifier_override + ">"; } struct ToStringHelper @@ -376,23 +564,24 @@ struct ToStringHelper template std::string operator()(const T& t) { - return type_as_string(t, module, tree, identifier_override); + return type_as_string(t, module, tree, type_name, identifier_override); } const Module& module; const Asn1Tree& tree; + const std::string& type_name; const std::string& identifier_override; }; std::string type_as_string(const BuiltinType& type, const Module& module, const Asn1Tree& tree, - const std::string& identifier_override) + const std::string& type_name, const std::string& identifier_override) { - ToStringHelper string_helper{module, tree, identifier_override}; + ToStringHelper string_helper{module, tree, type_name, identifier_override}; return absl::visit(string_helper, type); } -std::string type_as_string(const Type& type, const Module& module, const Asn1Tree& tree, +std::string type_as_string(const Type& type, const Module& module, const Asn1Tree& tree, const std::string& type_name, const std::string& identifier_override) { - ToStringHelper string_helper{module, tree, identifier_override}; + ToStringHelper string_helper{module, tree, type_name, identifier_override}; return absl::visit(string_helper, type); } diff --git a/src/compiler/ValueAsString.cpp b/src/compiler/ValueAsString.cpp new file mode 100644 index 00000000..334c9142 --- /dev/null +++ b/src/compiler/ValueAsString.cpp @@ -0,0 +1,129 @@ +#include "fast_ber/compiler/ValueAsString.hpp" + +#include + +std::string cpp_value(const HexStringValue& hex) +{ + std::string res = "\""; + size_t i = 0; + + if (hex.value.length() % 2 == 1) + { + const std::string& byte = std::string(hex.value.begin(), hex.value.begin() + 1); + res += "\\"; + res += std::to_string(std::stoi(byte, nullptr, 16)); + i++; + } + + for (; i < hex.value.length(); i += 2) + { + const std::string& byte = std::string(hex.value.begin() + i, hex.value.begin() + i + 2); + res += "\\"; + res += std::to_string(std::stoi(byte, nullptr, 16)); + } + + return res + "\""; +} + +std::string value_as_string(const NamedType& value_type, const Value& value) +{ + assert(!is_defined(value_type.type)); // value_type should be concrete + + std::string result; + if (is_oid(value_type.type)) + { + result += "ObjectIdentifier<>{"; + try + { + const ObjectIdComponents& object_id = ObjectIdComponents(value); + + for (size_t i = 0; i < object_id.components.size(); i++) + { + if (object_id.components[i].value) + { + result += std::to_string(*object_id.components[i].value); + } + else + { + result += std::to_string(0); + } + + if (i < object_id.components.size() - 1) + { + result += ", "; + } + } + } + catch (const std::runtime_error& e) + { + std::cerr << std::string("Warning: Value is not an object identifier : ") + e.what() << std::endl; + return ""; + } + result += "}"; + } + else if (is_bit_string(value_type.type)) + { + if (absl::holds_alternative(value.value_selection)) + { + const BitStringValue& bstring = absl::get(value.value_selection); + (void)bstring; // TODO: convert bstring to cstring + result += "\"\""; + } + else + { + result += "\"\""; + } + } + else if (is_enumerated(value_type.type)) + { + if (absl::holds_alternative(value.value_selection)) + { + const DefinedValue& defined = absl::get(value.value_selection); + result += value_type.name + "Values::" + defined.reference; + } + else + { + throw std::runtime_error("Unexpected Enumerated type"); + } + } + else if (absl::holds_alternative(value.value_selection)) + { + const std::string& string = absl::get(value.value_selection); + result += string; + } + else if (absl::holds_alternative(value.value_selection)) + { + const HexStringValue& hstring = absl::get(value.value_selection); + result += "absl::string_view(" + cpp_value(hstring) + ")"; + } + else if (absl::holds_alternative(value.value_selection)) + { + const CharStringValue& cstring = absl::get(value.value_selection); + result += "absl::string_view(" + cstring.value + ")"; + } + else if (absl::holds_alternative(value.value_selection)) + { + const int64_t integer = absl::get(value.value_selection); + result += std::to_string(integer); + } + else if (absl::holds_alternative(value.value_selection)) + { + const DefinedValue& defined = absl::get(value.value_selection); + result += defined.reference; + } + else if (absl::holds_alternative(value.value_selection)) + { + const BooleanValue& boolean = absl::get(value.value_selection); + result += (boolean.value) ? "true" : "false"; + } + else if (absl::holds_alternative(value.value_selection)) + { + const double& real = absl::get(value.value_selection); + result += std::to_string(real); + } + else + { + throw std::runtime_error("Strange value assign"); + } + return result; +} diff --git a/src/compiler/ValueType.cpp b/src/compiler/ValueType.cpp new file mode 100644 index 00000000..bf4588dc --- /dev/null +++ b/src/compiler/ValueType.cpp @@ -0,0 +1,232 @@ +#include "fast_ber/compiler/ValueType.hpp" + +#include "fast_ber/compiler/Identifier.hpp" +#include "fast_ber/compiler/ResolveType.hpp" + +#include "absl/container/flat_hash_set.h" + +#include + +std::string identifier_template_params(const std::string& identifier_override) +{ + return "<" + identifier_override + ">"; +} + +std::string value_type(const AnyType&, const Module&, const Asn1Tree&, const std::string&, + const std::string& identifier_override) +{ + return "Any" + identifier_template_params(identifier_override); +} +std::string value_type(const BitStringType&, const Module&, const Asn1Tree&, const std::string&, const std::string&) +{ + return "absl::string_view"; +} +std::string value_type(const BooleanType&, const Module&, const Asn1Tree&, const std::string&, const std::string&) +{ + return "bool"; +} +std::string value_type(const CharacterStringType&, const Module&, const Asn1Tree&, const std::string&, + const std::string&) +{ + return "absl::string_view"; +} +std::string value_type(const ChoiceType&, const Module&, const Asn1Tree&, const std::string& type_name, + const std::string& identifier_override) +{ + return type_name + identifier_template_params(identifier_override); +} +std::string value_type(const DateType&, const Module&, const Asn1Tree&, const std::string&, + const std::string& identifier_override) +{ + return "Date" + identifier_template_params(identifier_override); +} +std::string value_type(const DateTimeType&, const Module&, const Asn1Tree&, const std::string&, + const std::string& identifier_override) +{ + return "DateTime" + identifier_template_params(identifier_override); +} +std::string value_type(const DurationType&, const Module&, const Asn1Tree&, const std::string&, + const std::string& identifier_override) +{ + return "Duration" + identifier_template_params(identifier_override); +} +std::string value_type(const EmbeddedPDVType&, const Module&, const Asn1Tree&, const std::string&, + const std::string& identifier_override) +{ + return "EmbeddedPDV" + identifier_template_params(identifier_override); +} +std::string value_type(const EnumeratedType&, const Module&, const Asn1Tree&, const std::string& assigned_type, + const std::string&) +{ + return assigned_type + "Values"; +} +std::string value_type(const ExternalType&, const Module&, const Asn1Tree&, const std::string&, + const std::string& identifier_override) +{ + return "External" + identifier_template_params(identifier_override); +} +std::string value_type(const GeneralizedTimeType&, const Module&, const Asn1Tree&, const std::string&, + const std::string& identifier_override) +{ + return "GeneralizedTime" + identifier_template_params(identifier_override); +} +std::string value_type(const InstanceOfType&, const Module&, const Asn1Tree&, const std::string&, + const std::string& identifier_override) +{ + return "InstanceOf" + identifier_template_params(identifier_override); +} +std::string value_type(const IntegerType&, const Module&, const Asn1Tree&, const std::string&, const std::string&) +{ + return "int64_t"; +} +std::string value_type(const IRIType&, const Module&, const Asn1Tree&, const std::string&, + const std::string& identifier_override) +{ + return "IRI" + identifier_template_params(identifier_override); +} +std::string value_type(const NullType&, const Module&, const Asn1Tree&, const std::string&, const std::string&) +{ + return "nullptr_t"; +} +std::string value_type(const ObjectClassFieldType&, const Module&, const Asn1Tree&, const std::string&, + const std::string&) +{ + throw std::runtime_error("ObjectClassFieldType is not serializable!"); +} +std::string value_type(const ObjectDescriptorType&, const Module&, const Asn1Tree&, const std::string&, + const std::string& identifier_override) +{ + return "ObjectDescriptor" + identifier_template_params(identifier_override); +} +std::string value_type(const ObjectIdentifierType&, const Module&, const Asn1Tree&, const std::string&, + const std::string& identifier_override) +{ + return "ObjectIdentifier" + identifier_template_params(identifier_override); +} +std::string value_type(const OctetStringType&, const Module&, const Asn1Tree&, const std::string&, const std::string&) +{ + return "absl::string_view"; +} +std::string value_type(const RealType&, const Module&, const Asn1Tree&, const std::string&, const std::string&) +{ + return "double"; +} +std::string value_type(const RelativeIRIType&, const Module&, const Asn1Tree&, const std::string&, + const std::string& identifier_override) +{ + return "RelativeIRI" + identifier_template_params(identifier_override); +} +std::string value_type(const RelativeOIDType&, const Module&, const Asn1Tree&, const std::string&, + const std::string& identifier_override) +{ + return "RelativeOID" + identifier_template_params(identifier_override); +} +std::string value_type(const SequenceType&, const Module&, const Asn1Tree&, const std::string& type_name, + const std::string& identifier_override) +{ + return type_name + identifier_template_params(identifier_override); +} +std::string value_type(const SequenceOfType& sequence, const Module& module, const Asn1Tree& tree, const std::string&, + const std::string& identifier_override) +{ + std::string name = sequence.has_name ? sequence.named_type->name : ""; + const Type& type = sequence.has_name ? sequence.named_type->type : *sequence.type; + std::string res = "SequenceOf<" + value_type(type, module, tree, name, {}); + if (identifier_override.empty()) + { + res += ", ExplicitId"; + } + else + { + res += ", " + identifier_override; + } + + res += ", " + to_string(sequence.storage); + res += ">"; + + return res; +} +std::string value_type(const SetType&, const Module&, const Asn1Tree&, const std::string& type_name, + const std::string& identifier_override) +{ + return type_name + identifier_template_params(identifier_override); +} +std::string value_type(const SetOfType& set, const Module& module, const Asn1Tree& tree, const std::string&, + const std::string& identifier_override) +{ + std::string name = set.has_name ? set.named_type->name : ""; + const Type& type = set.has_name ? set.named_type->type : *set.type; + std::string res = "SetOf<" + value_type(type, module, tree, set.named_type->name, {}); + if (identifier_override.empty()) + { + res += ", ExplicitId"; + } + else + { + res += ", " + identifier_override; + } + + res += ", " + to_string(set.storage); + res += ">"; + + return res; +} +std::string value_type(const PrefixedType& prefixed_type, const Module& module, const Asn1Tree& tree, + const std::string&, const std::string& identifier_override) +{ + auto id = identifier(prefixed_type, module, tree).name(); + if (!identifier_override.empty()) + { + id = identifier_override; + } + + return value_type(prefixed_type.tagged_type->type, module, tree, "", id); +} +std::string value_type(const TimeType&, const Module&, const Asn1Tree&, const std::string&, + const std::string& identifier_override) +{ + return "Time" + identifier_template_params(identifier_override); +} +std::string value_type(const TimeOfDayType&, const Module&, const Asn1Tree&, const std::string&, + const std::string& identifier_override) +{ + return "TimeOfDay" + identifier_template_params(identifier_override); +} +std::string value_type(const UTCTimeType&, const Module&, const Asn1Tree&, const std::string&, + const std::string& identifier_override) +{ + return "UTCTime" + identifier_template_params(identifier_override); +} +std::string value_type(const DefinedType& defined_type, const Module& module, const Asn1Tree& tree, const std::string&, + const std::string& identifier_override) +{ + const NamedType& referenced = resolve_type(tree, module.module_reference, defined_type); + return value_type(referenced.type, module, tree, referenced.name, identifier_override); +} + +struct ValueTypeHelper +{ + template + std::string operator()(const T& t) + { + return value_type(t, module, tree, type_name, identifier_override); + } + + const Module& module; + const Asn1Tree& tree; + const std::string& type_name; + const std::string& identifier_override; +}; + +std::string value_type(const BuiltinType& type, const Module& module, const Asn1Tree& tree, + const std::string& type_name, const std::string& identifier_override) +{ + ValueTypeHelper string_helper{module, tree, type_name, identifier_override}; + return absl::visit(string_helper, type); +} +std::string value_type(const Type& type, const Module& module, const Asn1Tree& tree, const std::string& type_name, + const std::string& identifier_override) +{ + ValueTypeHelper string_helper{module, tree, type_name, identifier_override}; + return absl::visit(string_helper, type); +} diff --git a/src/compiler/asn_compiler.yacc b/src/compiler/asn_compiler.yacc index 9dfbe10f..6a40d4bb 100644 --- a/src/compiler/asn_compiler.yacc +++ b/src/compiler/asn_compiler.yacc @@ -9,6 +9,7 @@ %code requires { #include "fast_ber/compiler/CompilerTypes.hpp" + #include "fast_ber/compiler/Logging.hpp" } %code @@ -22,8 +23,7 @@ }; void yy::asn1_parser::error(const location_type& l, const std::string& m) { - std::cerr << (l.begin.filename ? l.begin.filename->c_str() : "(undefined)"); - std::cerr << ':' << l.begin.line << ':' << l.begin.column << '-' << l.end.column << ": " << m << '\n'; + std::cerr << l << m << '\n'; } namespace yy { asn1_parser::symbol_type yylex(Context& c); } @@ -211,9 +211,9 @@ %type simplestring %type xmltstring %type realnumber -%type number -%type negativenumber -%type SignedNumber +%type number +%type negativenumber +%type SignedNumber %type DefinedValue %type BuiltinType; %type DefinedType; @@ -296,6 +296,8 @@ %type Value; %type SingleValue; %type ValueWithoutTypeIdentifier; +%type BooleanValue; +%type TimeValue; %type> SequenceOfValues; %type Reference; %type Symbol; @@ -363,7 +365,7 @@ ObjectClassAssignment: ObjectClass: DefinedObjectClass - { std::cerr << "Warning - Unhandled DefinedObjectClass\n"; } + { feature_not_implemented(context.location, context.asn1_tree, "ObjectClass"); } | ObjectClassDefn { $$ = $1; } //| ParameterizedObjectClass; @@ -667,7 +669,8 @@ ObjectSetFromObjects: ReferencedObjects "." FieldNameList; InstanceOfType: - INSTANCE OF DefinedObjectClass; + INSTANCE OF DefinedObjectClass + { feature_not_implemented(context.location, context.asn1_tree, "InstanceOfType"); } ParameterizedReference: Reference @@ -689,6 +692,8 @@ GeneralConstraint: UserDefinedConstraint: CONSTRAINED BY "{" UserDefinedConstraintParameter "}" + { feature_not_implemented(context.location, context.asn1_tree, "UserDefinedConstraint", "Not yet checking contraints. "); } + UserDefinedConstraintParameter: Governor ":" Value @@ -829,16 +834,27 @@ SymbolsFromModuleList: SymbolsFromModule: SymbolList FROM GlobalModuleReference - { $$ = Import{ $3, $1 }; } + { $$ = Import{ $3, {}, {} }; + for (const std::string& ref: $1) + { + if (std::isupper(ref[0])) + { + $$.imported_types.push_back(ref); + } + else + { + $$.imported_values.push_back(ref); + } + } + } GlobalModuleReference: - modulereference AssignedIdentifier + modulereference { $$ = $1; } - -AssignedIdentifier: - ObjectIdentifierValue -| valuereference -| %empty; +| modulereference ObjectIdentifierValue + { $$ = $1; } +// | modulereference valuereference +// { $$ = $1; } // Clashes with value import SymbolList: Symbol @@ -976,9 +992,9 @@ Type: | DefinedType { $$ = $1; } | SelectionType - { std::cerr << "Warning: Not handled - SelectionType\n"; } + { feature_not_implemented(context.location, context.asn1_tree, "SelectionType"); } | TypeFromObject - { std::cerr << "Warning: Not handled - TypeFromObject\n"; } + { feature_not_implemented(context.location, context.asn1_tree, "TypeFromObject"); } //| ValueSetFromObjects { std::cerr << std::string("Not handled - ValueSetFromObjects\n"); } BuiltinType: @@ -987,32 +1003,32 @@ BuiltinType: | BooleanType { $$ = $1; } | CharacterStringType { $$ = $1; } | ChoiceType { $$ = $1; } -| DateType { $$ = $1; } -| DateTimeType { $$ = $1; } -| DurationType { $$ = $1; } -| EmbeddedPDVType { $$ = $1; } +| DateType { $$ = $1; feature_not_implemented(context.location, context.asn1_tree, "DateType"); } +| DateTimeType { $$ = $1; feature_not_implemented(context.location, context.asn1_tree, "DateTimeType"); } +| DurationType { $$ = $1; feature_not_implemented(context.location, context.asn1_tree, "DurationType"); } +| EmbeddedPDVType { $$ = $1; feature_not_implemented(context.location, context.asn1_tree, "EmbeddedPDVType"); } | EnumeratedType { $$ = $1; } -| ExternalType { $$ = $1; } +| ExternalType { $$ = $1; feature_not_implemented(context.location, context.asn1_tree, "ExternalType"); } | GeneralizedTime { $$ = GeneralizedTimeType(); } -| InstanceOfType { $$ = $1; } +| InstanceOfType { $$ = $1; feature_not_implemented(context.location, context.asn1_tree, "InstanceOfType"); } | IntegerType { $$ = $1; } -| IRIType { $$ = $1; } +| IRIType { $$ = $1; feature_not_implemented(context.location, context.asn1_tree, "IRIType"); } | NullType { $$ = $1; } -| ObjectClassFieldType { $$ = $1; } +| ObjectClassFieldType { $$ = $1; feature_not_implemented(context.location, context.asn1_tree, "ObjectClassFieldType"); } | ObjectDescriptor { $$ = ObjectDescriptorType(); } | ObjectIdentifierType { $$ = $1; } | OctetStringType { $$ = $1; } -| RealType { $$ = $1; } -| RelativeIRIType { $$ = $1; } -| RelativeOIDType { $$ = $1; } +| RealType { $$ = $1; feature_not_implemented(context.location, context.asn1_tree, "RealType"); } +| RelativeIRIType { $$ = $1; feature_not_implemented(context.location, context.asn1_tree, "RelativeIRIType"); } +| RelativeOIDType { $$ = $1; feature_not_implemented(context.location, context.asn1_tree, "RelativeOIDType"); } | SequenceType { $$ = $1; } | SequenceOfType { $$ = $1; } -| SetType { $$ = $1; } +| SetType { $$ = $1; feature_not_implemented(context.location, context.asn1_tree, "SET", "Currently SET is treated as a SEQUENCE type. "); } | SetOfType { $$ = $1; } | PrefixedType { $$ = $1; } -| TimeType { $$ = $1; } -| TimeOfDayType { $$ = $1; } -| UTCTime { $$ = UTCTimeType(); } +| TimeType { $$ = $1; feature_not_implemented(context.location, context.asn1_tree, "TimeType"); } +| TimeOfDayType { $$ = $1; feature_not_implemented(context.location, context.asn1_tree, "TimeOfDayType"); } +| UTCTime { $$ = UTCTimeType(); feature_not_implemented(context.location, context.asn1_tree, "UTCTime"); } NamedType: identifier Type @@ -1101,7 +1117,9 @@ BooleanType: BooleanValue: TRUE -| FALSE; + { $$ = {true}; } +| FALSE + { $$ = {false}; } IntegerType: INTEGER @@ -1228,19 +1246,22 @@ ComponentTypeList: ComponentType: Type - { $$ = ComponentType{{gen_anon_member_name(), $1}, false, absl::nullopt, absl::nullopt}; } + { std::cerr << context.location << " WARNING: unnamed type\n"; + $$ = ComponentType{{gen_anon_member_name(), $1}, false, absl::nullopt, absl::nullopt, StorageMode::static_ }; } | Type OPTIONAL - { $$ = ComponentType{{gen_anon_member_name(), $1}, true, absl::nullopt, absl::nullopt}; } + { std::cerr << context.location << " WARNING: unnamed type\n"; + $$ = ComponentType{{gen_anon_member_name(), $1}, true, absl::nullopt, absl::nullopt, StorageMode::static_ }; } | Type DEFAULT SingleValue - { $$ = ComponentType{{gen_anon_member_name(), $1}, false, $3, absl::nullopt}; } + { $$ = ComponentType{{gen_anon_member_name(), $1}, false, $3, absl::nullopt, StorageMode::static_ }; + std::cerr << context.location << " WARNING: unnamed type\n"; } | NamedType - { $$ = ComponentType{$1, false, absl::nullopt, absl::nullopt}; } + { $$ = ComponentType{$1, false, absl::nullopt, absl::nullopt, StorageMode::static_ }; } | NamedType OPTIONAL - { $$ = ComponentType{$1, true, absl::nullopt, absl::nullopt}; } + { $$ = ComponentType{$1, true, absl::nullopt, absl::nullopt, StorageMode::static_ }; } | NamedType DEFAULT SingleValue - { $$ = ComponentType{$1, false, $3, absl::nullopt}; } + { $$ = ComponentType{$1, false, $3, absl::nullopt, StorageMode::static_ }; } | COMPONENTS OF Type - { $$ = ComponentType{{}, false, absl::nullopt, $3}; } + { $$ = ComponentType{{}, false, absl::nullopt, $3, StorageMode::static_}; } SequenceValue: "{" ComponentValueList "}" @@ -1270,7 +1291,7 @@ SetOfType: ChoiceType: CHOICE "{" AlternativeTypeLists "}" - { $$ = ChoiceType{ $3 }; } + { $$ = ChoiceType{ $3, StorageMode::static_ }; } AlternativeTypeLists: RootAlternativeTypeList @@ -1484,7 +1505,7 @@ ConstrainedType: Type Constraint { $$ = $1; } | TypeWithConstraint - { $$ = $1; } + { $$ = $1; feature_not_implemented(context.location, context.asn1_tree, "TypeWithConstraint", "Not yet checking contraints. "); } TypeWithConstraint: SET Constraint OF Type @@ -1505,7 +1526,8 @@ TypeWithConstraint: { $$ = SequenceOfType{ true, std::unique_ptr(new NamedType($4)), nullptr }; } Constraint: - "(" ConstraintSpec ExceptionSpec ")"; + "(" ConstraintSpec ExceptionSpec ")" + { feature_not_implemented(context.location, context.asn1_tree, "ConstraintSpec", "Not yet checking contraints. "); } ConstraintSpec: SubtypeConstraint @@ -1576,16 +1598,26 @@ SubtypeElements: SingleValue: BooleanValue + { $$.value_selection = $1; } //| IRIValue | ASN_NULL + { $$.value_selection = NullValue{}; } | TimeValue + { $$.value_selection = $1; } | bstring + { $$.value_selection = $1; } | hstring + { $$.value_selection = $1; } | cstring + { $$.value_selection = $1; } | GENERIC_IDENTIFIER_UPPERCASE -| GENERIC_IDENTIFIER_LOWERCASE + { $$.value_selection = $1; } +| DefinedValue + { $$.value_selection = $1; } | SignedNumber + { $$.value_selection = $1; } | realnumber + { $$.value_selection = $1; } ContainedSubtype: Includes Type; @@ -1882,8 +1914,8 @@ re2c:define:YYCURSOR = "context.cursor"; { context.location.columns(context.cursor - start); return yylex(context); } "--" ([\-]?[^\r\n\-])*[\-]? { context.location.columns(context.cursor - start); return yylex(context); } -"/*" ([^\*]|[\*][^/])* "*/" - { context.location.columns(context.cursor - start); return yylex(context); } +"/*" ([^\*]|([\*]+[^\*\/]))*[\*]+ "/" + { for (char c: std::string(start, context.cursor)) { context.location.columns(); if (c == '\n') context.location.lines(); } return yylex(context); } // Identifiers [0-9]+'\.'[0-9]+ { context.location.columns(context.cursor - start); return asn1_parser::make_realnumber(std::stod(std::string(start, context.cursor)), context.location); } @@ -1926,7 +1958,6 @@ re2c:define:YYCURSOR = "context.cursor"; "!" { context.location.columns(context.cursor - start); return asn1_parser::make_EXCLAMATION_MARK (context.location); } "<" { context.location.columns(context.cursor - start); return asn1_parser::make_LESS_THAN (context.location); } "^" { context.location.columns(context.cursor - start); return asn1_parser::make_ACCENT (context.location); } - "@" { context.location.columns(context.cursor - start); return asn1_parser::make_AT (context.location); } . { std::cerr << "Ignoring unknown symbol: " << static_cast(*start) << std::endl; return yylex(context); } %} diff --git a/src/compiler/autogen_copy/asn_compiler.hpp b/src/compiler/autogen_copy/asn_compiler.hpp index 0b6e0bb9..e9af1aec 100644 --- a/src/compiler/autogen_copy/asn_compiler.hpp +++ b/src/compiler/autogen_copy/asn_compiler.hpp @@ -1,5 +1,5 @@ /* Generated by re2c 1.1.1 */ -#line 1 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 1 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // A Bison parser, made by GNU Bison 3.3.2. // Skeleton implementation for Bison LALR(1) parsers in C++ @@ -43,8 +43,9 @@ #line 10 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:431 #include "fast_ber/compiler/CompilerTypes.hpp" + #include "fast_ber/compiler/Logging.hpp" -#line 46 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:431 +#line 47 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:431 # include # include // std::abort @@ -160,7 +161,7 @@ namespace yy { -#line 162 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:431 +#line 163 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:431 /// A point in a source file. class position @@ -640,142 +641,148 @@ namespace yy { // BooleanType char dummy3[sizeof (BooleanType)]; + // BooleanValue + char dummy4[sizeof (BooleanValue)]; + // BuiltinType - char dummy4[sizeof (BuiltinType)]; + char dummy5[sizeof (BuiltinType)]; // CharacterStringType // RestrictedCharacterStringType // UnrestrictedCharacterStringType - char dummy5[sizeof (CharacterStringType)]; + char dummy6[sizeof (CharacterStringType)]; // ChoiceType - char dummy6[sizeof (ChoiceType)]; + char dummy7[sizeof (ChoiceType)]; // Class - char dummy7[sizeof (Class)]; + char dummy8[sizeof (Class)]; // ComponentType - char dummy8[sizeof (ComponentType)]; + char dummy9[sizeof (ComponentType)]; // ComponentTypeLists // ComponentTypeList - char dummy9[sizeof (ComponentTypeList)]; + char dummy10[sizeof (ComponentTypeList)]; // DateTimeType - char dummy10[sizeof (DateTimeType)]; + char dummy11[sizeof (DateTimeType)]; // DateType - char dummy11[sizeof (DateType)]; + char dummy12[sizeof (DateType)]; // DefinedType // ParameterizedType // ExternalTypeReference - char dummy12[sizeof (DefinedType)]; + char dummy13[sizeof (DefinedType)]; // DefinedValue - char dummy13[sizeof (DefinedValue)]; + char dummy14[sizeof (DefinedValue)]; // DurationType - char dummy14[sizeof (DurationType)]; + char dummy15[sizeof (DurationType)]; // EmbeddedPDVType - char dummy15[sizeof (EmbeddedPDVType)]; + char dummy16[sizeof (EmbeddedPDVType)]; // EnumeratedType // Enumerations // Enumeration - char dummy16[sizeof (EnumeratedType)]; + char dummy17[sizeof (EnumeratedType)]; // EnumerationItem - char dummy17[sizeof (EnumerationValue)]; + char dummy18[sizeof (EnumerationValue)]; // ExternalType - char dummy18[sizeof (ExternalType)]; + char dummy19[sizeof (ExternalType)]; // IRIType - char dummy19[sizeof (IRIType)]; + char dummy20[sizeof (IRIType)]; // SymbolsFromModule - char dummy20[sizeof (Import)]; + char dummy21[sizeof (Import)]; // InstanceOfType - char dummy21[sizeof (InstanceOfType)]; + char dummy22[sizeof (InstanceOfType)]; // IntegerType - char dummy22[sizeof (IntegerType)]; + char dummy23[sizeof (IntegerType)]; // ModuleBody - char dummy23[sizeof (Module)]; + char dummy24[sizeof (Module)]; // NamedNumber - char dummy24[sizeof (NamedNumber)]; + char dummy25[sizeof (NamedNumber)]; // NamedType - char dummy25[sizeof (NamedType)]; + char dummy26[sizeof (NamedType)]; // NullType - char dummy26[sizeof (NullType)]; + char dummy27[sizeof (NullType)]; // ObjectClass // ObjectClassDefn - char dummy27[sizeof (ObjectClassAssignment)]; + char dummy28[sizeof (ObjectClassAssignment)]; // ObjectClassFieldType - char dummy28[sizeof (ObjectClassFieldType)]; + char dummy29[sizeof (ObjectClassFieldType)]; // ObjIdComponents // NameForm // NumberForm // NameAndNumberForm - char dummy29[sizeof (ObjectIdComponentValue)]; + char dummy30[sizeof (ObjectIdComponentValue)]; // ObjectIdentifierType - char dummy30[sizeof (ObjectIdentifierType)]; + char dummy31[sizeof (ObjectIdentifierType)]; // OctetStringType - char dummy31[sizeof (OctetStringType)]; + char dummy32[sizeof (OctetStringType)]; // Parameter - char dummy32[sizeof (Parameter)]; + char dummy33[sizeof (Parameter)]; // PrefixedType - char dummy33[sizeof (PrefixedType)]; + char dummy34[sizeof (PrefixedType)]; // RealType - char dummy34[sizeof (RealType)]; + char dummy35[sizeof (RealType)]; // RelativeIRIType - char dummy35[sizeof (RelativeIRIType)]; + char dummy36[sizeof (RelativeIRIType)]; // RelativeOIDType - char dummy36[sizeof (RelativeOIDType)]; + char dummy37[sizeof (RelativeOIDType)]; // SequenceOfType - char dummy37[sizeof (SequenceOfType)]; + char dummy38[sizeof (SequenceOfType)]; // SequenceType - char dummy38[sizeof (SequenceType)]; + char dummy39[sizeof (SequenceType)]; // SetOfType - char dummy39[sizeof (SetOfType)]; + char dummy40[sizeof (SetOfType)]; // SetType - char dummy40[sizeof (SetType)]; + char dummy41[sizeof (SetType)]; // Tag - char dummy41[sizeof (Tag)]; + char dummy42[sizeof (Tag)]; // TaggedType - char dummy42[sizeof (TaggedType)]; + char dummy43[sizeof (TaggedType)]; // TagDefault - char dummy43[sizeof (TaggingMode)]; + char dummy44[sizeof (TaggingMode)]; // TimeOfDayType - char dummy44[sizeof (TimeOfDayType)]; + char dummy45[sizeof (TimeOfDayType)]; // TimeType - char dummy45[sizeof (TimeType)]; + char dummy46[sizeof (TimeType)]; + + // TimeValue + char dummy47[sizeof (TimeValue)]; // ParamGovernor // Governor @@ -783,23 +790,23 @@ namespace yy { // Type // ConstrainedType // TypeWithConstraint - char dummy46[sizeof (Type)]; + char dummy48[sizeof (Type)]; // ValueWithoutTypeIdentifier // Value // SingleValue - char dummy47[sizeof (Value)]; + char dummy49[sizeof (Value)]; // realnumber - char dummy48[sizeof (double)]; + char dummy50[sizeof (double)]; // ClassNumber - char dummy49[sizeof (int)]; + char dummy51[sizeof (int)]; // number // negativenumber // SignedNumber - char dummy50[sizeof (long long)]; + char dummy52[sizeof (int64_t)]; // bstring // xmlbstring @@ -827,51 +834,51 @@ namespace yy { // modulereference // objectclassreference // word - char dummy51[sizeof (std::string)]; + char dummy53[sizeof (std::string)]; // AssignmentList - char dummy52[sizeof (std::vector)]; + char dummy54[sizeof (std::vector)]; // FieldSpecList // FieldSpec // TypeFieldSpec // FixedTypeValueFieldSpec - char dummy53[sizeof (std::vector)]; + char dummy55[sizeof (std::vector)]; // Exports - char dummy54[sizeof (std::vector)]; + char dummy56[sizeof (std::vector)]; // Imports // SymbolsImported // SymbolsFromModuleList - char dummy55[sizeof (std::vector)]; + char dummy57[sizeof (std::vector)]; // NamedNumberList - char dummy56[sizeof (std::vector)]; + char dummy58[sizeof (std::vector)]; // AlternativeTypeLists // RootAlternativeTypeList // AlternativeTypeList - char dummy57[sizeof (std::vector)]; + char dummy59[sizeof (std::vector)]; // ObjectIdentifierValue // ObjIdComponentsList - char dummy58[sizeof (std::vector)]; + char dummy60[sizeof (std::vector)]; // ParameterList // ParameterSeries - char dummy59[sizeof (std::vector)]; + char dummy61[sizeof (std::vector)]; // ActualParameterList - char dummy60[sizeof (std::vector)]; + char dummy62[sizeof (std::vector)]; // SequenceOfValues - char dummy61[sizeof (std::vector)]; + char dummy63[sizeof (std::vector)]; // FieldNameList // OneOrManyTypeFieldReference // SymbolList - char dummy62[sizeof (std::vector)]; + char dummy64[sizeof (std::vector)]; }; /// The size of the largest semantic type. @@ -1159,6 +1166,19 @@ namespace yy { , location (l) {} #endif +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, BooleanValue&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const BooleanValue& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif #if 201103L <= YY_CPLUSPLUS basic_symbol (typename Base::kind_type t, BuiltinType&& v, location_type&& l) : Base (t) @@ -1705,6 +1725,19 @@ namespace yy { , location (l) {} #endif +#if 201103L <= YY_CPLUSPLUS + basic_symbol (typename Base::kind_type t, TimeValue&& v, location_type&& l) + : Base (t) + , value (std::move (v)) + , location (std::move (l)) + {} +#else + basic_symbol (typename Base::kind_type t, const TimeValue& v, const location_type& l) + : Base (t) + , value (v) + , location (l) + {} +#endif #if 201103L <= YY_CPLUSPLUS basic_symbol (typename Base::kind_type t, Type&& v, location_type&& l) : Base (t) @@ -1758,13 +1791,13 @@ namespace yy { {} #endif #if 201103L <= YY_CPLUSPLUS - basic_symbol (typename Base::kind_type t, long long&& v, location_type&& l) + basic_symbol (typename Base::kind_type t, int64_t&& v, location_type&& l) : Base (t) , value (std::move (v)) , location (std::move (l)) {} #else - basic_symbol (typename Base::kind_type t, const long long& v, const location_type& l) + basic_symbol (typename Base::kind_type t, const int64_t& v, const location_type& l) : Base (t) , value (v) , location (l) @@ -1956,89 +1989,93 @@ switch (yytype) case 205: // ParameterizedValueAssignment case 206: // ParameterizedValueSetTypeAssignment case 207: // ParameterizedObjectClassAssignment - case 252: // Assignment - case 261: // TypeAssignment - case 262: // ValueAssignment - case 263: // ValueSetTypeAssignment + case 251: // Assignment + case 260: // TypeAssignment + case 261: // ValueAssignment + case 262: // ValueSetTypeAssignment value.template destroy< Assignment > (); break; - case 284: // BitStringType + case 283: // BitStringType value.template destroy< BitStringType > (); break; - case 273: // BooleanType + case 272: // BooleanType value.template destroy< BooleanType > (); break; - case 265: // BuiltinType + case 273: // BooleanValue + value.template destroy< BooleanValue > (); + break; + + case 264: // BuiltinType value.template destroy< BuiltinType > (); break; - case 329: // CharacterStringType - case 330: // RestrictedCharacterStringType - case 331: // UnrestrictedCharacterStringType + case 328: // CharacterStringType + case 329: // RestrictedCharacterStringType + case 330: // UnrestrictedCharacterStringType value.template destroy< CharacterStringType > (); break; - case 296: // ChoiceType + case 295: // ChoiceType value.template destroy< ChoiceType > (); break; - case 306: // Class + case 305: // Class value.template destroy< Class > (); break; - case 292: // ComponentType + case 291: // ComponentType value.template destroy< ComponentType > (); break; - case 290: // ComponentTypeLists - case 291: // ComponentTypeList + case 289: // ComponentTypeLists + case 290: // ComponentTypeList value.template destroy< ComponentTypeList > (); break; - case 327: // DateTimeType + case 326: // DateTimeType value.template destroy< DateTimeType > (); break; - case 325: // DateType + case 324: // DateType value.template destroy< DateType > (); break; - case 253: // DefinedType - case 255: // ParameterizedType - case 259: // ExternalTypeReference + case 252: // DefinedType + case 254: // ParameterizedType + case 258: // ExternalTypeReference value.template destroy< DefinedType > (); break; - case 254: // DefinedValue + case 253: // DefinedValue value.template destroy< DefinedValue > (); break; - case 328: // DurationType + case 327: // DurationType value.template destroy< DurationType > (); break; - case 321: // EmbeddedPDVType + case 320: // EmbeddedPDVType value.template destroy< EmbeddedPDVType > (); break; - case 279: // EnumeratedType - case 280: // Enumerations - case 281: // Enumeration + case 278: // EnumeratedType + case 279: // Enumerations + case 280: // Enumeration value.template destroy< EnumeratedType > (); break; - case 282: // EnumerationItem + case 281: // EnumerationItem value.template destroy< EnumerationValue > (); break; - case 322: // ExternalType + case 321: // ExternalType value.template destroy< ExternalType > (); break; - case 315: // IRIType + case 314: // IRIType value.template destroy< IRIType > (); break; @@ -2050,7 +2087,7 @@ switch (yytype) value.template destroy< InstanceOfType > (); break; - case 275: // IntegerType + case 274: // IntegerType value.template destroy< IntegerType > (); break; @@ -2058,15 +2095,15 @@ switch (yytype) value.template destroy< Module > (); break; - case 277: // NamedNumber + case 276: // NamedNumber value.template destroy< NamedNumber > (); break; - case 266: // NamedType + case 265: // NamedType value.template destroy< NamedType > (); break; - case 288: // NullType + case 287: // NullType value.template destroy< NullType > (); break; @@ -2079,18 +2116,18 @@ switch (yytype) value.template destroy< ObjectClassFieldType > (); break; - case 310: // ObjIdComponents - case 311: // NameForm - case 312: // NumberForm - case 313: // NameAndNumberForm + case 309: // ObjIdComponents + case 310: // NameForm + case 311: // NumberForm + case 312: // NameAndNumberForm value.template destroy< ObjectIdComponentValue > (); break; - case 307: // ObjectIdentifierType + case 306: // ObjectIdentifierType value.template destroy< ObjectIdentifierType > (); break; - case 287: // OctetStringType + case 286: // OctetStringType value.template destroy< OctetStringType > (); break; @@ -2098,43 +2135,43 @@ switch (yytype) value.template destroy< Parameter > (); break; - case 301: // PrefixedType + case 300: // PrefixedType value.template destroy< PrefixedType > (); break; - case 283: // RealType + case 282: // RealType value.template destroy< RealType > (); break; - case 320: // RelativeIRIType + case 319: // RelativeIRIType value.template destroy< RelativeIRIType > (); break; - case 314: // RelativeOIDType + case 313: // RelativeOIDType value.template destroy< RelativeOIDType > (); break; - case 293: // SequenceOfType + case 292: // SequenceOfType value.template destroy< SequenceOfType > (); break; - case 289: // SequenceType + case 288: // SequenceType value.template destroy< SequenceType > (); break; - case 295: // SetOfType + case 294: // SetOfType value.template destroy< SetOfType > (); break; - case 294: // SetType + case 293: // SetType value.template destroy< SetType > (); break; - case 303: // Tag + case 302: // Tag value.template destroy< Tag > (); break; - case 302: // TaggedType + case 301: // TaggedType value.template destroy< TaggedType > (); break; @@ -2142,26 +2179,30 @@ switch (yytype) value.template destroy< TaggingMode > (); break; - case 326: // TimeOfDayType + case 325: // TimeOfDayType value.template destroy< TimeOfDayType > (); break; - case 323: // TimeType + case 322: // TimeType value.template destroy< TimeType > (); break; + case 323: // TimeValue + value.template destroy< TimeValue > (); + break; + case 211: // ParamGovernor case 212: // Governor - case 258: // ActualParameter - case 264: // Type - case 332: // ConstrainedType - case 333: // TypeWithConstraint + case 257: // ActualParameter + case 263: // Type + case 331: // ConstrainedType + case 332: // TypeWithConstraint value.template destroy< Type > (); break; - case 267: // ValueWithoutTypeIdentifier - case 268: // Value - case 350: // SingleValue + case 266: // ValueWithoutTypeIdentifier + case 267: // Value + case 349: // SingleValue value.template destroy< Value > (); break; @@ -2169,14 +2210,14 @@ switch (yytype) value.template destroy< double > (); break; - case 305: // ClassNumber + case 304: // ClassNumber value.template destroy< int > (); break; case 4: // number case 5: // negativenumber - case 278: // SignedNumber - value.template destroy< long long > (); + case 277: // SignedNumber + value.template destroy< int64_t > (); break; case 7: // bstring @@ -2197,18 +2238,18 @@ switch (yytype) case 216: // SimpleDefinedType case 228: // ModuleIdentifier case 246: // GlobalModuleReference - case 249: // Symbol - case 250: // Reference - case 373: // typereference - case 374: // identifier - case 375: // valuereference - case 376: // modulereference - case 377: // objectclassreference - case 378: // word + case 248: // Symbol + case 249: // Reference + case 372: // typereference + case 373: // identifier + case 374: // valuereference + case 375: // modulereference + case 376: // objectclassreference + case 377: // word value.template destroy< std::string > (); break; - case 251: // AssignmentList + case 250: // AssignmentList value.template destroy< std::vector > (); break; @@ -2229,18 +2270,18 @@ switch (yytype) value.template destroy< std::vector > (); break; - case 276: // NamedNumberList + case 275: // NamedNumberList value.template destroy< std::vector > (); break; - case 297: // AlternativeTypeLists - case 298: // RootAlternativeTypeList - case 299: // AlternativeTypeList + case 296: // AlternativeTypeLists + case 297: // RootAlternativeTypeList + case 298: // AlternativeTypeList value.template destroy< std::vector > (); break; - case 308: // ObjectIdentifierValue - case 309: // ObjIdComponentsList + case 307: // ObjectIdentifierValue + case 308: // ObjIdComponentsList value.template destroy< std::vector > (); break; @@ -2249,17 +2290,17 @@ switch (yytype) value.template destroy< std::vector > (); break; - case 257: // ActualParameterList + case 256: // ActualParameterList value.template destroy< std::vector > (); break; - case 272: // SequenceOfValues + case 271: // SequenceOfValues value.template destroy< std::vector > (); break; case 166: // FieldNameList case 168: // OneOrManyTypeFieldReference - case 248: // SymbolList + case 247: // SymbolList value.template destroy< std::vector > (); break; @@ -2365,13 +2406,13 @@ switch (yytype) } #endif #if 201103L <= YY_CPLUSPLUS - symbol_type (int tok, long long v, location_type l) + symbol_type (int tok, int64_t v, location_type l) : super_type(token_type (tok), std::move (v), std::move (l)) { YYASSERT (tok == token::number || tok == token::negativenumber); } #else - symbol_type (int tok, const long long& v, const location_type& l) + symbol_type (int tok, const int64_t& v, const location_type& l) : super_type(token_type (tok), v, l) { YYASSERT (tok == token::number || tok == token::negativenumber); @@ -2460,14 +2501,14 @@ switch (yytype) #if 201103L <= YY_CPLUSPLUS static symbol_type - make_number (long long v, location_type l) + make_number (int64_t v, location_type l) { return symbol_type (token::number, std::move (v), std::move (l)); } #else static symbol_type - make_number (const long long& v, const location_type& l) + make_number (const int64_t& v, const location_type& l) { return symbol_type (token::number, v, l); } @@ -2475,14 +2516,14 @@ switch (yytype) #if 201103L <= YY_CPLUSPLUS static symbol_type - make_negativenumber (long long v, location_type l) + make_negativenumber (int64_t v, location_type l) { return symbol_type (token::negativenumber, std::move (v), std::move (l)); } #else static symbol_type - make_negativenumber (const long long& v, const location_type& l) + make_negativenumber (const int64_t& v, const location_type& l) { return symbol_type (token::negativenumber, v, l); } @@ -4953,8 +4994,8 @@ switch (yytype) enum { yyeof_ = 0, - yylast_ = 4825, ///< Last index in yytable_. - yynnts_ = 226, ///< Number of nonterminal symbols. + yylast_ = 5042, ///< Last index in yytable_. + yynnts_ = 225, ///< Number of nonterminal symbols. yyfinal_ = 6, ///< Termination state number. yyterror_ = 1, yyerrcode_ = 256, @@ -5045,89 +5086,93 @@ switch (yytype) case 205: // ParameterizedValueAssignment case 206: // ParameterizedValueSetTypeAssignment case 207: // ParameterizedObjectClassAssignment - case 252: // Assignment - case 261: // TypeAssignment - case 262: // ValueAssignment - case 263: // ValueSetTypeAssignment + case 251: // Assignment + case 260: // TypeAssignment + case 261: // ValueAssignment + case 262: // ValueSetTypeAssignment value.move< Assignment > (std::move (that.value)); break; - case 284: // BitStringType + case 283: // BitStringType value.move< BitStringType > (std::move (that.value)); break; - case 273: // BooleanType + case 272: // BooleanType value.move< BooleanType > (std::move (that.value)); break; - case 265: // BuiltinType + case 273: // BooleanValue + value.move< BooleanValue > (std::move (that.value)); + break; + + case 264: // BuiltinType value.move< BuiltinType > (std::move (that.value)); break; - case 329: // CharacterStringType - case 330: // RestrictedCharacterStringType - case 331: // UnrestrictedCharacterStringType + case 328: // CharacterStringType + case 329: // RestrictedCharacterStringType + case 330: // UnrestrictedCharacterStringType value.move< CharacterStringType > (std::move (that.value)); break; - case 296: // ChoiceType + case 295: // ChoiceType value.move< ChoiceType > (std::move (that.value)); break; - case 306: // Class + case 305: // Class value.move< Class > (std::move (that.value)); break; - case 292: // ComponentType + case 291: // ComponentType value.move< ComponentType > (std::move (that.value)); break; - case 290: // ComponentTypeLists - case 291: // ComponentTypeList + case 289: // ComponentTypeLists + case 290: // ComponentTypeList value.move< ComponentTypeList > (std::move (that.value)); break; - case 327: // DateTimeType + case 326: // DateTimeType value.move< DateTimeType > (std::move (that.value)); break; - case 325: // DateType + case 324: // DateType value.move< DateType > (std::move (that.value)); break; - case 253: // DefinedType - case 255: // ParameterizedType - case 259: // ExternalTypeReference + case 252: // DefinedType + case 254: // ParameterizedType + case 258: // ExternalTypeReference value.move< DefinedType > (std::move (that.value)); break; - case 254: // DefinedValue + case 253: // DefinedValue value.move< DefinedValue > (std::move (that.value)); break; - case 328: // DurationType + case 327: // DurationType value.move< DurationType > (std::move (that.value)); break; - case 321: // EmbeddedPDVType + case 320: // EmbeddedPDVType value.move< EmbeddedPDVType > (std::move (that.value)); break; - case 279: // EnumeratedType - case 280: // Enumerations - case 281: // Enumeration + case 278: // EnumeratedType + case 279: // Enumerations + case 280: // Enumeration value.move< EnumeratedType > (std::move (that.value)); break; - case 282: // EnumerationItem + case 281: // EnumerationItem value.move< EnumerationValue > (std::move (that.value)); break; - case 322: // ExternalType + case 321: // ExternalType value.move< ExternalType > (std::move (that.value)); break; - case 315: // IRIType + case 314: // IRIType value.move< IRIType > (std::move (that.value)); break; @@ -5139,7 +5184,7 @@ switch (yytype) value.move< InstanceOfType > (std::move (that.value)); break; - case 275: // IntegerType + case 274: // IntegerType value.move< IntegerType > (std::move (that.value)); break; @@ -5147,15 +5192,15 @@ switch (yytype) value.move< Module > (std::move (that.value)); break; - case 277: // NamedNumber + case 276: // NamedNumber value.move< NamedNumber > (std::move (that.value)); break; - case 266: // NamedType + case 265: // NamedType value.move< NamedType > (std::move (that.value)); break; - case 288: // NullType + case 287: // NullType value.move< NullType > (std::move (that.value)); break; @@ -5168,18 +5213,18 @@ switch (yytype) value.move< ObjectClassFieldType > (std::move (that.value)); break; - case 310: // ObjIdComponents - case 311: // NameForm - case 312: // NumberForm - case 313: // NameAndNumberForm + case 309: // ObjIdComponents + case 310: // NameForm + case 311: // NumberForm + case 312: // NameAndNumberForm value.move< ObjectIdComponentValue > (std::move (that.value)); break; - case 307: // ObjectIdentifierType + case 306: // ObjectIdentifierType value.move< ObjectIdentifierType > (std::move (that.value)); break; - case 287: // OctetStringType + case 286: // OctetStringType value.move< OctetStringType > (std::move (that.value)); break; @@ -5187,43 +5232,43 @@ switch (yytype) value.move< Parameter > (std::move (that.value)); break; - case 301: // PrefixedType + case 300: // PrefixedType value.move< PrefixedType > (std::move (that.value)); break; - case 283: // RealType + case 282: // RealType value.move< RealType > (std::move (that.value)); break; - case 320: // RelativeIRIType + case 319: // RelativeIRIType value.move< RelativeIRIType > (std::move (that.value)); break; - case 314: // RelativeOIDType + case 313: // RelativeOIDType value.move< RelativeOIDType > (std::move (that.value)); break; - case 293: // SequenceOfType + case 292: // SequenceOfType value.move< SequenceOfType > (std::move (that.value)); break; - case 289: // SequenceType + case 288: // SequenceType value.move< SequenceType > (std::move (that.value)); break; - case 295: // SetOfType + case 294: // SetOfType value.move< SetOfType > (std::move (that.value)); break; - case 294: // SetType + case 293: // SetType value.move< SetType > (std::move (that.value)); break; - case 303: // Tag + case 302: // Tag value.move< Tag > (std::move (that.value)); break; - case 302: // TaggedType + case 301: // TaggedType value.move< TaggedType > (std::move (that.value)); break; @@ -5231,26 +5276,30 @@ switch (yytype) value.move< TaggingMode > (std::move (that.value)); break; - case 326: // TimeOfDayType + case 325: // TimeOfDayType value.move< TimeOfDayType > (std::move (that.value)); break; - case 323: // TimeType + case 322: // TimeType value.move< TimeType > (std::move (that.value)); break; + case 323: // TimeValue + value.move< TimeValue > (std::move (that.value)); + break; + case 211: // ParamGovernor case 212: // Governor - case 258: // ActualParameter - case 264: // Type - case 332: // ConstrainedType - case 333: // TypeWithConstraint + case 257: // ActualParameter + case 263: // Type + case 331: // ConstrainedType + case 332: // TypeWithConstraint value.move< Type > (std::move (that.value)); break; - case 267: // ValueWithoutTypeIdentifier - case 268: // Value - case 350: // SingleValue + case 266: // ValueWithoutTypeIdentifier + case 267: // Value + case 349: // SingleValue value.move< Value > (std::move (that.value)); break; @@ -5258,14 +5307,14 @@ switch (yytype) value.move< double > (std::move (that.value)); break; - case 305: // ClassNumber + case 304: // ClassNumber value.move< int > (std::move (that.value)); break; case 4: // number case 5: // negativenumber - case 278: // SignedNumber - value.move< long long > (std::move (that.value)); + case 277: // SignedNumber + value.move< int64_t > (std::move (that.value)); break; case 7: // bstring @@ -5286,18 +5335,18 @@ switch (yytype) case 216: // SimpleDefinedType case 228: // ModuleIdentifier case 246: // GlobalModuleReference - case 249: // Symbol - case 250: // Reference - case 373: // typereference - case 374: // identifier - case 375: // valuereference - case 376: // modulereference - case 377: // objectclassreference - case 378: // word + case 248: // Symbol + case 249: // Reference + case 372: // typereference + case 373: // identifier + case 374: // valuereference + case 375: // modulereference + case 376: // objectclassreference + case 377: // word value.move< std::string > (std::move (that.value)); break; - case 251: // AssignmentList + case 250: // AssignmentList value.move< std::vector > (std::move (that.value)); break; @@ -5318,18 +5367,18 @@ switch (yytype) value.move< std::vector > (std::move (that.value)); break; - case 276: // NamedNumberList + case 275: // NamedNumberList value.move< std::vector > (std::move (that.value)); break; - case 297: // AlternativeTypeLists - case 298: // RootAlternativeTypeList - case 299: // AlternativeTypeList + case 296: // AlternativeTypeLists + case 297: // RootAlternativeTypeList + case 298: // AlternativeTypeList value.move< std::vector > (std::move (that.value)); break; - case 308: // ObjectIdentifierValue - case 309: // ObjIdComponentsList + case 307: // ObjectIdentifierValue + case 308: // ObjIdComponentsList value.move< std::vector > (std::move (that.value)); break; @@ -5338,17 +5387,17 @@ switch (yytype) value.move< std::vector > (std::move (that.value)); break; - case 257: // ActualParameterList + case 256: // ActualParameterList value.move< std::vector > (std::move (that.value)); break; - case 272: // SequenceOfValues + case 271: // SequenceOfValues value.move< std::vector > (std::move (that.value)); break; case 166: // FieldNameList case 168: // OneOrManyTypeFieldReference - case 248: // SymbolList + case 247: // SymbolList value.move< std::vector > (std::move (that.value)); break; @@ -5374,89 +5423,93 @@ switch (yytype) case 205: // ParameterizedValueAssignment case 206: // ParameterizedValueSetTypeAssignment case 207: // ParameterizedObjectClassAssignment - case 252: // Assignment - case 261: // TypeAssignment - case 262: // ValueAssignment - case 263: // ValueSetTypeAssignment + case 251: // Assignment + case 260: // TypeAssignment + case 261: // ValueAssignment + case 262: // ValueSetTypeAssignment value.copy< Assignment > (YY_MOVE (that.value)); break; - case 284: // BitStringType + case 283: // BitStringType value.copy< BitStringType > (YY_MOVE (that.value)); break; - case 273: // BooleanType + case 272: // BooleanType value.copy< BooleanType > (YY_MOVE (that.value)); break; - case 265: // BuiltinType + case 273: // BooleanValue + value.copy< BooleanValue > (YY_MOVE (that.value)); + break; + + case 264: // BuiltinType value.copy< BuiltinType > (YY_MOVE (that.value)); break; - case 329: // CharacterStringType - case 330: // RestrictedCharacterStringType - case 331: // UnrestrictedCharacterStringType + case 328: // CharacterStringType + case 329: // RestrictedCharacterStringType + case 330: // UnrestrictedCharacterStringType value.copy< CharacterStringType > (YY_MOVE (that.value)); break; - case 296: // ChoiceType + case 295: // ChoiceType value.copy< ChoiceType > (YY_MOVE (that.value)); break; - case 306: // Class + case 305: // Class value.copy< Class > (YY_MOVE (that.value)); break; - case 292: // ComponentType + case 291: // ComponentType value.copy< ComponentType > (YY_MOVE (that.value)); break; - case 290: // ComponentTypeLists - case 291: // ComponentTypeList + case 289: // ComponentTypeLists + case 290: // ComponentTypeList value.copy< ComponentTypeList > (YY_MOVE (that.value)); break; - case 327: // DateTimeType + case 326: // DateTimeType value.copy< DateTimeType > (YY_MOVE (that.value)); break; - case 325: // DateType + case 324: // DateType value.copy< DateType > (YY_MOVE (that.value)); break; - case 253: // DefinedType - case 255: // ParameterizedType - case 259: // ExternalTypeReference + case 252: // DefinedType + case 254: // ParameterizedType + case 258: // ExternalTypeReference value.copy< DefinedType > (YY_MOVE (that.value)); break; - case 254: // DefinedValue + case 253: // DefinedValue value.copy< DefinedValue > (YY_MOVE (that.value)); break; - case 328: // DurationType + case 327: // DurationType value.copy< DurationType > (YY_MOVE (that.value)); break; - case 321: // EmbeddedPDVType + case 320: // EmbeddedPDVType value.copy< EmbeddedPDVType > (YY_MOVE (that.value)); break; - case 279: // EnumeratedType - case 280: // Enumerations - case 281: // Enumeration + case 278: // EnumeratedType + case 279: // Enumerations + case 280: // Enumeration value.copy< EnumeratedType > (YY_MOVE (that.value)); break; - case 282: // EnumerationItem + case 281: // EnumerationItem value.copy< EnumerationValue > (YY_MOVE (that.value)); break; - case 322: // ExternalType + case 321: // ExternalType value.copy< ExternalType > (YY_MOVE (that.value)); break; - case 315: // IRIType + case 314: // IRIType value.copy< IRIType > (YY_MOVE (that.value)); break; @@ -5468,7 +5521,7 @@ switch (yytype) value.copy< InstanceOfType > (YY_MOVE (that.value)); break; - case 275: // IntegerType + case 274: // IntegerType value.copy< IntegerType > (YY_MOVE (that.value)); break; @@ -5476,15 +5529,15 @@ switch (yytype) value.copy< Module > (YY_MOVE (that.value)); break; - case 277: // NamedNumber + case 276: // NamedNumber value.copy< NamedNumber > (YY_MOVE (that.value)); break; - case 266: // NamedType + case 265: // NamedType value.copy< NamedType > (YY_MOVE (that.value)); break; - case 288: // NullType + case 287: // NullType value.copy< NullType > (YY_MOVE (that.value)); break; @@ -5497,18 +5550,18 @@ switch (yytype) value.copy< ObjectClassFieldType > (YY_MOVE (that.value)); break; - case 310: // ObjIdComponents - case 311: // NameForm - case 312: // NumberForm - case 313: // NameAndNumberForm + case 309: // ObjIdComponents + case 310: // NameForm + case 311: // NumberForm + case 312: // NameAndNumberForm value.copy< ObjectIdComponentValue > (YY_MOVE (that.value)); break; - case 307: // ObjectIdentifierType + case 306: // ObjectIdentifierType value.copy< ObjectIdentifierType > (YY_MOVE (that.value)); break; - case 287: // OctetStringType + case 286: // OctetStringType value.copy< OctetStringType > (YY_MOVE (that.value)); break; @@ -5516,43 +5569,43 @@ switch (yytype) value.copy< Parameter > (YY_MOVE (that.value)); break; - case 301: // PrefixedType + case 300: // PrefixedType value.copy< PrefixedType > (YY_MOVE (that.value)); break; - case 283: // RealType + case 282: // RealType value.copy< RealType > (YY_MOVE (that.value)); break; - case 320: // RelativeIRIType + case 319: // RelativeIRIType value.copy< RelativeIRIType > (YY_MOVE (that.value)); break; - case 314: // RelativeOIDType + case 313: // RelativeOIDType value.copy< RelativeOIDType > (YY_MOVE (that.value)); break; - case 293: // SequenceOfType + case 292: // SequenceOfType value.copy< SequenceOfType > (YY_MOVE (that.value)); break; - case 289: // SequenceType + case 288: // SequenceType value.copy< SequenceType > (YY_MOVE (that.value)); break; - case 295: // SetOfType + case 294: // SetOfType value.copy< SetOfType > (YY_MOVE (that.value)); break; - case 294: // SetType + case 293: // SetType value.copy< SetType > (YY_MOVE (that.value)); break; - case 303: // Tag + case 302: // Tag value.copy< Tag > (YY_MOVE (that.value)); break; - case 302: // TaggedType + case 301: // TaggedType value.copy< TaggedType > (YY_MOVE (that.value)); break; @@ -5560,26 +5613,30 @@ switch (yytype) value.copy< TaggingMode > (YY_MOVE (that.value)); break; - case 326: // TimeOfDayType + case 325: // TimeOfDayType value.copy< TimeOfDayType > (YY_MOVE (that.value)); break; - case 323: // TimeType + case 322: // TimeType value.copy< TimeType > (YY_MOVE (that.value)); break; + case 323: // TimeValue + value.copy< TimeValue > (YY_MOVE (that.value)); + break; + case 211: // ParamGovernor case 212: // Governor - case 258: // ActualParameter - case 264: // Type - case 332: // ConstrainedType - case 333: // TypeWithConstraint + case 257: // ActualParameter + case 263: // Type + case 331: // ConstrainedType + case 332: // TypeWithConstraint value.copy< Type > (YY_MOVE (that.value)); break; - case 267: // ValueWithoutTypeIdentifier - case 268: // Value - case 350: // SingleValue + case 266: // ValueWithoutTypeIdentifier + case 267: // Value + case 349: // SingleValue value.copy< Value > (YY_MOVE (that.value)); break; @@ -5587,14 +5644,14 @@ switch (yytype) value.copy< double > (YY_MOVE (that.value)); break; - case 305: // ClassNumber + case 304: // ClassNumber value.copy< int > (YY_MOVE (that.value)); break; case 4: // number case 5: // negativenumber - case 278: // SignedNumber - value.copy< long long > (YY_MOVE (that.value)); + case 277: // SignedNumber + value.copy< int64_t > (YY_MOVE (that.value)); break; case 7: // bstring @@ -5615,18 +5672,18 @@ switch (yytype) case 216: // SimpleDefinedType case 228: // ModuleIdentifier case 246: // GlobalModuleReference - case 249: // Symbol - case 250: // Reference - case 373: // typereference - case 374: // identifier - case 375: // valuereference - case 376: // modulereference - case 377: // objectclassreference - case 378: // word + case 248: // Symbol + case 249: // Reference + case 372: // typereference + case 373: // identifier + case 374: // valuereference + case 375: // modulereference + case 376: // objectclassreference + case 377: // word value.copy< std::string > (YY_MOVE (that.value)); break; - case 251: // AssignmentList + case 250: // AssignmentList value.copy< std::vector > (YY_MOVE (that.value)); break; @@ -5647,18 +5704,18 @@ switch (yytype) value.copy< std::vector > (YY_MOVE (that.value)); break; - case 276: // NamedNumberList + case 275: // NamedNumberList value.copy< std::vector > (YY_MOVE (that.value)); break; - case 297: // AlternativeTypeLists - case 298: // RootAlternativeTypeList - case 299: // AlternativeTypeList + case 296: // AlternativeTypeLists + case 297: // RootAlternativeTypeList + case 298: // AlternativeTypeList value.copy< std::vector > (YY_MOVE (that.value)); break; - case 308: // ObjectIdentifierValue - case 309: // ObjIdComponentsList + case 307: // ObjectIdentifierValue + case 308: // ObjIdComponentsList value.copy< std::vector > (YY_MOVE (that.value)); break; @@ -5667,17 +5724,17 @@ switch (yytype) value.copy< std::vector > (YY_MOVE (that.value)); break; - case 257: // ActualParameterList + case 256: // ActualParameterList value.copy< std::vector > (YY_MOVE (that.value)); break; - case 272: // SequenceOfValues + case 271: // SequenceOfValues value.copy< std::vector > (YY_MOVE (that.value)); break; case 166: // FieldNameList case 168: // OneOrManyTypeFieldReference - case 248: // SymbolList + case 247: // SymbolList value.copy< std::vector > (YY_MOVE (that.value)); break; @@ -5710,89 +5767,93 @@ switch (yytype) case 205: // ParameterizedValueAssignment case 206: // ParameterizedValueSetTypeAssignment case 207: // ParameterizedObjectClassAssignment - case 252: // Assignment - case 261: // TypeAssignment - case 262: // ValueAssignment - case 263: // ValueSetTypeAssignment + case 251: // Assignment + case 260: // TypeAssignment + case 261: // ValueAssignment + case 262: // ValueSetTypeAssignment value.move< Assignment > (YY_MOVE (s.value)); break; - case 284: // BitStringType + case 283: // BitStringType value.move< BitStringType > (YY_MOVE (s.value)); break; - case 273: // BooleanType + case 272: // BooleanType value.move< BooleanType > (YY_MOVE (s.value)); break; - case 265: // BuiltinType + case 273: // BooleanValue + value.move< BooleanValue > (YY_MOVE (s.value)); + break; + + case 264: // BuiltinType value.move< BuiltinType > (YY_MOVE (s.value)); break; - case 329: // CharacterStringType - case 330: // RestrictedCharacterStringType - case 331: // UnrestrictedCharacterStringType + case 328: // CharacterStringType + case 329: // RestrictedCharacterStringType + case 330: // UnrestrictedCharacterStringType value.move< CharacterStringType > (YY_MOVE (s.value)); break; - case 296: // ChoiceType + case 295: // ChoiceType value.move< ChoiceType > (YY_MOVE (s.value)); break; - case 306: // Class + case 305: // Class value.move< Class > (YY_MOVE (s.value)); break; - case 292: // ComponentType + case 291: // ComponentType value.move< ComponentType > (YY_MOVE (s.value)); break; - case 290: // ComponentTypeLists - case 291: // ComponentTypeList + case 289: // ComponentTypeLists + case 290: // ComponentTypeList value.move< ComponentTypeList > (YY_MOVE (s.value)); break; - case 327: // DateTimeType + case 326: // DateTimeType value.move< DateTimeType > (YY_MOVE (s.value)); break; - case 325: // DateType + case 324: // DateType value.move< DateType > (YY_MOVE (s.value)); break; - case 253: // DefinedType - case 255: // ParameterizedType - case 259: // ExternalTypeReference + case 252: // DefinedType + case 254: // ParameterizedType + case 258: // ExternalTypeReference value.move< DefinedType > (YY_MOVE (s.value)); break; - case 254: // DefinedValue + case 253: // DefinedValue value.move< DefinedValue > (YY_MOVE (s.value)); break; - case 328: // DurationType + case 327: // DurationType value.move< DurationType > (YY_MOVE (s.value)); break; - case 321: // EmbeddedPDVType + case 320: // EmbeddedPDVType value.move< EmbeddedPDVType > (YY_MOVE (s.value)); break; - case 279: // EnumeratedType - case 280: // Enumerations - case 281: // Enumeration + case 278: // EnumeratedType + case 279: // Enumerations + case 280: // Enumeration value.move< EnumeratedType > (YY_MOVE (s.value)); break; - case 282: // EnumerationItem + case 281: // EnumerationItem value.move< EnumerationValue > (YY_MOVE (s.value)); break; - case 322: // ExternalType + case 321: // ExternalType value.move< ExternalType > (YY_MOVE (s.value)); break; - case 315: // IRIType + case 314: // IRIType value.move< IRIType > (YY_MOVE (s.value)); break; @@ -5804,7 +5865,7 @@ switch (yytype) value.move< InstanceOfType > (YY_MOVE (s.value)); break; - case 275: // IntegerType + case 274: // IntegerType value.move< IntegerType > (YY_MOVE (s.value)); break; @@ -5812,15 +5873,15 @@ switch (yytype) value.move< Module > (YY_MOVE (s.value)); break; - case 277: // NamedNumber + case 276: // NamedNumber value.move< NamedNumber > (YY_MOVE (s.value)); break; - case 266: // NamedType + case 265: // NamedType value.move< NamedType > (YY_MOVE (s.value)); break; - case 288: // NullType + case 287: // NullType value.move< NullType > (YY_MOVE (s.value)); break; @@ -5833,18 +5894,18 @@ switch (yytype) value.move< ObjectClassFieldType > (YY_MOVE (s.value)); break; - case 310: // ObjIdComponents - case 311: // NameForm - case 312: // NumberForm - case 313: // NameAndNumberForm + case 309: // ObjIdComponents + case 310: // NameForm + case 311: // NumberForm + case 312: // NameAndNumberForm value.move< ObjectIdComponentValue > (YY_MOVE (s.value)); break; - case 307: // ObjectIdentifierType + case 306: // ObjectIdentifierType value.move< ObjectIdentifierType > (YY_MOVE (s.value)); break; - case 287: // OctetStringType + case 286: // OctetStringType value.move< OctetStringType > (YY_MOVE (s.value)); break; @@ -5852,43 +5913,43 @@ switch (yytype) value.move< Parameter > (YY_MOVE (s.value)); break; - case 301: // PrefixedType + case 300: // PrefixedType value.move< PrefixedType > (YY_MOVE (s.value)); break; - case 283: // RealType + case 282: // RealType value.move< RealType > (YY_MOVE (s.value)); break; - case 320: // RelativeIRIType + case 319: // RelativeIRIType value.move< RelativeIRIType > (YY_MOVE (s.value)); break; - case 314: // RelativeOIDType + case 313: // RelativeOIDType value.move< RelativeOIDType > (YY_MOVE (s.value)); break; - case 293: // SequenceOfType + case 292: // SequenceOfType value.move< SequenceOfType > (YY_MOVE (s.value)); break; - case 289: // SequenceType + case 288: // SequenceType value.move< SequenceType > (YY_MOVE (s.value)); break; - case 295: // SetOfType + case 294: // SetOfType value.move< SetOfType > (YY_MOVE (s.value)); break; - case 294: // SetType + case 293: // SetType value.move< SetType > (YY_MOVE (s.value)); break; - case 303: // Tag + case 302: // Tag value.move< Tag > (YY_MOVE (s.value)); break; - case 302: // TaggedType + case 301: // TaggedType value.move< TaggedType > (YY_MOVE (s.value)); break; @@ -5896,26 +5957,30 @@ switch (yytype) value.move< TaggingMode > (YY_MOVE (s.value)); break; - case 326: // TimeOfDayType + case 325: // TimeOfDayType value.move< TimeOfDayType > (YY_MOVE (s.value)); break; - case 323: // TimeType + case 322: // TimeType value.move< TimeType > (YY_MOVE (s.value)); break; + case 323: // TimeValue + value.move< TimeValue > (YY_MOVE (s.value)); + break; + case 211: // ParamGovernor case 212: // Governor - case 258: // ActualParameter - case 264: // Type - case 332: // ConstrainedType - case 333: // TypeWithConstraint + case 257: // ActualParameter + case 263: // Type + case 331: // ConstrainedType + case 332: // TypeWithConstraint value.move< Type > (YY_MOVE (s.value)); break; - case 267: // ValueWithoutTypeIdentifier - case 268: // Value - case 350: // SingleValue + case 266: // ValueWithoutTypeIdentifier + case 267: // Value + case 349: // SingleValue value.move< Value > (YY_MOVE (s.value)); break; @@ -5923,14 +5988,14 @@ switch (yytype) value.move< double > (YY_MOVE (s.value)); break; - case 305: // ClassNumber + case 304: // ClassNumber value.move< int > (YY_MOVE (s.value)); break; case 4: // number case 5: // negativenumber - case 278: // SignedNumber - value.move< long long > (YY_MOVE (s.value)); + case 277: // SignedNumber + value.move< int64_t > (YY_MOVE (s.value)); break; case 7: // bstring @@ -5951,18 +6016,18 @@ switch (yytype) case 216: // SimpleDefinedType case 228: // ModuleIdentifier case 246: // GlobalModuleReference - case 249: // Symbol - case 250: // Reference - case 373: // typereference - case 374: // identifier - case 375: // valuereference - case 376: // modulereference - case 377: // objectclassreference - case 378: // word + case 248: // Symbol + case 249: // Reference + case 372: // typereference + case 373: // identifier + case 374: // valuereference + case 375: // modulereference + case 376: // objectclassreference + case 377: // word value.move< std::string > (YY_MOVE (s.value)); break; - case 251: // AssignmentList + case 250: // AssignmentList value.move< std::vector > (YY_MOVE (s.value)); break; @@ -5983,18 +6048,18 @@ switch (yytype) value.move< std::vector > (YY_MOVE (s.value)); break; - case 276: // NamedNumberList + case 275: // NamedNumberList value.move< std::vector > (YY_MOVE (s.value)); break; - case 297: // AlternativeTypeLists - case 298: // RootAlternativeTypeList - case 299: // AlternativeTypeList + case 296: // AlternativeTypeLists + case 297: // RootAlternativeTypeList + case 298: // AlternativeTypeList value.move< std::vector > (YY_MOVE (s.value)); break; - case 308: // ObjectIdentifierValue - case 309: // ObjIdComponentsList + case 307: // ObjectIdentifierValue + case 308: // ObjIdComponentsList value.move< std::vector > (YY_MOVE (s.value)); break; @@ -6003,17 +6068,17 @@ switch (yytype) value.move< std::vector > (YY_MOVE (s.value)); break; - case 257: // ActualParameterList + case 256: // ActualParameterList value.move< std::vector > (YY_MOVE (s.value)); break; - case 272: // SequenceOfValues + case 271: // SequenceOfValues value.move< std::vector > (YY_MOVE (s.value)); break; case 166: // FieldNameList case 168: // OneOrManyTypeFieldReference - case 248: // SymbolList + case 247: // SymbolList value.move< std::vector > (YY_MOVE (s.value)); break; @@ -6095,7 +6160,7 @@ switch (yytype) } // yy -#line 6097 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:431 +#line 6162 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:431 @@ -6103,7 +6168,7 @@ switch (yytype) // Unqualified %code blocks. -#line 15 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:435 +#line 16 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:435 struct Context { @@ -6114,13 +6179,12 @@ switch (yytype) }; void yy::asn1_parser::error(const location_type& l, const std::string& m) { - std::cerr << (l.begin.filename ? l.begin.filename->c_str() : "(undefined)"); - std::cerr << ':' << l.begin.line << ':' << l.begin.column << '-' << l.end.column << ": " << m << '\n'; + std::cerr << l << m << '\n'; } namespace yy { asn1_parser::symbol_type yylex(Context& c); } -#line 6122 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:435 +#line 6186 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:435 #ifndef YY_ @@ -6215,7 +6279,7 @@ switch (yytype) namespace yy { -#line 6217 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:510 +#line 6281 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:510 /* Return YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is @@ -6330,89 +6394,93 @@ namespace yy { case 205: // ParameterizedValueAssignment case 206: // ParameterizedValueSetTypeAssignment case 207: // ParameterizedObjectClassAssignment - case 252: // Assignment - case 261: // TypeAssignment - case 262: // ValueAssignment - case 263: // ValueSetTypeAssignment + case 251: // Assignment + case 260: // TypeAssignment + case 261: // ValueAssignment + case 262: // ValueSetTypeAssignment value.YY_MOVE_OR_COPY< Assignment > (YY_MOVE (that.value)); break; - case 284: // BitStringType + case 283: // BitStringType value.YY_MOVE_OR_COPY< BitStringType > (YY_MOVE (that.value)); break; - case 273: // BooleanType + case 272: // BooleanType value.YY_MOVE_OR_COPY< BooleanType > (YY_MOVE (that.value)); break; - case 265: // BuiltinType + case 273: // BooleanValue + value.YY_MOVE_OR_COPY< BooleanValue > (YY_MOVE (that.value)); + break; + + case 264: // BuiltinType value.YY_MOVE_OR_COPY< BuiltinType > (YY_MOVE (that.value)); break; - case 329: // CharacterStringType - case 330: // RestrictedCharacterStringType - case 331: // UnrestrictedCharacterStringType + case 328: // CharacterStringType + case 329: // RestrictedCharacterStringType + case 330: // UnrestrictedCharacterStringType value.YY_MOVE_OR_COPY< CharacterStringType > (YY_MOVE (that.value)); break; - case 296: // ChoiceType + case 295: // ChoiceType value.YY_MOVE_OR_COPY< ChoiceType > (YY_MOVE (that.value)); break; - case 306: // Class + case 305: // Class value.YY_MOVE_OR_COPY< Class > (YY_MOVE (that.value)); break; - case 292: // ComponentType + case 291: // ComponentType value.YY_MOVE_OR_COPY< ComponentType > (YY_MOVE (that.value)); break; - case 290: // ComponentTypeLists - case 291: // ComponentTypeList + case 289: // ComponentTypeLists + case 290: // ComponentTypeList value.YY_MOVE_OR_COPY< ComponentTypeList > (YY_MOVE (that.value)); break; - case 327: // DateTimeType + case 326: // DateTimeType value.YY_MOVE_OR_COPY< DateTimeType > (YY_MOVE (that.value)); break; - case 325: // DateType + case 324: // DateType value.YY_MOVE_OR_COPY< DateType > (YY_MOVE (that.value)); break; - case 253: // DefinedType - case 255: // ParameterizedType - case 259: // ExternalTypeReference + case 252: // DefinedType + case 254: // ParameterizedType + case 258: // ExternalTypeReference value.YY_MOVE_OR_COPY< DefinedType > (YY_MOVE (that.value)); break; - case 254: // DefinedValue + case 253: // DefinedValue value.YY_MOVE_OR_COPY< DefinedValue > (YY_MOVE (that.value)); break; - case 328: // DurationType + case 327: // DurationType value.YY_MOVE_OR_COPY< DurationType > (YY_MOVE (that.value)); break; - case 321: // EmbeddedPDVType + case 320: // EmbeddedPDVType value.YY_MOVE_OR_COPY< EmbeddedPDVType > (YY_MOVE (that.value)); break; - case 279: // EnumeratedType - case 280: // Enumerations - case 281: // Enumeration + case 278: // EnumeratedType + case 279: // Enumerations + case 280: // Enumeration value.YY_MOVE_OR_COPY< EnumeratedType > (YY_MOVE (that.value)); break; - case 282: // EnumerationItem + case 281: // EnumerationItem value.YY_MOVE_OR_COPY< EnumerationValue > (YY_MOVE (that.value)); break; - case 322: // ExternalType + case 321: // ExternalType value.YY_MOVE_OR_COPY< ExternalType > (YY_MOVE (that.value)); break; - case 315: // IRIType + case 314: // IRIType value.YY_MOVE_OR_COPY< IRIType > (YY_MOVE (that.value)); break; @@ -6424,7 +6492,7 @@ namespace yy { value.YY_MOVE_OR_COPY< InstanceOfType > (YY_MOVE (that.value)); break; - case 275: // IntegerType + case 274: // IntegerType value.YY_MOVE_OR_COPY< IntegerType > (YY_MOVE (that.value)); break; @@ -6432,15 +6500,15 @@ namespace yy { value.YY_MOVE_OR_COPY< Module > (YY_MOVE (that.value)); break; - case 277: // NamedNumber + case 276: // NamedNumber value.YY_MOVE_OR_COPY< NamedNumber > (YY_MOVE (that.value)); break; - case 266: // NamedType + case 265: // NamedType value.YY_MOVE_OR_COPY< NamedType > (YY_MOVE (that.value)); break; - case 288: // NullType + case 287: // NullType value.YY_MOVE_OR_COPY< NullType > (YY_MOVE (that.value)); break; @@ -6453,18 +6521,18 @@ namespace yy { value.YY_MOVE_OR_COPY< ObjectClassFieldType > (YY_MOVE (that.value)); break; - case 310: // ObjIdComponents - case 311: // NameForm - case 312: // NumberForm - case 313: // NameAndNumberForm + case 309: // ObjIdComponents + case 310: // NameForm + case 311: // NumberForm + case 312: // NameAndNumberForm value.YY_MOVE_OR_COPY< ObjectIdComponentValue > (YY_MOVE (that.value)); break; - case 307: // ObjectIdentifierType + case 306: // ObjectIdentifierType value.YY_MOVE_OR_COPY< ObjectIdentifierType > (YY_MOVE (that.value)); break; - case 287: // OctetStringType + case 286: // OctetStringType value.YY_MOVE_OR_COPY< OctetStringType > (YY_MOVE (that.value)); break; @@ -6472,43 +6540,43 @@ namespace yy { value.YY_MOVE_OR_COPY< Parameter > (YY_MOVE (that.value)); break; - case 301: // PrefixedType + case 300: // PrefixedType value.YY_MOVE_OR_COPY< PrefixedType > (YY_MOVE (that.value)); break; - case 283: // RealType + case 282: // RealType value.YY_MOVE_OR_COPY< RealType > (YY_MOVE (that.value)); break; - case 320: // RelativeIRIType + case 319: // RelativeIRIType value.YY_MOVE_OR_COPY< RelativeIRIType > (YY_MOVE (that.value)); break; - case 314: // RelativeOIDType + case 313: // RelativeOIDType value.YY_MOVE_OR_COPY< RelativeOIDType > (YY_MOVE (that.value)); break; - case 293: // SequenceOfType + case 292: // SequenceOfType value.YY_MOVE_OR_COPY< SequenceOfType > (YY_MOVE (that.value)); break; - case 289: // SequenceType + case 288: // SequenceType value.YY_MOVE_OR_COPY< SequenceType > (YY_MOVE (that.value)); break; - case 295: // SetOfType + case 294: // SetOfType value.YY_MOVE_OR_COPY< SetOfType > (YY_MOVE (that.value)); break; - case 294: // SetType + case 293: // SetType value.YY_MOVE_OR_COPY< SetType > (YY_MOVE (that.value)); break; - case 303: // Tag + case 302: // Tag value.YY_MOVE_OR_COPY< Tag > (YY_MOVE (that.value)); break; - case 302: // TaggedType + case 301: // TaggedType value.YY_MOVE_OR_COPY< TaggedType > (YY_MOVE (that.value)); break; @@ -6516,26 +6584,30 @@ namespace yy { value.YY_MOVE_OR_COPY< TaggingMode > (YY_MOVE (that.value)); break; - case 326: // TimeOfDayType + case 325: // TimeOfDayType value.YY_MOVE_OR_COPY< TimeOfDayType > (YY_MOVE (that.value)); break; - case 323: // TimeType + case 322: // TimeType value.YY_MOVE_OR_COPY< TimeType > (YY_MOVE (that.value)); break; + case 323: // TimeValue + value.YY_MOVE_OR_COPY< TimeValue > (YY_MOVE (that.value)); + break; + case 211: // ParamGovernor case 212: // Governor - case 258: // ActualParameter - case 264: // Type - case 332: // ConstrainedType - case 333: // TypeWithConstraint + case 257: // ActualParameter + case 263: // Type + case 331: // ConstrainedType + case 332: // TypeWithConstraint value.YY_MOVE_OR_COPY< Type > (YY_MOVE (that.value)); break; - case 267: // ValueWithoutTypeIdentifier - case 268: // Value - case 350: // SingleValue + case 266: // ValueWithoutTypeIdentifier + case 267: // Value + case 349: // SingleValue value.YY_MOVE_OR_COPY< Value > (YY_MOVE (that.value)); break; @@ -6543,14 +6615,14 @@ namespace yy { value.YY_MOVE_OR_COPY< double > (YY_MOVE (that.value)); break; - case 305: // ClassNumber + case 304: // ClassNumber value.YY_MOVE_OR_COPY< int > (YY_MOVE (that.value)); break; case 4: // number case 5: // negativenumber - case 278: // SignedNumber - value.YY_MOVE_OR_COPY< long long > (YY_MOVE (that.value)); + case 277: // SignedNumber + value.YY_MOVE_OR_COPY< int64_t > (YY_MOVE (that.value)); break; case 7: // bstring @@ -6571,18 +6643,18 @@ namespace yy { case 216: // SimpleDefinedType case 228: // ModuleIdentifier case 246: // GlobalModuleReference - case 249: // Symbol - case 250: // Reference - case 373: // typereference - case 374: // identifier - case 375: // valuereference - case 376: // modulereference - case 377: // objectclassreference - case 378: // word + case 248: // Symbol + case 249: // Reference + case 372: // typereference + case 373: // identifier + case 374: // valuereference + case 375: // modulereference + case 376: // objectclassreference + case 377: // word value.YY_MOVE_OR_COPY< std::string > (YY_MOVE (that.value)); break; - case 251: // AssignmentList + case 250: // AssignmentList value.YY_MOVE_OR_COPY< std::vector > (YY_MOVE (that.value)); break; @@ -6603,18 +6675,18 @@ namespace yy { value.YY_MOVE_OR_COPY< std::vector > (YY_MOVE (that.value)); break; - case 276: // NamedNumberList + case 275: // NamedNumberList value.YY_MOVE_OR_COPY< std::vector > (YY_MOVE (that.value)); break; - case 297: // AlternativeTypeLists - case 298: // RootAlternativeTypeList - case 299: // AlternativeTypeList + case 296: // AlternativeTypeLists + case 297: // RootAlternativeTypeList + case 298: // AlternativeTypeList value.YY_MOVE_OR_COPY< std::vector > (YY_MOVE (that.value)); break; - case 308: // ObjectIdentifierValue - case 309: // ObjIdComponentsList + case 307: // ObjectIdentifierValue + case 308: // ObjIdComponentsList value.YY_MOVE_OR_COPY< std::vector > (YY_MOVE (that.value)); break; @@ -6623,17 +6695,17 @@ namespace yy { value.YY_MOVE_OR_COPY< std::vector > (YY_MOVE (that.value)); break; - case 257: // ActualParameterList + case 256: // ActualParameterList value.YY_MOVE_OR_COPY< std::vector > (YY_MOVE (that.value)); break; - case 272: // SequenceOfValues + case 271: // SequenceOfValues value.YY_MOVE_OR_COPY< std::vector > (YY_MOVE (that.value)); break; case 166: // FieldNameList case 168: // OneOrManyTypeFieldReference - case 248: // SymbolList + case 247: // SymbolList value.YY_MOVE_OR_COPY< std::vector > (YY_MOVE (that.value)); break; @@ -6659,89 +6731,93 @@ namespace yy { case 205: // ParameterizedValueAssignment case 206: // ParameterizedValueSetTypeAssignment case 207: // ParameterizedObjectClassAssignment - case 252: // Assignment - case 261: // TypeAssignment - case 262: // ValueAssignment - case 263: // ValueSetTypeAssignment + case 251: // Assignment + case 260: // TypeAssignment + case 261: // ValueAssignment + case 262: // ValueSetTypeAssignment value.move< Assignment > (YY_MOVE (that.value)); break; - case 284: // BitStringType + case 283: // BitStringType value.move< BitStringType > (YY_MOVE (that.value)); break; - case 273: // BooleanType + case 272: // BooleanType value.move< BooleanType > (YY_MOVE (that.value)); break; - case 265: // BuiltinType + case 273: // BooleanValue + value.move< BooleanValue > (YY_MOVE (that.value)); + break; + + case 264: // BuiltinType value.move< BuiltinType > (YY_MOVE (that.value)); break; - case 329: // CharacterStringType - case 330: // RestrictedCharacterStringType - case 331: // UnrestrictedCharacterStringType + case 328: // CharacterStringType + case 329: // RestrictedCharacterStringType + case 330: // UnrestrictedCharacterStringType value.move< CharacterStringType > (YY_MOVE (that.value)); break; - case 296: // ChoiceType + case 295: // ChoiceType value.move< ChoiceType > (YY_MOVE (that.value)); break; - case 306: // Class + case 305: // Class value.move< Class > (YY_MOVE (that.value)); break; - case 292: // ComponentType + case 291: // ComponentType value.move< ComponentType > (YY_MOVE (that.value)); break; - case 290: // ComponentTypeLists - case 291: // ComponentTypeList + case 289: // ComponentTypeLists + case 290: // ComponentTypeList value.move< ComponentTypeList > (YY_MOVE (that.value)); break; - case 327: // DateTimeType + case 326: // DateTimeType value.move< DateTimeType > (YY_MOVE (that.value)); break; - case 325: // DateType + case 324: // DateType value.move< DateType > (YY_MOVE (that.value)); break; - case 253: // DefinedType - case 255: // ParameterizedType - case 259: // ExternalTypeReference + case 252: // DefinedType + case 254: // ParameterizedType + case 258: // ExternalTypeReference value.move< DefinedType > (YY_MOVE (that.value)); break; - case 254: // DefinedValue + case 253: // DefinedValue value.move< DefinedValue > (YY_MOVE (that.value)); break; - case 328: // DurationType + case 327: // DurationType value.move< DurationType > (YY_MOVE (that.value)); break; - case 321: // EmbeddedPDVType + case 320: // EmbeddedPDVType value.move< EmbeddedPDVType > (YY_MOVE (that.value)); break; - case 279: // EnumeratedType - case 280: // Enumerations - case 281: // Enumeration + case 278: // EnumeratedType + case 279: // Enumerations + case 280: // Enumeration value.move< EnumeratedType > (YY_MOVE (that.value)); break; - case 282: // EnumerationItem + case 281: // EnumerationItem value.move< EnumerationValue > (YY_MOVE (that.value)); break; - case 322: // ExternalType + case 321: // ExternalType value.move< ExternalType > (YY_MOVE (that.value)); break; - case 315: // IRIType + case 314: // IRIType value.move< IRIType > (YY_MOVE (that.value)); break; @@ -6753,7 +6829,7 @@ namespace yy { value.move< InstanceOfType > (YY_MOVE (that.value)); break; - case 275: // IntegerType + case 274: // IntegerType value.move< IntegerType > (YY_MOVE (that.value)); break; @@ -6761,15 +6837,15 @@ namespace yy { value.move< Module > (YY_MOVE (that.value)); break; - case 277: // NamedNumber + case 276: // NamedNumber value.move< NamedNumber > (YY_MOVE (that.value)); break; - case 266: // NamedType + case 265: // NamedType value.move< NamedType > (YY_MOVE (that.value)); break; - case 288: // NullType + case 287: // NullType value.move< NullType > (YY_MOVE (that.value)); break; @@ -6782,18 +6858,18 @@ namespace yy { value.move< ObjectClassFieldType > (YY_MOVE (that.value)); break; - case 310: // ObjIdComponents - case 311: // NameForm - case 312: // NumberForm - case 313: // NameAndNumberForm + case 309: // ObjIdComponents + case 310: // NameForm + case 311: // NumberForm + case 312: // NameAndNumberForm value.move< ObjectIdComponentValue > (YY_MOVE (that.value)); break; - case 307: // ObjectIdentifierType + case 306: // ObjectIdentifierType value.move< ObjectIdentifierType > (YY_MOVE (that.value)); break; - case 287: // OctetStringType + case 286: // OctetStringType value.move< OctetStringType > (YY_MOVE (that.value)); break; @@ -6801,43 +6877,43 @@ namespace yy { value.move< Parameter > (YY_MOVE (that.value)); break; - case 301: // PrefixedType + case 300: // PrefixedType value.move< PrefixedType > (YY_MOVE (that.value)); break; - case 283: // RealType + case 282: // RealType value.move< RealType > (YY_MOVE (that.value)); break; - case 320: // RelativeIRIType + case 319: // RelativeIRIType value.move< RelativeIRIType > (YY_MOVE (that.value)); break; - case 314: // RelativeOIDType + case 313: // RelativeOIDType value.move< RelativeOIDType > (YY_MOVE (that.value)); break; - case 293: // SequenceOfType + case 292: // SequenceOfType value.move< SequenceOfType > (YY_MOVE (that.value)); break; - case 289: // SequenceType + case 288: // SequenceType value.move< SequenceType > (YY_MOVE (that.value)); break; - case 295: // SetOfType + case 294: // SetOfType value.move< SetOfType > (YY_MOVE (that.value)); break; - case 294: // SetType + case 293: // SetType value.move< SetType > (YY_MOVE (that.value)); break; - case 303: // Tag + case 302: // Tag value.move< Tag > (YY_MOVE (that.value)); break; - case 302: // TaggedType + case 301: // TaggedType value.move< TaggedType > (YY_MOVE (that.value)); break; @@ -6845,26 +6921,30 @@ namespace yy { value.move< TaggingMode > (YY_MOVE (that.value)); break; - case 326: // TimeOfDayType + case 325: // TimeOfDayType value.move< TimeOfDayType > (YY_MOVE (that.value)); break; - case 323: // TimeType + case 322: // TimeType value.move< TimeType > (YY_MOVE (that.value)); break; + case 323: // TimeValue + value.move< TimeValue > (YY_MOVE (that.value)); + break; + case 211: // ParamGovernor case 212: // Governor - case 258: // ActualParameter - case 264: // Type - case 332: // ConstrainedType - case 333: // TypeWithConstraint + case 257: // ActualParameter + case 263: // Type + case 331: // ConstrainedType + case 332: // TypeWithConstraint value.move< Type > (YY_MOVE (that.value)); break; - case 267: // ValueWithoutTypeIdentifier - case 268: // Value - case 350: // SingleValue + case 266: // ValueWithoutTypeIdentifier + case 267: // Value + case 349: // SingleValue value.move< Value > (YY_MOVE (that.value)); break; @@ -6872,14 +6952,14 @@ namespace yy { value.move< double > (YY_MOVE (that.value)); break; - case 305: // ClassNumber + case 304: // ClassNumber value.move< int > (YY_MOVE (that.value)); break; case 4: // number case 5: // negativenumber - case 278: // SignedNumber - value.move< long long > (YY_MOVE (that.value)); + case 277: // SignedNumber + value.move< int64_t > (YY_MOVE (that.value)); break; case 7: // bstring @@ -6900,18 +6980,18 @@ namespace yy { case 216: // SimpleDefinedType case 228: // ModuleIdentifier case 246: // GlobalModuleReference - case 249: // Symbol - case 250: // Reference - case 373: // typereference - case 374: // identifier - case 375: // valuereference - case 376: // modulereference - case 377: // objectclassreference - case 378: // word + case 248: // Symbol + case 249: // Reference + case 372: // typereference + case 373: // identifier + case 374: // valuereference + case 375: // modulereference + case 376: // objectclassreference + case 377: // word value.move< std::string > (YY_MOVE (that.value)); break; - case 251: // AssignmentList + case 250: // AssignmentList value.move< std::vector > (YY_MOVE (that.value)); break; @@ -6932,18 +7012,18 @@ namespace yy { value.move< std::vector > (YY_MOVE (that.value)); break; - case 276: // NamedNumberList + case 275: // NamedNumberList value.move< std::vector > (YY_MOVE (that.value)); break; - case 297: // AlternativeTypeLists - case 298: // RootAlternativeTypeList - case 299: // AlternativeTypeList + case 296: // AlternativeTypeLists + case 297: // RootAlternativeTypeList + case 298: // AlternativeTypeList value.move< std::vector > (YY_MOVE (that.value)); break; - case 308: // ObjectIdentifierValue - case 309: // ObjIdComponentsList + case 307: // ObjectIdentifierValue + case 308: // ObjIdComponentsList value.move< std::vector > (YY_MOVE (that.value)); break; @@ -6952,17 +7032,17 @@ namespace yy { value.move< std::vector > (YY_MOVE (that.value)); break; - case 257: // ActualParameterList + case 256: // ActualParameterList value.move< std::vector > (YY_MOVE (that.value)); break; - case 272: // SequenceOfValues + case 271: // SequenceOfValues value.move< std::vector > (YY_MOVE (that.value)); break; case 166: // FieldNameList case 168: // OneOrManyTypeFieldReference - case 248: // SymbolList + case 247: // SymbolList value.move< std::vector > (YY_MOVE (that.value)); break; @@ -6988,89 +7068,93 @@ namespace yy { case 205: // ParameterizedValueAssignment case 206: // ParameterizedValueSetTypeAssignment case 207: // ParameterizedObjectClassAssignment - case 252: // Assignment - case 261: // TypeAssignment - case 262: // ValueAssignment - case 263: // ValueSetTypeAssignment + case 251: // Assignment + case 260: // TypeAssignment + case 261: // ValueAssignment + case 262: // ValueSetTypeAssignment value.move< Assignment > (that.value); break; - case 284: // BitStringType + case 283: // BitStringType value.move< BitStringType > (that.value); break; - case 273: // BooleanType + case 272: // BooleanType value.move< BooleanType > (that.value); break; - case 265: // BuiltinType + case 273: // BooleanValue + value.move< BooleanValue > (that.value); + break; + + case 264: // BuiltinType value.move< BuiltinType > (that.value); break; - case 329: // CharacterStringType - case 330: // RestrictedCharacterStringType - case 331: // UnrestrictedCharacterStringType + case 328: // CharacterStringType + case 329: // RestrictedCharacterStringType + case 330: // UnrestrictedCharacterStringType value.move< CharacterStringType > (that.value); break; - case 296: // ChoiceType + case 295: // ChoiceType value.move< ChoiceType > (that.value); break; - case 306: // Class + case 305: // Class value.move< Class > (that.value); break; - case 292: // ComponentType + case 291: // ComponentType value.move< ComponentType > (that.value); break; - case 290: // ComponentTypeLists - case 291: // ComponentTypeList + case 289: // ComponentTypeLists + case 290: // ComponentTypeList value.move< ComponentTypeList > (that.value); break; - case 327: // DateTimeType + case 326: // DateTimeType value.move< DateTimeType > (that.value); break; - case 325: // DateType + case 324: // DateType value.move< DateType > (that.value); break; - case 253: // DefinedType - case 255: // ParameterizedType - case 259: // ExternalTypeReference + case 252: // DefinedType + case 254: // ParameterizedType + case 258: // ExternalTypeReference value.move< DefinedType > (that.value); break; - case 254: // DefinedValue + case 253: // DefinedValue value.move< DefinedValue > (that.value); break; - case 328: // DurationType + case 327: // DurationType value.move< DurationType > (that.value); break; - case 321: // EmbeddedPDVType + case 320: // EmbeddedPDVType value.move< EmbeddedPDVType > (that.value); break; - case 279: // EnumeratedType - case 280: // Enumerations - case 281: // Enumeration + case 278: // EnumeratedType + case 279: // Enumerations + case 280: // Enumeration value.move< EnumeratedType > (that.value); break; - case 282: // EnumerationItem + case 281: // EnumerationItem value.move< EnumerationValue > (that.value); break; - case 322: // ExternalType + case 321: // ExternalType value.move< ExternalType > (that.value); break; - case 315: // IRIType + case 314: // IRIType value.move< IRIType > (that.value); break; @@ -7082,7 +7166,7 @@ namespace yy { value.move< InstanceOfType > (that.value); break; - case 275: // IntegerType + case 274: // IntegerType value.move< IntegerType > (that.value); break; @@ -7090,15 +7174,15 @@ namespace yy { value.move< Module > (that.value); break; - case 277: // NamedNumber + case 276: // NamedNumber value.move< NamedNumber > (that.value); break; - case 266: // NamedType + case 265: // NamedType value.move< NamedType > (that.value); break; - case 288: // NullType + case 287: // NullType value.move< NullType > (that.value); break; @@ -7111,18 +7195,18 @@ namespace yy { value.move< ObjectClassFieldType > (that.value); break; - case 310: // ObjIdComponents - case 311: // NameForm - case 312: // NumberForm - case 313: // NameAndNumberForm + case 309: // ObjIdComponents + case 310: // NameForm + case 311: // NumberForm + case 312: // NameAndNumberForm value.move< ObjectIdComponentValue > (that.value); break; - case 307: // ObjectIdentifierType + case 306: // ObjectIdentifierType value.move< ObjectIdentifierType > (that.value); break; - case 287: // OctetStringType + case 286: // OctetStringType value.move< OctetStringType > (that.value); break; @@ -7130,43 +7214,43 @@ namespace yy { value.move< Parameter > (that.value); break; - case 301: // PrefixedType + case 300: // PrefixedType value.move< PrefixedType > (that.value); break; - case 283: // RealType + case 282: // RealType value.move< RealType > (that.value); break; - case 320: // RelativeIRIType + case 319: // RelativeIRIType value.move< RelativeIRIType > (that.value); break; - case 314: // RelativeOIDType + case 313: // RelativeOIDType value.move< RelativeOIDType > (that.value); break; - case 293: // SequenceOfType + case 292: // SequenceOfType value.move< SequenceOfType > (that.value); break; - case 289: // SequenceType + case 288: // SequenceType value.move< SequenceType > (that.value); break; - case 295: // SetOfType + case 294: // SetOfType value.move< SetOfType > (that.value); break; - case 294: // SetType + case 293: // SetType value.move< SetType > (that.value); break; - case 303: // Tag + case 302: // Tag value.move< Tag > (that.value); break; - case 302: // TaggedType + case 301: // TaggedType value.move< TaggedType > (that.value); break; @@ -7174,26 +7258,30 @@ namespace yy { value.move< TaggingMode > (that.value); break; - case 326: // TimeOfDayType + case 325: // TimeOfDayType value.move< TimeOfDayType > (that.value); break; - case 323: // TimeType + case 322: // TimeType value.move< TimeType > (that.value); break; + case 323: // TimeValue + value.move< TimeValue > (that.value); + break; + case 211: // ParamGovernor case 212: // Governor - case 258: // ActualParameter - case 264: // Type - case 332: // ConstrainedType - case 333: // TypeWithConstraint + case 257: // ActualParameter + case 263: // Type + case 331: // ConstrainedType + case 332: // TypeWithConstraint value.move< Type > (that.value); break; - case 267: // ValueWithoutTypeIdentifier - case 268: // Value - case 350: // SingleValue + case 266: // ValueWithoutTypeIdentifier + case 267: // Value + case 349: // SingleValue value.move< Value > (that.value); break; @@ -7201,14 +7289,14 @@ namespace yy { value.move< double > (that.value); break; - case 305: // ClassNumber + case 304: // ClassNumber value.move< int > (that.value); break; case 4: // number case 5: // negativenumber - case 278: // SignedNumber - value.move< long long > (that.value); + case 277: // SignedNumber + value.move< int64_t > (that.value); break; case 7: // bstring @@ -7229,18 +7317,18 @@ namespace yy { case 216: // SimpleDefinedType case 228: // ModuleIdentifier case 246: // GlobalModuleReference - case 249: // Symbol - case 250: // Reference - case 373: // typereference - case 374: // identifier - case 375: // valuereference - case 376: // modulereference - case 377: // objectclassreference - case 378: // word + case 248: // Symbol + case 249: // Reference + case 372: // typereference + case 373: // identifier + case 374: // valuereference + case 375: // modulereference + case 376: // objectclassreference + case 377: // word value.move< std::string > (that.value); break; - case 251: // AssignmentList + case 250: // AssignmentList value.move< std::vector > (that.value); break; @@ -7261,18 +7349,18 @@ namespace yy { value.move< std::vector > (that.value); break; - case 276: // NamedNumberList + case 275: // NamedNumberList value.move< std::vector > (that.value); break; - case 297: // AlternativeTypeLists - case 298: // RootAlternativeTypeList - case 299: // AlternativeTypeList + case 296: // AlternativeTypeLists + case 297: // RootAlternativeTypeList + case 298: // AlternativeTypeList value.move< std::vector > (that.value); break; - case 308: // ObjectIdentifierValue - case 309: // ObjIdComponentsList + case 307: // ObjectIdentifierValue + case 308: // ObjIdComponentsList value.move< std::vector > (that.value); break; @@ -7281,17 +7369,17 @@ namespace yy { value.move< std::vector > (that.value); break; - case 257: // ActualParameterList + case 256: // ActualParameterList value.move< std::vector > (that.value); break; - case 272: // SequenceOfValues + case 271: // SequenceOfValues value.move< std::vector > (that.value); break; case 166: // FieldNameList case 168: // OneOrManyTypeFieldReference - case 248: // SymbolList + case 247: // SymbolList value.move< std::vector > (that.value); break; @@ -7551,89 +7639,93 @@ namespace yy { case 205: // ParameterizedValueAssignment case 206: // ParameterizedValueSetTypeAssignment case 207: // ParameterizedObjectClassAssignment - case 252: // Assignment - case 261: // TypeAssignment - case 262: // ValueAssignment - case 263: // ValueSetTypeAssignment + case 251: // Assignment + case 260: // TypeAssignment + case 261: // ValueAssignment + case 262: // ValueSetTypeAssignment yylhs.value.emplace< Assignment > (); break; - case 284: // BitStringType + case 283: // BitStringType yylhs.value.emplace< BitStringType > (); break; - case 273: // BooleanType + case 272: // BooleanType yylhs.value.emplace< BooleanType > (); break; - case 265: // BuiltinType + case 273: // BooleanValue + yylhs.value.emplace< BooleanValue > (); + break; + + case 264: // BuiltinType yylhs.value.emplace< BuiltinType > (); break; - case 329: // CharacterStringType - case 330: // RestrictedCharacterStringType - case 331: // UnrestrictedCharacterStringType + case 328: // CharacterStringType + case 329: // RestrictedCharacterStringType + case 330: // UnrestrictedCharacterStringType yylhs.value.emplace< CharacterStringType > (); break; - case 296: // ChoiceType + case 295: // ChoiceType yylhs.value.emplace< ChoiceType > (); break; - case 306: // Class + case 305: // Class yylhs.value.emplace< Class > (); break; - case 292: // ComponentType + case 291: // ComponentType yylhs.value.emplace< ComponentType > (); break; - case 290: // ComponentTypeLists - case 291: // ComponentTypeList + case 289: // ComponentTypeLists + case 290: // ComponentTypeList yylhs.value.emplace< ComponentTypeList > (); break; - case 327: // DateTimeType + case 326: // DateTimeType yylhs.value.emplace< DateTimeType > (); break; - case 325: // DateType + case 324: // DateType yylhs.value.emplace< DateType > (); break; - case 253: // DefinedType - case 255: // ParameterizedType - case 259: // ExternalTypeReference + case 252: // DefinedType + case 254: // ParameterizedType + case 258: // ExternalTypeReference yylhs.value.emplace< DefinedType > (); break; - case 254: // DefinedValue + case 253: // DefinedValue yylhs.value.emplace< DefinedValue > (); break; - case 328: // DurationType + case 327: // DurationType yylhs.value.emplace< DurationType > (); break; - case 321: // EmbeddedPDVType + case 320: // EmbeddedPDVType yylhs.value.emplace< EmbeddedPDVType > (); break; - case 279: // EnumeratedType - case 280: // Enumerations - case 281: // Enumeration + case 278: // EnumeratedType + case 279: // Enumerations + case 280: // Enumeration yylhs.value.emplace< EnumeratedType > (); break; - case 282: // EnumerationItem + case 281: // EnumerationItem yylhs.value.emplace< EnumerationValue > (); break; - case 322: // ExternalType + case 321: // ExternalType yylhs.value.emplace< ExternalType > (); break; - case 315: // IRIType + case 314: // IRIType yylhs.value.emplace< IRIType > (); break; @@ -7645,7 +7737,7 @@ namespace yy { yylhs.value.emplace< InstanceOfType > (); break; - case 275: // IntegerType + case 274: // IntegerType yylhs.value.emplace< IntegerType > (); break; @@ -7653,15 +7745,15 @@ namespace yy { yylhs.value.emplace< Module > (); break; - case 277: // NamedNumber + case 276: // NamedNumber yylhs.value.emplace< NamedNumber > (); break; - case 266: // NamedType + case 265: // NamedType yylhs.value.emplace< NamedType > (); break; - case 288: // NullType + case 287: // NullType yylhs.value.emplace< NullType > (); break; @@ -7674,18 +7766,18 @@ namespace yy { yylhs.value.emplace< ObjectClassFieldType > (); break; - case 310: // ObjIdComponents - case 311: // NameForm - case 312: // NumberForm - case 313: // NameAndNumberForm + case 309: // ObjIdComponents + case 310: // NameForm + case 311: // NumberForm + case 312: // NameAndNumberForm yylhs.value.emplace< ObjectIdComponentValue > (); break; - case 307: // ObjectIdentifierType + case 306: // ObjectIdentifierType yylhs.value.emplace< ObjectIdentifierType > (); break; - case 287: // OctetStringType + case 286: // OctetStringType yylhs.value.emplace< OctetStringType > (); break; @@ -7693,43 +7785,43 @@ namespace yy { yylhs.value.emplace< Parameter > (); break; - case 301: // PrefixedType + case 300: // PrefixedType yylhs.value.emplace< PrefixedType > (); break; - case 283: // RealType + case 282: // RealType yylhs.value.emplace< RealType > (); break; - case 320: // RelativeIRIType + case 319: // RelativeIRIType yylhs.value.emplace< RelativeIRIType > (); break; - case 314: // RelativeOIDType + case 313: // RelativeOIDType yylhs.value.emplace< RelativeOIDType > (); break; - case 293: // SequenceOfType + case 292: // SequenceOfType yylhs.value.emplace< SequenceOfType > (); break; - case 289: // SequenceType + case 288: // SequenceType yylhs.value.emplace< SequenceType > (); break; - case 295: // SetOfType + case 294: // SetOfType yylhs.value.emplace< SetOfType > (); break; - case 294: // SetType + case 293: // SetType yylhs.value.emplace< SetType > (); break; - case 303: // Tag + case 302: // Tag yylhs.value.emplace< Tag > (); break; - case 302: // TaggedType + case 301: // TaggedType yylhs.value.emplace< TaggedType > (); break; @@ -7737,26 +7829,30 @@ namespace yy { yylhs.value.emplace< TaggingMode > (); break; - case 326: // TimeOfDayType + case 325: // TimeOfDayType yylhs.value.emplace< TimeOfDayType > (); break; - case 323: // TimeType + case 322: // TimeType yylhs.value.emplace< TimeType > (); break; + case 323: // TimeValue + yylhs.value.emplace< TimeValue > (); + break; + case 211: // ParamGovernor case 212: // Governor - case 258: // ActualParameter - case 264: // Type - case 332: // ConstrainedType - case 333: // TypeWithConstraint + case 257: // ActualParameter + case 263: // Type + case 331: // ConstrainedType + case 332: // TypeWithConstraint yylhs.value.emplace< Type > (); break; - case 267: // ValueWithoutTypeIdentifier - case 268: // Value - case 350: // SingleValue + case 266: // ValueWithoutTypeIdentifier + case 267: // Value + case 349: // SingleValue yylhs.value.emplace< Value > (); break; @@ -7764,14 +7860,14 @@ namespace yy { yylhs.value.emplace< double > (); break; - case 305: // ClassNumber + case 304: // ClassNumber yylhs.value.emplace< int > (); break; case 4: // number case 5: // negativenumber - case 278: // SignedNumber - yylhs.value.emplace< long long > (); + case 277: // SignedNumber + yylhs.value.emplace< int64_t > (); break; case 7: // bstring @@ -7792,18 +7888,18 @@ namespace yy { case 216: // SimpleDefinedType case 228: // ModuleIdentifier case 246: // GlobalModuleReference - case 249: // Symbol - case 250: // Reference - case 373: // typereference - case 374: // identifier - case 375: // valuereference - case 376: // modulereference - case 377: // objectclassreference - case 378: // word + case 248: // Symbol + case 249: // Reference + case 372: // typereference + case 373: // identifier + case 374: // valuereference + case 375: // modulereference + case 376: // objectclassreference + case 377: // word yylhs.value.emplace< std::string > (); break; - case 251: // AssignmentList + case 250: // AssignmentList yylhs.value.emplace< std::vector > (); break; @@ -7824,18 +7920,18 @@ namespace yy { yylhs.value.emplace< std::vector > (); break; - case 276: // NamedNumberList + case 275: // NamedNumberList yylhs.value.emplace< std::vector > (); break; - case 297: // AlternativeTypeLists - case 298: // RootAlternativeTypeList - case 299: // AlternativeTypeList + case 296: // AlternativeTypeLists + case 297: // RootAlternativeTypeList + case 298: // AlternativeTypeList yylhs.value.emplace< std::vector > (); break; - case 308: // ObjectIdentifierValue - case 309: // ObjIdComponentsList + case 307: // ObjectIdentifierValue + case 308: // ObjIdComponentsList yylhs.value.emplace< std::vector > (); break; @@ -7844,17 +7940,17 @@ namespace yy { yylhs.value.emplace< std::vector > (); break; - case 257: // ActualParameterList + case 256: // ActualParameterList yylhs.value.emplace< std::vector > (); break; - case 272: // SequenceOfValues + case 271: // SequenceOfValues yylhs.value.emplace< std::vector > (); break; case 166: // FieldNameList case 168: // OneOrManyTypeFieldReference - case 248: // SymbolList + case 247: // SymbolList yylhs.value.emplace< std::vector > (); break; @@ -7879,1492 +7975,1603 @@ namespace yy { switch (yyn) { case 4: -#line 339 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 341 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yystack_[2].value.as < Module > ().module_reference = yystack_[9].value.as < std::string > (); yystack_[2].value.as < Module > ().tagging_default = yystack_[6].value.as < TaggingMode > (); context.asn1_tree.modules.push_back(yystack_[2].value.as < Module > ()); } -#line 7885 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 7981 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 10: -#line 356 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 358 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::string > () = "TYPE-IDENTIFIER"; } -#line 7891 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 7987 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 11: -#line 358 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 360 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::string > () = "TYPE-IDENTIFIER"; } -#line 7897 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 7993 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 12: -#line 362 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 364 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Assignment > () = Assignment{yystack_[2].value.as < std::string > (), yystack_[0].value.as < ObjectClassAssignment > ()}; } -#line 7903 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 7999 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 13: -#line 366 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { std::cerr << "Warning - Unhandled DefinedObjectClass\n"; } -#line 7909 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 368 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { feature_not_implemented(context.location, context.asn1_tree, "ObjectClass"); } +#line 8005 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 14: -#line 368 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 370 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < ObjectClassAssignment > () = yystack_[0].value.as < ObjectClassAssignment > (); } -#line 7915 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8011 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 15: -#line 373 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 375 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < ObjectClassAssignment > () = {yystack_[2].value.as < std::vector > ()}; } -#line 7921 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8017 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 16: -#line 377 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 379 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[0].value.as < std::vector > (); } -#line 7927 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8023 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 17: -#line 379 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 381 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[2].value.as < std::vector > (); yylhs.value.as < std::vector > ().insert(yylhs.value.as < std::vector > ().end(), yystack_[0].value.as < std::vector > ().begin(), yystack_[0].value.as < std::vector > ().end()); } -#line 7933 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8029 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 18: -#line 383 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 385 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[0].value.as < std::vector > (); } -#line 7939 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8035 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 19: -#line 385 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 387 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[0].value.as < std::vector > (); } -#line 7945 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8041 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 24: -#line 393 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 395 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::string > () = yystack_[0].value.as < std::string > (); } -#line 7951 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8047 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 25: -#line 395 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 397 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::string > () = yystack_[0].value.as < std::string > (); } -#line 7957 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8053 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 26: -#line 403 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 405 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > ().push_back(yystack_[0].value.as < std::string > ()); } -#line 7963 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8059 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 27: -#line 405 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 407 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[2].value.as < std::vector > (); yylhs.value.as < std::vector > ().push_back(yystack_[0].value.as < std::string > ()); } -#line 7969 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8065 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 28: -#line 409 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 411 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { for (const std::string& name : yystack_[1].value.as < std::vector > ()) yylhs.value.as < std::vector > ().push_back(ClassField{name, TypeField{}}); } -#line 7975 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8071 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 29: -#line 413 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 415 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > ().push_back(yystack_[0].value.as < std::string > ()); } -#line 7981 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8077 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 30: -#line 415 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 417 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[1].value.as < std::vector > (); yylhs.value.as < std::vector > ().push_back(yystack_[0].value.as < std::string > ()); } -#line 7987 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8083 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 37: -#line 429 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 431 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > ().push_back(ClassField{yystack_[3].value.as < std::string > (), FixedTypeValueField{yystack_[2].value.as < Type > ()}}); } -#line 7993 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8089 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 86: -#line 544 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 546 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Assignment > () = Assignment{yystack_[3].value.as < std::string > (), ObjectSetAssignment{}}; } -#line 7999 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8095 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 93: -#line 564 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 566 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < ObjectClassFieldType > () = {DefinedType{{}, }, yystack_[0].value.as < std::vector > ()}; } -#line 8005 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8101 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 94: -#line 566 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 568 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < ObjectClassFieldType > () = {DefinedType{{}, yystack_[2].value.as < std::string > ()}, yystack_[0].value.as < std::vector > ()}; } -#line 8011 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8107 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 95: -#line 573 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 575 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Assignment > () = yystack_[0].value.as < Assignment > (); } -#line 8017 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8113 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 96: -#line 575 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 577 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Assignment > () = yystack_[0].value.as < Assignment > (); } -#line 8023 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8119 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 97: -#line 577 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 579 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Assignment > () = yystack_[0].value.as < Assignment > (); } -#line 8029 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8125 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 98: -#line 579 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 581 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Assignment > () = yystack_[0].value.as < Assignment > (); } -#line 8035 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8131 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 99: -#line 586 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 588 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Assignment > () = Assignment{ yystack_[3].value.as < std::string > (), TypeAssignment{yystack_[0].value.as < Type > ()}, {}, yystack_[2].value.as < std::vector > () }; } -#line 8041 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8137 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 100: -#line 590 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 592 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Assignment > () = Assignment{ yystack_[4].value.as < std::string > (), ValueAssignment{} }; } -#line 8047 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8143 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 101: -#line 594 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 596 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Assignment > () = Assignment{ yystack_[4].value.as < std::string > (), ValueAssignment{} }; } -#line 8053 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8149 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 102: -#line 598 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 600 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Assignment > () = Assignment{ yystack_[3].value.as < std::string > (), ObjectClassAssignment{} }; } -#line 8059 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8155 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 103: -#line 610 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 612 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[1].value.as < std::vector > (); } -#line 8065 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8161 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 104: -#line 614 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 616 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > ().push_back(yystack_[0].value.as < Parameter > ()); } -#line 8071 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8167 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 105: -#line 616 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 618 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[2].value.as < std::vector > (); yylhs.value.as < std::vector > ().push_back(yystack_[0].value.as < Parameter > ()); } -#line 8077 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8173 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 106: -#line 620 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 622 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Parameter > () = Parameter{yystack_[2].value.as < Type > (), yystack_[0].value.as < std::string > ()}; } -#line 8083 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8179 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 107: -#line 622 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 624 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Parameter > () = Parameter{{}, yystack_[0].value.as < std::string > ()}; } -#line 8089 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8185 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 108: -#line 626 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 628 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Type > () = yystack_[0].value.as < Type > (); } -#line 8095 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8191 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 109: -#line 628 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 630 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Type > () = DefinedType{{}, yystack_[0].value.as < std::string > ()}; } -#line 8101 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8197 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 110: -#line 632 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 634 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Type > () = yystack_[0].value.as < Type > (); } -#line 8107 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8203 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 111: -#line 634 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 636 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { } -#line 8113 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8209 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 114: +#line 673 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { feature_not_implemented(context.location, context.asn1_tree, "InstanceOfType"); } +#line 8215 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 116: -#line 679 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 682 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::string > () = yystack_[0].value.as < std::string > (); } -#line 8119 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8221 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 122: +#line 695 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { feature_not_implemented(context.location, context.asn1_tree, "UserDefinedConstraint", "Not yet checking contraints. "); } +#line 8227 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 130: -#line 704 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 709 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { std::cerr << "Simple constraint\n"; } -#line 8125 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8233 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 131: -#line 706 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 711 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { std::cerr << "Relation constraint\n"; } -#line 8131 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8239 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 144: -#line 748 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 753 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::string > () = yystack_[1].value.as < std::string > (); } -#line 8139 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8247 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 159: -#line 787 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 792 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < TaggingMode > () = TaggingMode::explicit_; } -#line 8145 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8253 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 160: -#line 789 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 794 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < TaggingMode > () = TaggingMode::implicit; } -#line 8151 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8259 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 161: -#line 791 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 796 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < TaggingMode > () = TaggingMode::automatic; } -#line 8157 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8265 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 162: -#line 793 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 798 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < TaggingMode > () = TaggingMode::explicit_; } -#line 8163 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8271 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 165: -#line 801 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 806 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Module > () = Module{ {}, TaggingMode(), yystack_[2].value.as < std::vector > (), yystack_[1].value.as < std::vector > (), yystack_[0].value.as < std::vector > ()}; } -#line 8169 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8277 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 166: -#line 803 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 808 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { } -#line 8175 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8283 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 172: -#line 816 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 821 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[1].value.as < std::vector > (); } -#line 8181 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8289 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 174: -#line 821 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 826 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[0].value.as < std::vector > (); } -#line 8187 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8295 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 176: -#line 826 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 831 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > ().push_back(yystack_[0].value.as < Import > ()); } -#line 8193 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8301 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 177: -#line 828 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 833 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[1].value.as < std::vector > (); yylhs.value.as < std::vector > ().push_back(yystack_[0].value.as < Import > ()); } -#line 8199 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8307 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 178: -#line 832 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < Import > () = Import{ yystack_[0].value.as < std::string > (), yystack_[2].value.as < std::vector > () }; } -#line 8205 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 837 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Import > () = Import{ yystack_[0].value.as < std::string > (), {}, {} }; + for (const std::string& ref: yystack_[2].value.as < std::vector > ()) + { + if (std::isupper(ref[0])) + { + yylhs.value.as < Import > ().imported_types.push_back(ref); + } + else + { + yylhs.value.as < Import > ().imported_values.push_back(ref); + } + } + } +#line 8325 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 179: -#line 836 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 853 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < std::string > () = yystack_[0].value.as < std::string > (); } +#line 8331 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 180: +#line 855 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::string > () = yystack_[1].value.as < std::string > (); } -#line 8211 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8337 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 183: -#line 845 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 181: +#line 861 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > ().push_back(yystack_[0].value.as < std::string > ()); } -#line 8217 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8343 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 184: -#line 847 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 182: +#line 863 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[2].value.as < std::vector > (); yylhs.value.as < std::vector > ().push_back(yystack_[0].value.as < std::string > ()); } -#line 8223 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8349 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 185: -#line 851 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 183: +#line 867 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < std::string > () = yystack_[0].value.as < std::string > (); } +#line 8355 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 184: +#line 871 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::string > () = yystack_[0].value.as < std::string > (); } -#line 8229 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8361 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 185: +#line 873 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < std::string > () = yystack_[2].value.as < std::string > (); } +#line 8367 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 186: -#line 855 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 875 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::string > () = yystack_[0].value.as < std::string > (); } -#line 8235 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8373 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 187: -#line 857 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < std::string > () = yystack_[2].value.as < std::string > (); } -#line 8241 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 884 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < std::vector > ().push_back(yystack_[0].value.as < Assignment > ()); } +#line 8379 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 188: -#line 859 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < std::string > () = yystack_[0].value.as < std::string > (); } -#line 8247 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 886 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < std::vector > () = yystack_[0].value.as < std::vector > (); yylhs.value.as < std::vector > ().push_back(yystack_[1].value.as < Assignment > ()); } +#line 8385 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 189: -#line 868 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < std::vector > ().push_back(yystack_[0].value.as < Assignment > ()); } -#line 8253 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 890 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Assignment > () = yystack_[0].value.as < Assignment > (); } +#line 8391 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 190: -#line 870 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < std::vector > () = yystack_[0].value.as < std::vector > (); yylhs.value.as < std::vector > ().push_back(yystack_[1].value.as < Assignment > ()); } -#line 8259 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 892 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Assignment > () = yystack_[0].value.as < Assignment > (); } +#line 8397 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 191: -#line 874 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 894 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Assignment > () = yystack_[0].value.as < Assignment > (); } -#line 8265 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8403 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 192: -#line 876 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 896 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Assignment > () = yystack_[0].value.as < Assignment > (); } -#line 8271 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8409 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 193: -#line 878 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 899 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Assignment > () = yystack_[0].value.as < Assignment > (); } -#line 8277 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8415 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 194: -#line 880 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 901 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Assignment > () = yystack_[0].value.as < Assignment > (); } -#line 8283 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8421 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 195: -#line 883 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < Assignment > () = yystack_[0].value.as < Assignment > (); } -#line 8289 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 905 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < DefinedType > () = yystack_[0].value.as < DefinedType > (); } +#line 8427 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 196: -#line 885 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < Assignment > () = yystack_[0].value.as < Assignment > (); } -#line 8295 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 907 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < DefinedType > () = DefinedType{absl::nullopt, yystack_[0].value.as < std::string > (), {}}; } +#line 8433 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 197: -#line 889 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 909 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < DefinedType > () = yystack_[0].value.as < DefinedType > (); } -#line 8301 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8439 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 198: -#line 891 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < DefinedType > () = DefinedType{absl::nullopt, yystack_[0].value.as < std::string > (), {}}; } -#line 8307 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 - break; - - case 199: -#line 893 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < DefinedType > () = yystack_[0].value.as < DefinedType > (); } -#line 8313 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 - break; - - case 200: -#line 899 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 915 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < DefinedValue > () = DefinedValue{yystack_[0].value.as < std::string > ()}; } -#line 8319 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8445 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 202: -#line 904 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 200: +#line 920 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < DefinedType > () = DefinedType{ absl::nullopt, yystack_[3].value.as < std::string > (), yystack_[1].value.as < std::vector > ()}; } -#line 8325 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8451 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 204: -#line 911 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 202: +#line 927 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > ().push_back(yystack_[0].value.as < Type > ()); } -#line 8331 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8457 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 205: -#line 913 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 203: +#line 929 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[0].value.as < std::vector > (); yylhs.value.as < std::vector > ().push_back(yystack_[2].value.as < Type > ()); } -#line 8337 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8463 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 206: -#line 917 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 204: +#line 933 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Type > () = yystack_[0].value.as < Type > (); } -#line 8343 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8469 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 207: -#line 919 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 205: +#line 935 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { std::cerr << "Warning: Not yet dealing with value paramaters\n"; } -#line 8349 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8475 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 209: -#line 932 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 207: +#line 948 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < DefinedType > () = DefinedType{yystack_[2].value.as < std::string > (), yystack_[0].value.as < std::string > (), {}}; } -#line 8355 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8481 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 211: -#line 961 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 209: +#line 977 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Assignment > () = Assignment{ yystack_[2].value.as < std::string > (), TypeAssignment{yystack_[0].value.as < Type > ()}, {} }; } -#line 8361 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8487 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 212: -#line 965 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 210: +#line 981 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Assignment > () = Assignment{ yystack_[3].value.as < std::string > (), ValueAssignment{yystack_[2].value.as < Type > (), yystack_[0].value.as < Value > ()}, {} }; } -#line 8367 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8493 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 213: -#line 969 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 211: +#line 985 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Assignment > () = Assignment{ yystack_[3].value.as < std::string > (), TypeAssignment{yystack_[2].value.as < Type > ()}, {} }; } -#line 8373 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8499 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 214: -#line 973 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 212: +#line 989 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Type > () = yystack_[0].value.as < BuiltinType > (); } -#line 8379 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8505 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 215: -#line 975 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 213: +#line 991 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Type > () = yystack_[0].value.as < Type > (); } -#line 8385 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8511 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 216: -#line 977 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 214: +#line 993 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Type > () = yystack_[0].value.as < DefinedType > (); } -#line 8391 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8517 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 215: +#line 995 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { feature_not_implemented(context.location, context.asn1_tree, "SelectionType"); } +#line 8523 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 216: +#line 997 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { feature_not_implemented(context.location, context.asn1_tree, "TypeFromObject"); } +#line 8529 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 217: -#line 979 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { std::cerr << "Warning: Not handled - SelectionType\n"; } -#line 8397 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1001 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = AnyType(); } +#line 8535 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 218: -#line 981 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { std::cerr << "Warning: Not handled - TypeFromObject\n"; } -#line 8403 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1002 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < BitStringType > (); } +#line 8541 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 219: -#line 985 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = AnyType(); } -#line 8409 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1003 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < BooleanType > (); } +#line 8547 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 220: -#line 986 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < BitStringType > (); } -#line 8415 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1004 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < CharacterStringType > (); } +#line 8553 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 221: -#line 987 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < BooleanType > (); } -#line 8421 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1005 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < ChoiceType > (); } +#line 8559 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 222: -#line 988 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < CharacterStringType > (); } -#line 8427 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1006 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < DateType > (); feature_not_implemented(context.location, context.asn1_tree, "DateType"); } +#line 8565 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 223: -#line 989 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < ChoiceType > (); } -#line 8433 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1007 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < DateTimeType > (); feature_not_implemented(context.location, context.asn1_tree, "DateTimeType"); } +#line 8571 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 224: -#line 990 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < DateType > (); } -#line 8439 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1008 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < DurationType > (); feature_not_implemented(context.location, context.asn1_tree, "DurationType"); } +#line 8577 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 225: -#line 991 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < DateTimeType > (); } -#line 8445 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1009 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < EmbeddedPDVType > (); feature_not_implemented(context.location, context.asn1_tree, "EmbeddedPDVType"); } +#line 8583 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 226: -#line 992 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < DurationType > (); } -#line 8451 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1010 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < EnumeratedType > (); } +#line 8589 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 227: -#line 993 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < EmbeddedPDVType > (); } -#line 8457 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1011 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < ExternalType > (); feature_not_implemented(context.location, context.asn1_tree, "ExternalType"); } +#line 8595 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 228: -#line 994 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < EnumeratedType > (); } -#line 8463 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1012 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = GeneralizedTimeType(); } +#line 8601 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 229: -#line 995 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < ExternalType > (); } -#line 8469 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1013 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < InstanceOfType > (); feature_not_implemented(context.location, context.asn1_tree, "InstanceOfType"); } +#line 8607 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 230: -#line 996 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = GeneralizedTimeType(); } -#line 8475 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1014 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < IntegerType > (); } +#line 8613 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 231: -#line 997 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < InstanceOfType > (); } -#line 8481 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1015 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < IRIType > (); feature_not_implemented(context.location, context.asn1_tree, "IRIType"); } +#line 8619 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 232: -#line 998 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < IntegerType > (); } -#line 8487 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1016 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < NullType > (); } +#line 8625 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 233: -#line 999 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < IRIType > (); } -#line 8493 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1017 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < ObjectClassFieldType > (); feature_not_implemented(context.location, context.asn1_tree, "ObjectClassFieldType"); } +#line 8631 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 234: -#line 1000 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < NullType > (); } -#line 8499 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1018 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = ObjectDescriptorType(); } +#line 8637 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 235: -#line 1001 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < ObjectClassFieldType > (); } -#line 8505 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1019 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < ObjectIdentifierType > (); } +#line 8643 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 236: -#line 1002 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = ObjectDescriptorType(); } -#line 8511 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1020 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < OctetStringType > (); } +#line 8649 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 237: -#line 1003 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < ObjectIdentifierType > (); } -#line 8517 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1021 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < RealType > (); feature_not_implemented(context.location, context.asn1_tree, "RealType"); } +#line 8655 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 238: -#line 1004 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < OctetStringType > (); } -#line 8523 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1022 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < RelativeIRIType > (); feature_not_implemented(context.location, context.asn1_tree, "RelativeIRIType"); } +#line 8661 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 239: -#line 1005 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < RealType > (); } -#line 8529 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1023 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < RelativeOIDType > (); feature_not_implemented(context.location, context.asn1_tree, "RelativeOIDType"); } +#line 8667 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 240: -#line 1006 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < RelativeIRIType > (); } -#line 8535 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1024 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < SequenceType > (); } +#line 8673 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 241: -#line 1007 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < RelativeOIDType > (); } -#line 8541 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1025 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < SequenceOfType > (); } +#line 8679 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 242: -#line 1008 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < SequenceType > (); } -#line 8547 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1026 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < SetType > (); feature_not_implemented(context.location, context.asn1_tree, "SET", "Currently SET is treated as a SEQUENCE type. "); } +#line 8685 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 243: -#line 1009 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < SequenceOfType > (); } -#line 8553 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1027 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < SetOfType > (); } +#line 8691 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 244: -#line 1010 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < SetType > (); } -#line 8559 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1028 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < PrefixedType > (); } +#line 8697 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 245: -#line 1011 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < SetOfType > (); } -#line 8565 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1029 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < TimeType > (); feature_not_implemented(context.location, context.asn1_tree, "TimeType"); } +#line 8703 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 246: -#line 1012 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < PrefixedType > (); } -#line 8571 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1030 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < TimeOfDayType > (); feature_not_implemented(context.location, context.asn1_tree, "TimeOfDayType"); } +#line 8709 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 247: -#line 1013 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < TimeType > (); } -#line 8577 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1031 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BuiltinType > () = UTCTimeType(); feature_not_implemented(context.location, context.asn1_tree, "UTCTime"); } +#line 8715 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 248: -#line 1014 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = yystack_[0].value.as < TimeOfDayType > (); } -#line 8583 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1035 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < NamedType > () = NamedType{ yystack_[1].value.as < std::string > (), yystack_[0].value.as < Type > () }; } +#line 8721 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 249: -#line 1015 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < BuiltinType > () = UTCTimeType(); } -#line 8589 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1039 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { std::cerr << std::string("Warning: Unhandled field: BooleanValue\n"); } +#line 8727 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 250: -#line 1019 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < NamedType > () = NamedType{ yystack_[1].value.as < std::string > (), yystack_[0].value.as < Type > () }; } -#line 8595 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1041 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { std::cerr << std::string("Warning: Unhandled field: IRIValue\n"); } +#line 8733 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 251: -#line 1023 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { std::cerr << std::string("Warning: Unhandled field: BooleanValue\n"); } -#line 8601 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1043 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { std::cerr << std::string("Warning: Unhandled field: ASN_NULL\n"); } +#line 8739 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 252: -#line 1025 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { std::cerr << std::string("Warning: Unhandled field: IRIValue\n"); } -#line 8607 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1045 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { std::cerr << std::string("Warning: Unhandled field: TimeValue\n"); } +#line 8745 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 253: -#line 1027 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { std::cerr << std::string("Warning: Unhandled field: ASN_NULL\n"); } -#line 8613 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1047 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Value > ().value_selection = BitStringValue{yystack_[0].value.as < std::string > ()}; } +#line 8751 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 254: -#line 1029 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { std::cerr << std::string("Warning: Unhandled field: TimeValue\n"); } -#line 8619 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1049 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Value > ().value_selection = HexStringValue{yystack_[0].value.as < std::string > ()}; } +#line 8757 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 255: -#line 1031 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < Value > ().value_selection = BitStringValue{yystack_[0].value.as < std::string > ()}; } -#line 8625 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1051 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Value > ().value_selection = CharStringValue{yystack_[0].value.as < std::string > ()}; } +#line 8763 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 256: -#line 1033 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < Value > ().value_selection = HexStringValue{yystack_[0].value.as < std::string > ()}; } -#line 8631 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1053 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { std::cerr << std::string("Warning: Unhandled field: CONTAINING\n"); } +#line 8769 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 257: -#line 1035 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < Value > ().value_selection = CharStringValue{yystack_[0].value.as < std::string > ()}; } -#line 8637 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1055 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Value > ().value_selection = yystack_[0].value.as < DefinedValue > (); } +#line 8775 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 258: -#line 1037 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { std::cerr << std::string("Warning: Unhandled field: CONTAINING\n"); } -#line 8643 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 - break; - - case 259: -#line 1039 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < Value > ().value_selection = yystack_[0].value.as < DefinedValue > (); } -#line 8649 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1057 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Value > ().value_selection = NamedNumber{yystack_[3].value.as < std::string > (), yystack_[1].value.as < int64_t > ()}; } +#line 8781 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 260: -#line 1041 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < Value > ().value_selection = NamedNumber{yystack_[3].value.as < std::string > (), yystack_[1].value.as < long long > ()}; } -#line 8655 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 - break; - - case 262: -#line 1044 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < Value > ().value_selection = yystack_[0].value.as < long long > (); } -#line 8661 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1060 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Value > ().value_selection = yystack_[0].value.as < int64_t > (); } +#line 8787 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 263: -#line 1046 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 261: +#line 1062 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Value > ().value_selection = yystack_[0].value.as < double > (); } -#line 8667 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8793 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 264: -#line 1048 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 262: +#line 1064 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { std::cerr << std::string("Warning: Unhandled field: ValueCommaListChoice\n"); } -#line 8673 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8799 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 265: -#line 1050 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 263: +#line 1066 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { std::cerr << std::string("Warning: Unhandled field: ValueCommaListChoice\n"); } -#line 8679 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8805 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 270: -#line 1058 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 268: +#line 1074 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Value > ().value_selection = yystack_[1].value.as < std::vector > (); } -#line 8685 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8811 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 271: -#line 1060 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 269: +#line 1076 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { std::cerr << std::string("Warning: Unhandled field: ValueChoice\n"); } -#line 8691 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8817 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 272: -#line 1062 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 270: +#line 1078 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { std::cerr << std::string("Warning: Unhandled field: OPTIONAL\n"); } -#line 8697 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8823 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 273: -#line 1064 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 271: +#line 1080 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { std::cerr << std::string("Warning: Unhandled field: ValueCommaListChoice\n"); } -#line 8703 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8829 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 274: -#line 1066 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 272: +#line 1082 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { std::cerr << std::string("Warning: Unhandled field: BY\n"); } -#line 8709 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8835 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 275: -#line 1068 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 273: +#line 1084 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { std::cerr << std::string("Warning: Unhandled field: WITH\n"); } -#line 8715 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8841 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 276: -#line 1073 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 274: +#line 1089 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Value > () = yystack_[0].value.as < Value > (); } -#line 8721 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8847 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 277: -#line 1075 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 275: +#line 1091 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Value > ().value_selection = yystack_[0].value.as < std::string > (); } -#line 8727 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8853 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 284: -#line 1091 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 282: +#line 1107 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > ().push_back(yystack_[0].value.as < Value > ()); } -#line 8733 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8859 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 285: -#line 1093 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 283: +#line 1109 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[1].value.as < std::vector > (); yylhs.value.as < std::vector > ().push_back(yystack_[0].value.as < Value > ()); } -#line 8739 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8865 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 289: -#line 1108 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 285: +#line 1120 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BooleanValue > () = {true}; } +#line 8871 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 286: +#line 1122 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < BooleanValue > () = {false}; } +#line 8877 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 287: +#line 1126 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < IntegerType > () = IntegerType{{}}; } -#line 8745 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8883 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 290: -#line 1110 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 288: +#line 1128 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < IntegerType > () = IntegerType{yystack_[1].value.as < std::vector > ()}; } -#line 8751 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8889 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 291: -#line 1114 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 289: +#line 1132 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = {yystack_[0].value.as < NamedNumber > ()}; } -#line 8757 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8895 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 292: -#line 1116 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 290: +#line 1134 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[2].value.as < std::vector > (); yylhs.value.as < std::vector > ().push_back(yystack_[0].value.as < NamedNumber > ()); } -#line 8763 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8901 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 293: -#line 1120 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < NamedNumber > () = NamedNumber{ yystack_[3].value.as < std::string > (), yystack_[1].value.as < long long > () }; } -#line 8769 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 + case 291: +#line 1138 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < NamedNumber > () = NamedNumber{ yystack_[3].value.as < std::string > (), yystack_[1].value.as < int64_t > () }; } +#line 8907 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 294: -#line 1122 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 292: +#line 1140 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < NamedNumber > () = NamedNumber{ yystack_[3].value.as < std::string > (), 0 }; } -#line 8775 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8913 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 295: -#line 1126 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < long long > () = yystack_[0].value.as < long long > (); } -#line 8781 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 + case 293: +#line 1144 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < int64_t > () = yystack_[0].value.as < int64_t > (); } +#line 8919 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 296: -#line 1128 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < long long > () = yystack_[0].value.as < long long > (); } -#line 8787 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 + case 294: +#line 1146 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < int64_t > () = yystack_[0].value.as < int64_t > (); } +#line 8925 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 297: -#line 1132 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 295: +#line 1150 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < EnumeratedType > () = yystack_[1].value.as < EnumeratedType > (); } -#line 8793 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8931 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 298: -#line 1136 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 296: +#line 1154 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < EnumeratedType > () = yystack_[0].value.as < EnumeratedType > (); yylhs.value.as < EnumeratedType > ().accept_anything = false; } -#line 8800 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8938 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 299: -#line 1139 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 297: +#line 1157 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < EnumeratedType > () = yystack_[3].value.as < EnumeratedType > (); yylhs.value.as < EnumeratedType > ().accept_anything = true; } -#line 8807 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8945 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 300: -#line 1142 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 298: +#line 1160 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < EnumeratedType > () = yystack_[5].value.as < EnumeratedType > (); yylhs.value.as < EnumeratedType > ().accept_anything = true; yylhs.value.as < EnumeratedType > ().enum_values.insert(yylhs.value.as < EnumeratedType > ().enum_values.end(), yystack_[0].value.as < EnumeratedType > ().enum_values.begin(), yystack_[0].value.as < EnumeratedType > ().enum_values.end()); } -#line 8815 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8953 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 302: -#line 1149 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 300: +#line 1167 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < EnumeratedType > ().enum_values.push_back(yystack_[0].value.as < EnumerationValue > ()); } -#line 8821 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8959 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 303: -#line 1151 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 301: +#line 1169 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < EnumeratedType > () = yystack_[2].value.as < EnumeratedType > (); yylhs.value.as < EnumeratedType > ().enum_values.push_back(yystack_[0].value.as < EnumerationValue > ()); } -#line 8827 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8965 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 304: -#line 1155 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 302: +#line 1173 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < EnumerationValue > ().name = yystack_[0].value.as < std::string > (); } -#line 8833 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8971 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 305: -#line 1157 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 303: +#line 1175 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < EnumerationValue > ().name = yystack_[0].value.as < NamedNumber > ().name; yylhs.value.as < EnumerationValue > ().value = yystack_[0].value.as < NamedNumber > ().number; } -#line 8840 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8978 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 307: -#line 1168 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 305: +#line 1186 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < BitStringType > () = BitStringType{}; } -#line 8846 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8984 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 308: -#line 1170 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 306: +#line 1188 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < BitStringType > () = BitStringType{}; } -#line 8852 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8990 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 315: -#line 1199 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 313: +#line 1217 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < SequenceType > () = SequenceType(); } -#line 8858 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 8996 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 316: -#line 1201 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 314: +#line 1219 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < SequenceType > () = SequenceType{yystack_[1].value.as < ComponentTypeList > ()}; } -#line 8864 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9002 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 317: -#line 1205 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 315: +#line 1223 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < ComponentTypeList > () = yystack_[0].value.as < ComponentTypeList > (); } -#line 8870 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9008 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 318: -#line 1207 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 316: +#line 1225 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < ComponentTypeList > () = yystack_[3].value.as < ComponentTypeList > (); } -#line 8876 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9014 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 319: -#line 1209 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 317: +#line 1227 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < ComponentTypeList > () = yystack_[5].value.as < ComponentTypeList > (); yylhs.value.as < ComponentTypeList > ().insert(yylhs.value.as < ComponentTypeList > ().end(), yystack_[0].value.as < ComponentTypeList > ().begin(), yystack_[0].value.as < ComponentTypeList > ().end()); } -#line 8882 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9020 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 320: -#line 1211 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 318: +#line 1229 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < ComponentTypeList > () = yystack_[7].value.as < ComponentTypeList > (); yylhs.value.as < ComponentTypeList > ().insert(yylhs.value.as < ComponentTypeList > ().end(), yystack_[2].value.as < ComponentTypeList > ().begin(), yystack_[2].value.as < ComponentTypeList > ().end()); } -#line 8888 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9026 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 321: -#line 1213 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 319: +#line 1231 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < ComponentTypeList > () = yystack_[9].value.as < ComponentTypeList > (); yylhs.value.as < ComponentTypeList > ().insert(yylhs.value.as < ComponentTypeList > ().end(), yystack_[4].value.as < ComponentTypeList > ().begin(), yystack_[4].value.as < ComponentTypeList > ().end()); yylhs.value.as < ComponentTypeList > ().insert(yylhs.value.as < ComponentTypeList > ().end(), yystack_[0].value.as < ComponentTypeList > ().begin(), yystack_[0].value.as < ComponentTypeList > ().end()); } -#line 8894 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9032 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 322: -#line 1215 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 320: +#line 1233 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < ComponentTypeList > () = yystack_[0].value.as < ComponentTypeList > (); } -#line 8900 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9038 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 323: -#line 1217 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 321: +#line 1235 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < ComponentTypeList > () = yystack_[2].value.as < ComponentTypeList > (); } -#line 8906 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9044 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 324: -#line 1219 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 322: +#line 1237 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < ComponentTypeList > () = {}; } -#line 8912 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9050 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 325: -#line 1221 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 323: +#line 1239 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < ComponentTypeList > () = {}; } -#line 8918 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9056 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 326: -#line 1225 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 324: +#line 1243 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < ComponentTypeList > () = ComponentTypeList{yystack_[0].value.as < ComponentType > ()}; } -#line 8924 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9062 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 327: -#line 1227 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 325: +#line 1245 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yystack_[2].value.as < ComponentTypeList > ().push_back(yystack_[0].value.as < ComponentType > ()); yylhs.value.as < ComponentTypeList > () = yystack_[2].value.as < ComponentTypeList > (); } -#line 8930 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9068 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 326: +#line 1249 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { std::cerr << context.location << " WARNING: unnamed type\n"; + yylhs.value.as < ComponentType > () = ComponentType{{gen_anon_member_name(), yystack_[0].value.as < Type > ()}, false, absl::nullopt, absl::nullopt, StorageMode::static_ }; } +#line 9075 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 327: +#line 1252 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { std::cerr << context.location << " WARNING: unnamed type\n"; + yylhs.value.as < ComponentType > () = ComponentType{{gen_anon_member_name(), yystack_[1].value.as < Type > ()}, true, absl::nullopt, absl::nullopt, StorageMode::static_ }; } +#line 9082 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 328: -#line 1231 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < ComponentType > () = ComponentType{{gen_anon_member_name(), yystack_[0].value.as < Type > ()}, false, absl::nullopt, absl::nullopt}; } -#line 8936 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1255 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < ComponentType > () = ComponentType{{gen_anon_member_name(), yystack_[2].value.as < Type > ()}, false, yystack_[0].value.as < Value > (), absl::nullopt, StorageMode::static_ }; + std::cerr << context.location << " WARNING: unnamed type\n"; } +#line 9089 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 329: -#line 1233 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < ComponentType > () = ComponentType{{gen_anon_member_name(), yystack_[1].value.as < Type > ()}, true, absl::nullopt, absl::nullopt}; } -#line 8942 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1258 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < ComponentType > () = ComponentType{yystack_[0].value.as < NamedType > (), false, absl::nullopt, absl::nullopt, StorageMode::static_ }; } +#line 9095 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 330: -#line 1235 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < ComponentType > () = ComponentType{{gen_anon_member_name(), yystack_[2].value.as < Type > ()}, false, yystack_[0].value.as < Value > (), absl::nullopt}; } -#line 8948 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1260 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < ComponentType > () = ComponentType{yystack_[1].value.as < NamedType > (), true, absl::nullopt, absl::nullopt, StorageMode::static_ }; } +#line 9101 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 331: -#line 1237 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < ComponentType > () = ComponentType{yystack_[0].value.as < NamedType > (), false, absl::nullopt, absl::nullopt}; } -#line 8954 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1262 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < ComponentType > () = ComponentType{yystack_[2].value.as < NamedType > (), false, yystack_[0].value.as < Value > (), absl::nullopt, StorageMode::static_ }; } +#line 9107 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 332: -#line 1239 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < ComponentType > () = ComponentType{yystack_[1].value.as < NamedType > (), true, absl::nullopt, absl::nullopt}; } -#line 8960 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1264 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < ComponentType > () = ComponentType{{}, false, absl::nullopt, yystack_[0].value.as < Type > (), StorageMode::static_}; } +#line 9113 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 333: -#line 1241 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < ComponentType > () = ComponentType{yystack_[2].value.as < NamedType > (), false, yystack_[0].value.as < Value > (), absl::nullopt}; } -#line 8966 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1276 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < SequenceOfType > () = SequenceOfType{ false, nullptr, std::unique_ptr(new Type(yystack_[0].value.as < Type > ())) }; } +#line 9119 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 334: -#line 1243 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < ComponentType > () = ComponentType{{}, false, absl::nullopt, yystack_[0].value.as < Type > ()}; } -#line 8972 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1278 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < SequenceOfType > () = SequenceOfType{ true, std::unique_ptr(new NamedType(yystack_[0].value.as < NamedType > ())), nullptr }; } +#line 9125 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 335: -#line 1255 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < SequenceOfType > () = SequenceOfType{ false, nullptr, std::unique_ptr(new Type(yystack_[0].value.as < Type > ())) }; } -#line 8978 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1282 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < SetType > () = SetType{}; } +#line 9131 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 336: -#line 1257 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < SequenceOfType > () = SequenceOfType{ true, std::unique_ptr(new NamedType(yystack_[0].value.as < NamedType > ())), nullptr }; } -#line 8984 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1284 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < SetType > () = SetType{yystack_[1].value.as < ComponentTypeList > ()}; } +#line 9137 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 337: -#line 1261 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < SetType > () = SetType{}; } -#line 8990 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1288 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < SetOfType > () = SetOfType{ false, nullptr, std::unique_ptr(new Type(yystack_[0].value.as < Type > ())) }; } +#line 9143 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 338: -#line 1263 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < SetType > () = SetType{yystack_[1].value.as < ComponentTypeList > ()}; } -#line 8996 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1290 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < SetOfType > () = SetOfType{ true, std::unique_ptr(new NamedType(yystack_[0].value.as < NamedType > ())), nullptr }; } +#line 9149 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 339: -#line 1267 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < SetOfType > () = SetOfType{ false, nullptr, std::unique_ptr(new Type(yystack_[0].value.as < Type > ())) }; } -#line 9002 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 1294 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < ChoiceType > () = ChoiceType{ yystack_[1].value.as < std::vector > (), StorageMode::static_ }; } +#line 9155 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; case 340: -#line 1269 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < SetOfType > () = SetOfType{ true, std::unique_ptr(new NamedType(yystack_[0].value.as < NamedType > ())), nullptr }; } -#line 9008 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 - break; - - case 341: -#line 1273 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < ChoiceType > () = ChoiceType{ yystack_[1].value.as < std::vector > () }; } -#line 9014 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 - break; - - case 342: -#line 1277 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 +#line 1298 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[0].value.as < std::vector > (); } -#line 9020 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9161 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 343: -#line 1281 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 341: +#line 1302 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[0].value.as < std::vector > (); } -#line 9026 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9167 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 344: -#line 1283 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 342: +#line 1304 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[2].value.as < std::vector > (); } -#line 9032 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9173 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 345: -#line 1285 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 343: +#line 1306 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[4].value.as < std::vector > (); yylhs.value.as < std::vector > ().insert(yylhs.value.as < std::vector > ().begin(), yystack_[0].value.as < std::vector > ().begin(), yystack_[0].value.as < std::vector > ().end()); } -#line 9038 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9179 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 346: -#line 1289 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 344: +#line 1310 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = std::vector { yystack_[0].value.as < NamedType > () }; } -#line 9044 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9185 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 347: -#line 1291 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 345: +#line 1312 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yystack_[2].value.as < std::vector > ().push_back( yystack_[0].value.as < NamedType > () ); yylhs.value.as < std::vector > () = yystack_[2].value.as < std::vector > (); } -#line 9050 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9191 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 349: -#line 1301 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 347: +#line 1322 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < PrefixedType > () = PrefixedType(yystack_[0].value.as < TaggedType > ()); } -#line 9056 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9197 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 350: -#line 1305 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 348: +#line 1326 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < TaggedType > () = TaggedType{ yystack_[1].value.as < Tag > (), TaggingMode::automatic, yystack_[0].value.as < Type > () }; } -#line 9062 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9203 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 351: -#line 1307 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 349: +#line 1328 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < TaggedType > () = TaggedType{ yystack_[2].value.as < Tag > (), TaggingMode::implicit, yystack_[0].value.as < Type > () }; } -#line 9068 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9209 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 352: -#line 1309 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 350: +#line 1330 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < TaggedType > () = TaggedType{ yystack_[2].value.as < Tag > (), TaggingMode::explicit_, yystack_[0].value.as < Type > () }; } -#line 9074 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9215 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 353: -#line 1313 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 351: +#line 1334 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Tag > () = Tag{ yystack_[2].value.as < Class > (), yystack_[1].value.as < int > () }; } -#line 9080 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9221 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 356: -#line 1321 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < int > () = yystack_[0].value.as < long long > (); } -#line 9086 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 + case 354: +#line 1342 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < int > () = yystack_[0].value.as < int64_t > (); } +#line 9227 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 358: -#line 1326 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 356: +#line 1347 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Class > () = Class::universal; } -#line 9092 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9233 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 359: -#line 1328 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 357: +#line 1349 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Class > () = Class::application; } -#line 9098 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9239 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 360: -#line 1330 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 358: +#line 1351 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Class > () = Class::private_; } -#line 9104 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9245 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 361: -#line 1332 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 359: +#line 1353 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Class > () = Class::context_specific; } -#line 9110 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9251 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 363: -#line 1345 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 361: +#line 1366 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[1].value.as < std::vector > (); std::reverse(yylhs.value.as < std::vector > ().begin(), yylhs.value.as < std::vector > ().end()); } -#line 9116 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9257 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 364: -#line 1347 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 362: +#line 1368 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[1].value.as < std::vector > (); std::reverse(yylhs.value.as < std::vector > ().begin(), yylhs.value.as < std::vector > ().end()); } -#line 9122 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9263 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 365: -#line 1351 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 363: +#line 1372 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > ().push_back(yystack_[0].value.as < ObjectIdComponentValue > ()); } -#line 9128 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9269 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 366: -#line 1353 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 364: +#line 1374 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::vector > () = yystack_[0].value.as < std::vector > (); yylhs.value.as < std::vector > ().push_back(yystack_[1].value.as < ObjectIdComponentValue > ()); } -#line 9134 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9275 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 367: -#line 1357 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 365: +#line 1378 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < ObjectIdComponentValue > () = yystack_[0].value.as < ObjectIdComponentValue > (); } -#line 9140 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9281 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 368: -#line 1359 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 366: +#line 1380 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < ObjectIdComponentValue > () = yystack_[0].value.as < ObjectIdComponentValue > (); } -#line 9146 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9287 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 369: -#line 1361 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 367: +#line 1382 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < ObjectIdComponentValue > () = yystack_[0].value.as < ObjectIdComponentValue > (); } -#line 9152 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9293 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 370: -#line 1365 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 368: +#line 1386 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < ObjectIdComponentValue > ().name = yystack_[0].value.as < std::string > (); } -#line 9158 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9299 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 371: -#line 1369 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < ObjectIdComponentValue > ().value = yystack_[0].value.as < long long > (); } -#line 9164 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 + case 369: +#line 1390 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < ObjectIdComponentValue > ().value = yystack_[0].value.as < int64_t > (); } +#line 9305 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 373: -#line 1374 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 371: +#line 1395 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < ObjectIdComponentValue > () = yystack_[1].value.as < ObjectIdComponentValue > (); yylhs.value.as < ObjectIdComponentValue > ().name = yystack_[3].value.as < std::string > (); } -#line 9170 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9311 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 391: -#line 1447 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 389: +#line 1468 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < CharacterStringType > () = yystack_[0].value.as < CharacterStringType > (); } -#line 9176 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9317 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 392: -#line 1449 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 390: +#line 1470 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < CharacterStringType > () = yystack_[0].value.as < CharacterStringType > (); } -#line 9182 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9323 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 393: -#line 1453 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 391: +#line 1474 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < CharacterStringType > () = CharacterStringType::bmp_string; } -#line 9188 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9329 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 394: -#line 1455 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 392: +#line 1476 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < CharacterStringType > () = CharacterStringType::general_string; } -#line 9194 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9335 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 395: -#line 1457 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 393: +#line 1478 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < CharacterStringType > () = CharacterStringType::graphic_string; } -#line 9200 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9341 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 396: -#line 1459 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 394: +#line 1480 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < CharacterStringType > () = CharacterStringType::ia5_string; } -#line 9206 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9347 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 397: -#line 1461 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 395: +#line 1482 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < CharacterStringType > () = CharacterStringType::iso646_string; } -#line 9212 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9353 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 398: -#line 1463 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 396: +#line 1484 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < CharacterStringType > () = CharacterStringType::numeric_string; } -#line 9218 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9359 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 399: -#line 1465 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 397: +#line 1486 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < CharacterStringType > () = CharacterStringType::printable_string; } -#line 9224 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9365 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 400: -#line 1467 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 398: +#line 1488 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < CharacterStringType > () = CharacterStringType::teletex_string; } -#line 9230 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9371 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 401: -#line 1469 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 399: +#line 1490 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < CharacterStringType > () = CharacterStringType::t61_string; } -#line 9236 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9377 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 402: -#line 1471 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 400: +#line 1492 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < CharacterStringType > () = CharacterStringType::universal_string; } -#line 9242 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9383 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 403: -#line 1473 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 401: +#line 1494 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < CharacterStringType > () = CharacterStringType::utf8_string; } -#line 9248 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9389 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 404: -#line 1475 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 402: +#line 1496 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < CharacterStringType > () = CharacterStringType::videotex_string; } -#line 9254 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9395 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 405: -#line 1477 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 403: +#line 1498 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < CharacterStringType > () = CharacterStringType::visible_string; } -#line 9260 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9401 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 406: -#line 1481 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 404: +#line 1502 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < CharacterStringType > () = CharacterStringType::character_string; } -#line 9266 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9407 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 407: -#line 1485 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 405: +#line 1506 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Type > () = yystack_[1].value.as < Type > (); } -#line 9272 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9413 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 408: -#line 1487 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 - { yylhs.value.as < Type > () = yystack_[0].value.as < Type > (); } -#line 9278 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 + case 406: +#line 1508 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Type > () = yystack_[0].value.as < Type > (); feature_not_implemented(context.location, context.asn1_tree, "TypeWithConstraint", "Not yet checking contraints. "); } +#line 9419 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 409: -#line 1491 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 407: +#line 1512 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Type > () = SetOfType{ false, nullptr, std::unique_ptr(new Type(yystack_[0].value.as < Type > ())) }; } -#line 9284 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9425 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 410: -#line 1493 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 408: +#line 1514 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Type > () = SetOfType{ false, nullptr, std::unique_ptr(new Type(yystack_[0].value.as < Type > ())) }; } -#line 9290 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9431 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 411: -#line 1495 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 409: +#line 1516 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Type > () = SequenceOfType{ false, nullptr, std::unique_ptr(new Type(yystack_[0].value.as < Type > ())) }; } -#line 9296 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9437 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 412: -#line 1497 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 410: +#line 1518 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Type > () = SequenceOfType{ false, nullptr, std::unique_ptr(new Type(yystack_[0].value.as < Type > ())) }; } -#line 9302 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9443 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 413: -#line 1499 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 411: +#line 1520 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Type > () = SetOfType{ true, std::unique_ptr(new NamedType(yystack_[0].value.as < NamedType > ())), nullptr }; } -#line 9308 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9449 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 414: -#line 1501 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 412: +#line 1522 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Type > () = SetOfType{ true, std::unique_ptr(new NamedType(yystack_[0].value.as < NamedType > ())), nullptr }; } -#line 9314 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9455 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 415: -#line 1503 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 413: +#line 1524 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Type > () = SequenceOfType{ true, std::unique_ptr(new NamedType(yystack_[0].value.as < NamedType > ())), nullptr }; } -#line 9320 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9461 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 416: -#line 1505 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 414: +#line 1526 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < Type > () = SequenceOfType{ true, std::unique_ptr(new NamedType(yystack_[0].value.as < NamedType > ())), nullptr }; } -#line 9326 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9467 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 499: -#line 1673 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 415: +#line 1530 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { feature_not_implemented(context.location, context.asn1_tree, "ConstraintSpec", "Not yet checking contraints. "); } +#line 9473 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 449: +#line 1601 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Value > ().value_selection = yystack_[0].value.as < BooleanValue > (); } +#line 9479 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 450: +#line 1604 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Value > ().value_selection = NullValue{}; } +#line 9485 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 451: +#line 1606 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Value > ().value_selection = yystack_[0].value.as < TimeValue > (); } +#line 9491 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 452: +#line 1608 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Value > ().value_selection = yystack_[0].value.as < std::string > (); } +#line 9497 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 453: +#line 1610 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Value > ().value_selection = yystack_[0].value.as < std::string > (); } +#line 9503 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 454: +#line 1612 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Value > ().value_selection = yystack_[0].value.as < std::string > (); } +#line 9509 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 455: +#line 1614 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Value > ().value_selection = yystack_[0].value.as < std::string > (); } +#line 9515 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 456: +#line 1616 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Value > ().value_selection = yystack_[0].value.as < DefinedValue > (); } +#line 9521 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 457: +#line 1618 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Value > ().value_selection = yystack_[0].value.as < int64_t > (); } +#line 9527 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 458: +#line 1620 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + { yylhs.value.as < Value > ().value_selection = yystack_[0].value.as < double > (); } +#line 9533 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 + break; + + case 497: +#line 1705 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::string > () = yystack_[0].value.as < std::string > (); } -#line 9332 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9539 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 500: -#line 1677 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 498: +#line 1709 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::string > () = yystack_[0].value.as < std::string > (); } -#line 9338 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9545 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 501: -#line 1681 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 499: +#line 1713 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::string > () = yystack_[0].value.as < std::string > (); } -#line 9344 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9551 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 502: -#line 1685 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 500: +#line 1717 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::string > () = yystack_[0].value.as < std::string > (); } -#line 9350 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9557 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 503: -#line 1689 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 501: +#line 1721 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::string > () = yystack_[0].value.as < std::string > (); } -#line 9356 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9563 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; - case 504: -#line 1692 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 + case 502: +#line 1724 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:919 { yylhs.value.as < std::string > () = yystack_[0].value.as < std::string > (); } -#line 9362 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9569 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 break; -#line 9366 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:919 +#line 9573 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:919 default: break; } @@ -9634,573 +9841,525 @@ namespace yy { } - const short asn1_parser::yypact_ninf_ = -791; + const short asn1_parser::yypact_ninf_ = -663; - const short asn1_parser::yytable_ninf_ = -504; + const short asn1_parser::yytable_ninf_ = -502; const short asn1_parser::yypact_[] = { - -76, -791, 89, -76, 54, 44, -791, -791, 135, 32, - -791, 86, -791, 111, 94, -791, -791, 97, 32, -791, - -791, -791, 117, 146, -791, -791, 196, 219, 229, 258, - -791, -791, 341, 336, 211, -791, -791, -791, 288, 244, - 242, -791, -791, -791, 336, 239, -791, 342, -791, 211, - -791, 210, -791, 13, -791, 308, 247, -791, -791, 256, - 249, -791, -791, 279, -791, 355, 224, 224, -791, -791, - 224, 291, -791, 276, 224, -791, -4, -791, -791, -791, - -791, -791, -791, -791, -791, 224, -791, -791, -791, 2530, - 3227, -791, -791, -791, -791, -76, -791, -791, -791, -791, - -791, 316, -791, -791, 317, 297, -791, -791, -791, 333, - 298, -791, -791, -791, -791, -791, 339, 304, -791, -791, - 362, -791, 335, -791, -791, -791, -791, -791, -25, -24, - -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, - 3326, 3825, 423, -791, 303, -791, -791, 322, -791, -791, - 3425, 307, -791, -791, 324, -791, -791, 326, 33, -791, - -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, - -791, -791, -791, -791, -791, 2633, -791, -791, -791, -791, - -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, - -791, -791, 114, 323, 318, 3924, 74, 91, 319, -791, - -57, 330, -791, 296, -791, 43, 9, 296, -791, -791, - 3924, 329, 2332, 1340, 371, 372, 3924, 2431, 375, 377, - 344, -791, -791, -791, 303, -791, -791, 329, 334, -791, - 109, -791, 123, -791, 328, -791, 332, 329, 12, 345, - 17, 331, 347, 3326, 116, 331, 1596, 350, -791, 3924, - 3924, 329, 24, 3924, -1, 194, 2226, 458, 22, -791, - -791, -791, 296, -791, 357, -791, 346, 3924, 356, -791, - 366, 359, -791, 367, 354, -791, -791, 360, 144, -791, - 367, 329, -791, 3528, -791, 407, 356, -791, 6, 18, - 376, 365, -791, -791, -791, -791, -791, -791, -791, -791, - 447, 76, 466, 3924, 469, -791, 329, -791, -791, 2226, - 497, -791, 352, 1465, 1721, 130, -791, 388, -791, -791, - -791, -791, 329, -791, -791, -791, 356, -791, -791, 379, - -27, -20, -22, -18, -791, 447, 456, -791, 181, -791, - 3924, -791, 394, 389, -791, -791, -791, -791, -791, -791, - 3924, 3924, 329, -791, -791, 393, 3924, 3924, 275, 25, - -791, 3825, 224, -791, -791, -791, -791, 31, -791, -791, - -791, 384, -791, -791, 329, 2226, 384, -791, -791, -791, - -791, -791, -791, 397, -791, 2226, 213, -791, -791, 2226, - -791, 164, 187, -791, 380, 400, -791, -791, 401, 390, - -791, 329, 186, 173, 391, 385, -791, -791, -791, -791, - 140, 395, 1721, -791, 329, 329, 384, -791, 329, -791, - -791, 2226, -791, -791, 139, 403, -791, -791, 173, 399, - 408, -791, 22, 406, 22, -791, -791, -791, 409, 415, - 147, -791, 421, -791, 62, 329, 2076, -791, -791, 70, - 27, 404, -791, 296, 3924, 411, 77, -791, 77, -791, - -791, 2732, 1977, -791, 428, 11, 2226, -791, 173, -791, - 329, 431, 427, 433, 429, 443, 416, 445, 453, -791, - -791, 1977, -791, -791, 1977, -791, 329, 725, -791, 329, - -791, 329, -791, -791, 329, -791, 329, -791, 4023, 2831, - 9, 150, -791, -791, 37, -791, -791, -791, -791, -791, - -791, -791, -791, -791, -791, -791, 448, 331, 173, 173, - 173, 838, 572, 1596, -791, 1596, 2226, 2226, 2226, 2226, - 2226, 382, -3, 454, 173, 331, 430, -791, 461, -791, - -791, 39, -791, 296, 41, 444, -791, -791, 4, -791, - -791, 449, 356, -791, 462, 463, -791, 329, 2930, -791, - -791, -791, -791, -791, 356, -791, -791, 3627, 543, 173, - -791, -791, 80, -791, 1721, -791, 471, -791, 59, 155, - -791, -791, 451, -22, -791, -791, 932, -791, -791, -791, - 30, -17, -15, -17, 53, 474, 275, -791, 3924, -791, - -791, -791, -791, -791, 173, 468, 475, -791, 173, 173, - 173, 173, 173, -791, -791, -791, -791, -791, 472, -791, - 476, 477, 296, 2226, 16, 459, -791, -791, -791, 464, - 465, -791, 480, -791, 470, 481, 284, 479, 2226, 158, - 485, 478, 329, -791, 482, 483, 484, -791, -791, 416, - 1721, -791, 20, -791, -791, -791, -791, 71, 72, 72, - -791, -791, -791, 510, -791, -791, 329, -791, -791, -791, - -791, -791, 486, 173, 296, 3029, 3726, 2194, -791, 29, - 173, -791, 296, -791, 296, -791, -791, 46, 1721, 483, - 296, 296, -791, -791, 1215, -791, -791, -791, -791, -791, - 350, -791, -791, 77, -791, -791, -791, 494, 296, 488, - -791, 490, 1215, -791, 173, 487, 495, -791, -791, -791, - -791, -791, -791, -791, 484, -791, 4592, 4680, -791, 491, - -791, -791, 397, -791, -791, 316, -791, -791, -791, 317, - 297, -791, -791, -791, -791, 2226, -791, -791, -791, -791, - -791, 333, -791, -791, -791, 298, -791, -791, -791, -791, - -791, -791, -791, -791, -791, -791, -791, -791, 339, -791, - 206, -791, -791, -791, -791, -791, 362, 335, -791, -791, - -791, -791, -791, -791, -791, -791, -791, -791, -791, -25, - -24, -791, -791, -791, -791, -791, -791, -791, -791, 493, - -791, -791, -791, -791, -791, 139, 1852, -791, 496, 1068, - -791, -791, 329, 173, -791, -791, -791, 4496, -791, 296, - 3128, 173, -791, -791, 489, -791, -791, -791, -791, -791, - -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, - -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, - -791, -791, -791, -791, -791, -791, -791, -791, -791, 4496, - -791, 4262, -791, -791, -791, 4145, -791, 498, 507, 4379, - -791, -791, -791, -791, 3726, -791, -791, 499, 3726 + -86, -663, 173, -86, 35, 75, -663, -663, 242, 19, + -663, 73, -663, 87, 162, -663, -663, 136, 19, -663, + -663, -663, 158, 132, -663, -663, 193, 224, 240, 246, + -663, -663, 355, 307, 221, -663, -663, -663, 293, 248, + 244, -663, -663, -663, 307, 243, -663, 343, -663, 221, + -663, 222, -663, -1, -663, 309, 245, -663, -663, 252, + 253, -663, -663, 273, -663, 348, 199, 199, -663, -663, + 199, 280, -663, 264, 199, -663, -15, -663, -663, -663, + -663, -663, -663, -663, -663, 199, -663, -663, -663, 2747, + 3444, -663, -663, -663, -663, -86, -663, -663, -663, -663, + -663, 304, -663, -663, 305, 287, -663, -663, -663, 322, + 294, -663, -663, -663, -663, -663, 332, 296, -663, -663, + 357, -663, 321, -663, -663, -663, -663, -663, -6, 0, + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + 3543, 4042, 411, -663, 290, -663, -663, 314, -663, -663, + 3642, 299, -663, -663, 316, -663, -663, 317, 184, -663, + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, 2850, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, 122, 315, 308, 4141, 187, -5, 311, -663, + 323, 324, -663, 300, -663, -50, 43, 300, -663, -663, + 4141, 326, 2549, 1557, 366, 367, 4141, 2648, 370, 371, + 336, -663, -663, -663, 290, -663, -663, 326, 330, -663, + 88, -663, 27, -663, 320, -663, 329, 326, -41, 335, + 20, 328, 338, 3543, 188, 328, 1813, 349, -663, 4141, + 4141, 326, 36, 4141, 18, 190, 2443, 452, 34, -663, + 300, -663, 352, -663, 341, 4141, 350, -663, 356, 346, + -663, 354, 347, -663, -663, 358, 94, -663, 354, 326, + -663, 3745, -663, 397, 350, -663, 2, 24, 362, 351, + -663, -663, -663, -663, -663, -663, -663, -663, 432, -7, + 455, 4141, 458, -663, 326, -663, -663, 2443, 479, -663, + 310, 1682, 1938, 96, 375, 377, -663, -663, -663, -663, + -663, -663, -663, 326, -663, -663, -663, 350, -663, -663, + 365, -44, -33, -10, 1, -663, 432, 449, -663, 72, + -663, 4141, -663, 395, 390, -663, -663, -663, -663, -663, + -663, 398, 383, 4141, 4141, 326, -663, -663, 400, 4141, + 4141, 201, 26, -663, 4042, 199, -663, -663, -663, -663, + 39, -663, -663, -663, 385, -663, -663, 326, 2443, 385, + -663, -663, -663, -663, -663, -663, 401, -663, 2443, 209, + -663, -663, 2443, -663, 144, 171, -663, 381, -663, 403, + 392, 326, 178, 146, 404, 399, -663, -663, -663, -663, + 103, 405, 1938, -663, 326, 326, 385, -663, 326, -663, + -663, 2443, -663, -663, 98, 416, -663, -663, 146, 408, + 409, -663, 34, 427, 34, -663, -663, -663, 429, 117, + -663, 430, -663, -47, 326, 2293, -663, -663, -46, 41, + 410, -663, 300, 4141, 421, 759, -663, 759, -663, -663, + 2949, 2194, -663, 433, 12, 2443, -663, 146, -663, 326, + 436, 426, 439, 428, 441, 422, 1813, 443, 450, -663, + -663, 2194, -663, -663, 2194, -663, 326, 30, -663, 11, + 326, -663, 326, -663, -663, 326, -663, 326, -663, 4240, + 3048, 43, 125, -663, -663, 32, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -663, -663, 442, 328, 146, + 146, 146, 1083, 569, -663, 1813, 2443, 2443, 2443, 2443, + 2443, 333, 9, 460, 146, 328, 424, -663, 462, -663, + -663, 55, -663, 300, 61, 451, -663, -663, 5, -663, + -663, 350, -663, 453, 465, -663, 326, 3147, -663, 347, + -663, -663, 350, -663, -663, 3844, 549, 146, -663, -663, + 59, -663, 1938, -663, 471, -663, 114, 134, -663, 469, + -663, 461, -10, -663, -663, 499, -663, -663, -663, -663, + 38, -18, 74, -18, 40, 481, 201, -663, 4141, -663, + -663, -663, -663, -663, 146, 472, -663, 146, 146, 146, + 146, 146, -663, -663, -663, -663, 475, -663, 476, 478, + 300, 2443, 470, -663, -663, -663, 473, 477, -663, 483, + -663, 480, 487, 241, 468, 2443, 142, 491, 482, 326, + -663, 485, 488, 492, -663, -663, 422, -663, 1938, -663, + 29, -663, -663, -663, -663, 48, 56, 56, -663, -663, + -663, 514, -663, -663, 326, -663, -663, -663, -663, 497, + 146, 300, 3246, 3943, 2411, -663, 33, 146, -663, 300, + -663, 300, -663, -663, 81, 1938, 488, 300, 300, -663, + -663, 1432, -663, -663, -663, -663, -663, 349, -663, -663, + 759, -663, -663, -663, 501, 300, 498, -663, 500, 1432, + -663, 146, 495, 504, -663, -663, -663, -663, -663, -663, + -663, 492, -663, 4809, 4897, -663, 502, -663, -663, 401, + -663, -663, 304, -663, -663, -663, 305, 287, -663, -663, + -663, -663, 2443, -663, -663, -663, -663, -663, 322, -663, + -663, -663, 294, -663, -663, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, 332, -663, 212, -663, -663, + -663, -663, -663, 357, 321, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -663, -6, 0, -663, -663, + -663, -663, -663, -663, -663, -663, 503, -663, -663, -663, + -663, -663, 98, 2069, -663, 506, 1285, -663, -663, 326, + 146, -663, -663, -663, 4713, -663, 300, 3345, 146, -663, + -663, 490, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -663, 4713, -663, 4479, -663, + -663, -663, 4362, -663, 507, 517, 4596, -663, -663, -663, + -663, 3943, -663, -663, 509, 3943 }; const unsigned short asn1_parser::yydefact_[] = { - 0, 502, 0, 2, 0, 147, 1, 3, 158, 0, - 144, 145, 146, 0, 162, 155, 500, 0, 150, 153, - 154, 152, 370, 0, 149, 157, 0, 0, 0, 164, - 148, 151, 0, 0, 379, 161, 159, 160, 0, 0, - 0, 380, 381, 377, 0, 0, 163, 0, 156, 379, - 376, 169, 378, 171, 143, 173, 0, 499, 501, 0, - 170, 183, 185, 186, 188, 0, 175, 0, 168, 167, - 0, 0, 4, 0, 174, 176, 0, 193, 195, 196, - 95, 96, 97, 98, 165, 189, 191, 192, 194, 0, - 0, 184, 187, 172, 177, 0, 190, 68, 11, 219, - 314, 0, 393, 286, 0, 0, 387, 389, 390, 0, - 0, 384, 230, 394, 395, 396, 0, 289, 397, 398, - 0, 236, 0, 375, 399, 306, 374, 382, 0, 0, - 401, 400, 385, 388, 10, 402, 249, 403, 404, 405, - 0, 0, 355, 499, 0, 112, 67, 0, 83, 235, - 0, 0, 218, 231, 0, 216, 199, 197, 0, 214, - 221, 232, 228, 239, 220, 238, 234, 242, 243, 244, - 245, 223, 217, 246, 349, 0, 237, 241, 233, 240, - 227, 229, 247, 224, 248, 225, 226, 222, 391, 392, - 215, 408, 84, 0, 0, 0, 0, 198, 0, 178, - 182, 307, 406, 0, 383, 0, 0, 0, 362, 313, + 0, 500, 0, 2, 0, 147, 1, 3, 158, 0, + 144, 145, 146, 0, 162, 155, 498, 0, 150, 153, + 154, 152, 368, 0, 149, 157, 0, 0, 0, 164, + 148, 151, 0, 0, 377, 161, 159, 160, 0, 0, + 0, 378, 379, 375, 0, 0, 163, 0, 156, 377, + 374, 169, 376, 171, 143, 173, 0, 497, 499, 0, + 170, 181, 183, 184, 186, 0, 175, 0, 168, 167, + 0, 0, 4, 0, 174, 176, 0, 191, 193, 194, + 95, 96, 97, 98, 165, 187, 189, 190, 192, 0, + 0, 182, 185, 172, 177, 0, 188, 68, 11, 217, + 312, 0, 391, 284, 0, 0, 385, 387, 388, 0, + 0, 382, 228, 392, 393, 394, 0, 287, 395, 396, + 0, 234, 0, 373, 397, 304, 372, 380, 0, 0, + 399, 398, 383, 386, 10, 400, 247, 401, 402, 403, + 0, 0, 353, 497, 0, 112, 67, 0, 83, 233, + 0, 0, 216, 229, 0, 214, 197, 195, 0, 212, + 219, 230, 226, 237, 218, 236, 232, 240, 241, 242, + 243, 221, 215, 244, 347, 0, 235, 239, 231, 238, + 225, 227, 245, 222, 246, 223, 224, 220, 389, 390, + 213, 406, 84, 0, 0, 0, 0, 196, 0, 178, + 179, 305, 404, 0, 381, 0, 0, 0, 360, 311, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 499, 13, 6, 8, 12, 14, 211, 0, 7, - 500, 111, 0, 104, 0, 108, 107, 110, 186, 0, - 361, 0, 0, 0, 0, 0, 0, 0, 407, 0, - 0, 350, 0, 0, 0, 0, 0, 0, 0, 179, - 180, 181, 0, 346, 0, 342, 343, 0, 495, 305, - 0, 298, 302, 304, 503, 114, 8, 0, 0, 291, - 0, 335, 336, 0, 472, 0, 495, 315, 328, 331, - 0, 317, 326, 295, 296, 460, 454, 455, 456, 386, - 0, 314, 0, 0, 0, 288, 0, 462, 469, 0, - 0, 287, 0, 0, 0, 457, 458, 130, 419, 119, - 120, 121, 473, 451, 459, 453, 495, 418, 420, 421, - 424, 0, 426, 0, 429, 0, 432, 440, 442, 443, - 0, 444, 0, 464, 446, 447, 445, 448, 449, 450, - 0, 0, 339, 340, 337, 0, 0, 0, 0, 0, - 103, 0, 0, 354, 359, 360, 358, 0, 24, 25, - 26, 93, 86, 102, 99, 0, 113, 263, 255, 256, - 257, 268, 269, 253, 274, 0, 278, 272, 275, 0, - 261, 499, 501, 208, 235, 0, 259, 201, 0, 204, - 117, 206, 207, 0, 273, 271, 251, 262, 252, 254, - 200, 0, 0, 213, 352, 351, 94, 209, 348, 69, - 85, 0, 253, 278, 277, 501, 264, 276, 212, 0, - 0, 371, 372, 0, 365, 367, 368, 369, 370, 200, - 0, 309, 0, 341, 0, 250, 0, 301, 297, 0, - 0, 0, 290, 0, 0, 324, 0, 329, 0, 332, - 316, 0, 0, 425, 0, 140, 0, 474, 492, 493, - 0, 478, 90, 0, 88, 0, 0, 0, 0, 437, - 436, 0, 439, 438, 0, 433, 461, 0, 465, 411, - 415, 412, 416, 338, 409, 413, 410, 414, 29, 0, - 0, 0, 16, 18, 33, 19, 20, 21, 22, 23, - 503, 9, 105, 106, 356, 357, 0, 0, 101, 258, - 284, 0, 0, 0, 202, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 100, 0, 0, 372, 0, 363, - 366, 0, 308, 0, 0, 344, 347, 497, 0, 496, - 494, 0, 495, 303, 0, 0, 292, 334, 0, 452, - 457, 458, 330, 333, 495, 327, 435, 129, 0, 141, - 477, 475, 0, 476, 0, 87, 0, 441, 0, 0, - 132, 417, 422, 427, 430, 471, 0, 470, 463, 466, + 0, 497, 13, 6, 8, 12, 14, 209, 0, 7, + 499, 111, 0, 104, 0, 108, 107, 110, 184, 0, + 359, 0, 0, 0, 0, 0, 0, 0, 405, 0, + 0, 348, 0, 0, 0, 0, 0, 0, 0, 180, + 0, 344, 0, 340, 341, 0, 493, 303, 0, 296, + 300, 302, 501, 114, 8, 0, 0, 289, 0, 333, + 334, 0, 470, 0, 493, 313, 326, 329, 0, 315, + 324, 293, 294, 458, 452, 453, 454, 384, 0, 312, + 0, 0, 0, 286, 0, 460, 467, 0, 0, 285, + 0, 0, 0, 455, 130, 0, 417, 119, 120, 121, + 456, 199, 117, 471, 449, 457, 451, 493, 416, 418, + 419, 422, 0, 424, 0, 427, 0, 430, 438, 440, + 441, 0, 442, 0, 462, 444, 445, 443, 446, 447, + 448, 198, 0, 0, 0, 337, 338, 335, 0, 0, + 0, 0, 0, 103, 0, 0, 352, 357, 358, 356, + 0, 24, 25, 26, 93, 86, 102, 99, 0, 113, + 261, 253, 254, 255, 266, 267, 251, 272, 0, 276, + 270, 273, 0, 259, 497, 499, 206, 233, 257, 0, + 202, 204, 205, 0, 271, 269, 249, 260, 250, 252, + 198, 0, 0, 211, 350, 349, 94, 207, 346, 69, + 85, 0, 251, 276, 275, 499, 262, 274, 210, 0, + 0, 369, 370, 0, 363, 365, 366, 367, 368, 0, + 307, 0, 339, 0, 248, 0, 299, 295, 0, 0, + 0, 288, 0, 0, 322, 0, 327, 0, 330, 314, + 0, 0, 423, 0, 140, 0, 472, 490, 491, 0, + 476, 90, 0, 88, 0, 0, 0, 0, 0, 435, + 434, 0, 437, 436, 0, 431, 459, 0, 463, 0, + 409, 413, 410, 414, 336, 407, 411, 408, 412, 29, + 0, 0, 0, 16, 18, 33, 19, 20, 21, 22, + 23, 501, 9, 105, 106, 354, 355, 0, 0, 101, + 256, 282, 0, 0, 200, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 100, 0, 0, 370, 0, 361, + 364, 0, 306, 0, 0, 342, 345, 495, 0, 494, + 492, 493, 301, 0, 0, 290, 332, 0, 450, 455, + 328, 331, 493, 325, 433, 129, 0, 141, 475, 473, + 0, 474, 0, 87, 0, 439, 0, 0, 132, 0, + 415, 420, 425, 428, 469, 0, 468, 461, 464, 208, 49, 36, 36, 36, 53, 55, 0, 30, 0, 31, - 28, 353, 27, 270, 285, 0, 0, 205, 279, 265, - 281, 280, 282, 266, 267, 210, 283, 364, 0, 310, - 0, 0, 0, 0, 0, 299, 294, 293, 325, 322, - 318, 128, 111, 125, 0, 0, 110, 0, 0, 0, - 0, 482, 487, 91, 89, 137, 134, 138, 131, 0, - 0, 467, 0, 47, 46, 34, 35, 45, 40, 40, - 52, 51, 50, 0, 15, 17, 32, 260, 203, 373, - 311, 312, 345, 498, 0, 0, 0, 0, 122, 0, - 142, 479, 0, 481, 0, 486, 484, 491, 0, 137, - 0, 0, 133, 423, 0, 70, 48, 71, 72, 73, - 0, 43, 42, 0, 38, 41, 37, 0, 0, 300, - 323, 319, 0, 124, 123, 499, 0, 483, 489, 490, - 488, 485, 92, 136, 135, 139, 24, 25, 505, 506, - 507, 508, 253, 510, 511, 512, 393, 286, 274, 516, - 517, 518, 519, 520, 521, 522, 387, 389, 525, 526, - 390, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 384, 288, 539, 540, 541, 542, 543, 544, 545, 546, - 278, 548, 549, 550, 551, 552, 553, 554, 555, 375, - 272, 558, 559, 560, 561, 562, 306, 374, 382, 566, - 567, 568, 569, 570, 571, 572, 385, 388, 287, 576, - 577, 578, 579, 275, 66, 277, 0, 79, 0, 0, - 77, 80, 81, 82, 65, 44, 39, 64, 54, 0, - 0, 82, 480, 75, 0, 76, 78, 506, 509, 512, - 513, 514, 515, 516, 517, 522, 523, 524, 527, 528, - 532, 537, 538, 545, 547, 553, 554, 556, 557, 563, - 564, 565, 566, 567, 573, 574, 575, 576, 580, 64, - 504, 64, 56, 59, 58, 0, 62, 320, 0, 64, - 5, 57, 61, 63, 0, 74, 60, 321, 0 + 28, 351, 27, 268, 283, 0, 203, 277, 263, 279, + 278, 280, 264, 265, 281, 362, 0, 308, 0, 0, + 0, 0, 297, 292, 291, 323, 320, 316, 128, 111, + 125, 0, 0, 110, 0, 0, 0, 0, 480, 485, + 91, 89, 137, 134, 138, 131, 0, 201, 0, 465, + 0, 47, 46, 34, 35, 45, 40, 40, 52, 51, + 50, 0, 15, 17, 32, 258, 371, 309, 310, 343, + 496, 0, 0, 0, 0, 122, 0, 142, 477, 0, + 479, 0, 484, 482, 489, 0, 137, 0, 0, 133, + 421, 0, 70, 48, 71, 72, 73, 0, 43, 42, + 0, 38, 41, 37, 0, 0, 298, 321, 317, 0, + 124, 123, 497, 0, 481, 487, 488, 486, 483, 92, + 136, 135, 139, 24, 25, 503, 504, 505, 506, 251, + 508, 509, 510, 391, 284, 272, 514, 515, 516, 517, + 518, 519, 520, 385, 387, 523, 524, 388, 526, 527, + 528, 529, 530, 531, 532, 533, 534, 382, 286, 537, + 538, 539, 540, 541, 542, 543, 544, 276, 546, 547, + 548, 549, 550, 551, 552, 553, 373, 270, 556, 557, + 558, 559, 560, 304, 372, 380, 564, 565, 566, 567, + 568, 569, 570, 383, 386, 285, 574, 575, 576, 577, + 273, 66, 275, 0, 79, 0, 0, 77, 80, 81, + 82, 65, 44, 39, 64, 54, 0, 0, 82, 478, + 75, 0, 76, 78, 504, 507, 510, 511, 512, 513, + 514, 515, 520, 521, 522, 525, 526, 530, 535, 536, + 543, 545, 551, 552, 554, 555, 561, 562, 563, 564, + 565, 571, 572, 573, 574, 578, 64, 502, 64, 56, + 59, 58, 0, 62, 318, 0, 64, 5, 57, 61, + 63, 0, 74, 60, 319, 0 }; const short asn1_parser::yypgoto_[] = { - -791, 631, -791, -791, -137, -791, -130, -791, 396, -791, - -791, 45, -471, 95, -791, -791, -791, -178, -791, -19, - -791, -791, -791, -791, -791, -791, -791, -791, -216, -790, - -791, -791, -791, -682, -586, -791, -32, -791, -791, -791, - -791, -791, -163, -159, 81, -791, -791, 410, -791, 241, - -791, -791, -791, -791, -791, 559, -791, 289, -791, 84, - -791, -791, -791, -791, -791, -791, -791, -791, -791, -791, - 5, -34, -31, -791, -791, -791, -791, -791, -791, 638, - -791, 625, -791, -791, -791, -791, -791, -791, -791, -791, - -791, -791, 584, -791, -791, 607, 591, -117, 579, -791, - -791, -218, -791, -791, -382, -791, -791, -791, -791, -791, - -791, 217, -791, -146, -229, 176, -791, -791, -30, -791, - -791, -96, -791, -791, -191, -199, -791, -791, -2, -448, - -791, -791, -791, 131, -791, -791, -791, 460, -553, -436, - -791, -791, -791, -791, -791, -791, 57, -791, -791, -791, - -791, -791, -791, -791, -791, -791, -88, -791, 161, 145, - -791, -791, -791, 665, -791, 636, 643, -791, -791, -791, - -791, -79, -791, -791, -791, -791, -791, -791, -791, -791, - -791, -121, -791, -791, -260, -307, -791, -791, 199, -791, - 204, -791, 358, -791, -791, 228, -791, -429, -791, -791, - -791, -791, -791, -791, 105, -106, -791, -791, -791, -791, - -791, -332, -791, -791, -791, -791, -791, -791, -273, -791, - 223, -9, -33, 15, -357, -791 + -663, 644, -663, -663, -136, -663, -129, -663, 407, -663, + -663, 57, -476, 86, -663, -663, -663, -192, -663, -3, + -663, -663, -663, -663, -663, -663, -663, -663, -205, -563, + -663, -663, -663, -662, -457, -663, -22, -663, -663, -663, + -663, -663, -150, -146, 102, -663, -663, 419, -663, 505, + -663, -663, -663, -663, -663, 578, -663, 312, -663, 104, + -663, -663, -663, -663, -663, -663, -663, -663, -663, -663, + 28, -13, -4, -663, -663, -663, -663, -663, -663, 659, + -663, 648, -663, -663, -663, -663, -663, -663, -663, -663, + -663, -663, 607, -663, 629, 615, -120, 601, -663, -663, + -72, -663, -663, -414, -663, -663, -663, -663, -663, -663, + 374, -663, -188, -229, -253, -663, -663, 3, -663, -663, + -169, -663, -663, -187, -155, -663, -663, 16, -432, -663, + -663, -663, 145, -663, -663, -663, 474, -543, -442, -663, + -663, -663, -663, -663, -663, 77, -663, -663, -663, -663, + -663, -663, -663, -663, -663, -95, -663, 71, 151, -663, + -663, -663, 682, -663, 645, 654, -663, -663, -663, -663, + 420, -663, -663, -663, -663, -663, -663, -663, -663, -663, + -127, -663, -663, -280, -292, -663, -663, 218, -663, 220, + -663, 369, -663, -663, 247, -663, -430, -663, -663, -663, + -663, -663, -663, 121, -121, -663, -663, -663, -663, -663, + -338, -663, -663, -663, -663, -663, -663, -258, -663, 325, + -9, 530, 10, -356, -663 }; const short asn1_parser::yydefgoto_[] = { - -1, 2, 3, 818, 393, 223, 144, 77, 225, 226, - 501, 502, 370, 416, 503, 504, 600, 657, 505, 705, - 506, 507, 702, 508, 654, 509, 662, 664, 861, 862, - 863, 864, 865, 866, 145, 146, 696, 697, 698, 808, - 699, 809, 810, 811, 147, 148, 78, 317, 473, 149, + -1, 2, 3, 815, 396, 223, 144, 77, 225, 226, + 502, 503, 373, 416, 504, 505, 600, 655, 506, 702, + 507, 508, 699, 509, 652, 510, 660, 662, 858, 859, + 860, 861, 862, 863, 145, 146, 693, 694, 695, 805, + 696, 806, 807, 808, 147, 148, 78, 314, 472, 149, 79, 80, 81, 82, 83, 150, 232, 233, 234, 235, - 151, 152, 153, 154, 395, 318, 319, 635, 320, 579, - 580, 690, 646, 321, 65, 4, 10, 11, 12, 17, + 151, 152, 153, 154, 315, 316, 317, 632, 318, 577, + 578, 687, 643, 319, 65, 4, 10, 11, 12, 17, 18, 19, 20, 14, 29, 39, 54, 55, 59, 67, - 73, 74, 75, 199, 259, 76, 61, 62, 84, 85, - 155, 396, 156, 397, 398, 399, 157, 400, 86, 87, - 88, 322, 159, 289, 427, 403, 404, 405, 413, 521, - 160, 406, 161, 278, 269, 407, 162, 270, 271, 272, - 163, 164, 440, 441, 165, 166, 167, 290, 291, 292, - 168, 169, 170, 171, 264, 265, 266, 172, 173, 174, - 175, 240, 516, 367, 176, 260, 433, 434, 435, 436, - 437, 177, 178, 408, 34, 45, 43, 179, 180, 181, - 182, 409, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 248, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 463, 481, 484, 336, 337, 338, 339, 340, - 341, 342, 588, 343, 589, 344, 345, 346, 347, 571, - 573, 640, 641, 686, 687, 721, 348, 349, 447, 550, - 197, 193, 410, 198, 229, 814 + 73, 74, 75, 199, 76, 61, 62, 84, 85, 155, + 398, 156, 321, 399, 400, 157, 322, 86, 87, 88, + 323, 159, 287, 427, 403, 404, 405, 413, 522, 160, + 406, 161, 276, 267, 407, 162, 268, 269, 270, 163, + 164, 439, 440, 165, 166, 167, 288, 289, 290, 168, + 169, 170, 171, 262, 263, 264, 172, 173, 174, 175, + 240, 517, 370, 176, 259, 433, 434, 435, 436, 437, + 177, 178, 408, 34, 45, 43, 179, 180, 181, 182, + 409, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 248, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 462, 481, 484, 337, 338, 339, 340, 341, 342, + 343, 587, 344, 588, 345, 346, 347, 348, 569, 571, + 637, 638, 683, 684, 718, 349, 350, 446, 550, 197, + 193, 410, 198, 229, 811 }; const short asn1_parser::yytable_[] = { - 22, 553, 511, 222, 231, 629, 474, 214, 218, 22, - 224, 224, 807, 455, 324, 5, 279, 402, 5, 419, - 64, 419, 215, 219, 236, 565, 431, 562, 592, 563, - 807, 293, 294, 64, 90, 514, 15, 64, 419, 98, - 432, 64, 97, 431, 56, 620, 602, 419, 368, 369, - 364, 419, 90, 477, 475, -431, 456, 263, 587, 482, - 95, 597, 210, 216, 282, 568, 695, 258, 458, 275, - 353, 871, 655, 1, 655, 718, 276, 211, 211, 871, - 652, 293, 294, 295, 296, -428, 297, 598, 298, 6, - 284, 695, 479, 58, 511, 457, 656, 299, 656, 212, - 217, 213, 213, 660, 194, 8, 222, 459, 64, 213, - 200, 559, 365, 224, 324, 324, 224, 323, -428, 653, - 134, 700, 703, 711, -431, 480, 599, 807, 483, 26, - 213, 366, 213, 70, 325, 719, 71, 213, -198, 720, - 305, 606, 661, 607, 694, 623, 510, 58, 57, 515, - 252, 13, 533, 27, 247, 228, 228, 587, 274, 213, - 701, 704, 57, 58, 28, 268, 58, 261, 9, 1, - 21, 1, 230, 57, 510, 511, 1, 58, 715, 21, - 1, 58, 16, 873, 545, 467, 25, 311, 1, 58, - 1, 58, 552, 16, 267, 256, 273, 645, 280, -452, - 213, 283, 639, 283, 490, 492, -452, 283, 283, 16, - 495, 497, 16, 324, 537, -116, 537, 323, 323, 23, - 16, 277, 30, 806, 231, 439, 560, 561, 547, 252, - 16, 224, 554, -501, 325, 325, -501, 375, -116, 565, - -198, 806, 213, 32, 236, 513, -501, 549, 360, 438, - -501, 555, 252, 442, -499, -198, -499, 324, 228, 324, - 361, 411, 556, 324, -118, -499, -166, 643, -499, 452, - 53, 430, 542, 430, 816, 595, 63, -499, 531, 625, - 648, 453, 324, 681, 543, 324, 33, 596, 324, 63, - 89, 630, 649, 63, 402, 682, 402, 63, 546, 498, - 499, -277, 35, 500, -468, -277, 158, 196, 89, -277, - 526, -468, 192, 522, 527, 421, 323, -500, 528, 38, - 213, 877, 511, 537, 430, 36, 621, -276, 64, 64, - 207, -276, -289, 325, 439, 37, 371, 207, -289, -289, - 376, 283, 283, 693, 538, 15, 540, 283, 283, 570, - 716, 44, 717, 41, 42, 368, 369, 227, 237, 46, - 323, 590, 323, 594, 238, 47, 323, 244, 224, 48, - 276, 553, 50, 57, 58, 324, 228, 325, 51, 325, - 66, 722, 430, 325, 565, 323, 70, 324, 323, 68, - 430, 323, 251, 224, 872, 224, 470, 471, 69, 439, - 430, 439, 325, 71, 430, 325, 613, 614, 325, -126, - 213, 72, 255, 439, 658, 659, 92, 439, 93, 201, - 202, 203, 205, 438, 204, 438, 206, 281, 207, 288, - 632, 208, 428, 352, 288, 267, 430, 224, 209, 239, - 273, 241, 565, 242, 280, 245, 16, 430, 246, 430, - -115, 324, 283, 253, 262, 213, 254, 257, 350, 351, - 374, 551, 356, 401, 357, 430, 414, 415, 358, 362, - 418, 313, 359, -109, 412, 417, 263, 420, 323, 429, - 419, 430, 443, 444, 445, 468, 363, 394, 446, 324, - 323, 448, -502, 450, 454, 325, 449, 426, 451, 615, - 445, 460, 461, 615, 324, 462, 464, 325, 439, 466, - 469, 439, 476, 228, -434, 277, 478, 487, 493, 488, - 465, 685, 517, -314, 523, -264, 524, 525, 529, 522, - 530, 539, 429, 532, 442, 541, 430, 535, 411, -118, - 411, 430, 430, 430, 430, 430, 536, 544, 558, 283, - 426, 518, 567, 510, 323, 572, 430, 486, 575, 430, - 578, 519, 546, 642, 574, 520, 576, 489, 491, 647, - 577, 325, 581, 494, 496, 582, 605, 601, 237, 616, - 58, 622, 637, 638, 238, 63, 617, 624, 650, 626, - 627, 615, 323, 644, 663, 667, 674, 534, 429, 669, - 668, 675, 676, 670, 671, -127, 678, 323, 429, 325, - 683, 677, 429, 267, 707, 684, 426, 679, 817, 688, - 822, 689, 691, 708, 325, 819, 426, 820, -503, -11, - 426, -10, 875, 824, 7, 874, 878, 868, 430, 373, - 706, 665, 569, 869, 429, 713, 826, 823, 633, 195, - 512, 634, 372, 430, 692, 723, 31, 40, 94, 724, - 60, 91, 426, 548, 96, 273, 283, 283, 214, 218, - 815, 557, 709, 642, 619, 642, 24, 355, 288, 672, - 583, 647, 725, 215, 219, 52, 618, 49, 584, 429, - 566, 651, 551, 485, 0, 0, 0, 604, 0, 267, - 0, 0, 608, 609, 610, 611, 612, 426, 0, 551, - 0, 0, 0, 0, 0, 591, 593, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 551, 0, 293, - 294, 295, 296, 0, 297, 0, 298, 0, 0, 0, - 401, 0, 401, 0, 429, 299, 0, 0, 0, 429, - 429, 429, 429, 429, 0, 0, 0, 0, 0, 559, - 430, 0, 426, 0, 394, 0, 394, 426, 426, 426, - 426, 426, 0, 0, 0, 288, 0, 0, 0, 0, - 0, 0, 0, 0, 636, 0, 0, 0, 305, 0, - 192, 0, 0, 0, 0, 0, 0, 0, 0, 673, - 0, 0, 0, 0, 585, 0, 0, 0, 0, 0, - 273, 283, 0, 0, 680, 666, 0, 0, 0, 0, - 0, 551, 0, 0, 551, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 311, 0, 0, 0, 0, - 0, 0, 293, 294, 377, 378, 429, 379, 0, 380, - 0, 0, 0, 714, 0, 586, 0, 0, 299, 0, - 0, 429, 381, 382, 426, 283, 0, 0, 98, 283, - 813, 0, 422, 0, 560, 561, 0, 0, 384, 426, - 0, 0, 0, 0, 0, 385, 0, 0, 821, 0, - 0, 0, 288, 288, 0, 0, 0, 0, 0, 0, - 429, 305, 420, 0, 0, 0, 0, 0, 0, 0, - 0, 812, 0, 0, 423, 0, 0, 0, 426, 0, - 0, 519, 0, 0, 0, 0, 0, 387, 0, 812, - 0, 0, 0, 0, 0, 394, 293, 294, 295, 296, - 0, 297, 0, 298, 0, 0, 0, 0, 311, 134, - 0, 0, 299, 394, 0, 0, 0, 0, 388, 0, - 0, 0, 389, 603, 0, 0, 559, 0, 429, 0, - 0, 23, 0, 0, 0, 0, 0, 0, 0, 390, - 0, 0, 813, 0, 0, 813, 426, 424, 425, 0, - 0, 0, 0, 0, 0, 305, 0, 0, 0, 0, + 22, 214, 218, 428, 222, 231, 512, 215, 219, 22, + 5, 224, 224, 5, 626, 261, 552, 402, 563, 473, + 277, 236, 280, 15, 592, 560, 454, 561, 356, 804, + 56, 419, 474, 419, 291, 292, 293, 294, 431, 295, + 419, 296, 602, 515, 324, 291, 292, 804, 419, 95, + 297, 97, 455, 367, 467, 419, 597, 586, 325, 431, + 371, 372, 579, 1, 558, 618, 566, -429, -426, 477, + 273, 653, 266, 98, 457, 545, 551, 274, 482, 479, + 21, 210, 598, 71, 282, -196, 8, 216, 650, 21, + 658, 456, -498, 303, 512, 654, 211, 252, 697, 194, + 16, -426, 211, 16, 16, 200, 700, 222, 213, 584, + 715, 606, 480, 458, 224, 368, -450, 224, 212, -116, + 213, 599, 70, -450, 217, 519, 213, 651, 213, 659, + 708, 213, 533, 252, 369, 520, -429, 698, 213, 521, + 309, 320, 324, 324, 804, 701, 621, 483, 57, 58, + 228, 228, 363, 691, 134, 586, 325, 325, 511, 58, + 585, 58, 25, 653, 364, 491, 493, 57, 534, 16, + 716, 496, 498, 6, 717, 511, 512, 466, 1, 559, + 58, 636, 712, 1, 230, 57, 432, 654, 1, 58, + 1, 58, 272, 692, 265, -466, 271, 26, 278, 9, + 870, 281, -466, 281, 1, 58, 23, 281, 281, 16, + 1, 58, 567, -498, -498, 803, 275, 692, -498, 451, + -497, 27, -497, 352, -497, 499, 500, -118, 231, 501, + 563, 452, 28, 803, -497, 224, -497, -498, -498, 320, + 320, 531, 542, 324, 236, 514, -116, 402, -196, 438, + 595, 441, 642, 228, 543, 546, 411, 325, 13, 645, + 252, 30, 596, -196, 16, 555, 430, 678, 430, 604, + 813, 646, 33, 607, 608, 609, 610, 611, -166, 679, + 640, -275, 53, 526, 32, -275, 324, 527, 324, -275, + 549, 528, 324, 622, 554, 868, 402, 523, 516, 35, + 325, -498, 325, 868, 627, 247, 325, 38, 256, 378, + 213, 421, 324, 213, 213, 324, 213, 430, 324, -274, + 512, 352, 352, -274, 41, 42, 325, 374, 874, 325, + 36, 379, 325, 207, -287, -287, 207, 538, -287, 540, + 320, 713, 568, 714, 281, 281, 37, 224, 57, 58, + 281, 281, 371, 372, 469, 470, 690, 612, 613, 15, + 537, 44, 537, 590, 46, 594, -126, 213, 670, 47, + 224, 48, 274, 547, 228, 563, 50, 553, 63, 51, + 430, 66, 677, 320, 552, 320, 869, 68, 430, 320, + 70, 63, 89, 719, 69, 63, 224, 71, 430, 63, + 656, 657, 430, 324, 72, 92, 93, 201, 202, 320, + 89, 203, 320, 204, 192, 320, 324, 325, 205, 206, + 207, 711, 352, 438, 209, 438, 208, 239, 241, 629, + 325, 430, 261, 563, 265, 242, 224, 245, 810, 271, + 246, -115, 430, 278, 430, 253, 254, 258, 260, 257, + 16, 281, 213, 353, 354, 352, 818, 359, 360, 430, + 361, 365, 311, 158, 196, 430, 238, 430, 362, 537, + -109, 352, 619, 412, 419, 430, 366, 442, 443, 324, + 449, 447, 445, 448, 453, -500, 411, 459, 460, 520, + 461, 352, 468, 325, 352, 463, 450, 430, 465, 475, + 320, 476, 478, 291, 292, 293, 294, -432, 295, 228, + 296, 275, 682, 320, 227, 237, 324, 546, 487, 297, + 488, 489, -118, 518, 244, 494, -262, -312, 524, 525, + 325, 324, 430, 558, 441, 411, 430, 430, 430, 430, + 430, 529, 523, 532, 530, 325, 535, 536, 281, 251, + 810, 430, 539, 810, 430, 541, 544, 565, 557, 511, + 570, 639, 303, 572, 573, 574, 576, 644, 575, 255, + 580, 601, 581, 605, 58, 634, 320, 417, 584, 420, + 623, 429, 352, 64, 279, 614, 286, 615, 620, 635, + 355, 286, 624, 641, 647, 430, 64, 90, 648, 665, + 64, 661, 666, 667, 64, 668, 676, 671, -127, 309, + 672, 265, 675, 320, 673, 90, 680, 377, 704, 681, + 401, 674, 685, 414, 415, 814, 686, 418, 320, 819, + 688, 430, 429, 326, 705, 816, -501, 817, 865, 444, + -11, -10, 872, 821, 871, 430, 875, 7, 559, 58, + 376, 866, 710, 663, 703, 444, 823, 820, 352, 214, + 218, 375, 271, 281, 281, 215, 219, 630, 195, 631, + 639, 64, 639, 720, 689, 464, 513, 31, 644, 722, + 40, 94, 60, 721, 352, 91, 96, 706, 617, 238, + 63, 358, 616, 24, 52, 352, 265, 669, 49, 582, + 812, 352, 0, 429, 583, 485, 649, 0, 564, 0, + 430, 0, 0, 429, 0, 486, 0, 429, 0, 352, + 0, 0, 0, 0, 0, 0, 0, 490, 492, 0, + 0, 326, 326, 495, 497, 0, 0, 0, 237, 0, + 0, 0, 0, 351, 0, 0, 429, 0, 0, 0, + 0, 397, 430, 0, 0, 0, 0, 0, 0, 0, + 0, 426, 0, 291, 292, 293, 294, 0, 295, 0, + 296, 0, 0, 0, 0, 0, 0, 0, 0, 297, + 0, 0, 0, 0, 0, 0, 0, 0, 351, 0, + 429, 0, 0, 558, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 271, 281, 0, + 0, 0, 426, 352, 0, 0, 352, 0, 0, 548, + 0, 0, 303, 0, 0, 0, 0, 556, 0, 0, + 0, 0, 326, 0, 286, 0, 0, 0, 0, 0, + 0, 351, 351, 0, 0, 0, 0, 429, 0, 0, + 401, 429, 429, 429, 429, 429, 0, 0, 0, 0, + 0, 0, 281, 0, 0, 0, 281, 0, 0, 309, + 0, 0, 0, 591, 593, 326, 0, 326, 0, 0, + 0, 326, 0, 426, 0, 0, 0, 0, 0, 0, + 192, 0, 0, 426, 64, 64, 0, 426, 0, 401, + 351, 326, 0, 0, 326, 0, 0, 326, 559, 58, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 426, 0, 0, 0, + 0, 286, 0, 0, 0, 0, 0, 0, 0, 633, + 0, 0, 351, 0, 0, 0, 429, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 429, 0, 351, 0, 351, 0, 0, 0, 0, 0, + 426, 0, 664, 0, 0, 351, 0, 0, 0, 351, + 0, 397, 0, 0, 0, 351, 0, 351, 0, 0, + 0, 351, 326, 0, 0, 0, 0, 0, 0, 429, + 0, 420, 0, 0, 0, 326, 0, 0, 0, 0, + 0, 351, 0, 0, 351, 0, 0, 351, 0, 589, + 0, 0, 0, 0, 0, 0, 0, 426, 0, 0, + 397, 426, 426, 426, 426, 426, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 286, 286, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 589, 0, 0, 809, 589, 429, 326, 0, + 0, 351, 0, 0, 351, 0, 0, 0, 0, 0, + 0, 0, 0, 809, 0, 0, 0, 291, 292, 380, + 381, 0, 382, 0, 383, 0, 0, 0, 0, 0, + 0, 0, 351, 297, 0, 326, 0, 384, 385, 0, + 0, 0, 0, 98, 0, 351, 0, 422, 0, 0, + 326, 0, 0, 387, 0, 0, 426, 0, 0, 0, + 388, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 426, 0, 0, 0, 0, 0, 303, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 585, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 812, 0, 0, 812, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 288, 0, 0, - 0, 0, 311, 0, 0, 0, 0, 394, 0, 0, - 394, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 390, 0, 0, 0, 0, 809, 351, 426, + 809, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 286, 0, 309, 134, 0, 397, 0, 0, 0, + 0, 0, 0, 391, 0, 0, 0, 392, 603, 0, + 0, 0, 0, 0, 397, 351, 23, 0, 0, 0, + 0, 0, 0, 0, 393, 0, 0, 0, 0, 0, + 351, 0, 424, 425, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 286, 0, 426, 0, 286, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 293, 294, 377, 378, 0, 379, 0, 380, - 0, 560, 561, 0, 0, 0, 0, 0, 299, 0, - 97, 288, 381, 382, 0, 288, 0, 728, 729, 730, - 99, 731, 732, 733, 734, 735, 736, 737, 738, 739, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 291, + 292, 380, 381, 0, 382, 0, 383, 0, 0, 0, + 0, 0, 0, 0, 0, 297, 0, 97, 397, 384, + 385, 397, 0, 0, 725, 726, 727, 99, 728, 729, + 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, - 760, 761, 762, 112, 113, 114, 115, 763, 764, 765, - 766, 767, 768, 769, 770, 771, 118, 772, 773, 774, - 775, 119, 776, 121, 777, 778, 779, 780, 781, 782, - 783, 784, 124, 785, 786, 787, 788, 789, 790, 791, - 792, 793, 794, 130, 795, 131, 796, 797, 798, 799, - 800, 801, 802, 135, 136, 137, 138, 139, 803, 0, - 0, 0, 389, 825, 0, 0, 142, 0, 0, 0, - 0, 23, 0, 0, 0, 804, 0, 0, 0, 390, - 0, 0, 0, 0, 0, 0, 0, 805, 392, 293, - 294, 377, 378, 0, 379, 0, 380, 0, 0, 0, - 0, 0, 0, 0, 0, 299, 0, 97, 0, 726, - 727, 0, 0, 0, 728, 729, 730, 99, 731, 732, + 112, 113, 114, 115, 760, 761, 762, 763, 764, 765, + 766, 767, 768, 118, 769, 770, 771, 772, 119, 773, + 121, 774, 775, 776, 777, 778, 779, 780, 781, 124, + 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, + 130, 792, 131, 793, 794, 795, 796, 797, 798, 799, + 135, 136, 137, 138, 139, 800, 0, 0, 0, 392, + 822, 0, 0, 142, 0, 0, 0, 0, 23, 0, + 0, 0, 801, 0, 0, 0, 393, 0, 0, 0, + 0, 0, 0, 0, 802, 395, 291, 292, 380, 381, + 0, 382, 0, 383, 0, 0, 0, 0, 0, 0, + 0, 0, 297, 0, 97, 0, 723, 724, 0, 0, + 0, 725, 726, 727, 99, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 112, 113, 114, 115, 763, 764, 765, 766, 767, 768, - 769, 770, 771, 118, 772, 773, 774, 775, 119, 776, - 121, 777, 778, 779, 780, 781, 782, 783, 784, 124, - 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, - 130, 795, 131, 796, 797, 798, 799, 800, 801, 802, - 135, 136, 137, 138, 139, 803, 0, 0, 0, 389, - 0, 0, 0, 142, 293, 294, 295, 296, 23, 297, - 0, 298, 804, 0, 0, 0, 390, 0, 0, 0, - 299, 0, 97, 0, 805, 392, 0, 0, 0, 0, - 98, 300, 99, 0, 301, 0, 0, 101, 102, 103, - 0, 104, 105, 0, 0, 0, 302, 303, 106, 107, - 0, 0, 108, 109, 304, 0, 0, 110, 0, 0, - 0, 0, 111, 305, 306, 112, 113, 114, 115, 0, - 0, 0, 0, 307, 116, 0, 117, 0, 118, 0, - 308, 0, 0, 119, 120, 121, 122, 0, 123, 0, - 309, 0, 0, 0, 124, 0, 125, 126, 127, 128, - 129, 310, 211, 0, 0, 130, 0, 131, 132, 133, - 311, 134, 0, 0, 0, 135, 136, 137, 138, 139, - 312, 0, 0, 0, 313, 0, 314, 0, 142, 293, - 294, 295, 296, 0, 297, 0, 298, 0, 0, 0, - 0, 0, 0, 0, 0, 299, 0, 97, 0, 315, - 316, 0, 0, 0, 0, 98, 300, 99, 0, 301, - 0, 0, 101, 102, 103, 0, 104, 105, 0, 0, - 0, 0, 0, 106, 107, 0, 0, 108, 109, 0, - 0, 0, 110, 0, 0, 0, 0, 111, 305, 306, - 112, 113, 114, 115, 0, 0, 0, 0, 307, 116, - 0, 117, 0, 118, 0, 308, 0, 0, 119, 120, - 121, 122, 0, 123, 0, 309, 0, 0, 0, 124, - 0, 125, 126, 127, 128, 129, 310, 211, 0, 0, - 130, 0, 131, 132, 133, 311, 134, 0, 0, 0, - 135, 136, 137, 138, 139, 312, 0, 472, 0, 0, - 0, 314, 0, 142, 0, 0, 0, 0, 0, 0, - 293, 294, 377, 378, 0, 379, 0, 380, 0, 0, - 0, 0, 0, 0, 315, 316, 299, 0, 97, 0, - 381, 382, 0, 0, 0, 0, 98, 0, 99, 0, - 383, 0, 0, 101, 102, 103, 384, 104, 105, 0, - 0, 0, 0, 385, 106, 107, 0, 0, 108, 109, - 0, 0, 0, 110, 0, 0, 0, 0, 111, 305, - 0, 112, 113, 114, 115, 0, 0, 0, 0, 0, - 116, 0, 386, 0, 118, 0, 0, 0, 0, 119, - 120, 121, 122, 0, 123, 387, 0, 0, 0, 0, - 124, 0, 125, 126, 127, 128, 129, 0, 0, 0, - 0, 130, 0, 131, 132, 133, 311, 134, 0, 0, - 0, 135, 136, 137, 138, 139, 388, 0, 0, 0, - 389, 0, 0, 0, 142, 293, 294, 295, 296, 23, - 297, 0, 298, 0, 0, 0, 0, 390, 0, 0, - 0, 299, 0, 97, 0, 391, 392, 0, 0, 0, - 0, 98, 300, 99, 0, 301, 0, 0, 101, 102, - 103, 0, 104, 105, 0, 0, 0, 0, 0, 106, - 107, 0, 0, 108, 109, 0, 0, 0, 110, 0, - 0, 0, 0, 111, 305, 306, 112, 113, 114, 115, - 0, 0, 0, 0, 307, 116, 0, 117, 0, 118, - 0, 308, 0, 0, 119, 120, 121, 122, 0, 123, - 0, 309, 0, 0, 0, 124, 0, 125, 126, 127, - 128, 129, 310, 211, 0, 0, 130, 0, 131, 132, - 133, 311, 134, 0, 0, 0, 135, 136, 137, 138, - 139, 312, 0, 0, 0, 0, 0, 314, 0, 142, - 0, 0, 0, 0, 0, 0, 293, 294, 377, 378, - 0, 379, 0, 380, 0, 0, 0, 0, 0, 0, - 315, 316, 299, 0, 97, 0, 381, 382, 0, 0, - 0, 0, 98, 0, 99, 0, 383, 0, 0, 101, - 102, 103, 384, 104, 105, 0, 0, 0, 0, 385, - 106, 107, 0, 0, 108, 109, 0, 0, 0, 110, - 0, 0, 0, 0, 111, 305, 0, 112, 113, 114, - 115, 0, 0, 0, 0, 0, 116, 0, 386, 0, - 118, 0, 0, 0, 0, 119, 120, 121, 122, 0, - 123, 387, 0, 0, 0, 0, 124, 0, 125, 126, - 127, 128, 129, 0, 0, 0, 0, 130, 0, 131, - 132, 133, 311, 134, 0, 0, 0, 135, 136, 137, - 138, 139, 388, 0, 0, 0, 389, 0, 0, 0, - 142, 293, 294, 295, 296, 23, 297, 0, 298, 0, - 0, 0, 0, 390, 0, 0, 0, 299, 0, 97, - 0, 424, 392, 0, 0, 0, 0, 98, 0, 99, - 0, 301, 0, 0, 101, 102, 103, 0, 104, 105, - 0, 0, 0, 0, 0, 106, 107, 0, 0, 108, - 109, 0, 0, 0, 110, 0, 0, 0, 0, 111, - 305, 306, 112, 113, 114, 115, 0, 0, 0, 0, - 307, 116, 0, 117, 0, 118, 0, 308, 0, 0, - 119, 120, 121, 122, 0, 123, 0, 309, 0, 0, - 0, 124, 0, 125, 126, 127, 128, 129, 310, 211, - 293, 294, 130, 0, 131, 132, 133, 311, 134, 0, - 0, 0, 135, 136, 137, 138, 139, 312, 97, 0, - 0, 0, 0, 314, 0, 142, 98, 0, 99, 0, - 100, 0, 0, 101, 102, 103, 0, 104, 105, 0, - 0, 0, 0, 0, 106, 107, 315, 316, 108, 109, - 0, 0, 0, 110, 0, 0, 0, 0, 111, 0, - 0, 112, 113, 114, 115, 0, 0, 0, 0, 0, - 116, 0, 117, 0, 118, 0, 0, 0, 0, 119, - 120, 121, 122, 0, 123, 0, 0, 0, 0, 0, - 124, 0, 125, 126, 127, 128, 129, 0, 0, 0, - 0, 130, 0, 131, 132, 133, 0, 134, 0, 0, - 0, 135, 136, 137, 138, 139, 0, 0, 293, 294, - 377, 378, 0, 379, 142, 380, 0, 0, 0, 0, - 0, 0, 0, 0, 299, 0, 97, 0, 381, 382, - 0, 0, 0, 0, 98, 143, 230, 0, 422, 0, - 293, 294, 377, 378, 384, 379, 0, 380, 0, 0, - 0, 385, 0, 0, 0, 0, 299, 0, 0, 0, - 381, 382, 0, 0, 0, 0, 98, 305, 0, 0, - 422, 0, 0, 0, 0, 0, 384, 0, 0, 0, - 423, 0, 0, 385, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 387, 0, 0, 0, 0, 0, 305, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 423, 0, 311, 134, 0, 0, 0, 0, - 0, 0, 0, 0, 388, 387, 0, 0, 712, 0, - 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, - 0, 0, 0, 0, 0, 390, 311, 134, 0, 0, - 0, 0, 0, 424, 425, 0, 388, 0, 0, 0, - 389, 0, 0, 0, 97, 0, 0, 0, 0, 23, - 0, 0, 98, 0, 99, 0, 100, 390, 0, 101, - 102, 103, 0, 104, 105, 424, 425, 285, 0, 0, + 753, 754, 755, 756, 757, 758, 759, 112, 113, 114, + 115, 760, 761, 762, 763, 764, 765, 766, 767, 768, + 118, 769, 770, 771, 772, 119, 773, 121, 774, 775, + 776, 777, 778, 779, 780, 781, 124, 782, 783, 784, + 785, 786, 787, 788, 789, 790, 791, 130, 792, 131, + 793, 794, 795, 796, 797, 798, 799, 135, 136, 137, + 138, 139, 800, 0, 0, 0, 392, 0, 0, 0, + 142, 291, 292, 293, 294, 23, 295, 0, 296, 801, + 0, 0, 0, 393, 0, 0, 0, 297, 0, 97, + 0, 802, 395, 0, 0, 0, 0, 98, 298, 99, + 0, 299, 0, 0, 101, 102, 103, 0, 104, 105, + 0, 0, 0, 300, 301, 106, 107, 0, 0, 108, + 109, 302, 0, 0, 110, 0, 0, 0, 0, 111, + 303, 304, 112, 113, 114, 115, 0, 0, 0, 0, + 305, 116, 0, 117, 0, 118, 0, 306, 0, 0, + 119, 120, 121, 122, 0, 123, 0, 307, 0, 0, + 0, 124, 0, 125, 126, 127, 128, 129, 308, 211, + 0, 0, 130, 0, 131, 132, 133, 309, 134, 0, + 0, 0, 135, 136, 137, 138, 139, 310, 0, 0, + 0, 311, 0, 312, 0, 142, 291, 292, 293, 294, + 0, 295, 0, 296, 0, 0, 0, 0, 0, 0, + 0, 0, 297, 0, 97, 0, 313, 230, 0, 0, + 0, 0, 98, 298, 99, 0, 299, 0, 0, 101, + 102, 103, 0, 104, 105, 0, 0, 0, 0, 0, 106, 107, 0, 0, 108, 109, 0, 0, 0, 110, - 0, 0, 0, 0, 111, 0, 0, 112, 113, 114, - 115, 0, 0, 0, 0, 0, 116, 0, 117, 0, - 118, 0, 0, 0, 0, 119, 120, 121, 122, 0, - 123, 0, 0, 0, 0, 0, 124, 0, 125, 126, - 127, 128, 129, 0, 0, 0, 0, 130, 0, 131, - 132, 133, 0, 134, 0, 0, 0, 135, 136, 137, - 138, 139, 0, 97, 286, 0, 0, 287, 0, 0, - 142, 98, 0, 99, 0, 100, 0, 0, 101, 102, - 103, 0, 104, 105, 0, 0, 285, 0, 0, 106, - 107, 143, 16, 108, 109, 0, 0, 0, 110, 0, - 0, 0, 0, 111, 0, 0, 112, 113, 114, 115, - 0, 0, 0, 0, 0, 116, 0, 117, 0, 118, - 0, 0, 0, 0, 119, 120, 121, 122, 0, 123, - 0, 0, 0, 0, 0, 124, 0, 125, 126, 127, - 128, 129, 0, 0, 0, 0, 130, 0, 131, 132, - 133, 0, 134, 0, 0, 0, 135, 136, 137, 138, - 139, 0, 97, 286, 0, 0, 354, 0, 0, 142, - 98, 0, 99, 0, 100, 0, 0, 101, 102, 103, - 0, 104, 105, 0, 0, 0, 0, 0, 106, 107, - 143, 16, 108, 109, 0, 0, 0, 110, 0, 0, - 0, 0, 111, 0, 0, 112, 113, 114, 115, 0, - 0, 0, 0, 0, 116, 0, 117, 0, 118, 0, - 0, 0, 0, 119, 120, 121, 122, 0, 123, 0, - 0, 0, 0, 0, 124, 0, 125, 126, 127, 128, - 129, 0, 0, 0, 0, 130, 0, 131, 132, 133, - 0, 134, 0, 0, 0, 135, 136, 137, 138, 139, - 0, 140, 0, 0, 141, 97, 0, 0, 142, 0, - 0, 0, 0, 98, 0, 99, 0, 100, 0, 0, - 101, 102, 103, 0, 104, 105, 0, 0, 0, 143, - 16, 106, 107, 0, 0, 108, 109, 0, 0, 0, - 110, 0, 249, 0, 0, 111, 0, 0, 112, 113, - 114, 115, 0, 250, 0, 0, 0, 116, 0, 117, + 0, 0, 0, 0, 111, 303, 304, 112, 113, 114, + 115, 0, 0, 0, 0, 305, 116, 0, 117, 0, + 118, 0, 306, 0, 0, 119, 120, 121, 122, 0, + 123, 0, 307, 0, 0, 0, 124, 0, 125, 126, + 127, 128, 129, 308, 211, 0, 0, 130, 0, 131, + 132, 133, 309, 134, 0, 0, 0, 135, 136, 137, + 138, 139, 310, 0, 471, 0, 0, 0, 312, 0, + 142, 0, 0, 0, 0, 0, 0, 291, 292, 380, + 381, 0, 382, 0, 383, 0, 0, 0, 0, 0, + 0, 313, 230, 297, 0, 97, 0, 384, 385, 0, + 0, 0, 0, 98, 0, 99, 0, 386, 0, 0, + 101, 102, 103, 387, 104, 105, 0, 0, 0, 0, + 388, 106, 107, 0, 0, 108, 109, 0, 0, 0, + 110, 0, 0, 0, 0, 111, 303, 0, 112, 113, + 114, 115, 0, 0, 0, 0, 0, 116, 0, 389, + 0, 118, 0, 0, 0, 0, 119, 120, 121, 122, + 0, 123, 390, 0, 0, 0, 0, 124, 0, 125, + 126, 127, 128, 129, 0, 0, 0, 0, 130, 0, + 131, 132, 133, 309, 134, 0, 0, 0, 135, 136, + 137, 138, 139, 391, 0, 0, 0, 392, 0, 0, + 0, 142, 291, 292, 293, 294, 23, 295, 0, 296, + 0, 0, 0, 0, 393, 0, 0, 0, 297, 0, + 97, 0, 394, 395, 0, 0, 0, 0, 98, 298, + 99, 0, 299, 0, 0, 101, 102, 103, 0, 104, + 105, 0, 0, 0, 0, 0, 106, 107, 0, 0, + 108, 109, 0, 0, 0, 110, 0, 0, 0, 0, + 111, 303, 304, 112, 113, 114, 115, 0, 0, 0, + 0, 305, 116, 0, 117, 0, 118, 0, 306, 0, + 0, 119, 120, 121, 122, 0, 123, 0, 307, 0, + 0, 0, 124, 0, 125, 126, 127, 128, 129, 308, + 211, 0, 0, 130, 0, 131, 132, 133, 309, 134, + 0, 0, 0, 135, 136, 137, 138, 139, 310, 0, + 0, 0, 0, 0, 312, 0, 142, 0, 0, 0, + 0, 0, 0, 291, 292, 380, 381, 0, 382, 0, + 383, 0, 0, 0, 0, 0, 0, 313, 230, 297, + 0, 97, 0, 384, 385, 0, 0, 0, 0, 98, + 0, 99, 0, 386, 0, 0, 101, 102, 103, 387, + 104, 105, 0, 0, 0, 0, 388, 106, 107, 0, + 0, 108, 109, 0, 0, 0, 110, 0, 0, 0, + 0, 111, 303, 0, 112, 113, 114, 115, 0, 0, + 0, 0, 0, 116, 0, 389, 0, 118, 0, 0, + 0, 0, 119, 120, 121, 122, 0, 123, 390, 0, + 0, 0, 0, 124, 0, 125, 126, 127, 128, 129, + 0, 0, 0, 0, 130, 0, 131, 132, 133, 309, + 134, 0, 0, 0, 135, 136, 137, 138, 139, 391, + 0, 0, 0, 392, 0, 0, 0, 142, 291, 292, + 293, 294, 23, 295, 0, 296, 0, 0, 0, 0, + 393, 0, 0, 0, 297, 0, 97, 0, 424, 395, + 0, 0, 0, 0, 98, 0, 99, 0, 299, 0, + 0, 101, 102, 103, 0, 104, 105, 0, 0, 0, + 0, 0, 106, 107, 0, 0, 108, 109, 0, 0, + 0, 110, 0, 0, 0, 0, 111, 303, 304, 112, + 113, 114, 115, 0, 0, 0, 0, 305, 116, 0, + 117, 0, 118, 0, 306, 0, 0, 119, 120, 121, + 122, 0, 123, 0, 307, 0, 0, 0, 124, 0, + 125, 126, 127, 128, 129, 308, 211, 291, 292, 130, + 0, 131, 132, 133, 309, 134, 0, 0, 0, 135, + 136, 137, 138, 139, 310, 97, 0, 0, 0, 0, + 312, 0, 142, 98, 0, 99, 0, 100, 0, 0, + 101, 102, 103, 0, 104, 105, 0, 0, 0, 0, + 0, 106, 107, 313, 230, 108, 109, 0, 0, 0, + 110, 0, 0, 0, 0, 111, 0, 0, 112, 113, + 114, 115, 0, 0, 0, 0, 0, 116, 0, 117, 0, 118, 0, 0, 0, 0, 119, 120, 121, 122, 0, 123, 0, 0, 0, 0, 0, 124, 0, 125, 126, 127, 128, 129, 0, 0, 0, 0, 130, 0, 131, 132, 133, 0, 134, 0, 0, 0, 135, 136, - 137, 138, 139, 0, 97, 0, 0, 0, 0, 0, - 0, 142, 98, 0, 99, 0, 100, 0, 0, 101, - 102, 103, 0, 104, 105, 0, 0, 285, 0, 0, - 106, 107, 143, 16, 108, 109, 0, 0, 0, 110, - 0, 0, 0, 0, 111, 0, 0, 112, 113, 114, - 115, 0, 0, 0, 0, 0, 116, 0, 117, 0, - 118, 0, 0, 0, 0, 119, 120, 121, 122, 0, - 123, 0, 0, 0, 0, 0, 124, 0, 125, 126, - 127, 128, 129, 0, 0, 0, 0, 130, 0, 131, - 132, 133, 0, 134, 0, 0, 0, 135, 136, 137, - 138, 139, 0, 97, 564, 368, 369, 0, 0, 0, - 142, 98, 0, 99, 0, 100, 0, 0, 101, 102, - 103, 0, 104, 105, 0, 0, 0, 0, 0, 106, - 107, 143, 16, 108, 109, 0, 0, 0, 110, 0, - 0, 0, 0, 111, 0, 0, 112, 113, 114, 115, - 0, 0, 0, 0, 0, 116, 0, 117, 0, 118, - 0, 0, 0, 0, 119, 120, 121, 122, 0, 123, - 0, 0, 0, 0, 0, 124, 0, 125, 126, 127, - 128, 129, 0, 0, 0, 0, 130, 0, 131, 132, - 133, 0, 134, 0, 0, 0, 135, 136, 137, 138, - 139, 0, 97, 0, 0, 0, 0, 0, 0, 142, - 98, 0, 99, 0, 100, 0, 0, 101, 102, 103, - 0, 104, 105, 0, 0, 285, 0, 0, 106, 107, - 143, 16, 108, 109, 0, 0, 0, 110, 0, 0, - 0, 0, 111, 0, 0, 112, 113, 114, 115, 0, - 0, 0, 0, 0, 116, 0, 117, 0, 118, 0, - 0, 0, 0, 119, 120, 121, 122, 0, 123, 0, - 0, 0, 0, 0, 124, 0, 125, 126, 127, 128, - 129, 0, 0, 0, 0, 130, 0, 131, 132, 133, - 0, 134, 0, 0, 0, 135, 136, 137, 138, 139, - 0, 97, 628, 0, 0, 0, 0, 0, 142, 98, - 0, 99, 0, 100, 0, 0, 101, 102, 103, 0, - 104, 105, 0, 0, 285, 0, 0, 106, 107, 143, - 16, 108, 109, 0, 0, 0, 110, 0, 0, 0, + 137, 138, 139, 0, 0, 291, 292, 380, 381, 0, + 382, 142, 383, 0, 0, 0, 0, 0, 0, 0, + 0, 297, 0, 97, 0, 384, 385, 0, 0, 0, + 0, 98, 143, 230, 0, 422, 0, 291, 292, 380, + 381, 387, 382, 0, 383, 0, 0, 0, 388, 0, + 0, 0, 0, 297, 0, 0, 0, 384, 385, 0, + 0, 0, 0, 98, 303, 0, 0, 422, 0, 0, + 0, 0, 0, 387, 0, 0, 0, 423, 0, 0, + 388, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 390, 0, 0, 0, 0, 0, 303, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 423, + 0, 309, 134, 0, 0, 0, 0, 0, 0, 0, + 0, 391, 390, 0, 0, 709, 0, 0, 0, 0, + 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, + 0, 0, 393, 309, 134, 0, 0, 0, 0, 0, + 424, 425, 0, 391, 0, 0, 0, 392, 0, 0, + 0, 97, 0, 0, 0, 0, 23, 0, 0, 98, + 0, 99, 0, 100, 393, 0, 101, 102, 103, 0, + 104, 105, 424, 425, 283, 0, 0, 106, 107, 0, + 0, 108, 109, 0, 0, 0, 110, 0, 0, 0, 0, 111, 0, 0, 112, 113, 114, 115, 0, 0, 0, 0, 0, 116, 0, 117, 0, 118, 0, 0, 0, 0, 119, 120, 121, 122, 0, 123, 0, 0, 0, 0, 0, 124, 0, 125, 126, 127, 128, 129, 0, 0, 0, 0, 130, 0, 131, 132, 133, 0, 134, 0, 0, 0, 135, 136, 137, 138, 139, 0, - 97, 710, 0, 0, 0, 0, 0, 142, 98, 0, + 97, 284, 0, 0, 285, 0, 0, 142, 98, 0, 99, 0, 100, 0, 0, 101, 102, 103, 0, 104, - 105, 0, 0, 285, 0, 0, 106, 107, 143, 16, + 105, 0, 0, 283, 0, 0, 106, 107, 143, 16, 108, 109, 0, 0, 0, 110, 0, 0, 0, 0, 111, 0, 0, 112, 113, 114, 115, 0, 0, 0, 0, 0, 116, 0, 117, 0, 118, 0, 0, 0, @@ -10208,7 +10367,7 @@ namespace yy { 0, 0, 124, 0, 125, 126, 127, 128, 129, 0, 0, 0, 0, 130, 0, 131, 132, 133, 0, 134, 0, 0, 0, 135, 136, 137, 138, 139, 0, 97, - 867, 0, 0, 0, 0, 0, 142, 98, 0, 99, + 284, 0, 0, 357, 0, 0, 142, 98, 0, 99, 0, 100, 0, 0, 101, 102, 103, 0, 104, 105, 0, 0, 0, 0, 0, 106, 107, 143, 16, 108, 109, 0, 0, 0, 110, 0, 0, 0, 0, 111, @@ -10217,30 +10376,30 @@ namespace yy { 119, 120, 121, 122, 0, 123, 0, 0, 0, 0, 0, 124, 0, 125, 126, 127, 128, 129, 0, 0, 0, 0, 130, 0, 131, 132, 133, 0, 134, 0, - 0, 0, 135, 136, 137, 138, 139, 0, 97, 0, - 0, 141, 0, 0, 0, 142, 98, 0, 99, 0, - 100, 0, 0, 101, 102, 103, 0, 104, 105, 220, - 0, 0, 0, 0, 106, 107, 143, 16, 108, 109, - 0, 0, 0, 110, 0, 0, 0, 0, 111, 0, - 0, 112, 113, 114, 115, 0, 0, 0, 0, 0, - 116, 0, 117, 0, 118, 0, 0, 0, 0, 119, - 120, 121, 122, 0, 123, 0, 0, 0, 0, 0, - 124, 0, 125, 126, 127, 128, 129, 0, 0, 0, - 0, 130, 0, 131, 132, 133, 0, 134, 0, 0, - 0, 135, 136, 137, 138, 139, 0, 97, 0, 0, - 0, 0, 0, 0, 142, 98, 0, 99, 0, 100, - 0, 0, 101, 102, 103, 0, 104, 105, 0, 0, - 0, 0, 0, 106, 107, 221, 16, 108, 109, 0, - 0, 0, 110, 0, 0, 0, 0, 111, 0, 0, - 112, 113, 114, 115, 0, 0, 0, 0, 0, 116, - 0, 117, 0, 118, 0, 0, 0, 0, 119, 120, - 121, 122, 0, 123, 0, 0, 0, 0, 0, 124, - 0, 125, 126, 127, 128, 129, 0, 0, 0, 0, - 130, 0, 131, 132, 133, 0, 134, 0, 0, 0, - 135, 136, 137, 138, 139, 0, 243, 0, 0, 0, - 97, 0, 0, 142, 0, 0, 0, 0, 98, 0, + 0, 0, 135, 136, 137, 138, 139, 0, 140, 0, + 0, 141, 97, 0, 0, 142, 0, 0, 0, 0, + 98, 0, 99, 0, 100, 0, 0, 101, 102, 103, + 0, 104, 105, 0, 0, 0, 143, 16, 106, 107, + 0, 0, 108, 109, 0, 0, 0, 110, 0, 249, + 0, 0, 111, 0, 0, 112, 113, 114, 115, 0, + 250, 0, 0, 0, 116, 0, 117, 0, 118, 0, + 0, 0, 0, 119, 120, 121, 122, 0, 123, 0, + 0, 0, 0, 0, 124, 0, 125, 126, 127, 128, + 129, 0, 0, 0, 0, 130, 0, 131, 132, 133, + 0, 134, 0, 0, 0, 135, 136, 137, 138, 139, + 0, 97, 0, 0, 0, 0, 0, 0, 142, 98, + 0, 99, 0, 100, 0, 0, 101, 102, 103, 0, + 104, 105, 0, 0, 283, 0, 0, 106, 107, 143, + 16, 108, 109, 0, 0, 0, 110, 0, 0, 0, + 0, 111, 0, 0, 112, 113, 114, 115, 0, 0, + 0, 0, 0, 116, 0, 117, 0, 118, 0, 0, + 0, 0, 119, 120, 121, 122, 0, 123, 0, 0, + 0, 0, 0, 124, 0, 125, 126, 127, 128, 129, + 0, 0, 0, 0, 130, 0, 131, 132, 133, 0, + 134, 0, 0, 0, 135, 136, 137, 138, 139, 0, + 97, 562, 371, 372, 0, 0, 0, 142, 98, 0, 99, 0, 100, 0, 0, 101, 102, 103, 0, 104, - 105, 0, 0, 0, 143, 16, 106, 107, 0, 0, + 105, 0, 0, 0, 0, 0, 106, 107, 143, 16, 108, 109, 0, 0, 0, 110, 0, 0, 0, 0, 111, 0, 0, 112, 113, 114, 115, 0, 0, 0, 0, 0, 116, 0, 117, 0, 118, 0, 0, 0, @@ -10248,48 +10407,48 @@ namespace yy { 0, 0, 124, 0, 125, 126, 127, 128, 129, 0, 0, 0, 0, 130, 0, 131, 132, 133, 0, 134, 0, 0, 0, 135, 136, 137, 138, 139, 0, 97, - 0, 0, 0, 0, 0, 0, 142, 98, 253, 99, + 0, 0, 0, 0, 0, 0, 142, 98, 0, 99, 0, 100, 0, 0, 101, 102, 103, 0, 104, 105, - 0, 0, 0, 0, 0, 106, 107, 143, 16, 108, + 0, 0, 283, 0, 0, 106, 107, 143, 16, 108, 109, 0, 0, 0, 110, 0, 0, 0, 0, 111, 0, 0, 112, 113, 114, 115, 0, 0, 0, 0, 0, 116, 0, 117, 0, 118, 0, 0, 0, 0, 119, 120, 121, 122, 0, 123, 0, 0, 0, 0, 0, 124, 0, 125, 126, 127, 128, 129, 0, 0, 0, 0, 130, 0, 131, 132, 133, 0, 134, 0, - 0, 0, 135, 136, 137, 138, 139, 0, 97, 631, + 0, 0, 135, 136, 137, 138, 139, 0, 97, 625, 0, 0, 0, 0, 0, 142, 98, 0, 99, 0, 100, 0, 0, 101, 102, 103, 0, 104, 105, 0, - 0, 285, 0, 0, 106, 107, 221, 16, 108, 109, + 0, 283, 0, 0, 106, 107, 143, 16, 108, 109, 0, 0, 0, 110, 0, 0, 0, 0, 111, 0, 0, 112, 113, 114, 115, 0, 0, 0, 0, 0, 116, 0, 117, 0, 118, 0, 0, 0, 0, 119, 120, 121, 122, 0, 123, 0, 0, 0, 0, 0, 124, 0, 125, 126, 127, 128, 129, 0, 0, 0, 0, 130, 0, 131, 132, 133, 0, 134, 0, 0, - 0, 135, 136, 137, 138, 139, 0, 97, 0, 0, + 0, 135, 136, 137, 138, 139, 0, 97, 707, 0, 0, 0, 0, 0, 142, 98, 0, 99, 0, 100, 0, 0, 101, 102, 103, 0, 104, 105, 0, 0, - 0, 0, 0, 106, 107, 143, 16, 108, 109, 0, + 283, 0, 0, 106, 107, 143, 16, 108, 109, 0, 0, 0, 110, 0, 0, 0, 0, 111, 0, 0, 112, 113, 114, 115, 0, 0, 0, 0, 0, 116, 0, 117, 0, 118, 0, 0, 0, 0, 119, 120, 121, 122, 0, 123, 0, 0, 0, 0, 0, 124, 0, 125, 126, 127, 128, 129, 0, 0, 0, 0, 130, 0, 131, 132, 133, 0, 134, 0, 0, 0, - 135, 136, 137, 138, 139, 0, 97, 0, 0, 0, + 135, 136, 137, 138, 139, 0, 97, 864, 0, 0, 0, 0, 0, 142, 98, 0, 99, 0, 100, 0, 0, 101, 102, 103, 0, 104, 105, 0, 0, 0, - 0, 0, 106, 107, 221, 230, 108, 109, 0, 0, + 0, 0, 106, 107, 143, 16, 108, 109, 0, 0, 0, 110, 0, 0, 0, 0, 111, 0, 0, 112, 113, 114, 115, 0, 0, 0, 0, 0, 116, 0, 117, 0, 118, 0, 0, 0, 0, 119, 120, 121, 122, 0, 123, 0, 0, 0, 0, 0, 124, 0, 125, 126, 127, 128, 129, 0, 0, 0, 0, 130, 0, 131, 132, 133, 0, 134, 0, 0, 0, 135, - 136, 137, 138, 139, 0, 97, 0, 0, 0, 0, + 136, 137, 138, 139, 0, 97, 0, 0, 141, 0, 0, 0, 142, 98, 0, 99, 0, 100, 0, 0, - 101, 102, 103, 0, 104, 105, 0, 0, 0, 0, + 101, 102, 103, 0, 104, 105, 220, 0, 0, 0, 0, 106, 107, 143, 16, 108, 109, 0, 0, 0, 110, 0, 0, 0, 0, 111, 0, 0, 112, 113, 114, 115, 0, 0, 0, 0, 0, 116, 0, 117, @@ -10297,205 +10456,282 @@ namespace yy { 0, 123, 0, 0, 0, 0, 0, 124, 0, 125, 126, 127, 128, 129, 0, 0, 0, 0, 130, 0, 131, 132, 133, 0, 134, 0, 0, 0, 135, 136, - 137, 138, 139, 0, 0, 0, 0, 0, 0, 0, - 0, 142, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 368, - 369, 0, 221, 16, 728, 827, 730, 0, 731, 828, - 733, 734, 829, 830, 831, 832, 833, 834, 741, 742, - 743, 744, 835, 836, 837, 748, 749, 838, 839, 752, - 753, 754, 840, 756, 757, 758, 759, 841, 842, 762, - 0, 0, 0, 0, 763, 764, 765, 766, 767, 843, - 769, 844, 771, 0, 772, 773, 774, 775, 0, 845, - 0, 846, 778, 847, 848, 781, 782, 783, 784, 0, - 785, 849, 850, 851, 852, 853, 791, 792, 793, 794, - 0, 795, 0, 854, 855, 856, 857, 800, 801, 802, - 0, 0, 0, 0, 0, 858, 0, 0, 0, 0, + 137, 138, 139, 0, 97, 0, 0, 0, 0, 0, + 0, 142, 98, 0, 99, 0, 100, 0, 0, 101, + 102, 103, 0, 104, 105, 0, 0, 0, 0, 0, + 106, 107, 221, 16, 108, 109, 0, 0, 0, 110, + 0, 0, 0, 0, 111, 0, 0, 112, 113, 114, + 115, 0, 0, 0, 0, 0, 116, 0, 117, 0, + 118, 0, 0, 0, 0, 119, 120, 121, 122, 0, + 123, 0, 0, 0, 0, 0, 124, 0, 125, 126, + 127, 128, 129, 0, 0, 0, 0, 130, 0, 131, + 132, 133, 0, 134, 0, 0, 0, 135, 136, 137, + 138, 139, 0, 243, 0, 0, 0, 97, 0, 0, + 142, 0, 0, 0, 0, 98, 0, 99, 0, 100, + 0, 0, 101, 102, 103, 0, 104, 105, 0, 0, + 0, 143, 16, 106, 107, 0, 0, 108, 109, 0, + 0, 0, 110, 0, 0, 0, 0, 111, 0, 0, + 112, 113, 114, 115, 0, 0, 0, 0, 0, 116, + 0, 117, 0, 118, 0, 0, 0, 0, 119, 120, + 121, 122, 0, 123, 0, 0, 0, 0, 0, 124, + 0, 125, 126, 127, 128, 129, 0, 0, 0, 0, + 130, 0, 131, 132, 133, 0, 134, 0, 0, 0, + 135, 136, 137, 138, 139, 0, 97, 0, 0, 0, + 0, 0, 0, 142, 98, 253, 99, 0, 100, 0, + 0, 101, 102, 103, 0, 104, 105, 0, 0, 0, + 0, 0, 106, 107, 143, 16, 108, 109, 0, 0, + 0, 110, 0, 0, 0, 0, 111, 0, 0, 112, + 113, 114, 115, 0, 0, 0, 0, 0, 116, 0, + 117, 0, 118, 0, 0, 0, 0, 119, 120, 121, + 122, 0, 123, 0, 0, 0, 0, 0, 124, 0, + 125, 126, 127, 128, 129, 0, 0, 0, 0, 130, + 0, 131, 132, 133, 0, 134, 0, 0, 0, 135, + 136, 137, 138, 139, 0, 97, 628, 0, 0, 0, + 0, 0, 142, 98, 0, 99, 0, 100, 0, 0, + 101, 102, 103, 0, 104, 105, 0, 0, 283, 0, + 0, 106, 107, 221, 16, 108, 109, 0, 0, 0, + 110, 0, 0, 0, 0, 111, 0, 0, 112, 113, + 114, 115, 0, 0, 0, 0, 0, 116, 0, 117, + 0, 118, 0, 0, 0, 0, 119, 120, 121, 122, + 0, 123, 0, 0, 0, 0, 0, 124, 0, 125, + 126, 127, 128, 129, 0, 0, 0, 0, 130, 0, + 131, 132, 133, 0, 134, 0, 0, 0, 135, 136, + 137, 138, 139, 0, 97, 0, 0, 0, 0, 0, + 0, 142, 98, 0, 99, 0, 100, 0, 0, 101, + 102, 103, 0, 104, 105, 0, 0, 0, 0, 0, + 106, 107, 143, 16, 108, 109, 0, 0, 0, 110, + 0, 0, 0, 0, 111, 0, 0, 112, 113, 114, + 115, 0, 0, 0, 0, 0, 116, 0, 117, 0, + 118, 0, 0, 0, 0, 119, 120, 121, 122, 0, + 123, 0, 0, 0, 0, 0, 124, 0, 125, 126, + 127, 128, 129, 0, 0, 0, 0, 130, 0, 131, + 132, 133, 0, 134, 0, 0, 0, 135, 136, 137, + 138, 139, 0, 97, 0, 0, 0, 0, 0, 0, + 142, 98, 0, 99, 0, 100, 0, 0, 101, 102, + 103, 0, 104, 105, 0, 0, 0, 0, 0, 106, + 107, 221, 230, 108, 109, 0, 0, 0, 110, 0, + 0, 0, 0, 111, 0, 0, 112, 113, 114, 115, + 0, 0, 0, 0, 0, 116, 0, 117, 0, 118, + 0, 0, 0, 0, 119, 120, 121, 122, 0, 123, + 0, 0, 0, 0, 0, 124, 0, 125, 126, 127, + 128, 129, 0, 0, 0, 0, 130, 0, 131, 132, + 133, 0, 134, 0, 0, 0, 135, 136, 137, 138, + 139, 0, 97, 0, 0, 0, 0, 0, 0, 142, + 98, 0, 99, 0, 100, 0, 0, 101, 102, 103, + 0, 104, 105, 0, 0, 0, 0, 0, 106, 107, + 143, 16, 108, 109, 0, 0, 0, 110, 0, 0, + 0, 0, 111, 0, 0, 112, 113, 114, 115, 0, + 0, 0, 0, 0, 116, 0, 117, 0, 118, 0, + 0, 0, 0, 119, 120, 121, 122, 0, 123, 0, + 0, 0, 0, 0, 124, 0, 125, 126, 127, 128, + 129, 0, 0, 0, 0, 130, 0, 131, 132, 133, + 0, 134, 0, 0, 0, 135, 136, 137, 138, 139, + 0, 0, 0, 0, 0, 0, 0, 0, 142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 804, 0, 0, 0, 0, 0, 0, 0, - 0, 728, 827, 730, 860, 731, 828, 733, 734, 829, - 830, 831, 832, 833, 834, 741, 742, 743, 744, 835, - 836, 837, 748, 749, 838, 839, 752, 753, 754, 840, - 756, 757, 758, 759, 841, 842, 762, 0, 0, 0, - 0, 763, 764, 765, 766, 767, 843, 769, 844, 771, - 0, 772, 773, 774, 775, 0, 845, 0, 846, 778, - 847, 848, 781, 782, 783, 784, 0, 785, 849, 850, - 851, 852, 853, 791, 792, 793, 794, 0, 795, 0, - 854, 855, 856, 857, 800, 801, 802, 0, 0, 0, - 0, 0, 858, 0, 0, 0, 0, 870, 0, 0, - 859, 0, 0, 0, 0, 0, 0, 0, 0, 804, - 0, 0, 0, 0, 0, 0, 0, 0, 728, 827, - 730, 860, 731, 828, 733, 734, 829, 830, 831, 832, - 833, 834, 741, 742, 743, 744, 835, 836, 837, 748, - 749, 838, 839, 752, 753, 754, 840, 756, 757, 758, - 759, 841, 842, 762, 0, 0, 0, 0, 763, 764, - 765, 766, 767, 843, 769, 844, 771, 0, 772, 773, - 774, 775, 0, 845, 0, 846, 778, 847, 848, 781, - 782, 783, 784, 0, 785, 849, 850, 851, 852, 853, - 791, 792, 793, 794, 0, 795, 0, 854, 855, 856, - 857, 800, 801, 802, 0, 0, 0, 0, 0, 858, - 0, 0, 0, 0, 0, 0, 0, 859, 876, 0, - 0, 0, 0, 0, 0, 0, 804, 0, 0, 0, - 0, 0, 0, 0, 0, 728, 827, 730, 860, 731, - 828, 733, 734, 829, 830, 831, 832, 833, 834, 741, - 742, 743, 744, 835, 836, 837, 748, 749, 838, 839, - 752, 753, 754, 840, 756, 757, 758, 759, 841, 842, - 762, 0, 0, 0, 0, 763, 764, 765, 766, 767, - 843, 769, 844, 771, 0, 772, 773, 774, 775, 0, - 845, 0, 846, 778, 847, 848, 781, 782, 783, 784, - 0, 785, 849, 850, 851, 852, 853, 791, 792, 793, - 794, 0, 795, 0, 854, 855, 856, 857, 800, 801, - 802, 0, 0, 0, 0, 0, 858, 0, 0, 0, - 0, -268, 0, -268, 859, -268, 0, -268, -268, 0, - 0, 0, 0, 804, 0, -268, -268, -268, -268, 0, - 0, 0, -268, -268, 0, 860, -268, -268, -268, 0, - -268, -268, -268, -268, 0, 0, -268, 0, 0, 0, - 0, -268, -268, -268, -268, -268, 0, -268, 0, -268, - 0, -268, -268, -268, -268, 0, 0, 0, 0, -268, - 0, 0, -268, -268, -268, -268, 0, -268, 0, 0, - 0, 0, 0, -268, -268, -268, -268, 0, -268, 0, - 0, 0, 0, 0, -268, -268, -268, 0, 0, -269, - 0, -269, 0, -269, 0, -269, -269, -268, 0, 0, - 0, 0, 0, -269, -269, -269, -269, 0, 0, -268, - -269, -269, 0, 0, -269, -269, -269, -268, -269, -269, - -269, -269, 0, 0, -269, 0, 0, 0, 0, -269, - -269, -269, -269, -269, 0, -269, 0, -269, 0, -269, - -269, -269, -269, 0, 0, 0, 0, -269, 0, 0, - -269, -269, -269, -269, 0, -269, 0, 0, 0, 0, - 0, -269, -269, -269, -269, 0, -269, 0, 0, 0, - 0, 0, -269, -269, -269, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -269, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -269, 0, 0, - 0, 0, 0, 0, 0, -269 + 0, 0, 0, 0, 0, 0, 371, 372, 0, 221, + 16, 725, 824, 727, 0, 728, 825, 730, 731, 826, + 827, 828, 829, 830, 831, 738, 739, 740, 741, 832, + 833, 834, 745, 746, 835, 836, 749, 750, 751, 837, + 753, 754, 755, 756, 838, 839, 759, 0, 0, 0, + 0, 760, 761, 762, 763, 764, 840, 766, 841, 768, + 0, 769, 770, 771, 772, 0, 842, 0, 843, 775, + 844, 845, 778, 779, 780, 781, 0, 782, 846, 847, + 848, 849, 850, 788, 789, 790, 791, 0, 792, 0, + 851, 852, 853, 854, 797, 798, 799, 0, 0, 0, + 0, 0, 855, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 801, + 0, 0, 0, 0, 0, 0, 0, 0, 725, 824, + 727, 857, 728, 825, 730, 731, 826, 827, 828, 829, + 830, 831, 738, 739, 740, 741, 832, 833, 834, 745, + 746, 835, 836, 749, 750, 751, 837, 753, 754, 755, + 756, 838, 839, 759, 0, 0, 0, 0, 760, 761, + 762, 763, 764, 840, 766, 841, 768, 0, 769, 770, + 771, 772, 0, 842, 0, 843, 775, 844, 845, 778, + 779, 780, 781, 0, 782, 846, 847, 848, 849, 850, + 788, 789, 790, 791, 0, 792, 0, 851, 852, 853, + 854, 797, 798, 799, 0, 0, 0, 0, 0, 855, + 0, 0, 0, 0, 867, 0, 0, 856, 0, 0, + 0, 0, 0, 0, 0, 0, 801, 0, 0, 0, + 0, 0, 0, 0, 0, 725, 824, 727, 857, 728, + 825, 730, 731, 826, 827, 828, 829, 830, 831, 738, + 739, 740, 741, 832, 833, 834, 745, 746, 835, 836, + 749, 750, 751, 837, 753, 754, 755, 756, 838, 839, + 759, 0, 0, 0, 0, 760, 761, 762, 763, 764, + 840, 766, 841, 768, 0, 769, 770, 771, 772, 0, + 842, 0, 843, 775, 844, 845, 778, 779, 780, 781, + 0, 782, 846, 847, 848, 849, 850, 788, 789, 790, + 791, 0, 792, 0, 851, 852, 853, 854, 797, 798, + 799, 0, 0, 0, 0, 0, 855, 0, 0, 0, + 0, 0, 0, 0, 856, 873, 0, 0, 0, 0, + 0, 0, 0, 801, 0, 0, 0, 0, 0, 0, + 0, 0, 725, 824, 727, 857, 728, 825, 730, 731, + 826, 827, 828, 829, 830, 831, 738, 739, 740, 741, + 832, 833, 834, 745, 746, 835, 836, 749, 750, 751, + 837, 753, 754, 755, 756, 838, 839, 759, 0, 0, + 0, 0, 760, 761, 762, 763, 764, 840, 766, 841, + 768, 0, 769, 770, 771, 772, 0, 842, 0, 843, + 775, 844, 845, 778, 779, 780, 781, 0, 782, 846, + 847, 848, 849, 850, 788, 789, 790, 791, 0, 792, + 0, 851, 852, 853, 854, 797, 798, 799, 0, 0, + 0, 0, 0, 855, 0, 0, 0, 0, -266, 0, + -266, 856, -266, 0, -266, -266, 0, 0, 0, 0, + 801, 0, -266, -266, -266, -266, 0, 0, 0, -266, + -266, 0, 857, -266, -266, -266, 0, -266, -266, -266, + -266, 0, 0, -266, 0, 0, 0, 0, -266, -266, + -266, -266, -266, 0, -266, 0, -266, 0, -266, -266, + -266, -266, 0, 0, 0, 0, -266, 0, 0, -266, + -266, -266, -266, 0, -266, 0, 0, 0, 0, 0, + -266, -266, -266, -266, 0, -266, 0, 0, 0, 0, + 0, -266, -266, -266, 0, 0, -267, 0, -267, 0, + -267, 0, -267, -267, -266, 0, 0, 0, 0, 0, + -267, -267, -267, -267, 0, 0, -266, -267, -267, 0, + 0, -267, -267, -267, -266, -267, -267, -267, -267, 0, + 0, -267, 0, 0, 0, 0, -267, -267, -267, -267, + -267, 0, -267, 0, -267, 0, -267, -267, -267, -267, + 0, 0, 0, 0, -267, 0, 0, -267, -267, -267, + -267, 0, -267, 0, 0, 0, 0, 0, -267, -267, + -267, -267, 0, -267, 0, 0, 0, 0, 0, -267, + -267, -267, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -267, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -267, 0, 0, 0, 0, 0, + 0, 0, -267 }; const short asn1_parser::yycheck_[] = { - 9, 449, 359, 140, 141, 558, 313, 128, 129, 18, - 140, 141, 694, 286, 213, 0, 207, 246, 3, 22, - 53, 22, 128, 129, 141, 461, 4, 456, 499, 458, - 712, 4, 5, 66, 67, 4, 4, 70, 22, 30, - 258, 74, 22, 4, 31, 4, 517, 22, 24, 25, - 33, 22, 85, 326, 314, 77, 50, 203, 487, 77, - 64, 24, 87, 87, 210, 54, 652, 124, 50, 206, - 216, 861, 89, 149, 89, 29, 206, 102, 102, 869, - 50, 4, 5, 6, 7, 112, 9, 50, 11, 0, - 211, 677, 112, 150, 451, 89, 113, 20, 113, 124, - 124, 126, 126, 50, 89, 51, 243, 89, 141, 126, - 95, 34, 95, 243, 313, 314, 246, 213, 145, 89, - 111, 50, 50, 676, 146, 145, 89, 809, 146, 35, - 126, 114, 126, 137, 213, 89, 124, 126, 126, 93, - 63, 523, 89, 525, 124, 141, 149, 150, 149, 367, - 138, 16, 412, 59, 121, 140, 141, 586, 149, 126, - 89, 89, 149, 150, 70, 122, 150, 200, 124, 149, - 9, 149, 150, 149, 149, 532, 149, 150, 149, 18, - 149, 150, 150, 865, 122, 306, 75, 110, 149, 150, - 149, 150, 122, 150, 203, 121, 205, 138, 207, 123, - 126, 210, 122, 212, 350, 351, 130, 216, 217, 150, - 356, 357, 150, 412, 432, 124, 434, 313, 314, 133, - 150, 206, 125, 694, 361, 258, 149, 150, 446, 138, - 150, 361, 450, 124, 313, 314, 127, 121, 124, 675, - 126, 712, 126, 126, 361, 362, 137, 446, 125, 258, - 141, 450, 138, 262, 124, 141, 126, 456, 243, 458, - 137, 246, 453, 462, 124, 126, 56, 574, 138, 125, - 60, 256, 125, 258, 703, 125, 53, 138, 138, 552, - 125, 137, 481, 125, 137, 484, 140, 137, 487, 66, - 67, 564, 137, 70, 523, 137, 525, 74, 444, 24, - 25, 137, 106, 28, 123, 141, 89, 90, 85, 145, - 137, 130, 89, 126, 141, 121, 412, 130, 145, 61, - 126, 874, 679, 541, 309, 106, 544, 141, 361, 362, - 124, 145, 126, 412, 367, 106, 241, 124, 125, 126, - 245, 350, 351, 650, 432, 4, 434, 356, 357, 470, - 682, 140, 684, 17, 18, 24, 25, 140, 141, 71, - 456, 498, 458, 500, 141, 121, 462, 150, 498, 127, - 500, 819, 133, 149, 150, 574, 361, 456, 36, 458, - 72, 688, 367, 462, 820, 481, 137, 586, 484, 142, - 375, 487, 175, 523, 865, 525, 44, 45, 142, 432, - 385, 434, 481, 124, 389, 484, 24, 25, 487, 125, - 126, 56, 195, 446, 592, 593, 125, 450, 142, 103, - 103, 124, 124, 432, 91, 434, 87, 210, 124, 212, - 567, 69, 256, 216, 217, 444, 421, 567, 103, 16, - 449, 138, 878, 121, 453, 138, 150, 432, 124, 434, - 124, 650, 461, 130, 124, 126, 138, 138, 87, 87, - 243, 446, 87, 246, 87, 450, 249, 250, 124, 141, - 253, 124, 138, 141, 124, 252, 622, 254, 574, 256, - 22, 466, 125, 137, 267, 309, 141, 246, 132, 688, - 586, 125, 138, 126, 87, 574, 137, 256, 138, 532, - 283, 125, 137, 536, 703, 58, 40, 586, 541, 40, - 13, 544, 124, 498, 58, 500, 137, 123, 125, 130, - 303, 642, 138, 126, 124, 145, 125, 137, 137, 126, - 145, 125, 309, 138, 543, 126, 521, 138, 523, 124, - 525, 526, 527, 528, 529, 530, 138, 126, 137, 558, - 309, 375, 124, 149, 650, 124, 541, 340, 125, 544, - 144, 385, 708, 572, 137, 389, 137, 350, 351, 578, - 127, 650, 127, 356, 357, 122, 4, 129, 361, 125, - 150, 137, 567, 40, 361, 362, 125, 138, 137, 127, - 127, 624, 688, 122, 120, 127, 137, 421, 375, 127, - 125, 137, 137, 127, 127, 125, 125, 703, 385, 688, - 125, 141, 389, 622, 104, 137, 375, 138, 124, 137, - 125, 138, 138, 137, 703, 137, 385, 137, 141, 138, - 389, 138, 125, 137, 3, 137, 137, 148, 623, 243, - 659, 596, 466, 859, 421, 677, 809, 806, 567, 90, - 361, 567, 242, 638, 649, 689, 18, 32, 74, 690, - 53, 70, 421, 446, 85, 674, 675, 676, 789, 790, - 700, 454, 674, 682, 543, 684, 11, 217, 461, 622, - 481, 690, 691, 789, 790, 49, 541, 44, 484, 466, - 462, 586, 677, 335, -1, -1, -1, 521, -1, 708, - -1, -1, 526, 527, 528, 529, 530, 466, -1, 694, - -1, -1, -1, -1, -1, 498, 499, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 712, -1, 4, - 5, 6, 7, -1, 9, -1, 11, -1, -1, -1, - 523, -1, 525, -1, 521, 20, -1, -1, -1, 526, - 527, 528, 529, 530, -1, -1, -1, -1, -1, 34, - 745, -1, 521, -1, 523, -1, 525, 526, 527, 528, - 529, 530, -1, -1, -1, 558, -1, -1, -1, -1, - -1, -1, -1, -1, 567, -1, -1, -1, 63, -1, - 567, -1, -1, -1, -1, -1, -1, -1, -1, 623, - -1, -1, -1, -1, 79, -1, -1, -1, -1, -1, - 819, 820, -1, -1, 638, 598, -1, -1, -1, -1, - -1, 806, -1, -1, 809, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 110, -1, -1, -1, -1, - -1, -1, 4, 5, 6, 7, 623, 9, -1, 11, - -1, -1, -1, 677, -1, 130, -1, -1, 20, -1, - -1, 638, 24, 25, 623, 874, -1, -1, 30, 878, - 694, -1, 34, -1, 149, 150, -1, -1, 40, 638, - -1, -1, -1, -1, -1, 47, -1, -1, 712, -1, - -1, -1, 675, 676, -1, -1, -1, -1, -1, -1, - 677, 63, 679, -1, -1, -1, -1, -1, -1, -1, - -1, 694, -1, -1, 76, -1, -1, -1, 677, -1, - -1, 745, -1, -1, -1, -1, -1, 89, -1, 712, - -1, -1, -1, -1, -1, 694, 4, 5, 6, 7, - -1, 9, -1, 11, -1, -1, -1, -1, 110, 111, - -1, -1, 20, 712, -1, -1, -1, -1, 120, -1, - -1, -1, 124, 125, -1, -1, 34, -1, 745, -1, - -1, 133, -1, -1, -1, -1, -1, -1, -1, 141, - -1, -1, 806, -1, -1, 809, 745, 149, 150, -1, - -1, -1, -1, -1, -1, 63, -1, -1, -1, -1, + 9, 128, 129, 256, 140, 141, 362, 128, 129, 18, + 0, 140, 141, 3, 557, 203, 448, 246, 460, 311, + 207, 141, 210, 4, 500, 455, 284, 457, 216, 691, + 31, 22, 312, 22, 4, 5, 6, 7, 4, 9, + 22, 11, 518, 4, 213, 4, 5, 709, 22, 64, + 20, 22, 50, 33, 307, 22, 24, 487, 213, 4, + 24, 25, 476, 149, 34, 4, 54, 77, 112, 327, + 206, 89, 122, 30, 50, 122, 122, 206, 77, 112, + 9, 87, 50, 124, 211, 126, 51, 87, 50, 18, + 50, 89, 4, 63, 450, 113, 102, 138, 50, 89, + 150, 145, 102, 150, 150, 95, 50, 243, 126, 79, + 29, 525, 145, 89, 243, 95, 123, 246, 124, 124, + 126, 89, 137, 130, 124, 378, 126, 89, 126, 89, + 673, 126, 412, 138, 114, 388, 146, 89, 126, 392, + 110, 213, 311, 312, 806, 89, 141, 146, 149, 150, + 140, 141, 125, 124, 111, 585, 311, 312, 149, 150, + 130, 150, 75, 89, 137, 353, 354, 149, 421, 150, + 89, 359, 360, 0, 93, 149, 532, 304, 149, 149, + 150, 122, 149, 149, 150, 149, 258, 113, 149, 150, + 149, 150, 149, 650, 203, 123, 205, 35, 207, 124, + 862, 210, 130, 212, 149, 150, 133, 216, 217, 150, + 149, 150, 465, 125, 126, 691, 206, 674, 130, 125, + 124, 59, 126, 213, 126, 24, 25, 124, 364, 28, + 672, 137, 70, 709, 138, 364, 138, 149, 150, 311, + 312, 138, 125, 412, 364, 365, 124, 476, 126, 258, + 125, 260, 138, 243, 137, 443, 246, 412, 16, 125, + 138, 125, 137, 141, 150, 452, 256, 125, 258, 522, + 700, 137, 140, 526, 527, 528, 529, 530, 56, 137, + 572, 137, 60, 137, 126, 141, 455, 141, 457, 145, + 445, 145, 461, 551, 449, 858, 525, 126, 370, 106, + 455, 130, 457, 866, 562, 121, 461, 61, 121, 121, + 126, 121, 481, 126, 126, 484, 126, 307, 487, 141, + 676, 311, 312, 145, 17, 18, 481, 241, 871, 484, + 106, 245, 487, 124, 125, 126, 124, 432, 126, 434, + 412, 679, 469, 681, 353, 354, 106, 476, 149, 150, + 359, 360, 24, 25, 44, 45, 648, 24, 25, 4, + 432, 140, 434, 499, 71, 501, 125, 126, 621, 121, + 499, 127, 501, 445, 364, 817, 133, 449, 53, 36, + 370, 72, 635, 455, 816, 457, 862, 142, 378, 461, + 137, 66, 67, 685, 142, 70, 525, 124, 388, 74, + 592, 593, 392, 572, 56, 125, 142, 103, 103, 481, + 85, 124, 484, 91, 89, 487, 585, 572, 124, 87, + 124, 674, 412, 432, 103, 434, 69, 16, 138, 565, + 585, 421, 620, 875, 443, 121, 565, 138, 691, 448, + 124, 124, 432, 452, 434, 130, 138, 124, 124, 138, + 150, 460, 126, 87, 87, 445, 709, 87, 87, 449, + 124, 141, 124, 89, 90, 455, 141, 457, 138, 541, + 141, 461, 544, 124, 22, 465, 141, 125, 137, 648, + 126, 125, 132, 137, 87, 138, 476, 125, 137, 742, + 58, 481, 13, 648, 484, 40, 138, 487, 40, 124, + 572, 124, 137, 4, 5, 6, 7, 58, 9, 499, + 11, 501, 639, 585, 140, 141, 685, 705, 123, 20, + 130, 138, 124, 138, 150, 125, 145, 126, 125, 137, + 685, 700, 522, 34, 543, 525, 526, 527, 528, 529, + 530, 137, 126, 138, 145, 700, 138, 138, 557, 175, + 803, 541, 125, 806, 544, 126, 126, 124, 137, 149, + 124, 570, 63, 137, 125, 137, 144, 576, 127, 195, + 127, 129, 122, 4, 150, 565, 648, 252, 79, 254, + 127, 256, 572, 53, 210, 125, 212, 125, 137, 40, + 216, 217, 127, 122, 125, 585, 66, 67, 137, 127, + 70, 120, 127, 127, 74, 127, 138, 137, 125, 110, + 137, 620, 125, 685, 137, 85, 125, 243, 104, 137, + 246, 141, 137, 249, 250, 124, 138, 253, 700, 125, + 138, 621, 307, 213, 137, 137, 141, 137, 148, 265, + 138, 138, 125, 137, 137, 635, 137, 3, 149, 150, + 243, 856, 674, 596, 657, 281, 806, 803, 648, 786, + 787, 242, 671, 672, 673, 786, 787, 565, 90, 565, + 679, 141, 681, 686, 646, 301, 364, 18, 687, 688, + 32, 74, 53, 687, 674, 70, 85, 671, 543, 364, + 365, 217, 541, 11, 49, 685, 705, 620, 44, 481, + 697, 691, -1, 378, 484, 336, 585, -1, 461, -1, + 700, -1, -1, 388, -1, 341, -1, 392, -1, 709, + -1, -1, -1, -1, -1, -1, -1, 353, 354, -1, + -1, 311, 312, 359, 360, -1, -1, -1, 364, -1, + -1, -1, -1, 213, -1, -1, 421, -1, -1, -1, + -1, 246, 742, -1, -1, -1, -1, -1, -1, -1, + -1, 256, -1, 4, 5, 6, 7, -1, 9, -1, + 11, -1, -1, -1, -1, -1, -1, -1, -1, 20, + -1, -1, -1, -1, -1, -1, -1, -1, 258, -1, + 465, -1, -1, 34, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 816, 817, -1, + -1, -1, 307, 803, -1, -1, 806, -1, -1, 445, + -1, -1, 63, -1, -1, -1, -1, 453, -1, -1, + -1, -1, 412, -1, 460, -1, -1, -1, -1, -1, + -1, 311, 312, -1, -1, -1, -1, 522, -1, -1, + 476, 526, 527, 528, 529, 530, -1, -1, -1, -1, + -1, -1, 871, -1, -1, -1, 875, -1, -1, 110, + -1, -1, -1, 499, 500, 455, -1, 457, -1, -1, + -1, 461, -1, 378, -1, -1, -1, -1, -1, -1, + 565, -1, -1, 388, 364, 365, -1, 392, -1, 525, + 370, 481, -1, -1, 484, -1, -1, 487, 149, 150, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 421, -1, -1, -1, + -1, 557, -1, -1, -1, -1, -1, -1, -1, 565, + -1, -1, 412, -1, -1, -1, 621, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 635, -1, 432, -1, 434, -1, -1, -1, -1, -1, + 465, -1, 598, -1, -1, 445, -1, -1, -1, 449, + -1, 476, -1, -1, -1, 455, -1, 457, -1, -1, + -1, 461, 572, -1, -1, -1, -1, -1, -1, 674, + -1, 676, -1, -1, -1, 585, -1, -1, -1, -1, + -1, 481, -1, -1, 484, -1, -1, 487, -1, 489, + -1, -1, -1, -1, -1, -1, -1, 522, -1, -1, + 525, 526, 527, 528, 529, 530, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 672, 673, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 532, -1, -1, 691, 536, 742, 648, -1, + -1, 541, -1, -1, 544, -1, -1, -1, -1, -1, + -1, -1, -1, 709, -1, -1, -1, 4, 5, 6, + 7, -1, 9, -1, 11, -1, -1, -1, -1, -1, + -1, -1, 572, 20, -1, 685, -1, 24, 25, -1, + -1, -1, -1, 30, -1, 585, -1, 34, -1, -1, + 700, -1, -1, 40, -1, -1, 621, -1, -1, -1, + 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 635, -1, -1, -1, -1, -1, 63, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 79, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 806, -1, -1, 809, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 820, -1, -1, - -1, -1, 110, -1, -1, -1, -1, 806, -1, -1, - 809, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 89, -1, -1, -1, -1, 803, 648, 674, + 806, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 817, -1, 110, 111, -1, 691, -1, -1, -1, + -1, -1, -1, 120, -1, -1, -1, 124, 125, -1, + -1, -1, -1, -1, 709, 685, 133, -1, -1, -1, + -1, -1, -1, -1, 141, -1, -1, -1, -1, -1, + 700, -1, 149, 150, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 871, -1, 742, -1, 875, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 4, 5, 6, 7, -1, 9, -1, 11, - -1, 149, 150, -1, -1, -1, -1, -1, 20, -1, - 22, 874, 24, 25, -1, 878, -1, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, -1, - -1, -1, 124, 125, -1, -1, 128, -1, -1, -1, - -1, 133, -1, -1, -1, 137, -1, -1, -1, 141, - -1, -1, -1, -1, -1, -1, -1, 149, 150, 4, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, 5, 6, 7, -1, 9, -1, 11, -1, -1, -1, - -1, -1, -1, -1, -1, 20, -1, 22, -1, 24, - 25, -1, -1, -1, 29, 30, 31, 32, 33, 34, + -1, -1, -1, -1, -1, 20, -1, 22, 803, 24, + 25, 806, -1, -1, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, @@ -10505,188 +10741,133 @@ namespace yy { 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, - -1, -1, -1, 128, 4, 5, 6, 7, 133, 9, - -1, 11, 137, -1, -1, -1, 141, -1, -1, -1, - 20, -1, 22, -1, 149, 150, -1, -1, -1, -1, - 30, 31, 32, -1, 34, -1, -1, 37, 38, 39, - -1, 41, 42, -1, -1, -1, 46, 47, 48, 49, - -1, -1, 52, 53, 54, -1, -1, 57, -1, -1, - -1, -1, 62, 63, 64, 65, 66, 67, 68, -1, - -1, -1, -1, 73, 74, -1, 76, -1, 78, -1, - 80, -1, -1, 83, 84, 85, 86, -1, 88, -1, - 90, -1, -1, -1, 94, -1, 96, 97, 98, 99, - 100, 101, 102, -1, -1, 105, -1, 107, 108, 109, - 110, 111, -1, -1, -1, 115, 116, 117, 118, 119, - 120, -1, -1, -1, 124, -1, 126, -1, 128, 4, - 5, 6, 7, -1, 9, -1, 11, -1, -1, -1, - -1, -1, -1, -1, -1, 20, -1, 22, -1, 149, - 150, -1, -1, -1, -1, 30, 31, 32, -1, 34, - -1, -1, 37, 38, 39, -1, 41, 42, -1, -1, - -1, -1, -1, 48, 49, -1, -1, 52, 53, -1, - -1, -1, 57, -1, -1, -1, -1, 62, 63, 64, - 65, 66, 67, 68, -1, -1, -1, -1, 73, 74, - -1, 76, -1, 78, -1, 80, -1, -1, 83, 84, - 85, 86, -1, 88, -1, 90, -1, -1, -1, 94, - -1, 96, 97, 98, 99, 100, 101, 102, -1, -1, - 105, -1, 107, 108, 109, 110, 111, -1, -1, -1, - 115, 116, 117, 118, 119, 120, -1, 122, -1, -1, - -1, 126, -1, 128, -1, -1, -1, -1, -1, -1, - 4, 5, 6, 7, -1, 9, -1, 11, -1, -1, - -1, -1, -1, -1, 149, 150, 20, -1, 22, -1, - 24, 25, -1, -1, -1, -1, 30, -1, 32, -1, - 34, -1, -1, 37, 38, 39, 40, 41, 42, -1, - -1, -1, -1, 47, 48, 49, -1, -1, 52, 53, - -1, -1, -1, 57, -1, -1, -1, -1, 62, 63, - -1, 65, 66, 67, 68, -1, -1, -1, -1, -1, - 74, -1, 76, -1, 78, -1, -1, -1, -1, 83, - 84, 85, 86, -1, 88, 89, -1, -1, -1, -1, - 94, -1, 96, 97, 98, 99, 100, -1, -1, -1, - -1, 105, -1, 107, 108, 109, 110, 111, -1, -1, - -1, 115, 116, 117, 118, 119, 120, -1, -1, -1, - 124, -1, -1, -1, 128, 4, 5, 6, 7, 133, - 9, -1, 11, -1, -1, -1, -1, 141, -1, -1, - -1, 20, -1, 22, -1, 149, 150, -1, -1, -1, - -1, 30, 31, 32, -1, 34, -1, -1, 37, 38, - 39, -1, 41, 42, -1, -1, -1, -1, -1, 48, - 49, -1, -1, 52, 53, -1, -1, -1, 57, -1, - -1, -1, -1, 62, 63, 64, 65, 66, 67, 68, - -1, -1, -1, -1, 73, 74, -1, 76, -1, 78, - -1, 80, -1, -1, 83, 84, 85, 86, -1, 88, - -1, 90, -1, -1, -1, 94, -1, 96, 97, 98, - 99, 100, 101, 102, -1, -1, 105, -1, 107, 108, - 109, 110, 111, -1, -1, -1, 115, 116, 117, 118, - 119, 120, -1, -1, -1, -1, -1, 126, -1, 128, - -1, -1, -1, -1, -1, -1, 4, 5, 6, 7, + 125, -1, -1, 128, -1, -1, -1, -1, 133, -1, + -1, -1, 137, -1, -1, -1, 141, -1, -1, -1, + -1, -1, -1, -1, 149, 150, 4, 5, 6, 7, -1, 9, -1, 11, -1, -1, -1, -1, -1, -1, - 149, 150, 20, -1, 22, -1, 24, 25, -1, -1, - -1, -1, 30, -1, 32, -1, 34, -1, -1, 37, - 38, 39, 40, 41, 42, -1, -1, -1, -1, 47, - 48, 49, -1, -1, 52, 53, -1, -1, -1, 57, - -1, -1, -1, -1, 62, 63, -1, 65, 66, 67, - 68, -1, -1, -1, -1, -1, 74, -1, 76, -1, - 78, -1, -1, -1, -1, 83, 84, 85, 86, -1, - 88, 89, -1, -1, -1, -1, 94, -1, 96, 97, - 98, 99, 100, -1, -1, -1, -1, 105, -1, 107, - 108, 109, 110, 111, -1, -1, -1, 115, 116, 117, + -1, -1, 20, -1, 22, -1, 24, 25, -1, -1, + -1, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, -1, -1, -1, - 128, 4, 5, 6, 7, 133, 9, -1, 11, -1, + 128, 4, 5, 6, 7, 133, 9, -1, 11, 137, -1, -1, -1, 141, -1, -1, -1, 20, -1, 22, - -1, 149, 150, -1, -1, -1, -1, 30, -1, 32, + -1, 149, 150, -1, -1, -1, -1, 30, 31, 32, -1, 34, -1, -1, 37, 38, 39, -1, 41, 42, - -1, -1, -1, -1, -1, 48, 49, -1, -1, 52, - 53, -1, -1, -1, 57, -1, -1, -1, -1, 62, + -1, -1, -1, 46, 47, 48, 49, -1, -1, 52, + 53, 54, -1, -1, 57, -1, -1, -1, -1, 62, 63, 64, 65, 66, 67, 68, -1, -1, -1, -1, 73, 74, -1, 76, -1, 78, -1, 80, -1, -1, 83, 84, 85, 86, -1, 88, -1, 90, -1, -1, -1, 94, -1, 96, 97, 98, 99, 100, 101, 102, - 4, 5, 105, -1, 107, 108, 109, 110, 111, -1, - -1, -1, 115, 116, 117, 118, 119, 120, 22, -1, - -1, -1, -1, 126, -1, 128, 30, -1, 32, -1, - 34, -1, -1, 37, 38, 39, -1, 41, 42, -1, - -1, -1, -1, -1, 48, 49, 149, 150, 52, 53, - -1, -1, -1, 57, -1, -1, -1, -1, 62, -1, - -1, 65, 66, 67, 68, -1, -1, -1, -1, -1, - 74, -1, 76, -1, 78, -1, -1, -1, -1, 83, - 84, 85, 86, -1, 88, -1, -1, -1, -1, -1, - 94, -1, 96, 97, 98, 99, 100, -1, -1, -1, - -1, 105, -1, 107, 108, 109, -1, 111, -1, -1, - -1, 115, 116, 117, 118, 119, -1, -1, 4, 5, - 6, 7, -1, 9, 128, 11, -1, -1, -1, -1, - -1, -1, -1, -1, 20, -1, 22, -1, 24, 25, - -1, -1, -1, -1, 30, 149, 150, -1, 34, -1, - 4, 5, 6, 7, 40, 9, -1, 11, -1, -1, - -1, 47, -1, -1, -1, -1, 20, -1, -1, -1, - 24, 25, -1, -1, -1, -1, 30, 63, -1, -1, - 34, -1, -1, -1, -1, -1, 40, -1, -1, -1, - 76, -1, -1, 47, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 89, -1, -1, -1, -1, -1, 63, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 76, -1, 110, 111, -1, -1, -1, -1, - -1, -1, -1, -1, 120, 89, -1, -1, 124, -1, - -1, -1, -1, -1, -1, -1, -1, 133, -1, -1, - -1, -1, -1, -1, -1, 141, 110, 111, -1, -1, - -1, -1, -1, 149, 150, -1, 120, -1, -1, -1, - 124, -1, -1, -1, 22, -1, -1, -1, -1, 133, - -1, -1, 30, -1, 32, -1, 34, 141, -1, 37, - 38, 39, -1, 41, 42, 149, 150, 45, -1, -1, + -1, -1, 105, -1, 107, 108, 109, 110, 111, -1, + -1, -1, 115, 116, 117, 118, 119, 120, -1, -1, + -1, 124, -1, 126, -1, 128, 4, 5, 6, 7, + -1, 9, -1, 11, -1, -1, -1, -1, -1, -1, + -1, -1, 20, -1, 22, -1, 149, 150, -1, -1, + -1, -1, 30, 31, 32, -1, 34, -1, -1, 37, + 38, 39, -1, 41, 42, -1, -1, -1, -1, -1, 48, 49, -1, -1, 52, 53, -1, -1, -1, 57, - -1, -1, -1, -1, 62, -1, -1, 65, 66, 67, - 68, -1, -1, -1, -1, -1, 74, -1, 76, -1, - 78, -1, -1, -1, -1, 83, 84, 85, 86, -1, - 88, -1, -1, -1, -1, -1, 94, -1, 96, 97, - 98, 99, 100, -1, -1, -1, -1, 105, -1, 107, - 108, 109, -1, 111, -1, -1, -1, 115, 116, 117, - 118, 119, -1, 22, 122, -1, -1, 125, -1, -1, - 128, 30, -1, 32, -1, 34, -1, -1, 37, 38, - 39, -1, 41, 42, -1, -1, 45, -1, -1, 48, - 49, 149, 150, 52, 53, -1, -1, -1, 57, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - -1, -1, -1, -1, -1, 74, -1, 76, -1, 78, - -1, -1, -1, -1, 83, 84, 85, 86, -1, 88, - -1, -1, -1, -1, -1, 94, -1, 96, 97, 98, - 99, 100, -1, -1, -1, -1, 105, -1, 107, 108, - 109, -1, 111, -1, -1, -1, 115, 116, 117, 118, - 119, -1, 22, 122, -1, -1, 125, -1, -1, 128, - 30, -1, 32, -1, 34, -1, -1, 37, 38, 39, - -1, 41, 42, -1, -1, -1, -1, -1, 48, 49, - 149, 150, 52, 53, -1, -1, -1, 57, -1, -1, - -1, -1, 62, -1, -1, 65, 66, 67, 68, -1, - -1, -1, -1, -1, 74, -1, 76, -1, 78, -1, - -1, -1, -1, 83, 84, 85, 86, -1, 88, -1, - -1, -1, -1, -1, 94, -1, 96, 97, 98, 99, - 100, -1, -1, -1, -1, 105, -1, 107, 108, 109, - -1, 111, -1, -1, -1, 115, 116, 117, 118, 119, - -1, 121, -1, -1, 124, 22, -1, -1, 128, -1, + -1, -1, -1, -1, 62, 63, 64, 65, 66, 67, + 68, -1, -1, -1, -1, 73, 74, -1, 76, -1, + 78, -1, 80, -1, -1, 83, 84, 85, 86, -1, + 88, -1, 90, -1, -1, -1, 94, -1, 96, 97, + 98, 99, 100, 101, 102, -1, -1, 105, -1, 107, + 108, 109, 110, 111, -1, -1, -1, 115, 116, 117, + 118, 119, 120, -1, 122, -1, -1, -1, 126, -1, + 128, -1, -1, -1, -1, -1, -1, 4, 5, 6, + 7, -1, 9, -1, 11, -1, -1, -1, -1, -1, + -1, 149, 150, 20, -1, 22, -1, 24, 25, -1, -1, -1, -1, 30, -1, 32, -1, 34, -1, -1, - 37, 38, 39, -1, 41, 42, -1, -1, -1, 149, - 150, 48, 49, -1, -1, 52, 53, -1, -1, -1, - 57, -1, 59, -1, -1, 62, -1, -1, 65, 66, - 67, 68, -1, 70, -1, -1, -1, 74, -1, 76, + 37, 38, 39, 40, 41, 42, -1, -1, -1, -1, + 47, 48, 49, -1, -1, 52, 53, -1, -1, -1, + 57, -1, -1, -1, -1, 62, 63, -1, 65, 66, + 67, 68, -1, -1, -1, -1, -1, 74, -1, 76, -1, 78, -1, -1, -1, -1, 83, 84, 85, 86, - -1, 88, -1, -1, -1, -1, -1, 94, -1, 96, + -1, 88, 89, -1, -1, -1, -1, 94, -1, 96, 97, 98, 99, 100, -1, -1, -1, -1, 105, -1, - 107, 108, 109, -1, 111, -1, -1, -1, 115, 116, - 117, 118, 119, -1, 22, -1, -1, -1, -1, -1, - -1, 128, 30, -1, 32, -1, 34, -1, -1, 37, - 38, 39, -1, 41, 42, -1, -1, 45, -1, -1, - 48, 49, 149, 150, 52, 53, -1, -1, -1, 57, - -1, -1, -1, -1, 62, -1, -1, 65, 66, 67, - 68, -1, -1, -1, -1, -1, 74, -1, 76, -1, - 78, -1, -1, -1, -1, 83, 84, 85, 86, -1, - 88, -1, -1, -1, -1, -1, 94, -1, 96, 97, - 98, 99, 100, -1, -1, -1, -1, 105, -1, 107, - 108, 109, -1, 111, -1, -1, -1, 115, 116, 117, - 118, 119, -1, 22, 122, 24, 25, -1, -1, -1, - 128, 30, -1, 32, -1, 34, -1, -1, 37, 38, - 39, -1, 41, 42, -1, -1, -1, -1, -1, 48, - 49, 149, 150, 52, 53, -1, -1, -1, 57, -1, - -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, - -1, -1, -1, -1, -1, 74, -1, 76, -1, 78, - -1, -1, -1, -1, 83, 84, 85, 86, -1, 88, - -1, -1, -1, -1, -1, 94, -1, 96, 97, 98, - 99, 100, -1, -1, -1, -1, 105, -1, 107, 108, - 109, -1, 111, -1, -1, -1, 115, 116, 117, 118, - 119, -1, 22, -1, -1, -1, -1, -1, -1, 128, - 30, -1, 32, -1, 34, -1, -1, 37, 38, 39, - -1, 41, 42, -1, -1, 45, -1, -1, 48, 49, - 149, 150, 52, 53, -1, -1, -1, 57, -1, -1, - -1, -1, 62, -1, -1, 65, 66, 67, 68, -1, - -1, -1, -1, -1, 74, -1, 76, -1, 78, -1, - -1, -1, -1, 83, 84, 85, 86, -1, 88, -1, - -1, -1, -1, -1, 94, -1, 96, 97, 98, 99, - 100, -1, -1, -1, -1, 105, -1, 107, 108, 109, - -1, 111, -1, -1, -1, 115, 116, 117, 118, 119, - -1, 22, 122, -1, -1, -1, -1, -1, 128, 30, - -1, 32, -1, 34, -1, -1, 37, 38, 39, -1, - 41, 42, -1, -1, 45, -1, -1, 48, 49, 149, - 150, 52, 53, -1, -1, -1, 57, -1, -1, -1, + 107, 108, 109, 110, 111, -1, -1, -1, 115, 116, + 117, 118, 119, 120, -1, -1, -1, 124, -1, -1, + -1, 128, 4, 5, 6, 7, 133, 9, -1, 11, + -1, -1, -1, -1, 141, -1, -1, -1, 20, -1, + 22, -1, 149, 150, -1, -1, -1, -1, 30, 31, + 32, -1, 34, -1, -1, 37, 38, 39, -1, 41, + 42, -1, -1, -1, -1, -1, 48, 49, -1, -1, + 52, 53, -1, -1, -1, 57, -1, -1, -1, -1, + 62, 63, 64, 65, 66, 67, 68, -1, -1, -1, + -1, 73, 74, -1, 76, -1, 78, -1, 80, -1, + -1, 83, 84, 85, 86, -1, 88, -1, 90, -1, + -1, -1, 94, -1, 96, 97, 98, 99, 100, 101, + 102, -1, -1, 105, -1, 107, 108, 109, 110, 111, + -1, -1, -1, 115, 116, 117, 118, 119, 120, -1, + -1, -1, -1, -1, 126, -1, 128, -1, -1, -1, + -1, -1, -1, 4, 5, 6, 7, -1, 9, -1, + 11, -1, -1, -1, -1, -1, -1, 149, 150, 20, + -1, 22, -1, 24, 25, -1, -1, -1, -1, 30, + -1, 32, -1, 34, -1, -1, 37, 38, 39, 40, + 41, 42, -1, -1, -1, -1, 47, 48, 49, -1, + -1, 52, 53, -1, -1, -1, 57, -1, -1, -1, + -1, 62, 63, -1, 65, 66, 67, 68, -1, -1, + -1, -1, -1, 74, -1, 76, -1, 78, -1, -1, + -1, -1, 83, 84, 85, 86, -1, 88, 89, -1, + -1, -1, -1, 94, -1, 96, 97, 98, 99, 100, + -1, -1, -1, -1, 105, -1, 107, 108, 109, 110, + 111, -1, -1, -1, 115, 116, 117, 118, 119, 120, + -1, -1, -1, 124, -1, -1, -1, 128, 4, 5, + 6, 7, 133, 9, -1, 11, -1, -1, -1, -1, + 141, -1, -1, -1, 20, -1, 22, -1, 149, 150, + -1, -1, -1, -1, 30, -1, 32, -1, 34, -1, + -1, 37, 38, 39, -1, 41, 42, -1, -1, -1, + -1, -1, 48, 49, -1, -1, 52, 53, -1, -1, + -1, 57, -1, -1, -1, -1, 62, 63, 64, 65, + 66, 67, 68, -1, -1, -1, -1, 73, 74, -1, + 76, -1, 78, -1, 80, -1, -1, 83, 84, 85, + 86, -1, 88, -1, 90, -1, -1, -1, 94, -1, + 96, 97, 98, 99, 100, 101, 102, 4, 5, 105, + -1, 107, 108, 109, 110, 111, -1, -1, -1, 115, + 116, 117, 118, 119, 120, 22, -1, -1, -1, -1, + 126, -1, 128, 30, -1, 32, -1, 34, -1, -1, + 37, 38, 39, -1, 41, 42, -1, -1, -1, -1, + -1, 48, 49, 149, 150, 52, 53, -1, -1, -1, + 57, -1, -1, -1, -1, 62, -1, -1, 65, 66, + 67, 68, -1, -1, -1, -1, -1, 74, -1, 76, + -1, 78, -1, -1, -1, -1, 83, 84, 85, 86, + -1, 88, -1, -1, -1, -1, -1, 94, -1, 96, + 97, 98, 99, 100, -1, -1, -1, -1, 105, -1, + 107, 108, 109, -1, 111, -1, -1, -1, 115, 116, + 117, 118, 119, -1, -1, 4, 5, 6, 7, -1, + 9, 128, 11, -1, -1, -1, -1, -1, -1, -1, + -1, 20, -1, 22, -1, 24, 25, -1, -1, -1, + -1, 30, 149, 150, -1, 34, -1, 4, 5, 6, + 7, 40, 9, -1, 11, -1, -1, -1, 47, -1, + -1, -1, -1, 20, -1, -1, -1, 24, 25, -1, + -1, -1, -1, 30, 63, -1, -1, 34, -1, -1, + -1, -1, -1, 40, -1, -1, -1, 76, -1, -1, + 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 89, -1, -1, -1, -1, -1, 63, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, + -1, 110, 111, -1, -1, -1, -1, -1, -1, -1, + -1, 120, 89, -1, -1, 124, -1, -1, -1, -1, + -1, -1, -1, -1, 133, -1, -1, -1, -1, -1, + -1, -1, 141, 110, 111, -1, -1, -1, -1, -1, + 149, 150, -1, 120, -1, -1, -1, 124, -1, -1, + -1, 22, -1, -1, -1, -1, 133, -1, -1, 30, + -1, 32, -1, 34, 141, -1, 37, 38, 39, -1, + 41, 42, 149, 150, 45, -1, -1, 48, 49, -1, + -1, 52, 53, -1, -1, -1, 57, -1, -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, -1, -1, -1, -1, -1, 74, -1, 76, -1, 78, -1, -1, -1, -1, 83, 84, 85, 86, -1, 88, -1, -1, -1, -1, -1, 94, -1, 96, 97, 98, 99, 100, -1, -1, -1, -1, 105, -1, 107, 108, 109, -1, 111, -1, -1, -1, 115, 116, 117, 118, 119, -1, - 22, 122, -1, -1, -1, -1, -1, 128, 30, -1, + 22, 122, -1, -1, 125, -1, -1, 128, 30, -1, 32, -1, 34, -1, -1, 37, 38, 39, -1, 41, 42, -1, -1, 45, -1, -1, 48, 49, 149, 150, 52, 53, -1, -1, -1, 57, -1, -1, -1, -1, @@ -10696,7 +10877,7 @@ namespace yy { -1, -1, 94, -1, 96, 97, 98, 99, 100, -1, -1, -1, -1, 105, -1, 107, 108, 109, -1, 111, -1, -1, -1, 115, 116, 117, 118, 119, -1, 22, - 122, -1, -1, -1, -1, -1, 128, 30, -1, 32, + 122, -1, -1, 125, -1, -1, 128, 30, -1, 32, -1, 34, -1, -1, 37, 38, 39, -1, 41, 42, -1, -1, -1, -1, -1, 48, 49, 149, 150, 52, 53, -1, -1, -1, 57, -1, -1, -1, -1, 62, @@ -10705,30 +10886,30 @@ namespace yy { 83, 84, 85, 86, -1, 88, -1, -1, -1, -1, -1, 94, -1, 96, 97, 98, 99, 100, -1, -1, -1, -1, 105, -1, 107, 108, 109, -1, 111, -1, - -1, -1, 115, 116, 117, 118, 119, -1, 22, -1, - -1, 124, -1, -1, -1, 128, 30, -1, 32, -1, - 34, -1, -1, 37, 38, 39, -1, 41, 42, 43, - -1, -1, -1, -1, 48, 49, 149, 150, 52, 53, - -1, -1, -1, 57, -1, -1, -1, -1, 62, -1, - -1, 65, 66, 67, 68, -1, -1, -1, -1, -1, - 74, -1, 76, -1, 78, -1, -1, -1, -1, 83, - 84, 85, 86, -1, 88, -1, -1, -1, -1, -1, - 94, -1, 96, 97, 98, 99, 100, -1, -1, -1, - -1, 105, -1, 107, 108, 109, -1, 111, -1, -1, - -1, 115, 116, 117, 118, 119, -1, 22, -1, -1, - -1, -1, -1, -1, 128, 30, -1, 32, -1, 34, - -1, -1, 37, 38, 39, -1, 41, 42, -1, -1, - -1, -1, -1, 48, 49, 149, 150, 52, 53, -1, - -1, -1, 57, -1, -1, -1, -1, 62, -1, -1, - 65, 66, 67, 68, -1, -1, -1, -1, -1, 74, - -1, 76, -1, 78, -1, -1, -1, -1, 83, 84, - 85, 86, -1, 88, -1, -1, -1, -1, -1, 94, - -1, 96, 97, 98, 99, 100, -1, -1, -1, -1, - 105, -1, 107, 108, 109, -1, 111, -1, -1, -1, - 115, 116, 117, 118, 119, -1, 121, -1, -1, -1, - 22, -1, -1, 128, -1, -1, -1, -1, 30, -1, + -1, -1, 115, 116, 117, 118, 119, -1, 121, -1, + -1, 124, 22, -1, -1, 128, -1, -1, -1, -1, + 30, -1, 32, -1, 34, -1, -1, 37, 38, 39, + -1, 41, 42, -1, -1, -1, 149, 150, 48, 49, + -1, -1, 52, 53, -1, -1, -1, 57, -1, 59, + -1, -1, 62, -1, -1, 65, 66, 67, 68, -1, + 70, -1, -1, -1, 74, -1, 76, -1, 78, -1, + -1, -1, -1, 83, 84, 85, 86, -1, 88, -1, + -1, -1, -1, -1, 94, -1, 96, 97, 98, 99, + 100, -1, -1, -1, -1, 105, -1, 107, 108, 109, + -1, 111, -1, -1, -1, 115, 116, 117, 118, 119, + -1, 22, -1, -1, -1, -1, -1, -1, 128, 30, + -1, 32, -1, 34, -1, -1, 37, 38, 39, -1, + 41, 42, -1, -1, 45, -1, -1, 48, 49, 149, + 150, 52, 53, -1, -1, -1, 57, -1, -1, -1, + -1, 62, -1, -1, 65, 66, 67, 68, -1, -1, + -1, -1, -1, 74, -1, 76, -1, 78, -1, -1, + -1, -1, 83, 84, 85, 86, -1, 88, -1, -1, + -1, -1, -1, 94, -1, 96, 97, 98, 99, 100, + -1, -1, -1, -1, 105, -1, 107, 108, 109, -1, + 111, -1, -1, -1, 115, 116, 117, 118, 119, -1, + 22, 122, 24, 25, -1, -1, -1, 128, 30, -1, 32, -1, 34, -1, -1, 37, 38, 39, -1, 41, - 42, -1, -1, -1, 149, 150, 48, 49, -1, -1, + 42, -1, -1, -1, -1, -1, 48, 49, 149, 150, 52, 53, -1, -1, -1, 57, -1, -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, -1, -1, -1, -1, -1, 74, -1, 76, -1, 78, -1, -1, -1, @@ -10736,9 +10917,9 @@ namespace yy { -1, -1, 94, -1, 96, 97, 98, 99, 100, -1, -1, -1, -1, 105, -1, 107, 108, 109, -1, 111, -1, -1, -1, 115, 116, 117, 118, 119, -1, 22, - -1, -1, -1, -1, -1, -1, 128, 30, 130, 32, + -1, -1, -1, -1, -1, -1, 128, 30, -1, 32, -1, 34, -1, -1, 37, 38, 39, -1, 41, 42, - -1, -1, -1, -1, -1, 48, 49, 149, 150, 52, + -1, -1, 45, -1, -1, 48, 49, 149, 150, 52, 53, -1, -1, -1, 57, -1, -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, -1, -1, -1, -1, -1, 74, -1, 76, -1, 78, -1, -1, -1, -1, @@ -10755,17 +10936,17 @@ namespace yy { 84, 85, 86, -1, 88, -1, -1, -1, -1, -1, 94, -1, 96, 97, 98, 99, 100, -1, -1, -1, -1, 105, -1, 107, 108, 109, -1, 111, -1, -1, - -1, 115, 116, 117, 118, 119, -1, 22, -1, -1, + -1, 115, 116, 117, 118, 119, -1, 22, 122, -1, -1, -1, -1, -1, 128, 30, -1, 32, -1, 34, -1, -1, 37, 38, 39, -1, 41, 42, -1, -1, - -1, -1, -1, 48, 49, 149, 150, 52, 53, -1, + 45, -1, -1, 48, 49, 149, 150, 52, 53, -1, -1, -1, 57, -1, -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, -1, -1, -1, -1, -1, 74, -1, 76, -1, 78, -1, -1, -1, -1, 83, 84, 85, 86, -1, 88, -1, -1, -1, -1, -1, 94, -1, 96, 97, 98, 99, 100, -1, -1, -1, -1, 105, -1, 107, 108, 109, -1, 111, -1, -1, -1, - 115, 116, 117, 118, 119, -1, 22, -1, -1, -1, + 115, 116, 117, 118, 119, -1, 22, 122, -1, -1, -1, -1, -1, 128, 30, -1, 32, -1, 34, -1, -1, 37, 38, 39, -1, 41, 42, -1, -1, -1, -1, -1, 48, 49, 149, 150, 52, 53, -1, -1, @@ -10775,9 +10956,9 @@ namespace yy { 86, -1, 88, -1, -1, -1, -1, -1, 94, -1, 96, 97, 98, 99, 100, -1, -1, -1, -1, 105, -1, 107, 108, 109, -1, 111, -1, -1, -1, 115, - 116, 117, 118, 119, -1, 22, -1, -1, -1, -1, + 116, 117, 118, 119, -1, 22, -1, -1, 124, -1, -1, -1, 128, 30, -1, 32, -1, 34, -1, -1, - 37, 38, 39, -1, 41, 42, -1, -1, -1, -1, + 37, 38, 39, -1, 41, 42, 43, -1, -1, -1, -1, 48, 49, 149, 150, 52, 53, -1, -1, -1, 57, -1, -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, -1, -1, -1, -1, -1, 74, -1, 76, @@ -10785,22 +10966,80 @@ namespace yy { -1, 88, -1, -1, -1, -1, -1, 94, -1, 96, 97, 98, 99, 100, -1, -1, -1, -1, 105, -1, 107, 108, 109, -1, 111, -1, -1, -1, 115, 116, - 117, 118, 119, -1, -1, -1, -1, -1, -1, -1, - -1, 128, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 24, - 25, -1, 149, 150, 29, 30, 31, -1, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - -1, -1, -1, -1, 69, 70, 71, 72, 73, 74, - 75, 76, 77, -1, 79, 80, 81, 82, -1, 84, - -1, 86, 87, 88, 89, 90, 91, 92, 93, -1, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - -1, 106, -1, 108, 109, 110, 111, 112, 113, 114, - -1, -1, -1, -1, -1, 120, -1, -1, -1, -1, + 117, 118, 119, -1, 22, -1, -1, -1, -1, -1, + -1, 128, 30, -1, 32, -1, 34, -1, -1, 37, + 38, 39, -1, 41, 42, -1, -1, -1, -1, -1, + 48, 49, 149, 150, 52, 53, -1, -1, -1, 57, + -1, -1, -1, -1, 62, -1, -1, 65, 66, 67, + 68, -1, -1, -1, -1, -1, 74, -1, 76, -1, + 78, -1, -1, -1, -1, 83, 84, 85, 86, -1, + 88, -1, -1, -1, -1, -1, 94, -1, 96, 97, + 98, 99, 100, -1, -1, -1, -1, 105, -1, 107, + 108, 109, -1, 111, -1, -1, -1, 115, 116, 117, + 118, 119, -1, 121, -1, -1, -1, 22, -1, -1, + 128, -1, -1, -1, -1, 30, -1, 32, -1, 34, + -1, -1, 37, 38, 39, -1, 41, 42, -1, -1, + -1, 149, 150, 48, 49, -1, -1, 52, 53, -1, + -1, -1, 57, -1, -1, -1, -1, 62, -1, -1, + 65, 66, 67, 68, -1, -1, -1, -1, -1, 74, + -1, 76, -1, 78, -1, -1, -1, -1, 83, 84, + 85, 86, -1, 88, -1, -1, -1, -1, -1, 94, + -1, 96, 97, 98, 99, 100, -1, -1, -1, -1, + 105, -1, 107, 108, 109, -1, 111, -1, -1, -1, + 115, 116, 117, 118, 119, -1, 22, -1, -1, -1, + -1, -1, -1, 128, 30, 130, 32, -1, 34, -1, + -1, 37, 38, 39, -1, 41, 42, -1, -1, -1, + -1, -1, 48, 49, 149, 150, 52, 53, -1, -1, + -1, 57, -1, -1, -1, -1, 62, -1, -1, 65, + 66, 67, 68, -1, -1, -1, -1, -1, 74, -1, + 76, -1, 78, -1, -1, -1, -1, 83, 84, 85, + 86, -1, 88, -1, -1, -1, -1, -1, 94, -1, + 96, 97, 98, 99, 100, -1, -1, -1, -1, 105, + -1, 107, 108, 109, -1, 111, -1, -1, -1, 115, + 116, 117, 118, 119, -1, 22, 122, -1, -1, -1, + -1, -1, 128, 30, -1, 32, -1, 34, -1, -1, + 37, 38, 39, -1, 41, 42, -1, -1, 45, -1, + -1, 48, 49, 149, 150, 52, 53, -1, -1, -1, + 57, -1, -1, -1, -1, 62, -1, -1, 65, 66, + 67, 68, -1, -1, -1, -1, -1, 74, -1, 76, + -1, 78, -1, -1, -1, -1, 83, 84, 85, 86, + -1, 88, -1, -1, -1, -1, -1, 94, -1, 96, + 97, 98, 99, 100, -1, -1, -1, -1, 105, -1, + 107, 108, 109, -1, 111, -1, -1, -1, 115, 116, + 117, 118, 119, -1, 22, -1, -1, -1, -1, -1, + -1, 128, 30, -1, 32, -1, 34, -1, -1, 37, + 38, 39, -1, 41, 42, -1, -1, -1, -1, -1, + 48, 49, 149, 150, 52, 53, -1, -1, -1, 57, + -1, -1, -1, -1, 62, -1, -1, 65, 66, 67, + 68, -1, -1, -1, -1, -1, 74, -1, 76, -1, + 78, -1, -1, -1, -1, 83, 84, 85, 86, -1, + 88, -1, -1, -1, -1, -1, 94, -1, 96, 97, + 98, 99, 100, -1, -1, -1, -1, 105, -1, 107, + 108, 109, -1, 111, -1, -1, -1, 115, 116, 117, + 118, 119, -1, 22, -1, -1, -1, -1, -1, -1, + 128, 30, -1, 32, -1, 34, -1, -1, 37, 38, + 39, -1, 41, 42, -1, -1, -1, -1, -1, 48, + 49, 149, 150, 52, 53, -1, -1, -1, 57, -1, + -1, -1, -1, 62, -1, -1, 65, 66, 67, 68, + -1, -1, -1, -1, -1, 74, -1, 76, -1, 78, + -1, -1, -1, -1, 83, 84, 85, 86, -1, 88, + -1, -1, -1, -1, -1, 94, -1, 96, 97, 98, + 99, 100, -1, -1, -1, -1, 105, -1, 107, 108, + 109, -1, 111, -1, -1, -1, 115, 116, 117, 118, + 119, -1, 22, -1, -1, -1, -1, -1, -1, 128, + 30, -1, 32, -1, 34, -1, -1, 37, 38, 39, + -1, 41, 42, -1, -1, -1, -1, -1, 48, 49, + 149, 150, 52, 53, -1, -1, -1, 57, -1, -1, + -1, -1, 62, -1, -1, 65, 66, 67, 68, -1, + -1, -1, -1, -1, 74, -1, 76, -1, 78, -1, + -1, -1, -1, 83, 84, 85, 86, -1, 88, -1, + -1, -1, -1, -1, 94, -1, 96, 97, 98, 99, + 100, -1, -1, -1, -1, 105, -1, 107, 108, 109, + -1, 111, -1, -1, -1, 115, 116, 117, 118, 119, + -1, -1, -1, -1, -1, -1, -1, -1, 128, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 137, -1, -1, -1, -1, -1, -1, -1, - -1, 29, 30, 31, 149, 33, 34, 35, 36, 37, + -1, -1, -1, -1, -1, -1, 24, 25, -1, 149, + 150, 29, 30, 31, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, -1, -1, -1, @@ -10809,8 +11048,8 @@ namespace yy { 88, 89, 90, 91, 92, 93, -1, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, -1, 108, 109, 110, 111, 112, 113, 114, -1, -1, -1, - -1, -1, 120, -1, -1, -1, -1, 125, -1, -1, - 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, + -1, -1, 120, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 137, -1, -1, -1, -1, -1, -1, -1, -1, 29, 30, 31, 149, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, @@ -10821,7 +11060,7 @@ namespace yy { 91, 92, 93, -1, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, -1, 108, 109, 110, 111, 112, 113, 114, -1, -1, -1, -1, -1, 120, - -1, -1, -1, -1, -1, -1, -1, 128, 129, -1, + -1, -1, -1, -1, 125, -1, -1, 128, -1, -1, -1, -1, -1, -1, -1, -1, 137, -1, -1, -1, -1, -1, -1, -1, -1, 29, 30, 31, 149, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, @@ -10833,120 +11072,132 @@ namespace yy { -1, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, -1, 108, 109, 110, 111, 112, 113, 114, -1, -1, -1, -1, -1, 120, -1, -1, -1, - -1, 29, -1, 31, 128, 33, -1, 35, 36, -1, - -1, -1, -1, 137, -1, 43, 44, 45, 46, -1, - -1, -1, 50, 51, -1, 149, 54, 55, 56, -1, - 58, 59, 60, 61, -1, -1, 64, -1, -1, -1, - -1, 69, 70, 71, 72, 73, -1, 75, -1, 77, - -1, 79, 80, 81, 82, -1, -1, -1, -1, 87, - -1, -1, 90, 91, 92, 93, -1, 95, -1, -1, - -1, -1, -1, 101, 102, 103, 104, -1, 106, -1, - -1, -1, -1, -1, 112, 113, 114, -1, -1, 29, - -1, 31, -1, 33, -1, 35, 36, 125, -1, -1, - -1, -1, -1, 43, 44, 45, 46, -1, -1, 137, - 50, 51, -1, -1, 54, 55, 56, 145, 58, 59, - 60, 61, -1, -1, 64, -1, -1, -1, -1, 69, - 70, 71, 72, 73, -1, 75, -1, 77, -1, 79, - 80, 81, 82, -1, -1, -1, -1, 87, -1, -1, - 90, 91, 92, 93, -1, 95, -1, -1, -1, -1, - -1, 101, 102, 103, 104, -1, 106, -1, -1, -1, - -1, -1, 112, 113, 114, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 125, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 137, -1, -1, - -1, -1, -1, -1, -1, 145 + -1, -1, -1, -1, 128, 129, -1, -1, -1, -1, + -1, -1, -1, 137, -1, -1, -1, -1, -1, -1, + -1, -1, 29, 30, 31, 149, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, -1, -1, + -1, -1, 69, 70, 71, 72, 73, 74, 75, 76, + 77, -1, 79, 80, 81, 82, -1, 84, -1, 86, + 87, 88, 89, 90, 91, 92, 93, -1, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, -1, 106, + -1, 108, 109, 110, 111, 112, 113, 114, -1, -1, + -1, -1, -1, 120, -1, -1, -1, -1, 29, -1, + 31, 128, 33, -1, 35, 36, -1, -1, -1, -1, + 137, -1, 43, 44, 45, 46, -1, -1, -1, 50, + 51, -1, 149, 54, 55, 56, -1, 58, 59, 60, + 61, -1, -1, 64, -1, -1, -1, -1, 69, 70, + 71, 72, 73, -1, 75, -1, 77, -1, 79, 80, + 81, 82, -1, -1, -1, -1, 87, -1, -1, 90, + 91, 92, 93, -1, 95, -1, -1, -1, -1, -1, + 101, 102, 103, 104, -1, 106, -1, -1, -1, -1, + -1, 112, 113, 114, -1, -1, 29, -1, 31, -1, + 33, -1, 35, 36, 125, -1, -1, -1, -1, -1, + 43, 44, 45, 46, -1, -1, 137, 50, 51, -1, + -1, 54, 55, 56, 145, 58, 59, 60, 61, -1, + -1, 64, -1, -1, -1, -1, 69, 70, 71, 72, + 73, -1, 75, -1, 77, -1, 79, 80, 81, 82, + -1, -1, -1, -1, 87, -1, -1, 90, 91, 92, + 93, -1, 95, -1, -1, -1, -1, -1, 101, 102, + 103, 104, -1, 106, -1, -1, -1, -1, -1, 112, + 113, 114, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 125, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 137, -1, -1, -1, -1, -1, + -1, -1, 145 }; const unsigned short asn1_parser::yystos_[] = { - 0, 149, 154, 155, 228, 376, 0, 154, 51, 124, + 0, 149, 154, 155, 228, 375, 0, 154, 51, 124, 229, 230, 231, 16, 236, 4, 150, 232, 233, 234, - 235, 311, 374, 133, 316, 75, 35, 59, 70, 237, - 125, 232, 126, 140, 317, 106, 106, 106, 61, 238, - 234, 17, 18, 319, 140, 318, 71, 121, 127, 319, - 133, 36, 318, 60, 239, 240, 31, 149, 150, 241, - 248, 249, 250, 373, 375, 227, 72, 242, 142, 142, - 137, 124, 56, 243, 244, 245, 248, 160, 199, 203, - 204, 205, 206, 207, 251, 252, 261, 262, 263, 373, - 375, 249, 125, 142, 245, 64, 251, 22, 30, 32, + 235, 310, 373, 133, 315, 75, 35, 59, 70, 237, + 125, 232, 126, 140, 316, 106, 106, 106, 61, 238, + 234, 17, 18, 318, 140, 317, 71, 121, 127, 318, + 133, 36, 317, 60, 239, 240, 31, 149, 150, 241, + 247, 248, 249, 372, 374, 227, 72, 242, 142, 142, + 137, 124, 56, 243, 244, 245, 247, 160, 199, 203, + 204, 205, 206, 207, 250, 251, 260, 261, 262, 372, + 374, 248, 125, 142, 245, 64, 250, 22, 30, 32, 34, 37, 38, 39, 41, 42, 48, 49, 52, 53, 57, 62, 65, 66, 67, 68, 74, 76, 78, 83, 84, 85, 86, 88, 94, 96, 97, 98, 99, 100, 105, 107, 108, 109, 111, 115, 116, 117, 118, 119, 121, 124, 128, 149, 159, 187, 188, 197, 198, 202, - 208, 213, 214, 215, 216, 253, 255, 259, 264, 265, - 273, 275, 279, 283, 284, 287, 288, 289, 293, 294, - 295, 296, 300, 301, 302, 303, 307, 314, 315, 320, - 321, 322, 323, 325, 326, 327, 328, 329, 330, 331, - 332, 333, 373, 374, 376, 208, 264, 373, 376, 246, - 376, 103, 103, 124, 91, 124, 87, 124, 69, 103, - 87, 102, 124, 126, 334, 358, 87, 124, 334, 358, - 43, 149, 157, 158, 159, 161, 162, 264, 376, 377, - 150, 157, 209, 210, 211, 212, 250, 264, 373, 16, - 304, 138, 121, 121, 264, 138, 124, 121, 334, 59, - 70, 264, 138, 130, 138, 264, 121, 138, 124, 247, - 308, 375, 124, 266, 297, 298, 299, 374, 122, 277, - 280, 281, 282, 374, 149, 157, 159, 376, 276, 277, - 374, 264, 266, 374, 334, 45, 122, 125, 264, 266, - 290, 291, 292, 4, 5, 6, 7, 9, 11, 20, - 31, 34, 46, 47, 54, 63, 64, 73, 80, 90, - 101, 110, 120, 124, 126, 149, 150, 200, 218, 219, - 221, 226, 264, 274, 278, 324, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 344, 348, 349, 350, 351, - 352, 353, 354, 356, 358, 359, 360, 361, 369, 370, - 87, 87, 264, 266, 125, 290, 87, 87, 124, 138, - 125, 137, 141, 141, 33, 95, 114, 306, 24, 25, - 165, 166, 200, 161, 264, 121, 166, 6, 7, 9, - 11, 24, 25, 34, 40, 47, 76, 89, 120, 124, - 141, 149, 150, 157, 202, 217, 254, 256, 257, 258, - 260, 264, 267, 268, 269, 270, 274, 278, 316, 324, - 375, 376, 124, 271, 264, 264, 166, 373, 264, 22, - 373, 121, 34, 76, 149, 150, 202, 267, 268, 373, - 376, 4, 254, 309, 310, 311, 312, 313, 374, 375, - 285, 286, 374, 125, 137, 264, 132, 371, 125, 137, - 126, 138, 125, 137, 87, 371, 50, 89, 50, 89, - 125, 137, 58, 345, 40, 264, 40, 334, 268, 13, - 44, 45, 122, 201, 338, 337, 124, 371, 137, 112, - 145, 346, 77, 146, 347, 345, 264, 123, 130, 264, - 266, 264, 266, 125, 264, 266, 264, 266, 24, 25, - 28, 163, 164, 167, 168, 171, 173, 174, 176, 178, - 149, 377, 210, 250, 4, 254, 305, 138, 268, 268, - 268, 272, 126, 124, 125, 137, 137, 141, 145, 137, - 145, 138, 138, 337, 268, 138, 138, 254, 309, 125, - 309, 126, 125, 137, 126, 122, 266, 254, 264, 278, - 372, 376, 122, 282, 254, 278, 277, 264, 137, 34, - 149, 150, 350, 350, 122, 292, 348, 124, 54, 268, - 334, 362, 124, 363, 137, 125, 137, 127, 144, 222, - 223, 127, 122, 341, 343, 79, 130, 350, 355, 357, - 157, 264, 165, 264, 157, 125, 137, 24, 50, 89, - 169, 129, 165, 125, 268, 4, 257, 257, 268, 268, - 268, 268, 268, 24, 25, 375, 125, 125, 312, 286, - 4, 254, 137, 141, 138, 371, 127, 127, 122, 291, - 371, 122, 157, 197, 212, 220, 264, 376, 40, 122, - 364, 365, 374, 338, 122, 138, 225, 374, 125, 137, - 137, 357, 50, 89, 177, 89, 113, 170, 170, 170, - 50, 89, 179, 120, 180, 164, 264, 127, 125, 127, - 127, 127, 299, 268, 137, 137, 137, 141, 125, 138, - 268, 125, 137, 125, 137, 334, 366, 367, 137, 138, - 224, 138, 223, 338, 124, 187, 189, 190, 191, 193, - 50, 89, 175, 50, 89, 172, 172, 104, 137, 281, - 122, 291, 124, 189, 268, 149, 364, 364, 29, 89, - 93, 368, 338, 224, 225, 374, 24, 25, 29, 30, - 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 79, 80, 81, 82, 84, 86, 87, 88, - 89, 90, 91, 92, 93, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 106, 108, 109, 110, 111, - 112, 113, 114, 120, 137, 149, 165, 186, 192, 194, - 195, 196, 264, 268, 378, 271, 350, 124, 156, 137, - 137, 268, 125, 196, 137, 125, 195, 30, 34, 37, - 38, 39, 40, 41, 42, 47, 48, 49, 52, 53, - 57, 62, 63, 74, 76, 84, 86, 88, 89, 96, - 97, 98, 99, 100, 108, 109, 110, 111, 120, 128, - 149, 181, 182, 183, 184, 185, 186, 122, 148, 181, - 125, 182, 165, 186, 137, 125, 129, 291, 137 + 208, 213, 214, 215, 216, 252, 254, 258, 263, 264, + 272, 274, 278, 282, 283, 286, 287, 288, 292, 293, + 294, 295, 299, 300, 301, 302, 306, 313, 314, 319, + 320, 321, 322, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 372, 373, 375, 208, 263, 372, 375, 246, + 375, 103, 103, 124, 91, 124, 87, 124, 69, 103, + 87, 102, 124, 126, 333, 357, 87, 124, 333, 357, + 43, 149, 157, 158, 159, 161, 162, 263, 375, 376, + 150, 157, 209, 210, 211, 212, 249, 263, 372, 16, + 303, 138, 121, 121, 263, 138, 124, 121, 333, 59, + 70, 263, 138, 130, 138, 263, 121, 138, 124, 307, + 124, 265, 296, 297, 298, 373, 122, 276, 279, 280, + 281, 373, 149, 157, 159, 375, 275, 276, 373, 263, + 265, 373, 333, 45, 122, 125, 263, 265, 289, 290, + 291, 4, 5, 6, 7, 9, 11, 20, 31, 34, + 46, 47, 54, 63, 64, 73, 80, 90, 101, 110, + 120, 124, 126, 149, 200, 217, 218, 219, 221, 226, + 253, 255, 259, 263, 273, 277, 323, 334, 335, 336, + 337, 338, 339, 340, 341, 342, 343, 347, 348, 349, + 350, 351, 352, 353, 355, 357, 358, 359, 360, 368, + 369, 374, 375, 87, 87, 263, 265, 125, 289, 87, + 87, 124, 138, 125, 137, 141, 141, 33, 95, 114, + 305, 24, 25, 165, 166, 200, 161, 263, 121, 166, + 6, 7, 9, 11, 24, 25, 34, 40, 47, 76, + 89, 120, 124, 141, 149, 150, 157, 202, 253, 256, + 257, 263, 266, 267, 268, 269, 273, 277, 315, 323, + 374, 375, 124, 270, 263, 263, 166, 372, 263, 22, + 372, 121, 34, 76, 149, 150, 202, 266, 267, 372, + 375, 4, 253, 308, 309, 310, 311, 312, 373, 284, + 285, 373, 125, 137, 263, 132, 370, 125, 137, 126, + 138, 125, 137, 87, 370, 50, 89, 50, 89, 125, + 137, 58, 344, 40, 263, 40, 333, 267, 13, 44, + 45, 122, 201, 337, 336, 124, 124, 370, 137, 112, + 145, 345, 77, 146, 346, 344, 263, 123, 130, 138, + 263, 265, 263, 265, 125, 263, 265, 263, 265, 24, + 25, 28, 163, 164, 167, 168, 171, 173, 174, 176, + 178, 149, 376, 210, 249, 4, 253, 304, 138, 267, + 267, 267, 271, 126, 125, 137, 137, 141, 145, 137, + 145, 138, 138, 336, 267, 138, 138, 253, 308, 125, + 308, 126, 125, 137, 126, 122, 265, 253, 263, 277, + 371, 122, 281, 253, 277, 276, 263, 137, 34, 149, + 349, 349, 122, 291, 347, 124, 54, 267, 333, 361, + 124, 362, 137, 125, 137, 127, 144, 222, 223, 256, + 127, 122, 340, 342, 79, 130, 349, 354, 356, 374, + 157, 263, 165, 263, 157, 125, 137, 24, 50, 89, + 169, 129, 165, 125, 267, 4, 256, 267, 267, 267, + 267, 267, 24, 25, 125, 125, 311, 285, 4, 253, + 137, 141, 370, 127, 127, 122, 290, 370, 122, 157, + 197, 212, 220, 263, 375, 40, 122, 363, 364, 373, + 337, 122, 138, 225, 373, 125, 137, 125, 137, 356, + 50, 89, 177, 89, 113, 170, 170, 170, 50, 89, + 179, 120, 180, 164, 263, 127, 127, 127, 127, 298, + 267, 137, 137, 137, 141, 125, 138, 267, 125, 137, + 125, 137, 333, 365, 366, 137, 138, 224, 138, 223, + 337, 124, 187, 189, 190, 191, 193, 50, 89, 175, + 50, 89, 172, 172, 104, 137, 280, 122, 290, 124, + 189, 267, 149, 363, 363, 29, 89, 93, 367, 337, + 224, 225, 373, 24, 25, 29, 30, 31, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, + 80, 81, 82, 84, 86, 87, 88, 89, 90, 91, + 92, 93, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 106, 108, 109, 110, 111, 112, 113, 114, + 120, 137, 149, 165, 186, 192, 194, 195, 196, 263, + 267, 377, 270, 349, 124, 156, 137, 137, 267, 125, + 196, 137, 125, 195, 30, 34, 37, 38, 39, 40, + 41, 42, 47, 48, 49, 52, 53, 57, 62, 63, + 74, 76, 84, 86, 88, 89, 96, 97, 98, 99, + 100, 108, 109, 110, 111, 120, 128, 149, 181, 182, + 183, 184, 185, 186, 122, 148, 181, 125, 182, 165, + 186, 137, 125, 129, 290, 137 }; const unsigned short @@ -10970,47 +11221,46 @@ namespace yy { 232, 232, 233, 233, 233, 234, 235, 236, 236, 237, 237, 237, 237, 238, 238, 239, 239, 240, 240, 240, 241, 241, 242, 242, 243, 243, 244, 244, 245, 246, - 247, 247, 247, 248, 248, 249, 250, 250, 250, 251, - 251, 252, 252, 252, 252, 252, 252, 253, 253, 253, - 254, 254, 255, 256, 257, 257, 258, 258, 258, 259, - 260, 261, 262, 263, 264, 264, 264, 264, 264, 265, - 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, - 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, - 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, - 266, 267, 267, 267, 267, 267, 267, 267, 267, 267, - 267, 267, 267, 267, 267, 267, 267, 267, 267, 267, - 267, 267, 267, 267, 267, 267, 268, 268, 268, 269, - 269, 270, 270, 271, 272, 272, 273, 274, 274, 275, - 275, 276, 276, 277, 277, 278, 278, 279, 280, 280, - 280, 280, 281, 281, 282, 282, 283, 284, 284, 285, - 285, 286, 286, 287, 288, 289, 289, 290, 290, 290, - 290, 290, 290, 290, 290, 290, 291, 291, 292, 292, - 292, 292, 292, 292, 292, 293, 293, 294, 294, 295, - 295, 296, 297, 298, 298, 298, 299, 299, 300, 301, - 302, 302, 302, 303, 304, 304, 305, 305, 306, 306, - 306, 306, 307, 308, 308, 309, 309, 310, 310, 310, - 311, 312, 312, 313, 314, 315, 316, 317, 318, 318, - 319, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 328, 329, 329, 330, 330, 330, 330, 330, 330, 330, - 330, 330, 330, 330, 330, 330, 331, 332, 332, 333, - 333, 333, 333, 333, 333, 333, 333, 334, 335, 335, - 336, 337, 337, 337, 338, 338, 339, 339, 340, 341, - 341, 342, 343, 343, 344, 345, 346, 346, 347, 347, - 348, 348, 349, 349, 349, 349, 349, 349, 349, 349, - 349, 350, 350, 350, 350, 350, 350, 350, 350, 350, - 350, 351, 352, 353, 354, 354, 355, 355, 356, 356, - 357, 357, 358, 359, 360, 361, 361, 362, 363, 363, - 363, 363, 364, 364, 365, 366, 367, 367, 368, 368, - 368, 368, 369, 370, 371, 371, 372, 372, 372, 373, - 374, 375, 376, 377, 378, 378, 378, 378, 378, 378, - 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, - 378 + 246, 247, 247, 248, 249, 249, 249, 250, 250, 251, + 251, 251, 251, 251, 251, 252, 252, 252, 253, 253, + 254, 255, 256, 256, 257, 257, 257, 258, 259, 260, + 261, 262, 263, 263, 263, 263, 263, 264, 264, 264, + 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + 264, 264, 264, 264, 264, 264, 264, 264, 265, 266, + 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, + 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, + 266, 266, 266, 266, 267, 267, 267, 268, 268, 269, + 269, 270, 271, 271, 272, 273, 273, 274, 274, 275, + 275, 276, 276, 277, 277, 278, 279, 279, 279, 279, + 280, 280, 281, 281, 282, 283, 283, 284, 284, 285, + 285, 286, 287, 288, 288, 289, 289, 289, 289, 289, + 289, 289, 289, 289, 290, 290, 291, 291, 291, 291, + 291, 291, 291, 292, 292, 293, 293, 294, 294, 295, + 296, 297, 297, 297, 298, 298, 299, 300, 301, 301, + 301, 302, 303, 303, 304, 304, 305, 305, 305, 305, + 306, 307, 307, 308, 308, 309, 309, 309, 310, 311, + 311, 312, 313, 314, 315, 316, 317, 317, 318, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 328, 329, 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 330, 331, 331, 332, 332, 332, + 332, 332, 332, 332, 332, 333, 334, 334, 335, 336, + 336, 336, 337, 337, 338, 338, 339, 340, 340, 341, + 342, 342, 343, 344, 345, 345, 346, 346, 347, 347, + 348, 348, 348, 348, 348, 348, 348, 348, 348, 349, + 349, 349, 349, 349, 349, 349, 349, 349, 349, 350, + 351, 352, 353, 353, 354, 354, 355, 355, 356, 356, + 357, 358, 359, 360, 360, 361, 362, 362, 362, 362, + 363, 363, 364, 365, 366, 366, 367, 367, 367, 367, + 368, 369, 370, 370, 371, 371, 371, 372, 373, 374, + 375, 376, 377, 377, 377, 377, 377, 377, 377, 377, + 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, + 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, + 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, + 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, + 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, + 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, + 377, 377, 377, 377, 377, 377, 377, 377, 377 }; const unsigned char @@ -11033,40 +11283,39 @@ namespace yy { 2, 3, 5, 0, 2, 1, 1, 0, 3, 2, 1, 2, 1, 1, 1, 1, 4, 2, 0, 2, 2, 2, 0, 2, 0, 3, 0, 3, 3, 0, - 1, 0, 3, 0, 1, 0, 1, 2, 3, 2, - 1, 1, 0, 1, 3, 1, 1, 3, 1, 1, - 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 4, 4, 1, 3, 1, 1, 1, 3, - 3, 3, 4, 4, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 0, 3, 0, 1, 0, 1, 2, 3, 1, + 2, 1, 3, 1, 1, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 4, 4, 1, 3, 1, 1, 1, 3, 3, 3, + 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, - 4, 1, 1, 1, 1, 3, 3, 3, 1, 1, - 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 3, 3, 3, 3, 1, 2, 1, 1, 1, 1, - 4, 1, 3, 4, 4, 1, 1, 4, 1, 4, - 6, 2, 1, 3, 1, 1, 1, 2, 5, 1, - 3, 4, 4, 2, 1, 3, 4, 1, 4, 6, - 8, 10, 4, 6, 2, 4, 1, 3, 1, 2, - 3, 1, 2, 3, 3, 3, 3, 3, 4, 3, - 3, 4, 1, 1, 3, 5, 1, 3, 3, 1, - 2, 3, 3, 5, 2, 0, 1, 1, 1, 1, - 1, 0, 2, 3, 4, 1, 2, 1, 1, 1, - 1, 1, 1, 4, 1, 1, 4, 2, 3, 0, - 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 2, 1, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, - 1, 1, 3, 5, 1, 2, 1, 3, 1, 1, - 3, 1, 1, 2, 1, 2, 1, 1, 1, 1, - 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, + 1, 1, 1, 1, 1, 1, 2, 1, 4, 1, + 1, 1, 1, 3, 3, 3, 1, 1, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, + 3, 3, 1, 2, 1, 1, 1, 1, 4, 1, + 3, 4, 4, 1, 1, 4, 1, 4, 6, 2, + 1, 3, 1, 1, 1, 2, 5, 1, 3, 4, + 4, 2, 1, 3, 4, 1, 4, 6, 8, 10, + 4, 6, 2, 4, 1, 3, 1, 2, 3, 1, + 2, 3, 3, 3, 3, 3, 4, 3, 3, 4, + 1, 1, 3, 5, 1, 3, 3, 1, 2, 3, + 3, 5, 2, 0, 1, 1, 1, 1, 1, 0, + 2, 3, 4, 1, 2, 1, 1, 1, 1, 1, + 1, 4, 1, 1, 4, 2, 3, 0, 1, 1, + 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 3, 1, 2, 1, 2, 1, 1, - 1, 1, 2, 1, 2, 3, 3, 1, 0, 3, - 5, 3, 1, 3, 2, 2, 1, 0, 1, 1, - 1, 0, 2, 2, 2, 0, 1, 1, 3, 1, + 1, 1, 1, 1, 2, 2, 1, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, + 3, 5, 1, 2, 1, 3, 1, 1, 3, 1, + 1, 2, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 1, 3, 1, 2, 1, 2, 1, 1, 1, 1, + 2, 1, 2, 3, 3, 1, 0, 3, 5, 3, + 1, 3, 2, 2, 1, 0, 1, 1, 1, 0, + 2, 2, 2, 0, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -11074,7 +11323,7 @@ namespace yy { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1 }; @@ -11145,19 +11394,19 @@ namespace yy { "EncodingReferenceDefault", "TagDefault", "ExtensionDefault", "ModuleBody", "Exports", "SymbolsExported", "Imports", "SymbolsImported", "SymbolsFromModuleList", "SymbolsFromModule", "GlobalModuleReference", - "AssignedIdentifier", "SymbolList", "Symbol", "Reference", - "AssignmentList", "Assignment", "DefinedType", "DefinedValue", - "ParameterizedType", "ParameterizedValue", "ActualParameterList", - "ActualParameter", "ExternalTypeReference", "ExternalValueReference", - "TypeAssignment", "ValueAssignment", "ValueSetTypeAssignment", "Type", - "BuiltinType", "NamedType", "ValueWithoutTypeIdentifier", "Value", - "ValueCommaListChoice", "ValueChoice", "ValueSet", "SequenceOfValues", - "BooleanType", "BooleanValue", "IntegerType", "NamedNumberList", - "NamedNumber", "SignedNumber", "EnumeratedType", "Enumerations", - "Enumeration", "EnumerationItem", "RealType", "BitStringType", - "NamedBitList", "NamedBit", "OctetStringType", "NullType", - "SequenceType", "ComponentTypeLists", "ComponentTypeList", - "ComponentType", "SequenceOfType", "SetType", "SetOfType", "ChoiceType", + "SymbolList", "Symbol", "Reference", "AssignmentList", "Assignment", + "DefinedType", "DefinedValue", "ParameterizedType", "ParameterizedValue", + "ActualParameterList", "ActualParameter", "ExternalTypeReference", + "ExternalValueReference", "TypeAssignment", "ValueAssignment", + "ValueSetTypeAssignment", "Type", "BuiltinType", "NamedType", + "ValueWithoutTypeIdentifier", "Value", "ValueCommaListChoice", + "ValueChoice", "ValueSet", "SequenceOfValues", "BooleanType", + "BooleanValue", "IntegerType", "NamedNumberList", "NamedNumber", + "SignedNumber", "EnumeratedType", "Enumerations", "Enumeration", + "EnumerationItem", "RealType", "BitStringType", "NamedBitList", + "NamedBit", "OctetStringType", "NullType", "SequenceType", + "ComponentTypeLists", "ComponentTypeList", "ComponentType", + "SequenceOfType", "SetType", "SetOfType", "ChoiceType", "AlternativeTypeLists", "RootAlternativeTypeList", "AlternativeTypeList", "SelectionType", "PrefixedType", "TaggedType", "Tag", "EncodingReference", "ClassNumber", "Class", "ObjectIdentifierType", @@ -11187,65 +11436,64 @@ namespace yy { const unsigned short asn1_parser::yyrline_[] = { - 0, 325, 325, 326, 329, 344, 347, 348, 349, 352, - 355, 357, 361, 365, 367, 372, 376, 378, 382, 384, - 386, 387, 388, 389, 392, 394, 402, 404, 408, 412, - 414, 418, 419, 420, 423, 424, 425, 428, 432, 433, - 434, 437, 440, 443, 444, 445, 448, 451, 452, 453, - 456, 459, 460, 461, 467, 468, 471, 472, 475, 476, - 479, 482, 485, 486, 487, 490, 491, 494, 495, 498, - 504, 505, 510, 511, 514, 517, 520, 523, 524, 527, - 528, 531, 532, 536, 537, 540, 543, 547, 550, 551, - 552, 553, 554, 563, 565, 572, 574, 576, 578, 585, - 589, 593, 597, 609, 613, 615, 619, 621, 625, 627, - 631, 633, 649, 661, 670, 677, 678, 682, 683, 686, - 687, 688, 691, 694, 695, 696, 697, 698, 699, 700, - 703, 705, 709, 710, 713, 714, 717, 718, 721, 722, - 725, 726, 727, 738, 746, 753, 754, 755, 758, 761, - 765, 766, 770, 771, 772, 775, 778, 782, 783, 786, - 788, 790, 792, 796, 797, 800, 802, 806, 807, 808, - 811, 812, 815, 817, 820, 822, 825, 827, 831, 835, - 839, 840, 841, 844, 846, 850, 854, 856, 858, 867, - 869, 873, 875, 877, 879, 882, 884, 888, 890, 892, - 898, 900, 903, 907, 910, 912, 916, 918, 921, 931, - 935, 960, 964, 968, 972, 974, 976, 978, 980, 985, - 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, - 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, - 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, - 1018, 1022, 1024, 1026, 1028, 1030, 1032, 1034, 1036, 1038, - 1040, 1042, 1043, 1045, 1047, 1049, 1053, 1054, 1055, 1056, - 1057, 1059, 1061, 1063, 1065, 1067, 1072, 1074, 1076, 1079, - 1080, 1083, 1084, 1087, 1090, 1092, 1100, 1103, 1104, 1107, - 1109, 1113, 1115, 1119, 1121, 1125, 1127, 1131, 1135, 1138, - 1141, 1145, 1148, 1150, 1154, 1156, 1164, 1167, 1169, 1173, - 1174, 1177, 1178, 1192, 1195, 1198, 1200, 1204, 1206, 1208, - 1210, 1212, 1214, 1216, 1218, 1220, 1224, 1226, 1230, 1232, - 1234, 1236, 1238, 1240, 1242, 1254, 1256, 1260, 1262, 1266, - 1268, 1272, 1276, 1280, 1282, 1284, 1288, 1290, 1297, 1300, - 1304, 1306, 1308, 1312, 1316, 1317, 1320, 1322, 1325, 1327, - 1329, 1331, 1341, 1344, 1346, 1350, 1352, 1356, 1358, 1360, - 1364, 1368, 1370, 1373, 1377, 1389, 1392, 1398, 1401, 1402, - 1405, 1406, 1409, 1415, 1422, 1428, 1431, 1434, 1437, 1440, - 1443, 1446, 1448, 1452, 1454, 1456, 1458, 1460, 1462, 1464, - 1466, 1468, 1470, 1472, 1474, 1476, 1480, 1484, 1486, 1490, - 1492, 1494, 1496, 1498, 1500, 1502, 1504, 1508, 1511, 1512, - 1515, 1518, 1519, 1520, 1523, 1524, 1527, 1528, 1531, 1534, - 1535, 1538, 1541, 1542, 1545, 1548, 1551, 1552, 1555, 1556, - 1559, 1561, 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571, - 1572, 1578, 1580, 1581, 1582, 1583, 1584, 1585, 1586, 1587, - 1588, 1591, 1594, 1597, 1600, 1601, 1604, 1605, 1608, 1609, - 1612, 1613, 1616, 1619, 1622, 1625, 1626, 1629, 1631, 1632, - 1633, 1634, 1637, 1638, 1641, 1644, 1647, 1648, 1651, 1652, - 1653, 1654, 1657, 1660, 1663, 1664, 1667, 1668, 1669, 1672, - 1676, 1680, 1684, 1688, 1692, 1693, 1694, 1695, 1696, 1697, - 1698, 1699, 1700, 1701, 1702, 1703, 1704, 1705, 1706, 1707, - 1708, 1709, 1710, 1711, 1712, 1713, 1714, 1715, 1716, 1717, - 1718, 1719, 1720, 1721, 1722, 1723, 1724, 1725, 1726, 1727, - 1728, 1729, 1730, 1731, 1732, 1733, 1734, 1735, 1736, 1737, - 1738, 1739, 1740, 1741, 1742, 1743, 1744, 1745, 1746, 1747, - 1748, 1749, 1750, 1751, 1752, 1753, 1754, 1755, 1756, 1757, - 1758, 1759, 1760, 1761, 1762, 1763, 1764, 1765, 1766, 1767, - 1768 + 0, 327, 327, 328, 331, 346, 349, 350, 351, 354, + 357, 359, 363, 367, 369, 374, 378, 380, 384, 386, + 388, 389, 390, 391, 394, 396, 404, 406, 410, 414, + 416, 420, 421, 422, 425, 426, 427, 430, 434, 435, + 436, 439, 442, 445, 446, 447, 450, 453, 454, 455, + 458, 461, 462, 463, 469, 470, 473, 474, 477, 478, + 481, 484, 487, 488, 489, 492, 493, 496, 497, 500, + 506, 507, 512, 513, 516, 519, 522, 525, 526, 529, + 530, 533, 534, 538, 539, 542, 545, 549, 552, 553, + 554, 555, 556, 565, 567, 574, 576, 578, 580, 587, + 591, 595, 599, 611, 615, 617, 621, 623, 627, 629, + 633, 635, 651, 663, 672, 680, 681, 685, 686, 689, + 690, 691, 694, 699, 700, 701, 702, 703, 704, 705, + 708, 710, 714, 715, 718, 719, 722, 723, 726, 727, + 730, 731, 732, 743, 751, 758, 759, 760, 763, 766, + 770, 771, 775, 776, 777, 780, 783, 787, 788, 791, + 793, 795, 797, 801, 802, 805, 807, 811, 812, 813, + 816, 817, 820, 822, 825, 827, 830, 832, 836, 852, + 854, 860, 862, 866, 870, 872, 874, 883, 885, 889, + 891, 893, 895, 898, 900, 904, 906, 908, 914, 916, + 919, 923, 926, 928, 932, 934, 937, 947, 951, 976, + 980, 984, 988, 990, 992, 994, 996, 1001, 1002, 1003, + 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, + 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, + 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1034, 1038, + 1040, 1042, 1044, 1046, 1048, 1050, 1052, 1054, 1056, 1058, + 1059, 1061, 1063, 1065, 1069, 1070, 1071, 1072, 1073, 1075, + 1077, 1079, 1081, 1083, 1088, 1090, 1092, 1095, 1096, 1099, + 1100, 1103, 1106, 1108, 1116, 1119, 1121, 1125, 1127, 1131, + 1133, 1137, 1139, 1143, 1145, 1149, 1153, 1156, 1159, 1163, + 1166, 1168, 1172, 1174, 1182, 1185, 1187, 1191, 1192, 1195, + 1196, 1210, 1213, 1216, 1218, 1222, 1224, 1226, 1228, 1230, + 1232, 1234, 1236, 1238, 1242, 1244, 1248, 1251, 1254, 1257, + 1259, 1261, 1263, 1275, 1277, 1281, 1283, 1287, 1289, 1293, + 1297, 1301, 1303, 1305, 1309, 1311, 1318, 1321, 1325, 1327, + 1329, 1333, 1337, 1338, 1341, 1343, 1346, 1348, 1350, 1352, + 1362, 1365, 1367, 1371, 1373, 1377, 1379, 1381, 1385, 1389, + 1391, 1394, 1398, 1410, 1413, 1419, 1422, 1423, 1426, 1427, + 1430, 1436, 1443, 1449, 1452, 1455, 1458, 1461, 1464, 1467, + 1469, 1473, 1475, 1477, 1479, 1481, 1483, 1485, 1487, 1489, + 1491, 1493, 1495, 1497, 1501, 1505, 1507, 1511, 1513, 1515, + 1517, 1519, 1521, 1523, 1525, 1529, 1533, 1534, 1537, 1540, + 1541, 1542, 1545, 1546, 1549, 1550, 1553, 1556, 1557, 1560, + 1563, 1564, 1567, 1570, 1573, 1574, 1577, 1578, 1581, 1583, + 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1594, 1600, + 1603, 1605, 1607, 1609, 1611, 1613, 1615, 1617, 1619, 1623, + 1626, 1629, 1632, 1633, 1636, 1637, 1640, 1641, 1644, 1645, + 1648, 1651, 1654, 1657, 1658, 1661, 1663, 1664, 1665, 1666, + 1669, 1670, 1673, 1676, 1679, 1680, 1683, 1684, 1685, 1686, + 1689, 1692, 1695, 1696, 1699, 1700, 1701, 1704, 1708, 1712, + 1716, 1720, 1724, 1725, 1726, 1727, 1728, 1729, 1730, 1731, + 1732, 1733, 1734, 1735, 1736, 1737, 1738, 1739, 1740, 1741, + 1742, 1743, 1744, 1745, 1746, 1747, 1748, 1749, 1750, 1751, + 1752, 1753, 1754, 1755, 1756, 1757, 1758, 1759, 1760, 1761, + 1762, 1763, 1764, 1765, 1766, 1767, 1768, 1769, 1770, 1771, + 1772, 1773, 1774, 1775, 1776, 1777, 1778, 1779, 1780, 1781, + 1782, 1783, 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1791, + 1792, 1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800 }; // Print the state stack on the debug stream. @@ -11280,8 +11528,8 @@ namespace yy { } // yy -#line 11282 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" // lalr1.cc:1242 -#line 1770 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:1243 +#line 11530 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" // lalr1.cc:1242 +#line 1802 "/home/styler/git/fast_ber/src/compiler/asn_compiler.yacc" // lalr1.cc:1243 @@ -11294,7 +11542,7 @@ namespace yy { context.location.step(); // Lexer -#line 11298 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 11546 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" { char yych; unsigned int yyaccept = 0; @@ -11394,25 +11642,25 @@ namespace yy { } yy2: ++context.cursor; -#line 11417 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11665 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_END_OF_FILE(context.location); } -#line 11400 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 11648 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy4: ++context.cursor; yy5: -#line 11444 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11691 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { std::cerr << "Ignoring unknown symbol: " << static_cast(*start) << std::endl; return yylex(context); } -#line 11406 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 11654 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy6: ++context.cursor; -#line 11421 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11669 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); context.location.columns(); return yylex(context); } -#line 11411 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 11659 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy8: ++context.cursor; -#line 11420 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11668 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); context.location.lines(); return yylex(context); } -#line 11416 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 11664 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy10: yych = *++context.cursor; switch (yych) { @@ -11421,9 +11669,9 @@ namespace yy { } yy11: ++context.cursor; -#line 11439 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11687 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_EXCLAMATION_MARK (context.location); } -#line 11427 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 11675 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy13: yych = *++context.cursor; switch (yych) { @@ -11521,19 +11769,19 @@ namespace yy { } yy18: ++context.cursor; -#line 11429 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11677 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_OPEN_PARENTHESIS (context.location); } -#line 11527 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 11775 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy20: ++context.cursor; -#line 11430 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11678 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_CLOSE_PARENTHESIS (context.location); } -#line 11532 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 11780 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy22: ++context.cursor; -#line 11435 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11683 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_COMMA (context.location); } -#line 11537 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 11785 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy24: yych = *++context.cursor; switch (yych) { @@ -11551,9 +11799,9 @@ namespace yy { default: goto yy25; } yy25: -#line 11436 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11684 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_HYPHEN_MINUS (context.location); } -#line 11557 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 11805 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy26: yych = *++context.cursor; switch (yych) { @@ -11561,9 +11809,9 @@ namespace yy { default: goto yy27; } yy27: -#line 11437 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11685 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_FULL_STOP (context.location); } -#line 11567 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 11815 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy28: yych = *++context.cursor; switch (yych) { @@ -11588,9 +11836,9 @@ namespace yy { default: goto yy31; } yy31: -#line 11403 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11651 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_number(std::stoll(std::string(start, context.cursor)), context.location); } -#line 11594 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 11842 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy32: yyaccept = 1; yych = *(YYMARKER = ++context.cursor); @@ -11599,24 +11847,24 @@ namespace yy { default: goto yy33; } yy33: -#line 11433 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11681 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_COLON (context.location); } -#line 11605 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 11853 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy34: ++context.cursor; -#line 11434 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11682 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_SEMICOLON (context.location); } -#line 11610 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 11858 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy36: ++context.cursor; -#line 11440 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11688 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_LESS_THAN (context.location); } -#line 11615 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 11863 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy38: ++context.cursor; -#line 11443 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11690 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_AT (context.location); } -#line 11620 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 11868 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy40: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); @@ -11629,9 +11877,9 @@ namespace yy { default: goto yy49; } yy41: -#line 11411 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11659 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_GENERIC_IDENTIFIER_UPPERCASE(santize_name(std::string(start, context.cursor)), context.location); } -#line 11635 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 11883 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy42: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); @@ -11862,19 +12110,19 @@ namespace yy { } yy61: ++context.cursor; -#line 11431 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11679 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_OPEN_SQUARE_BRACKET (context.location); } -#line 11868 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 12116 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy63: ++context.cursor; -#line 11432 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11680 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_CLOSE_SQUARE_BRACKET (context.location); } -#line 11873 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 12121 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy65: ++context.cursor; -#line 11441 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11689 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_ACCENT (context.location); } -#line 11878 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 12126 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy67: yyaccept = 3; yych = *(YYMARKER = ++context.cursor); @@ -11946,24 +12194,24 @@ namespace yy { default: goto yy69; } yy69: -#line 11412 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11660 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_GENERIC_IDENTIFIER_LOWERCASE(santize_name(std::string(start, context.cursor)), context.location); } -#line 11952 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 12200 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy70: ++context.cursor; -#line 11427 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11675 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_OPEN_BRACE (context.location); } -#line 11957 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 12205 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy72: ++context.cursor; -#line 11438 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11686 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_VERTICAL_LINE (context.location); } -#line 11962 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 12210 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy74: ++context.cursor; -#line 11428 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11676 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_CLOSE_BRACE (context.location); } -#line 11967 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 12215 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy76: yych = *++context.cursor; switch (yych) { @@ -11971,9 +12219,9 @@ namespace yy { default: goto yy77; } yy77: -#line 11406 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11654 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_cstring(std::string(start, context.cursor), context.location); } -#line 11977 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 12225 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy78: ++context.cursor; goto yy77; @@ -12055,9 +12303,9 @@ namespace yy { default: goto yy83; } yy83: -#line 11413 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11661 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_typefieldreference(santize_name(std::string(start, context.cursor)), context.location); } -#line 12061 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 12309 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy84: yyaccept = 5; yych = *(YYMARKER = ++context.cursor); @@ -12129,9 +12377,9 @@ namespace yy { default: goto yy86; } yy86: -#line 11414 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11662 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_valuefieldreference(santize_name(std::string(start, context.cursor)), context.location); } -#line 12135 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 12383 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy87: yych = *++context.cursor; switch (yych) { @@ -12178,9 +12426,9 @@ namespace yy { default: goto yy90; } yy92: -#line 11397 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11645 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return yylex(context); } -#line 12184 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 12432 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy93: yych = *++context.cursor; switch (yych) { @@ -12197,9 +12445,9 @@ namespace yy { default: goto yy95; } yy95: -#line 11404 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11652 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_negativenumber(std::stoll(std::string(start, context.cursor)), context.location); } -#line 12203 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 12451 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy96: yych = *++context.cursor; switch (yych) { @@ -12207,9 +12455,9 @@ namespace yy { default: goto yy97; } yy97: -#line 11426 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11674 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_RANGE (context.location); } -#line 12213 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 12461 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy98: yych = *++context.cursor; switch (yych) { @@ -12228,7 +12476,7 @@ namespace yy { case '6': case '7': case '8': - case '9': goto yy180; + case '9': goto yy181; default: goto yy101; } yy101: @@ -12242,101 +12490,101 @@ namespace yy { case 5: goto yy86; case 6: goto yy114; case 7: goto yy141; - case 8: goto yy187; - case 9: goto yy189; - case 10: goto yy194; - case 11: goto yy208; - case 12: goto yy225; - case 13: goto yy227; - case 14: goto yy238; - case 15: goto yy247; - case 16: goto yy282; - case 17: goto yy295; - case 18: goto yy309; - case 19: goto yy322; - case 20: goto yy327; - case 21: goto yy332; - case 22: goto yy334; - case 23: goto yy336; - case 24: goto yy348; - case 25: goto yy354; - case 26: goto yy360; - case 27: goto yy377; - case 28: goto yy395; - case 29: goto yy414; - case 30: goto yy423; - case 31: goto yy431; - case 32: goto yy444; - case 33: goto yy466; - case 34: goto yy479; - case 35: goto yy481; - case 36: goto yy487; - case 37: goto yy499; - case 38: goto yy506; - case 39: goto yy511; - case 40: goto yy516; - case 41: goto yy525; - case 42: goto yy527; - case 43: goto yy532; - case 44: goto yy539; - case 45: goto yy543; - case 46: goto yy546; - case 47: goto yy548; - case 48: goto yy559; - case 49: goto yy575; - case 50: goto yy577; - case 51: goto yy581; - case 52: goto yy584; - case 53: goto yy591; - case 54: goto yy593; - case 55: goto yy595; - case 56: goto yy603; - case 57: goto yy609; - case 58: goto yy611; - case 59: goto yy624; - case 60: goto yy626; - case 61: goto yy628; - case 62: goto yy630; - case 63: goto yy634; - case 64: goto yy643; - case 65: goto yy656; - case 66: goto yy661; - case 67: goto yy669; - case 68: goto yy672; - case 69: goto yy676; - case 70: goto yy682; - case 71: goto yy697; - case 72: goto yy703; - case 73: goto yy705; - case 74: goto yy707; - case 75: goto yy724; - case 76: goto yy737; - case 77: goto yy739; - case 78: goto yy741; - case 79: goto yy744; - case 80: goto yy750; - case 81: goto yy759; - case 82: goto yy761; - case 83: goto yy764; - case 84: goto yy767; - case 85: goto yy770; - case 86: goto yy775; - case 87: goto yy779; - case 88: goto yy784; - case 89: goto yy791; - case 90: goto yy793; - case 91: goto yy796; - case 92: goto yy799; - case 93: goto yy802; - case 94: goto yy804; - case 95: goto yy806; - case 96: goto yy808; - default: goto yy810; + case 8: goto yy188; + case 9: goto yy190; + case 10: goto yy195; + case 11: goto yy209; + case 12: goto yy226; + case 13: goto yy228; + case 14: goto yy239; + case 15: goto yy248; + case 16: goto yy283; + case 17: goto yy296; + case 18: goto yy310; + case 19: goto yy323; + case 20: goto yy328; + case 21: goto yy333; + case 22: goto yy335; + case 23: goto yy337; + case 24: goto yy349; + case 25: goto yy355; + case 26: goto yy361; + case 27: goto yy378; + case 28: goto yy396; + case 29: goto yy415; + case 30: goto yy424; + case 31: goto yy432; + case 32: goto yy445; + case 33: goto yy467; + case 34: goto yy480; + case 35: goto yy482; + case 36: goto yy488; + case 37: goto yy500; + case 38: goto yy507; + case 39: goto yy512; + case 40: goto yy517; + case 41: goto yy526; + case 42: goto yy528; + case 43: goto yy533; + case 44: goto yy540; + case 45: goto yy544; + case 46: goto yy547; + case 47: goto yy549; + case 48: goto yy560; + case 49: goto yy576; + case 50: goto yy578; + case 51: goto yy582; + case 52: goto yy585; + case 53: goto yy592; + case 54: goto yy594; + case 55: goto yy596; + case 56: goto yy604; + case 57: goto yy610; + case 58: goto yy612; + case 59: goto yy625; + case 60: goto yy627; + case 61: goto yy629; + case 62: goto yy631; + case 63: goto yy635; + case 64: goto yy644; + case 65: goto yy657; + case 66: goto yy662; + case 67: goto yy670; + case 68: goto yy673; + case 69: goto yy677; + case 70: goto yy683; + case 71: goto yy698; + case 72: goto yy704; + case 73: goto yy706; + case 74: goto yy708; + case 75: goto yy725; + case 76: goto yy738; + case 77: goto yy740; + case 78: goto yy742; + case 79: goto yy745; + case 80: goto yy751; + case 81: goto yy760; + case 82: goto yy762; + case 83: goto yy765; + case 84: goto yy768; + case 85: goto yy771; + case 86: goto yy776; + case 87: goto yy780; + case 88: goto yy785; + case 89: goto yy792; + case 90: goto yy794; + case 91: goto yy797; + case 92: goto yy800; + case 93: goto yy803; + case 94: goto yy805; + case 95: goto yy807; + case 96: goto yy809; + default: goto yy811; } yy102: yych = *++context.cursor; switch (yych) { - case '=': goto yy183; + case '=': goto yy184; default: goto yy101; } yy103: @@ -12411,63 +12659,63 @@ namespace yy { yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy185; + case 'S': goto yy186; default: goto yy49; } yy105: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'L': goto yy186; + case 'L': goto yy187; default: goto yy49; } yy106: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'Y': goto yy188; + case 'Y': goto yy189; default: goto yy49; } yy107: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'P': goto yy190; + case 'P': goto yy191; default: goto yy49; } yy108: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy191; + case 'T': goto yy192; default: goto yy49; } yy109: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'G': goto yy192; + case 'G': goto yy193; default: goto yy49; } yy110: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy193; + case 'T': goto yy194; default: goto yy49; } yy111: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'P': goto yy195; + case 'P': goto yy196; default: goto yy49; } yy112: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'O': goto yy196; + case 'O': goto yy197; default: goto yy49; } yy113: @@ -12541,190 +12789,190 @@ namespace yy { default: goto yy114; } yy114: -#line 11310 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11558 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_BY (context.location); } -#line 12547 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 12795 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy115: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy197; - case 'O': goto yy198; + case 'A': goto yy198; + case 'O': goto yy199; default: goto yy49; } yy116: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy199; + case 'A': goto yy200; default: goto yy49; } yy117: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'M': goto yy200; - case 'N': goto yy201; + case 'M': goto yy201; + case 'N': goto yy202; default: goto yy49; } yy118: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy202; + case 'T': goto yy203; default: goto yy49; } yy119: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'F': goto yy203; + case 'F': goto yy204; default: goto yy49; } yy120: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'R': goto yy204; + case 'R': goto yy205; default: goto yy49; } yy121: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'B': goto yy205; + case 'B': goto yy206; default: goto yy49; } yy122: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'C': goto yy206; - case 'D': goto yy207; - case 'U': goto yy209; + case 'C': goto yy207; + case 'D': goto yy208; + case 'U': goto yy210; default: goto yy49; } yy123: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'C': goto yy210; - case 'P': goto yy211; - case 'T': goto yy212; + case 'C': goto yy211; + case 'P': goto yy212; + case 'T': goto yy213; default: goto yy49; } yy124: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'L': goto yy213; + case 'L': goto yy214; default: goto yy49; } yy125: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'O': goto yy214; + case 'O': goto yy215; default: goto yy49; } yy126: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'n': goto yy215; + case 'n': goto yy216; default: goto yy49; } yy127: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'a': goto yy216; + case 'a': goto yy217; default: goto yy49; } yy128: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case '5': goto yy217; + case '5': goto yy218; default: goto yy49; } yy129: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy218; + case 'E': goto yy219; default: goto yy49; } yy130: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'P': goto yy219; + case 'P': goto yy220; default: goto yy49; } yy131: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'C': goto yy220; - case 'S': goto yy221; - case 'T': goto yy222; + case 'C': goto yy221; + case 'S': goto yy222; + case 'T': goto yy223; default: goto yy49; } yy132: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'O': goto yy223; + case 'O': goto yy224; default: goto yy49; } yy133: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'X': goto yy224; + case 'X': goto yy225; default: goto yy49; } yy134: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy226; + case 'N': goto yy227; default: goto yy49; } yy135: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy228; + case 'T': goto yy229; default: goto yy49; } yy136: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'L': goto yy229; + case 'L': goto yy230; default: goto yy49; } yy137: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'm': goto yy230; + case 'm': goto yy231; default: goto yy49; } yy138: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'J': goto yy231; + case 'J': goto yy232; default: goto yy49; } yy139: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy232; + case 'T': goto yy233; default: goto yy49; } yy140: @@ -12798,180 +13046,180 @@ namespace yy { default: goto yy141; } yy141: -#line 11358 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11606 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_OF (context.location); } -#line 12804 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 13052 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy142: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'D': goto yy233; + case 'D': goto yy234; default: goto yy49; } yy143: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy234; + case 'T': goto yy235; default: goto yy49; } yy144: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'j': goto yy235; + case 'j': goto yy236; default: goto yy49; } yy145: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy236; + case 'T': goto yy237; default: goto yy49; } yy146: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'V': goto yy237; + case 'V': goto yy238; default: goto yy49; } yy147: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'U': goto yy239; + case 'U': goto yy240; default: goto yy49; } yy148: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy240; - case 'I': goto yy241; + case 'E': goto yy241; + case 'I': goto yy242; default: goto yy49; } yy149: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy242; + case 'i': goto yy243; default: goto yy49; } yy150: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy243; - case 'L': goto yy244; + case 'A': goto yy244; + case 'L': goto yy245; default: goto yy49; } yy151: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'Q': goto yy245; - case 'T': goto yy246; + case 'Q': goto yy246; + case 'T': goto yy247; default: goto yy49; } yy152: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'Z': goto yy248; + case 'Z': goto yy249; default: goto yy49; } yy153: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'R': goto yy249; + case 'R': goto yy250; default: goto yy49; } yy154: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy250; + case 'N': goto yy251; default: goto yy49; } yy155: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case '1': goto yy251; + case '1': goto yy252; default: goto yy49; } yy156: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'G': goto yy252; + case 'G': goto yy253; default: goto yy49; } yy157: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'M': goto yy253; + case 'M': goto yy254; default: goto yy49; } yy158: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'U': goto yy254; + case 'U': goto yy255; default: goto yy49; } yy159: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'P': goto yy255; + case 'P': goto yy256; default: goto yy49; } yy160: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'l': goto yy256; + case 'l': goto yy257; default: goto yy49; } yy161: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy257; + case 'I': goto yy258; default: goto yy49; } yy162: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'C': goto yy258; - case 'F': goto yy259; + case 'C': goto yy259; + case 'F': goto yy260; default: goto yy49; } yy163: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy260; + case 'i': goto yy261; default: goto yy49; } yy164: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'd': goto yy261; - case 's': goto yy262; + case 'd': goto yy262; + case 's': goto yy263; default: goto yy49; } yy165: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy263; + case 'T': goto yy264; default: goto yy49; } yy166: @@ -13188,14 +13436,14 @@ namespace yy { } yy171: ++context.cursor; -#line 11408 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11656 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_bstring(std::string(start + 1, context.cursor - 2), context.location); } -#line 13194 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 13442 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy173: ++context.cursor; -#line 11410 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11658 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_hstring(std::string(start + 1, context.cursor - 2), context.location); } -#line 13199 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 13447 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy175: yych = *++context.cursor; switch (yych) { @@ -13207,21 +13455,22 @@ namespace yy { switch (yych) { case '\n': case '\r': goto yy92; - case '-': goto yy264; + case '-': goto yy265; default: goto yy90; } yy177: ++context.cursor; -#line 11425 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11673 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_ELIPSIS (context.location); } -#line 13218 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 13466 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy179: yych = *++context.cursor; switch (yych) { - case '/': goto yy266; + case '*': goto yy179; + case '/': goto yy267; default: goto yy98; } -yy180: +yy181: yych = *++context.cursor; switch (yych) { case '0': @@ -13233,27 +13482,27 @@ namespace yy { case '6': case '7': case '8': - case '9': goto yy180; - default: goto yy182; + case '9': goto yy181; + default: goto yy183; } -yy182: -#line 11402 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_realnumber(std::stod(std::string(start, context.cursor)), context.location); } -#line 13243 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy183: +#line 11650 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_realnumber(std::stod(std::string(start, context.cursor)), context.location); } +#line 13492 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy184: ++context.cursor; -#line 11424 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11672 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_DEFINED_AS (context.location); } -#line 13248 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" -yy185: +#line 13497 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy186: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy268; - case 'T': goto yy269; + case 'E': goto yy269; + case 'T': goto yy270; default: goto yy49; } -yy186: +yy187: yyaccept = 8; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -13321,13 +13570,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy187; + default: goto yy188; } -yy187: -#line 11302 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_ALL (context.location); } -#line 13330 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy188: +#line 11550 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_ALL (context.location); } +#line 13579 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy189: yyaccept = 9; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -13395,34 +13644,34 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy189; + default: goto yy190; } -yy189: -#line 11303 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_ANY (context.location); } -#line 13404 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy190: +#line 11551 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_ANY (context.location); } +#line 13653 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy191: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'L': goto yy270; + case 'L': goto yy271; default: goto yy49; } -yy191: +yy192: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'O': goto yy271; + case 'O': goto yy272; default: goto yy49; } -yy192: +yy193: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy272; + case 'I': goto yy273; default: goto yy49; } -yy193: +yy194: yyaccept = 10; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -13490,99 +13739,99 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy194; + default: goto yy195; } -yy194: -#line 11307 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_BIT (context.location); } -#line 13499 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy195: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'S': goto yy273; - default: goto yy49; - } +#line 11555 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_BIT (context.location); } +#line 13748 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy196: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'L': goto yy274; + case 'S': goto yy274; default: goto yy49; } yy197: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'R': goto yy275; + case 'L': goto yy275; default: goto yy49; } yy198: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy276; + case 'R': goto yy276; default: goto yy49; } yy199: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy277; + case 'I': goto yy277; default: goto yy49; } yy200: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'P': goto yy278; + case 'S': goto yy278; default: goto yy49; } yy201: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy279; - case 'T': goto yy280; + case 'P': goto yy279; default: goto yy49; } yy202: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy281; + case 'S': goto yy280; + case 'T': goto yy281; default: goto yy49; } yy203: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy283; - case 'I': goto yy284; + case 'E': goto yy282; default: goto yy49; } yy204: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy285; + case 'A': goto yy284; + case 'I': goto yy285; default: goto yy49; } yy205: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy286; + case 'A': goto yy286; default: goto yy49; } yy206: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'O': goto yy287; + case 'E': goto yy287; default: goto yy49; } yy207: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'O': goto yy288; + default: goto yy49; + } +yy208: yyaccept = 11; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -13650,120 +13899,120 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy208; + default: goto yy209; } -yy208: -#line 11326 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_END (context.location); } -#line 13659 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy209: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'M': goto yy288; - default: goto yy49; - } +#line 11574 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_END (context.location); } +#line 13908 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy210: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy289; + case 'M': goto yy289; default: goto yy49; } yy211: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'L': goto yy290; - case 'O': goto yy291; + case 'E': goto yy290; default: goto yy49; } yy212: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy292; + case 'L': goto yy291; + case 'O': goto yy292; default: goto yy49; } yy213: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy293; + case 'E': goto yy293; default: goto yy49; } yy214: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'M': goto yy294; + case 'S': goto yy294; default: goto yy49; } yy215: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'e': goto yy296; + case 'M': goto yy295; default: goto yy49; } yy216: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'p': goto yy297; + case 'e': goto yy297; default: goto yy49; } yy217: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy298; + case 'p': goto yy298; default: goto yy49; } yy218: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy299; + case 'S': goto yy299; default: goto yy49; } yy219: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'L': goto yy300; - case 'O': goto yy301; + case 'N': goto yy300; default: goto yy49; } yy220: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'L': goto yy302; + case 'L': goto yy301; + case 'O': goto yy302; default: goto yy49; } yy221: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy303; + case 'L': goto yy303; default: goto yy49; } yy222: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy304; + case 'T': goto yy304; default: goto yy49; } yy223: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case '6': goto yy305; + case 'E': goto yy305; default: goto yy49; } yy224: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case '6': goto yy306; + default: goto yy49; + } +yy225: yyaccept = 12; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -13831,13 +14080,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy225; + default: goto yy226; } -yy225: -#line 11349 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_MAX (context.location); } -#line 13840 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy226: +#line 11597 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_MAX (context.location); } +#line 14089 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy227: yyaccept = 13; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -13904,39 +14153,32 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - case 'U': goto yy306; - default: goto yy227; + case 'U': goto yy307; + default: goto yy228; } -yy227: -#line 11350 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_MIN (context.location); } -#line 13914 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy228: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case '-': goto yy307; - default: goto yy49; - } +#line 11598 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_MIN (context.location); } +#line 14163 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy229: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'L': goto yy308; + case '-': goto yy308; default: goto yy49; } yy230: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'e': goto yy310; + case 'L': goto yy309; default: goto yy49; } yy231: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy311; + case 'e': goto yy311; default: goto yy49; } yy232: @@ -13950,31 +14192,38 @@ namespace yy { yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case '_': goto yy313; + case 'E': goto yy313; default: goto yy49; } yy234: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy314; + case '_': goto yy314; default: goto yy49; } yy235: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'e': goto yy315; + case 'I': goto yy315; default: goto yy49; } yy236: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy316; + case 'e': goto yy316; default: goto yy49; } yy237: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'T': goto yy317; + default: goto yy49; + } +yy238: yyaccept = 14; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -14042,19 +14291,12 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy238; + default: goto yy239; } -yy238: -#line 11362 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_PDV (context.location); } -#line 14051 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy239: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'S': goto yy317; - default: goto yy49; - } +#line 11610 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_PDV (context.location); } +#line 14300 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy240: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); @@ -14066,38 +14308,45 @@ namespace yy { yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'V': goto yy319; + case 'S': goto yy319; default: goto yy49; } yy242: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'n': goto yy320; + case 'V': goto yy320; default: goto yy49; } yy243: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'L': goto yy321; + case 'n': goto yy321; default: goto yy49; } yy244: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy323; + case 'L': goto yy322; default: goto yy49; } yy245: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'U': goto yy324; + case 'A': goto yy324; default: goto yy49; } yy246: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'U': goto yy325; + default: goto yy49; + } +yy247: yyaccept = 15; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -14164,39 +14413,32 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - case 'T': goto yy325; - default: goto yy247; + case 'T': goto yy326; + default: goto yy248; } -yy247: -#line 11371 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_SET (context.location); } -#line 14174 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy248: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'E': goto yy326; - default: goto yy49; - } +#line 11619 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_SET (context.location); } +#line 14423 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy249: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy328; + case 'E': goto yy327; default: goto yy49; } yy250: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy329; + case 'I': goto yy329; default: goto yy49; } yy251: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy330; + case 'T': goto yy330; default: goto yy49; } yy252: @@ -14210,187 +14452,194 @@ namespace yy { yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy333; + case 'S': goto yy332; default: goto yy49; } yy254: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy335; + case 'E': goto yy334; default: goto yy49; } yy255: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy337; + case 'E': goto yy336; default: goto yy49; } yy256: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'e': goto yy338; + case 'E': goto yy338; default: goto yy49; } yy257: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'O': goto yy339; - case 'Q': goto yy340; - case 'V': goto yy341; + case 'e': goto yy339; default: goto yy49; } yy258: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy342; + case 'O': goto yy340; + case 'Q': goto yy341; + case 'V': goto yy342; default: goto yy49; } yy259: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case '8': goto yy343; + case 'T': goto yy343; default: goto yy49; } yy260: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'v': goto yy344; + case '8': goto yy344; default: goto yy49; } yy261: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'e': goto yy345; + case 'v': goto yy345; default: goto yy49; } yy262: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy346; + case 'e': goto yy346; default: goto yy49; } yy263: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'H': goto yy347; + case 'i': goto yy347; default: goto yy49; } yy264: - ++context.cursor; -#line 11395 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return yylex(context); } -#line 14293 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" -yy266: - ++context.cursor; -#line 11399 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return yylex(context); } -#line 14298 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" -yy268: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy349; + case 'H': goto yy348; default: goto yy49; } +yy265: + ++context.cursor; +#line 11643 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return yylex(context); } +#line 14542 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy267: + ++context.cursor; +#line 11647 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { for (char c: std::string(start, context.cursor)) { context.location.columns(); if (c == '\n') context.location.lines(); } return yylex(context); } +#line 14547 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy269: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'R': goto yy350; + case 'N': goto yy350; default: goto yy49; } yy270: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy351; + case 'R': goto yy351; default: goto yy49; } yy271: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'M': goto yy352; + case 'I': goto yy352; default: goto yy49; } yy272: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy353; + case 'M': goto yy353; default: goto yy49; } yy273: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 't': goto yy355; + case 'N': goto yy354; default: goto yy49; } yy274: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy356; + case 't': goto yy356; default: goto yy49; } yy275: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy357; + case 'E': goto yy357; default: goto yy49; } yy276: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'C': goto yy358; + case 'A': goto yy358; default: goto yy49; } yy277: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy359; + case 'C': goto yy359; default: goto yy49; } yy278: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'O': goto yy361; + case 'S': goto yy360; default: goto yy49; } yy279: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy362; + case 'O': goto yy362; default: goto yy49; } yy280: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy363; + case 'T': goto yy363; default: goto yy49; } yy281: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'A': goto yy364; + default: goto yy49; + } +yy282: yyaccept = 16; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case '-': goto yy364; + case '-': goto yy365; case '0': case '1': case '2': @@ -14454,38 +14703,31 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy282; + default: goto yy283; } -yy282: -#line 11318 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_DATE (context.location); } -#line 14463 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy283: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'U': goto yy365; - default: goto yy49; - } +#line 11566 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_DATE (context.location); } +#line 14712 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy284: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy366; + case 'U': goto yy366; default: goto yy49; } yy285: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy367; + case 'N': goto yy367; default: goto yy49; } yy286: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'D': goto yy368; + case 'T': goto yy368; default: goto yy49; } yy287: @@ -14499,46 +14741,53 @@ namespace yy { yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy370; + case 'D': goto yy370; default: goto yy49; } yy289: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'P': goto yy371; + case 'E': goto yy371; default: goto yy49; } yy290: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy372; + case 'P': goto yy372; default: goto yy49; } yy291: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'R': goto yy373; + case 'I': goto yy373; default: goto yy49; } yy292: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy374; - case 'R': goto yy375; + case 'R': goto yy374; default: goto yy49; } yy293: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy376; + case 'N': goto yy375; + case 'R': goto yy376; default: goto yy49; } yy294: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'E': goto yy377; + default: goto yy49; + } +yy295: yyaccept = 17; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -14606,92 +14855,92 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy295; + default: goto yy296; } -yy295: -#line 11334 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_FROM (context.location); } -#line 14615 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy296: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'r': goto yy378; - default: goto yy49; - } +#line 11582 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_FROM (context.location); } +#line 14864 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy297: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'h': goto yy379; + case 'r': goto yy379; default: goto yy49; } yy298: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 't': goto yy380; + case 'h': goto yy380; default: goto yy49; } yy299: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy381; + case 't': goto yy381; default: goto yy49; } yy300: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy382; + case 'T': goto yy382; default: goto yy49; } yy301: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'R': goto yy383; + case 'I': goto yy383; default: goto yy49; } yy302: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'U': goto yy384; + case 'R': goto yy384; default: goto yy49; } yy303: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy385; - case 'R': goto yy386; + case 'U': goto yy385; default: goto yy49; } yy304: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'G': goto yy387; - case 'R': goto yy388; + case 'A': goto yy386; + case 'R': goto yy387; default: goto yy49; } yy305: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case '4': goto yy389; + case 'G': goto yy388; + case 'R': goto yy389; default: goto yy49; } yy306: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy390; + case '4': goto yy390; default: goto yy49; } yy307: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'S': goto yy391; + default: goto yy49; + } +yy308: yych = *++context.cursor; switch (yych) { case '0': @@ -14756,10 +15005,10 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - case 'A': goto yy391; + case 'A': goto yy392; default: goto yy101; } -yy308: +yy309: yyaccept = 18; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -14822,95 +15071,95 @@ namespace yy { case 's': case 't': case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': goto yy48; - default: goto yy309; - } -yy309: -#line 11353 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_ASN_NULL (context.location); } -#line 14836 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" -yy310: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'r': goto yy392; - default: goto yy49; + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy48; + default: goto yy310; } +yy310: +#line 11601 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_ASN_NULL (context.location); } +#line 15085 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy311: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'C': goto yy393; + case 'r': goto yy393; default: goto yy49; } yy312: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy394; + case 'C': goto yy394; default: goto yy49; } yy313: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy396; + case 'T': goto yy395; default: goto yy49; } yy314: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'O': goto yy397; + case 'I': goto yy397; default: goto yy49; } yy315: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'c': goto yy398; + case 'O': goto yy398; default: goto yy49; } yy316: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy399; + case 'c': goto yy399; default: goto yy49; } yy317: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case '_': goto yy400; + case 'E': goto yy400; default: goto yy49; } yy318: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy401; + case '_': goto yy401; default: goto yy49; } yy319: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy402; + case 'E': goto yy402; default: goto yy49; } yy320: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 't': goto yy403; + case 'A': goto yy403; default: goto yy49; } yy321: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 't': goto yy404; + default: goto yy49; + } +yy322: yyaccept = 19; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -14978,34 +15227,34 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy322; + default: goto yy323; } -yy322: -#line 11367 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_REAL (context.location); } -#line 14987 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy323: +#line 11615 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_REAL (context.location); } +#line 15236 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy324: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy404; + case 'T': goto yy405; default: goto yy49; } -yy324: +yy325: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy405; + case 'E': goto yy406; default: goto yy49; } -yy325: +yy326: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy406; + case 'I': goto yy407; default: goto yy49; } -yy326: +yy327: yyaccept = 20; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -15073,34 +15322,34 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy327; + default: goto yy328; } -yy327: -#line 11373 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_SIZE (context.location); } -#line 15082 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy328: +#line 11621 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_SIZE (context.location); } +#line 15331 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy329: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy407; + case 'N': goto yy408; default: goto yy49; } -yy329: +yy330: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy408; + case 'A': goto yy409; default: goto yy49; } -yy330: +yy331: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 't': goto yy409; + case 't': goto yy410; default: goto yy49; } -yy331: +yy332: yyaccept = 21; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -15168,17 +15417,17 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy332; + default: goto yy333; } -yy332: -#line 11377 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_TAGS (context.location); } -#line 15177 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy333: +#line 11625 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_TAGS (context.location); } +#line 15426 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy334: yyaccept = 22; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case '-': goto yy410; + case '-': goto yy411; case '0': case '1': case '2': @@ -15242,13 +15491,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy334; + default: goto yy335; } -yy334: -#line 11379 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_TIME (context.location); } -#line 15251 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy335: +#line 11627 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_TIME (context.location); } +#line 15500 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy336: yyaccept = 23; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -15316,83 +15565,83 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy336; + default: goto yy337; } -yy336: -#line 11381 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_TRUE (context.location); } -#line 15325 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy337: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case '-': goto yy411; - default: goto yy49; - } +#line 11629 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_TRUE (context.location); } +#line 15574 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy338: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 't': goto yy412; + case '-': goto yy412; default: goto yy49; } yy339: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy413; + case 't': goto yy413; default: goto yy49; } yy340: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'U': goto yy415; + case 'N': goto yy414; default: goto yy49; } yy341: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy416; + case 'U': goto yy416; default: goto yy49; } yy342: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy417; + case 'E': goto yy417; default: goto yy49; } yy343: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy418; + case 'i': goto yy418; default: goto yy49; } yy344: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'e': goto yy419; + case 'S': goto yy419; default: goto yy49; } yy345: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'o': goto yy420; + case 'e': goto yy420; default: goto yy49; } yy346: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'b': goto yy421; + case 'o': goto yy421; default: goto yy49; } yy347: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'b': goto yy422; + default: goto yy49; + } +yy348: yyaccept = 24; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -15460,41 +15709,41 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy348; + default: goto yy349; } -yy348: -#line 11391 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_WITH (context.location); } -#line 15469 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy349: +#line 11639 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_WITH (context.location); } +#line 15718 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy350: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy422; + case 'T': goto yy423; default: goto yy49; } -yy350: +yy351: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy424; + case 'A': goto yy425; default: goto yy49; } -yy351: +yy352: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'C': goto yy425; + case 'C': goto yy426; default: goto yy49; } -yy352: +yy353: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy426; + case 'A': goto yy427; default: goto yy49; } -yy353: +yy354: yyaccept = 25; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -15562,41 +15811,41 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy354; + default: goto yy355; } -yy354: -#line 11306 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_BEGIN (context.location); } -#line 15571 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy355: +#line 11554 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_BEGIN (context.location); } +#line 15820 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy356: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'r': goto yy427; + case 'r': goto yy428; default: goto yy49; } -yy356: +yy357: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy428; + case 'A': goto yy429; default: goto yy49; } -yy357: +yy358: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'C': goto yy429; + case 'C': goto yy430; default: goto yy49; } -yy358: +yy359: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy430; + case 'E': goto yy431; default: goto yy49; } -yy359: +yy360: yyaccept = 26; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -15664,34 +15913,34 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy360; + default: goto yy361; } -yy360: -#line 11313 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_CLASS (context.location); } -#line 15673 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy361: +#line 11561 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_CLASS (context.location); } +#line 15922 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy362: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy432; + case 'N': goto yy433; default: goto yy49; } -yy362: +yy363: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'R': goto yy433; + case 'R': goto yy434; default: goto yy49; } -yy363: +yy364: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy434; + case 'I': goto yy435; default: goto yy49; } -yy364: +yy365: yych = *++context.cursor; switch (yych) { case '0': @@ -15756,21 +16005,14 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - case 'T': goto yy435; + case 'T': goto yy436; default: goto yy101; } -yy365: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'L': goto yy436; - default: goto yy49; - } yy366: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy437; + case 'L': goto yy437; default: goto yy49; } yy367: @@ -15784,60 +16026,67 @@ namespace yy { yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'D': goto yy439; + case 'I': goto yy439; default: goto yy49; } yy369: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy440; - case 'I': goto yy441; + case 'D': goto yy440; default: goto yy49; } yy370: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'R': goto yy442; + case 'E': goto yy441; + case 'I': goto yy442; default: goto yy49; } yy371: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy443; + case 'R': goto yy443; default: goto yy49; } yy372: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'C': goto yy445; + case 'T': goto yy444; default: goto yy49; } yy373: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy446; + case 'C': goto yy446; default: goto yy49; } yy374: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy447; + case 'T': goto yy447; default: goto yy49; } yy375: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy448; + case 'S': goto yy448; default: goto yy49; } yy376: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'N': goto yy449; + default: goto yy49; + } +yy377: yyaccept = 27; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -15905,102 +16154,95 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy377; + default: goto yy378; } -yy377: -#line 11333 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_FALSE (context.location); } -#line 15914 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy378: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'a': goto yy449; - default: goto yy49; - } +#line 11581 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_FALSE (context.location); } +#line 16163 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy379: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy450; + case 'a': goto yy450; default: goto yy49; } yy380: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'r': goto yy451; + case 'i': goto yy451; default: goto yy49; } yy381: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy452; + case 'r': goto yy452; default: goto yy49; } yy382: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'C': goto yy453; - case 'E': goto yy454; + case 'I': goto yy453; default: goto yy49; } yy383: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy455; + case 'C': goto yy454; + case 'E': goto yy455; default: goto yy49; } yy384: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'D': goto yy456; + case 'T': goto yy456; default: goto yy49; } yy385: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy457; + case 'D': goto yy457; default: goto yy49; } yy386: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'U': goto yy458; + case 'N': goto yy458; default: goto yy49; } yy387: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy459; + case 'U': goto yy459; default: goto yy49; } yy388: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy460; + case 'E': goto yy460; default: goto yy49; } yy389: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case '6': goto yy461; + case 'S': goto yy461; default: goto yy49; } yy390: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case '-': goto yy462; + case '6': goto yy462; default: goto yy49; } yy391: @@ -16014,17 +16256,24 @@ namespace yy { yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy464; + case '-': goto yy464; default: goto yy49; } yy393: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy465; + case 'i': goto yy465; default: goto yy49; } yy394: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'T': goto yy466; + default: goto yy49; + } +yy395: yyaccept = 28; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -16092,80 +16341,73 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy395; + default: goto yy396; } -yy395: -#line 11357 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_OCTET (context.location); } -#line 16101 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy396: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'R': goto yy467; - default: goto yy49; - } +#line 11605 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_OCTET (context.location); } +#line 16350 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy397: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy468; + case 'R': goto yy468; default: goto yy49; } yy398: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 't': goto yy469; + case 'N': goto yy469; default: goto yy49; } yy399: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'R': goto yy470; + case 't': goto yy470; default: goto yy49; } yy400: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy471; + case 'R': goto yy471; default: goto yy49; } yy401: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy472; + case 'I': goto yy472; default: goto yy49; } yy402: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy473; + case 'N': goto yy473; default: goto yy49; } yy403: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'a': goto yy474; + case 'T': goto yy474; default: goto yy49; } yy404: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy475; + case 'a': goto yy475; default: goto yy49; } yy405: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy476; + case 'I': goto yy476; default: goto yy49; } yy406: @@ -16179,24 +16421,31 @@ namespace yy { yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'G': goto yy478; + case 'N': goto yy478; default: goto yy49; } yy408: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'X': goto yy480; + case 'G': goto yy479; default: goto yy49; } yy409: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'r': goto yy482; + case 'X': goto yy481; default: goto yy49; } yy410: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'r': goto yy483; + default: goto yy49; + } +yy411: yych = *++context.cursor; switch (yych) { case '0': @@ -16261,10 +16510,10 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - case 'O': goto yy483; + case 'O': goto yy484; default: goto yy101; } -yy411: +yy412: yych = *++context.cursor; switch (yych) { case '0': @@ -16329,17 +16578,17 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - case 'I': goto yy484; + case 'I': goto yy485; default: goto yy101; } -yy412: +yy413: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'e': goto yy485; + case 'e': goto yy486; default: goto yy49; } -yy413: +yy414: yyaccept = 29; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -16407,62 +16656,62 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy414; + default: goto yy415; } -yy414: -#line 11383 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_UNION (context.location); } -#line 16416 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy415: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'E': goto yy486; - default: goto yy49; - } +#line 11631 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_UNION (context.location); } +#line 16665 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy416: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'R': goto yy488; + case 'E': goto yy487; default: goto yy49; } yy417: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'm': goto yy489; + case 'R': goto yy489; default: goto yy49; } yy418: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 't': goto yy490; + case 'm': goto yy490; default: goto yy49; } yy419: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'r': goto yy491; + case 't': goto yy491; default: goto yy49; } yy420: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 't': goto yy492; + case 'r': goto yy492; default: goto yy49; } yy421: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'l': goto yy493; + case 't': goto yy493; default: goto yy49; } yy422: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'l': goto yy494; + default: goto yy49; + } +yy423: yyaccept = 30; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -16530,55 +16779,55 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy423; + default: goto yy424; } -yy423: -#line 11300 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_ABSENT (context.location); } -#line 16539 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy424: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'C': goto yy494; - default: goto yy49; - } +#line 11548 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_ABSENT (context.location); } +#line 16788 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy425: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy495; + case 'C': goto yy495; default: goto yy49; } yy426: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy496; + case 'A': goto yy496; default: goto yy49; } yy427: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy497; + case 'T': goto yy497; default: goto yy49; } yy428: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy498; + case 'i': goto yy498; default: goto yy49; } yy429: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy500; + case 'N': goto yy499; default: goto yy49; } yy430: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'T': goto yy501; + default: goto yy49; + } +yy431: yyaccept = 31; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -16646,90 +16895,90 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy431; + default: goto yy432; } -yy431: -#line 11312 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_CHOICE (context.location); } -#line 16655 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy432: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'E': goto yy501; - default: goto yy49; - } +#line 11560 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_CHOICE (context.location); } +#line 16904 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy433: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy502; + case 'E': goto yy502; default: goto yy49; } yy434: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy503; + case 'A': goto yy503; default: goto yy49; } yy435: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy504; + case 'N': goto yy504; default: goto yy49; } yy436: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy505; + case 'I': goto yy505; default: goto yy49; } yy437: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy507; + case 'T': goto yy506; default: goto yy49; } yy438: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'O': goto yy508; + case 'T': goto yy508; default: goto yy49; } yy439: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy509; + case 'O': goto yy509; default: goto yy49; } yy440: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'D': goto yy510; + case 'E': goto yy510; default: goto yy49; } yy441: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy512; + case 'D': goto yy511; default: goto yy49; } yy442: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy513; + case 'N': goto yy513; default: goto yy49; } yy443: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'A': goto yy514; + default: goto yy49; + } +yy444: yyaccept = 32; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -16797,101 +17046,94 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy444; + default: goto yy445; } -yy444: -#line 11328 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_EXCEPT (context.location); } -#line 16806 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy445: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'I': goto yy514; - default: goto yy49; - } +#line 11576 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_EXCEPT (context.location); } +#line 17055 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy446: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy515; + case 'I': goto yy515; default: goto yy49; } yy447: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy517; + case 'S': goto yy516; default: goto yy49; } yy448: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy518; + case 'I': goto yy518; default: goto yy49; } yy449: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'l': goto yy519; + case 'A': goto yy519; default: goto yy49; } yy450: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'c': goto yy520; + case 'l': goto yy520; default: goto yy49; } yy451: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy521; + case 'c': goto yy521; default: goto yy49; } yy452: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'F': goto yy522; + case 'i': goto yy522; default: goto yy49; } yy453: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy523; + case 'F': goto yy523; default: goto yy49; } yy454: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'D': goto yy524; + case 'I': goto yy524; default: goto yy49; } yy455: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy526; + case 'D': goto yy525; default: goto yy49; } yy456: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy528; + case 'S': goto yy527; default: goto yy49; } yy457: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'C': goto yy529; + case 'E': goto yy529; default: goto yy49; } yy458: @@ -16905,24 +17147,31 @@ namespace yy { yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'R': goto yy531; + case 'C': goto yy531; default: goto yy49; } yy460: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy533; + case 'R': goto yy532; default: goto yy49; } yy461: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy534; + case 'E': goto yy534; default: goto yy49; } yy462: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'S': goto yy535; + default: goto yy49; + } +yy463: yych = *++context.cursor; switch (yych) { case '0': @@ -16987,10 +17236,10 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - case 'I': goto yy535; + case 'I': goto yy536; default: goto yy101; } -yy463: +yy464: yych = *++context.cursor; switch (yych) { case '0': @@ -17055,17 +17304,17 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - case 'N': goto yy536; + case 'N': goto yy537; default: goto yy101; } -yy464: +yy465: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'c': goto yy537; + case 'c': goto yy538; default: goto yy49; } -yy465: +yy466: yyaccept = 33; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -17133,90 +17382,90 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy466; + default: goto yy467; } -yy466: -#line 11355 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_OBJECT (context.location); } -#line 17142 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy467: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'I': goto yy538; - default: goto yy49; - } +#line 11603 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_OBJECT (context.location); } +#line 17391 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy468: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy540; + case 'I': goto yy539; default: goto yy49; } yy469: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'D': goto yy541; + case 'A': goto yy541; default: goto yy49; } yy470: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy542; + case 'D': goto yy542; default: goto yy49; } yy471: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy544; + case 'N': goto yy543; default: goto yy49; } yy472: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy545; + case 'N': goto yy545; default: goto yy49; } yy473: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy547; + case 'T': goto yy546; default: goto yy49; } yy474: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'b': goto yy549; + case 'E': goto yy548; default: goto yy49; } yy475: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'V': goto yy550; + case 'b': goto yy550; default: goto yy49; } yy476: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'C': goto yy551; + case 'V': goto yy551; default: goto yy49; } yy477: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'G': goto yy552; + case 'C': goto yy552; default: goto yy49; } yy478: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'G': goto yy553; + default: goto yy49; + } +yy479: yyaccept = 34; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -17284,13 +17533,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy479; + default: goto yy480; } -yy479: -#line 11374 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_STRING (context.location); } -#line 17293 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy480: +#line 11622 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_STRING (context.location); } +#line 17542 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy481: yyaccept = 35; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -17358,41 +17607,41 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy481; + default: goto yy482; } -yy481: -#line 11375 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_SYNTAX (context.location); } -#line 17367 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy482: +#line 11623 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_SYNTAX (context.location); } +#line 17616 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy483: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy553; + case 'i': goto yy554; default: goto yy49; } -yy483: +yy484: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'F': goto yy554; + case 'F': goto yy555; default: goto yy49; } -yy484: +yy485: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'D': goto yy555; + case 'D': goto yy556; default: goto yy49; } -yy485: +yy486: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'x': goto yy556; + case 'x': goto yy557; default: goto yy49; } -yy486: +yy487: yyaccept = 36; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -17460,45 +17709,38 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy487; + default: goto yy488; } -yy487: -#line 11384 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_UNIQUE (context.location); } -#line 17469 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy488: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'S': goto yy557; - default: goto yy49; - } +#line 11632 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_UNIQUE (context.location); } +#line 17718 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy489: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'e': goto yy558; + case 'S': goto yy558; default: goto yy49; } yy490: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'r': goto yy560; + case 'e': goto yy559; default: goto yy49; } yy491: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 's': goto yy561; + case 'r': goto yy561; default: goto yy49; } yy492: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'e': goto yy562; + case 's': goto yy562; default: goto yy49; } yy493: @@ -17512,7 +17754,7 @@ namespace yy { yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy564; + case 'e': goto yy564; default: goto yy49; } yy495: @@ -17526,17 +17768,24 @@ namespace yy { yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy566; + case 'T': goto yy566; default: goto yy49; } yy497: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'n': goto yy567; + case 'I': goto yy567; default: goto yy49; } yy498: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'n': goto yy568; + default: goto yy49; + } +yy499: yyaccept = 37; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -17604,31 +17853,24 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy499; + default: goto yy500; } -yy499: -#line 11309 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_BOOLEAN (context.location); } -#line 17613 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy500: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'E': goto yy568; - default: goto yy49; - } +#line 11557 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_BOOLEAN (context.location); } +#line 17862 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy501: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy569; + case 'E': goto yy569; default: goto yy49; } yy502: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy570; + case 'N': goto yy570; default: goto yy49; } yy503: @@ -17642,10 +17884,17 @@ namespace yy { yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'M': goto yy572; + case 'I': goto yy572; default: goto yy49; } yy505: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'M': goto yy573; + default: goto yy49; + } +yy506: yyaccept = 38; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -17713,34 +17962,34 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy506; + default: goto yy507; } -yy506: -#line 11320 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_DEFAULT (context.location); } -#line 17722 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy507: +#line 11568 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_DEFAULT (context.location); } +#line 17971 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy508: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy573; + case 'I': goto yy574; default: goto yy49; } -yy508: +yy509: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy574; + case 'N': goto yy575; default: goto yy49; } -yy509: +yy510: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'D': goto yy576; + case 'D': goto yy577; default: goto yy49; } -yy510: +yy511: yyaccept = 39; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -17808,34 +18057,34 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy511; + default: goto yy512; } -yy511: -#line 11324 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_ENCODED (context.location); } -#line 17817 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy512: +#line 11572 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_ENCODED (context.location); } +#line 18066 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy513: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'G': goto yy578; + case 'G': goto yy579; default: goto yy49; } -yy513: +yy514: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy579; + case 'T': goto yy580; default: goto yy49; } -yy514: +yy515: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy580; + case 'T': goto yy581; default: goto yy49; } -yy515: +yy516: yyaccept = 40; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -17903,63 +18152,63 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy516; + default: goto yy517; } -yy516: -#line 11330 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_EXPORTS (context.location); } -#line 17912 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy517: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'B': goto yy582; - default: goto yy49; - } +#line 11578 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_EXPORTS (context.location); } +#line 18161 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy518: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'L': goto yy583; + case 'B': goto yy583; default: goto yy49; } yy519: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy585; - case 'i': goto yy586; + case 'L': goto yy584; default: goto yy49; } yy520: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy587; + case 'S': goto yy586; + case 'i': goto yy587; default: goto yy49; } yy521: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'n': goto yy588; + case 'S': goto yy588; default: goto yy49; } yy522: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy589; + case 'n': goto yy589; default: goto yy49; } yy523: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy590; + case 'I': goto yy590; default: goto yy49; } yy524: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'T': goto yy591; + default: goto yy49; + } +yy525: yyaccept = 41; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -18027,13 +18276,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy525; + default: goto yy526; } -yy525: -#line 11341 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_IMPLIED (context.location); } -#line 18036 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy526: +#line 11589 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_IMPLIED (context.location); } +#line 18285 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy527: yyaccept = 42; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -18101,34 +18350,34 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy527; + default: goto yy528; } -yy527: -#line 11342 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_IMPORTS (context.location); } -#line 18110 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy528: +#line 11590 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_IMPORTS (context.location); } +#line 18359 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy529: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy592; + case 'S': goto yy593; default: goto yy49; } -yy529: +yy530: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy594; + case 'E': goto yy595; default: goto yy49; } -yy530: +yy531: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy596; + case 'T': goto yy597; default: goto yy49; } -yy531: +yy532: yyaccept = 43; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -18196,48 +18445,48 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy532; + default: goto yy533; } -yy532: -#line 11346 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_INTEGER (context.location); } -#line 18205 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy533: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'C': goto yy597; - default: goto yy49; - } +#line 11594 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_INTEGER (context.location); } +#line 18454 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy534: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 't': goto yy598; + case 'C': goto yy598; default: goto yy49; } yy535: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy599; + case 't': goto yy599; default: goto yy49; } yy536: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'U': goto yy600; + case 'N': goto yy600; default: goto yy49; } yy537: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy601; + case 'U': goto yy601; default: goto yy49; } yy538: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'S': goto yy602; + default: goto yy49; + } +yy539: yyaccept = 44; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -18305,27 +18554,27 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy539; + default: goto yy540; } -yy539: -#line 11359 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_OID_IRI (context.location); } -#line 18314 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy540: +#line 11607 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_OID_IRI (context.location); } +#line 18563 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy541: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'L': goto yy602; + case 'L': goto yy603; default: goto yy49; } -yy541: +yy542: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'e': goto yy604; + case 'e': goto yy605; default: goto yy49; } -yy542: +yy543: yyaccept = 45; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -18393,20 +18642,20 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy543; + default: goto yy544; } -yy543: -#line 11361 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_PATTERN (context.location); } -#line 18402 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy544: +#line 11609 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_PATTERN (context.location); } +#line 18651 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy545: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'F': goto yy605; + case 'F': goto yy606; default: goto yy49; } -yy545: +yy546: yyaccept = 46; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -18474,13 +18723,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy546; + default: goto yy547; } -yy546: -#line 11364 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_PRESENT (context.location); } -#line 18483 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy547: +#line 11612 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_PRESENT (context.location); } +#line 18732 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy548: yyaccept = 47; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -18548,24 +18797,17 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy548; + default: goto yy549; } -yy548: -#line 11366 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_PRIVATE (context.location); } -#line 18557 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy549: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'l': goto yy606; - default: goto yy49; - } +#line 11614 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_PRIVATE (context.location); } +#line 18806 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy550: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy607; + case 'l': goto yy607; default: goto yy49; } yy551: @@ -18579,45 +18821,52 @@ namespace yy { yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy610; + case 'E': goto yy609; default: goto yy49; } yy553: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'n': goto yy612; + case 'S': goto yy611; default: goto yy49; } yy554: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case '-': goto yy613; + case 'n': goto yy613; default: goto yy49; } yy555: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy614; + case '-': goto yy614; default: goto yy49; } yy556: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy615; + case 'E': goto yy615; default: goto yy49; } yy557: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy616; + case 'S': goto yy616; default: goto yy49; } yy558: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'A': goto yy617; + default: goto yy49; + } +yy559: yyaccept = 48; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -18685,87 +18934,80 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy559; + default: goto yy560; } -yy559: -#line 11387 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_UTCTime (context.location); } -#line 18694 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy560: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'i': goto yy617; - default: goto yy49; - } +#line 11635 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_UTCTime (context.location); } +#line 18943 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy561: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'a': goto yy618; + case 'i': goto yy618; default: goto yy49; } yy562: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'x': goto yy619; + case 'a': goto yy619; default: goto yy49; } yy563: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy620; + case 'x': goto yy620; default: goto yy49; } yy564: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case '-': goto yy621; + case 'S': goto yy621; default: goto yy49; } yy565: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy622; + case '-': goto yy622; default: goto yy49; } yy566: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'C': goto yy623; + case 'I': goto yy623; default: goto yy49; } yy567: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'g': goto yy625; + case 'C': goto yy624; default: goto yy49; } yy568: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'R': goto yy627; + case 'g': goto yy626; default: goto yy49; } yy569: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy629; + case 'R': goto yy628; default: goto yy49; } yy570: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy631; + case 'T': goto yy630; default: goto yy49; } yy571: @@ -18779,17 +19021,24 @@ namespace yy { yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy633; + case 'N': goto yy633; default: goto yy49; } yy573: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'O': goto yy635; + case 'E': goto yy634; default: goto yy49; } yy574: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'O': goto yy636; + default: goto yy49; + } +yy575: yyaccept = 49; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -18857,13 +19106,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy575; + default: goto yy576; } -yy575: -#line 11322 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_DURATION (context.location); } -#line 18866 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy576: +#line 11570 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_DURATION (context.location); } +#line 19115 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy577: yyaccept = 50; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -18931,27 +19180,27 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy577; + default: goto yy578; } -yy577: -#line 11323 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_EMBEDDED (context.location); } -#line 18940 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy578: +#line 11571 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_EMBEDDED (context.location); } +#line 19189 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy579: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case '_': goto yy636; + case '_': goto yy637; default: goto yy49; } -yy579: +yy580: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy637; + case 'E': goto yy638; default: goto yy49; } -yy580: +yy581: yyaccept = 51; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -19019,20 +19268,20 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy581; + default: goto yy582; } -yy581: -#line 11329 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_EXPLICIT (context.location); } -#line 19028 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy582: +#line 11577 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_EXPLICIT (context.location); } +#line 19277 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy583: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy638; + case 'I': goto yy639; default: goto yy49; } -yy583: +yy584: yyaccept = 52; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -19100,48 +19349,48 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy584; + default: goto yy585; } -yy584: -#line 11332 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_EXTERNAL (context.location); } -#line 19109 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy585: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 't': goto yy639; - default: goto yy49; - } +#line 11580 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_EXTERNAL (context.location); } +#line 19358 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy586: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'z': goto yy640; + case 't': goto yy640; default: goto yy49; } yy587: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 't': goto yy641; + case 'z': goto yy641; default: goto yy49; } yy588: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'g': goto yy642; + case 't': goto yy642; default: goto yy49; } yy589: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy644; + case 'g': goto yy643; default: goto yy49; } yy590: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'E': goto yy645; + default: goto yy49; + } +yy591: yyaccept = 53; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -19209,13 +19458,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy591; + default: goto yy592; } -yy591: -#line 11340 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_IMPLICIT (context.location); } -#line 19218 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy592: +#line 11588 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_IMPLICIT (context.location); } +#line 19467 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy593: yyaccept = 54; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -19283,13 +19532,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy593; + default: goto yy594; } -yy593: -#line 11343 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_INCLUDES (context.location); } -#line 19292 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy594: +#line 11591 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_INCLUDES (context.location); } +#line 19541 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy595: yyaccept = 55; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -19357,55 +19606,55 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy595; + default: goto yy596; } -yy595: -#line 11344 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_INSTANCE (context.location); } -#line 19366 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy596: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'I': goto yy645; - default: goto yy49; - } +#line 11592 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_INSTANCE (context.location); } +#line 19615 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy597: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy646; + case 'I': goto yy646; default: goto yy49; } yy598: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'r': goto yy647; + case 'T': goto yy647; default: goto yy49; } yy599: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'F': goto yy648; + case 'r': goto yy648; default: goto yy49; } yy600: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'M': goto yy649; + case 'F': goto yy649; default: goto yy49; } yy601: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 't': goto yy650; + case 'M': goto yy650; default: goto yy49; } yy602: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 't': goto yy651; + default: goto yy49; + } +yy603: yyaccept = 56; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -19473,41 +19722,41 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy603; + default: goto yy604; } -yy603: -#line 11360 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_OPTIONAL (context.location); } -#line 19482 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy604: +#line 11608 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_OPTIONAL (context.location); } +#line 19731 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy605: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 's': goto yy651; + case 's': goto yy652; default: goto yy49; } -yy605: +yy606: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy652; + case 'I': goto yy653; default: goto yy49; } -yy606: +yy607: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'e': goto yy653; + case 'e': goto yy654; default: goto yy49; } -yy607: +yy608: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case '-': goto yy654; + case '-': goto yy655; default: goto yy49; } -yy608: +yy609: yyaccept = 57; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -19575,13 +19824,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy609; + default: goto yy610; } -yy609: -#line 11370 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_SEQUENCE (context.location); } -#line 19584 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy610: +#line 11618 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_SEQUENCE (context.location); } +#line 19833 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy611: yyaccept = 58; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -19649,20 +19898,20 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy611; + default: goto yy612; } -yy611: -#line 11372 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_SETTINGS (context.location); } -#line 19658 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy612: +#line 11620 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_SETTINGS (context.location); } +#line 19907 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy613: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'g': goto yy655; + case 'g': goto yy656; default: goto yy49; } -yy613: +yy614: yych = *++context.cursor; switch (yych) { case '0': @@ -19727,59 +19976,59 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - case 'D': goto yy657; + case 'D': goto yy658; default: goto yy101; } -yy614: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'N': goto yy658; - default: goto yy49; - } yy615: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 't': goto yy659; + case 'N': goto yy659; default: goto yy49; } yy616: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'L': goto yy660; + case 't': goto yy660; default: goto yy49; } yy617: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'n': goto yy662; + case 'L': goto yy661; default: goto yy49; } yy618: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'l': goto yy663; + case 'n': goto yy663; default: goto yy49; } yy619: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy664; + case 'l': goto yy664; default: goto yy49; } yy620: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 't': goto yy665; + case 'S': goto yy665; default: goto yy49; } yy621: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 't': goto yy666; + default: goto yy49; + } +yy622: yych = *++context.cursor; switch (yych) { case '0': @@ -19844,17 +20093,17 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - case 'S': goto yy666; + case 'S': goto yy667; default: goto yy101; } -yy622: +yy623: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'O': goto yy667; + case 'O': goto yy668; default: goto yy49; } -yy623: +yy624: yyaccept = 59; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -19922,13 +20171,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy624; + default: goto yy625; } -yy624: -#line 11305 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_AUTOMATIC (context.location); } -#line 19931 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy625: +#line 11553 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_AUTOMATIC (context.location); } +#line 20180 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy626: yyaccept = 60; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -19996,13 +20245,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy626; + default: goto yy627; } -yy626: -#line 11308 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_BMPString (context.location); } -#line 20005 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy627: +#line 11556 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_BMPString (context.location); } +#line 20254 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy628: yyaccept = 61; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -20070,13 +20319,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy628; + default: goto yy629; } -yy628: -#line 11311 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_CHARACTER (context.location); } -#line 20079 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy629: +#line 11559 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_CHARACTER (context.location); } +#line 20328 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy630: yyaccept = 62; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -20143,28 +20392,28 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - case 'S': goto yy668; - default: goto yy630; + case 'S': goto yy669; + default: goto yy631; } -yy630: -#line 11314 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_COMPONENT (context.location); } -#line 20153 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy631: +#line 11562 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_COMPONENT (context.location); } +#line 20402 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy632: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy670; + case 'E': goto yy671; default: goto yy49; } -yy632: +yy633: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'G': goto yy671; + case 'G': goto yy672; default: goto yy49; } -yy633: +yy634: yyaccept = 63; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -20232,62 +20481,62 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy634; + default: goto yy635; } -yy634: -#line 11319 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_DATE_TIME (context.location); } -#line 20241 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy635: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'N': goto yy673; - default: goto yy49; - } +#line 11567 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_DATE_TIME (context.location); } +#line 20490 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy636: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'C': goto yy674; + case 'N': goto yy674; default: goto yy49; } yy637: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'D': goto yy675; + case 'C': goto yy675; default: goto yy49; } yy638: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'L': goto yy677; + case 'D': goto yy676; default: goto yy49; } yy639: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'r': goto yy678; + case 'L': goto yy678; default: goto yy49; } yy640: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'e': goto yy679; + case 'r': goto yy679; default: goto yy49; } yy641: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'r': goto yy680; + case 'e': goto yy680; default: goto yy49; } yy642: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'r': goto yy681; + default: goto yy49; + } +yy643: yyaccept = 64; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -20355,83 +20604,83 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy643; + default: goto yy644; } -yy643: -#line 11338 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_IA5String (context.location); } -#line 20364 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy644: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'R': goto yy681; - default: goto yy49; - } +#line 11586 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_IA5String (context.location); } +#line 20613 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy645: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'O': goto yy683; + case 'R': goto yy682; default: goto yy49; } yy646: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy684; + case 'O': goto yy684; default: goto yy49; } yy647: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy685; + case 'I': goto yy685; default: goto yy49; } yy648: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy686; + case 'i': goto yy686; default: goto yy49; } yy649: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'B': goto yy687; + case 'I': goto yy687; default: goto yy49; } yy650: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'r': goto yy688; + case 'B': goto yy688; default: goto yy49; } yy651: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'c': goto yy689; + case 'r': goto yy689; default: goto yy49; } yy652: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy690; + case 'c': goto yy690; default: goto yy49; } yy653: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy691; + case 'N': goto yy691; default: goto yy49; } yy654: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'S': goto yy692; + default: goto yy49; + } +yy655: yych = *++context.cursor; switch (yych) { case '0': @@ -20496,10 +20745,10 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - case 'O': goto yy692; + case 'O': goto yy693; default: goto yy101; } -yy655: +yy656: yyaccept = 65; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -20567,34 +20816,34 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy656; - } -yy656: -#line 11376 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_T61String (context.location); } -#line 20576 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" + default: goto yy657; + } yy657: +#line 11624 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_T61String (context.location); } +#line 20825 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy658: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy693; + case 'A': goto yy694; default: goto yy49; } -yy658: +yy659: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy694; + case 'T': goto yy695; default: goto yy49; } -yy659: +yy660: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'r': goto yy695; + case 'r': goto yy696; default: goto yy49; } -yy660: +yy661: yyaccept = 66; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -20662,55 +20911,55 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy661; + default: goto yy662; } -yy661: -#line 11385 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_UNIVERSAL (context.location); } -#line 20671 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy662: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'g': goto yy696; - default: goto yy49; - } +#line 11633 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_UNIVERSAL (context.location); } +#line 20920 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy663: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy698; + case 'g': goto yy697; default: goto yy49; } yy664: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 't': goto yy699; + case 'S': goto yy699; default: goto yy49; } yy665: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'r': goto yy700; + case 't': goto yy700; default: goto yy49; } yy666: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'Y': goto yy701; + case 'r': goto yy701; default: goto yy49; } yy667: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy702; + case 'Y': goto yy702; default: goto yy49; } yy668: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'N': goto yy703; + default: goto yy49; + } +yy669: yyaccept = 67; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -20778,20 +21027,20 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy669; + default: goto yy670; } -yy669: -#line 11315 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_COMPONENTS (context.location); } -#line 20787 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy670: +#line 11563 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_COMPONENTS (context.location); } +#line 21036 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy671: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'D': goto yy704; + case 'D': goto yy705; default: goto yy49; } -yy671: +yy672: yyaccept = 68; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -20859,27 +21108,27 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy672; + default: goto yy673; } -yy672: -#line 11317 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_CONTAINING (context.location); } -#line 20868 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy673: +#line 11565 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_CONTAINING (context.location); } +#line 21117 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy674: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy706; + case 'S': goto yy707; default: goto yy49; } -yy674: +yy675: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'O': goto yy708; + case 'O': goto yy709; default: goto yy49; } -yy675: +yy676: yyaccept = 69; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -20947,41 +21196,41 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy676; + default: goto yy677; } -yy676: -#line 11327 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_ENUMERATED (context.location); } -#line 20956 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy677: +#line 11575 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_ENUMERATED (context.location); } +#line 21205 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy678: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy709; + case 'I': goto yy710; default: goto yy49; } -yy678: +yy679: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy710; + case 'i': goto yy711; default: goto yy49; } -yy679: +yy680: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'd': goto yy711; + case 'd': goto yy712; default: goto yy49; } -yy680: +yy681: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy712; + case 'i': goto yy713; default: goto yy49; } -yy681: +yy682: yyaccept = 70; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -21049,104 +21298,104 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy682; + default: goto yy683; } -yy682: -#line 11339 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_IDENTIFIER (context.location); } -#line 21058 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy683: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'N': goto yy713; - default: goto yy49; - } +#line 11587 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_IDENTIFIER (context.location); } +#line 21307 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy684: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'O': goto yy714; + case 'N': goto yy714; default: goto yy49; } yy685: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'n': goto yy715; + case 'O': goto yy715; default: goto yy49; } yy686: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy716; + case 'n': goto yy716; default: goto yy49; } yy687: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy717; + case 'N': goto yy717; default: goto yy49; } yy688: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy718; + case 'E': goto yy718; default: goto yy49; } yy689: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'r': goto yy719; + case 'i': goto yy719; default: goto yy49; } yy690: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy720; + case 'r': goto yy720; default: goto yy49; } yy691: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 't': goto yy721; + case 'I': goto yy721; default: goto yy49; } yy692: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy722; + case 't': goto yy722; default: goto yy49; } yy693: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'Y': goto yy723; + case 'I': goto yy723; default: goto yy49; } yy694: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy725; + case 'Y': goto yy724; default: goto yy49; } yy695: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy726; + case 'I': goto yy726; default: goto yy49; } yy696: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'i': goto yy727; + default: goto yy49; + } +yy697: yyaccept = 71; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -21214,41 +21463,41 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy697; + default: goto yy698; } -yy697: -#line 11388 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_UTF8String (context.location); } -#line 21223 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy698: +#line 11636 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_UTF8String (context.location); } +#line 21472 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy699: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 't': goto yy727; + case 't': goto yy728; default: goto yy49; } -yy699: +yy700: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'r': goto yy728; + case 'r': goto yy729; default: goto yy49; } -yy700: +yy701: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy729; + case 'i': goto yy730; default: goto yy49; } -yy701: +yy702: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy730; + case 'N': goto yy731; default: goto yy49; } -yy702: +yy703: yyaccept = 72; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -21316,13 +21565,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy703; + default: goto yy704; } -yy703: -#line 11304 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_APPLICATION (context.location); } -#line 21325 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy704: +#line 11552 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_APPLICATION (context.location); } +#line 21574 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy705: yyaccept = 73; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -21390,13 +21639,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy705; + default: goto yy706; } -yy705: -#line 11316 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_CONSTRAINED (context.location); } -#line 21399 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy706: +#line 11564 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_CONSTRAINED (context.location); } +#line 21648 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy707: yyaccept = 74; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -21464,118 +21713,118 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy707; + default: goto yy708; } -yy707: -#line 11321 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_DEFINITIONS (context.location); } -#line 21473 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy708: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'N': goto yy731; - default: goto yy49; - } +#line 11569 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_DEFINITIONS (context.location); } +#line 21722 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy709: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy732; + case 'N': goto yy732; default: goto yy49; } yy710: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'n': goto yy733; + case 'T': goto yy733; default: goto yy49; } yy711: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy734; + case 'n': goto yy734; default: goto yy49; } yy712: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'n': goto yy735; + case 'T': goto yy735; default: goto yy49; } yy713: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'S': goto yy736; + case 'n': goto yy736; default: goto yy49; } yy714: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'N': goto yy738; + case 'S': goto yy737; default: goto yy49; } yy715: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'g': goto yy740; + case 'N': goto yy739; default: goto yy49; } yy716: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy742; + case 'g': goto yy741; default: goto yy49; } yy717: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'R': goto yy743; + case 'I': goto yy743; default: goto yy49; } yy718: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'n': goto yy745; + case 'R': goto yy744; default: goto yy49; } yy719: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy746; + case 'n': goto yy746; default: goto yy49; } yy720: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy747; + case 'i': goto yy747; default: goto yy49; } yy721: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'r': goto yy748; + case 'T': goto yy748; default: goto yy49; } yy722: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'D': goto yy749; + case 'r': goto yy749; default: goto yy49; } yy723: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'D': goto yy750; + default: goto yy49; + } +yy724: yyaccept = 75; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -21643,52 +21892,45 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy724; + default: goto yy725; } -yy724: -#line 11380 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_TIME_OF_DAY (context.location); } -#line 21652 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy725: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'F': goto yy751; - default: goto yy49; - } +#line 11628 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_TIME_OF_DAY (context.location); } +#line 21901 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy726: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'n': goto yy752; + case 'F': goto yy752; default: goto yy49; } yy727: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'r': goto yy753; + case 'n': goto yy753; default: goto yy49; } yy728: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy754; + case 'r': goto yy754; default: goto yy49; } yy729: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'n': goto yy755; + case 'i': goto yy755; default: goto yy49; } yy730: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy756; + case 'n': goto yy756; default: goto yy49; } yy731: @@ -21702,31 +21944,38 @@ namespace yy { yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'Y': goto yy758; + case 'T': goto yy758; default: goto yy49; } yy733: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'g': goto yy760; + case 'Y': goto yy759; default: goto yy49; } yy734: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy762; + case 'g': goto yy761; default: goto yy49; } yy735: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'g': goto yy763; + case 'i': goto yy763; default: goto yy49; } yy736: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'g': goto yy764; + default: goto yy49; + } +yy737: yyaccept = 76; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -21794,13 +22043,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy737; + default: goto yy738; } -yy737: -#line 11345 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_INSTRUCTIONS (context.location); } -#line 21803 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy738: +#line 11593 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_INSTRUCTIONS (context.location); } +#line 22052 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy739: yyaccept = 77; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -21868,13 +22117,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy739; + default: goto yy740; } -yy739: -#line 11347 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_INTERSECTION (context.location); } -#line 21877 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy740: +#line 11595 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_INTERSECTION (context.location); } +#line 22126 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy741: yyaccept = 78; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -21942,20 +22191,20 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy741; + default: goto yy742; } -yy741: -#line 11348 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_ISO646String (context.location); } -#line 21951 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy742: +#line 11596 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_ISO646String (context.location); } +#line 22200 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy743: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'T': goto yy765; + case 'T': goto yy766; default: goto yy49; } -yy743: +yy744: yyaccept = 79; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -22023,45 +22272,45 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy744; + default: goto yy745; } -yy744: -#line 11352 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_NOT_A_NUMBER (context.location); } -#line 22032 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy745: +#line 11600 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_NOT_A_NUMBER (context.location); } +#line 22281 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy746: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'g': goto yy766; + case 'g': goto yy767; default: goto yy49; } -yy746: +yy747: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'p': goto yy768; + case 'p': goto yy769; default: goto yy49; } -yy747: +yy748: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'Y': goto yy769; + case 'Y': goto yy770; default: goto yy49; } -yy748: +yy749: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy771; + case 'i': goto yy772; default: goto yy49; } -yy749: +yy750: yyaccept = 80; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case '-': goto yy772; + case '-': goto yy773; case '0': case '1': case '2': @@ -22125,62 +22374,62 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy750; + default: goto yy751; } -yy750: -#line 11368 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_RELATIVE_OID (context.location); } -#line 22134 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy751: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'I': goto yy773; - default: goto yy49; - } +#line 11616 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_RELATIVE_OID (context.location); } +#line 22383 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy752: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'g': goto yy774; + case 'I': goto yy774; default: goto yy49; } yy753: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'i': goto yy776; + case 'g': goto yy775; default: goto yy49; } yy754: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'n': goto yy777; + case 'i': goto yy777; default: goto yy49; } yy755: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'g': goto yy778; + case 'n': goto yy778; default: goto yy49; } yy756: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'A': goto yy780; + case 'g': goto yy779; default: goto yy49; } yy757: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'R': goto yy781; + case 'A': goto yy781; default: goto yy49; } yy758: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'R': goto yy782; + default: goto yy49; + } +yy759: yyaccept = 81; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -22248,13 +22497,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy759; + default: goto yy760; } -yy759: -#line 11331 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_EXTENSIBILITY (context.location); } -#line 22257 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy760: +#line 11579 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_EXTENSIBILITY (context.location); } +#line 22506 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy761: yyaccept = 82; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -22322,20 +22571,20 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy761; + default: goto yy762; } -yy761: -#line 11336 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_GeneralString (context.location); } -#line 22331 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy762: +#line 11584 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_GeneralString (context.location); } +#line 22580 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy763: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'm': goto yy782; + case 'm': goto yy783; default: goto yy49; } -yy763: +yy764: yyaccept = 83; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -22403,20 +22652,20 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy764; + default: goto yy765; } -yy764: -#line 11337 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_GraphicString (context.location); } -#line 22412 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy765: +#line 11585 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_GraphicString (context.location); } +#line 22661 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy766: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'Y': goto yy783; + case 'Y': goto yy784; default: goto yy49; } -yy766: +yy767: yyaccept = 84; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -22484,20 +22733,20 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy767; + default: goto yy768; } -yy767: -#line 11354 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_NumericString (context.location); } -#line 22493 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy768: +#line 11602 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_NumericString (context.location); } +#line 22742 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy769: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 't': goto yy785; + case 't': goto yy786; default: goto yy49; } -yy769: +yy770: yyaccept = 85; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -22565,20 +22814,20 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy770; + default: goto yy771; } -yy770: -#line 11363 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_PLUS_INFINITY (context.location); } -#line 22574 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy771: +#line 11611 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_PLUS_INFINITY (context.location); } +#line 22823 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy772: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'n': goto yy786; + case 'n': goto yy787; default: goto yy49; } -yy772: +yy773: yych = *++context.cursor; switch (yych) { case '0': @@ -22643,17 +22892,17 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - case 'I': goto yy787; + case 'I': goto yy788; default: goto yy101; } -yy773: +yy774: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'E': goto yy788; + case 'E': goto yy789; default: goto yy49; } -yy774: +yy775: yyaccept = 86; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -22721,27 +22970,27 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy775; + default: goto yy776; } -yy775: -#line 11378 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_TeletexString (context.location); } -#line 22730 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy776: +#line 11626 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_TeletexString (context.location); } +#line 22979 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy777: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'n': goto yy789; + case 'n': goto yy790; default: goto yy49; } -yy777: +yy778: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'g': goto yy790; + case 'g': goto yy791; default: goto yy49; } -yy778: +yy779: yyaccept = 87; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -22809,34 +23058,34 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy779; + default: goto yy780; } -yy779: -#line 11390 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_VisibleString (context.location); } -#line 22818 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy780: +#line 11638 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_VisibleString (context.location); } +#line 23067 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy781: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'X': goto yy792; + case 'X': goto yy793; default: goto yy49; } -yy781: +yy782: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'O': goto yy794; + case 'O': goto yy795; default: goto yy49; } -yy782: +yy783: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'e': goto yy795; + case 'e': goto yy796; default: goto yy49; } -yy783: +yy784: yyaccept = 88; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -22904,31 +23153,24 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy784; + default: goto yy785; } -yy784: -#line 11351 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_MINUS_INFINITY (context.location); } -#line 22913 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy785: - yyaccept = 2; - yych = *(YYMARKER = ++context.cursor); - switch (yych) { - case 'o': goto yy797; - default: goto yy49; - } +#line 11599 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_MINUS_INFINITY (context.location); } +#line 23162 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" yy786: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'g': goto yy798; + case 'o': goto yy798; default: goto yy49; } yy787: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'R': goto yy800; + case 'g': goto yy799; default: goto yy49; } yy788: @@ -22942,10 +23184,17 @@ namespace yy { yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'g': goto yy803; + case 'R': goto yy802; default: goto yy49; } yy790: + yyaccept = 2; + yych = *(YYMARKER = ++context.cursor); + switch (yych) { + case 'g': goto yy804; + default: goto yy49; + } +yy791: yyaccept = 89; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -23013,13 +23262,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy791; + default: goto yy792; } -yy791: -#line 11389 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_VideotexString (context.location); } -#line 23022 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy792: +#line 11637 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_VideotexString (context.location); } +#line 23271 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy793: yyaccept = 90; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -23087,20 +23336,20 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy793; + default: goto yy794; } -yy793: -#line 11301 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_ABSTRACT_SYNTAX (context.location); } -#line 23096 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy794: +#line 11549 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_ABSTRACT_SYNTAX (context.location); } +#line 23345 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy795: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'L': goto yy805; + case 'L': goto yy806; default: goto yy49; } -yy795: +yy796: yyaccept = 91; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -23168,20 +23417,20 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy796; + default: goto yy797; } -yy796: -#line 11335 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_GeneralizedTime (context.location); } -#line 23177 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy797: +#line 11583 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_GeneralizedTime (context.location); } +#line 23426 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy798: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'r': goto yy807; + case 'r': goto yy808; default: goto yy49; } -yy798: +yy799: yyaccept = 92; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -23249,20 +23498,20 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy799; + default: goto yy800; } -yy799: -#line 11365 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_PrintableString (context.location); } -#line 23258 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy800: +#line 11613 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_PrintableString (context.location); } +#line 23507 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy801: yyaccept = 2; yych = *(YYMARKER = ++context.cursor); switch (yych) { - case 'I': goto yy809; + case 'I': goto yy810; default: goto yy49; } -yy801: +yy802: yyaccept = 93; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -23330,13 +23579,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy802; + default: goto yy803; } -yy802: -#line 11382 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_TYPE_IDENTIFIER (context.location); } -#line 23339 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy803: +#line 11630 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_TYPE_IDENTIFIER (context.location); } +#line 23588 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy804: yyaccept = 94; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -23404,13 +23653,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy804; + default: goto yy805; } -yy804: -#line 11386 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_UniversalString (context.location); } -#line 23413 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy805: +#line 11634 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_UniversalString (context.location); } +#line 23662 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy806: yyaccept = 95; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -23478,13 +23727,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy806; + default: goto yy807; } -yy806: -#line 11325 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_ENCODING_CONTROL (context.location); } -#line 23487 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy807: +#line 11573 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_ENCODING_CONTROL (context.location); } +#line 23736 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy808: yyaccept = 96; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -23552,13 +23801,13 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy808; + default: goto yy809; } -yy808: -#line 11356 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" - { context.location.columns(context.cursor - start); return asn1_parser::make_ObjectDescriptor (context.location); } -#line 23561 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" yy809: +#line 11604 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" + { context.location.columns(context.cursor - start); return asn1_parser::make_ObjectDescriptor (context.location); } +#line 23810 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" +yy810: yyaccept = 97; yych = *(YYMARKER = ++context.cursor); switch (yych) { @@ -23626,14 +23875,14 @@ namespace yy { case 'x': case 'y': case 'z': goto yy48; - default: goto yy810; + default: goto yy811; } -yy810: -#line 11369 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +yy811: +#line 11617 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" { context.location.columns(context.cursor - start); return asn1_parser::make_RELATIVE_OID_IRI (context.location); } -#line 23635 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.hpp" +#line 23884 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.hpp" } -#line 11445 "/home/styler/git/fast_ber/build/src/autogen/asn_compiler.re" +#line 11692 "/home/styler/git/fast_ber/build_debug/src/autogen/asn_compiler.re" } } diff --git a/include/fast_ber/compiler/CompilerTypes.hpp b/src/compiler/include/fast_ber/compiler/CompilerTypes.hpp similarity index 64% rename from include/fast_ber/compiler/CompilerTypes.hpp rename to src/compiler/include/fast_ber/compiler/CompilerTypes.hpp index 8cf40dbd..5282620d 100644 --- a/include/fast_ber/compiler/CompilerTypes.hpp +++ b/src/compiler/include/fast_ber/compiler/CompilerTypes.hpp @@ -7,6 +7,7 @@ #include "absl/types/variant.h" #include +#include #include #include #include @@ -33,7 +34,15 @@ enum class Class private_, }; +enum class StorageMode +{ + static_, + small_buffer_optimised, + dynamic, +}; + std::string to_string(Class class_, bool abbreviated); +std::string to_string(StorageMode mode); struct ComponentType; struct TaggedType; @@ -60,6 +69,111 @@ struct BitStringType struct BooleanType { }; + +enum class UniversalTag +{ + reserved = 0, + boolean = 1, + integer = 2, + bit_string = 3, + octet_string = 4, + null = 5, + object_identifier = 6, + object_descriptor = 7, + instance_of = 8, + external = 8, + real = 9, + enumerated = 10, + embedded_pdv = 11, + utf8_string = 12, + relative_oid = 13, + sequence = 16, + sequence_of = 16, + set = 17, + set_of = 17, + numeric_string = 18, + printable_string = 19, + teletex_string = 20, + t61_string = 20, + videotex_string = 21, + ia5_string = 22, + utc_time = 23, + generalized_time = 24, + graphic_string = 25, + visible_string = 26, + iso646_string = 26, + general_string = 27, + universal_string = 28, + character_string = 29, + bmp_string = 30 +}; + +inline std::string to_string(UniversalTag t) noexcept +{ + switch (t) + { + case UniversalTag::reserved: + return "reserved"; + case UniversalTag::boolean: + return "boolean"; + case UniversalTag::integer: + return "integer"; + case UniversalTag::bit_string: + return "bit_string"; + case UniversalTag::octet_string: + return "octet_string"; + case UniversalTag::null: + return "null"; + case UniversalTag::object_identifier: + return "object_identifier"; + case UniversalTag::object_descriptor: + return "object_descriptor"; + case UniversalTag::instance_of: + return "instance_of"; + case UniversalTag::real: + return "real"; + case UniversalTag::enumerated: + return "enumerated"; + case UniversalTag::embedded_pdv: + return "embedded_pdv"; + case UniversalTag::utf8_string: + return "utf8_string"; + case UniversalTag::relative_oid: + return "relative_oid"; + case UniversalTag::sequence: + return "sequence"; + case UniversalTag::set: + return "set"; + case UniversalTag::numeric_string: + return "numeric_string"; + case UniversalTag::printable_string: + return "printable_string"; + case UniversalTag::teletex_string: + return "teletex_string"; + case UniversalTag::videotex_string: + return "videotex_string"; + case UniversalTag::ia5_string: + return "ia5_string"; + case UniversalTag::utc_time: + return "utc_time"; + case UniversalTag::generalized_time: + return "generalized_time"; + case UniversalTag::graphic_string: + return "graphic_string"; + case UniversalTag::visible_string: + return "visible_string"; + case UniversalTag::general_string: + return "general_string"; + case UniversalTag::universal_string: + return "universal_string"; + case UniversalTag::character_string: + return "character_string"; + case UniversalTag::bmp_string: + return "bmp_string"; + } + return "Unknown Universal Tag"; +} + enum class CharacterStringType { unknown, @@ -100,7 +214,7 @@ inline std::string to_string(CharacterStringType type) case CharacterStringType::teletex_string: return "TeletexString"; case CharacterStringType::t61_string: - return "T61String"; + return "T161String"; case CharacterStringType::universal_string: return "UniversalString"; case CharacterStringType::utf8_string: @@ -116,42 +230,42 @@ inline std::string to_string(CharacterStringType type) } return "UnknownStringType"; } -inline std::string to_string_snake_case(CharacterStringType type) +inline UniversalTag universal_tag(CharacterStringType type) { switch (type) { case CharacterStringType::bmp_string: - return "bmp_string"; + return UniversalTag::bmp_string; case CharacterStringType::general_string: - return "general_string"; + return UniversalTag::general_string; case CharacterStringType::graphic_string: - return "graphic_string"; + return UniversalTag::graphic_string; case CharacterStringType::ia5_string: - return "ia5_string"; + return UniversalTag::ia5_string; case CharacterStringType::iso646_string: - return "iso646_string"; + return UniversalTag::iso646_string; case CharacterStringType::numeric_string: - return "numeric_string"; + return UniversalTag::numeric_string; case CharacterStringType::printable_string: - return "printable_string"; + return UniversalTag::printable_string; case CharacterStringType::teletex_string: - return "teletex_string"; + return UniversalTag::teletex_string; case CharacterStringType::t61_string: - return "t61_string"; + return UniversalTag::t61_string; case CharacterStringType::universal_string: - return "universal_string"; + return UniversalTag::universal_string; case CharacterStringType::utf8_string: - return "utf8_string"; + return UniversalTag::utf8_string; case CharacterStringType::videotex_string: - return "videotex_string"; + return UniversalTag::videotex_string; case CharacterStringType::visible_string: - return "visible_string"; + return UniversalTag::visible_string; case CharacterStringType::character_string: - return "character_string"; + return UniversalTag::character_string; case CharacterStringType::unknown: - return "unknown"; + return UniversalTag::reserved; } - return "UnknownStringType"; + return UniversalTag::reserved; } struct ChoiceType; @@ -274,6 +388,7 @@ struct SequenceOfType bool has_name; std::unique_ptr named_type; std::unique_ptr type; + StorageMode storage = StorageMode::small_buffer_optimised; SequenceOfType() = default; SequenceOfType(bool, std::unique_ptr&&, std::unique_ptr&&); @@ -286,6 +401,7 @@ struct SetOfType bool has_name; std::unique_ptr named_type; std::unique_ptr type; + StorageMode storage = StorageMode::small_buffer_optimised; SetOfType() = default; SetOfType(bool, std::unique_ptr&&, std::unique_ptr&&); @@ -296,6 +412,7 @@ struct SetOfType struct ChoiceType { std::vector choices; + StorageMode storage; }; struct DefinedValue @@ -324,10 +441,24 @@ struct CharStringValue std::string value; }; +struct BooleanValue +{ + bool value; +}; + +struct NullValue +{ +}; + +struct TimeValue +{ + std::string time; +}; + struct Value { absl::variant, int64_t, std::string, NamedNumber, BitStringValue, HexStringValue, - CharStringValue, DefinedValue> + CharStringValue, DefinedValue, BooleanValue, NullValue, TimeValue, double> value_selection; }; @@ -347,8 +478,9 @@ struct ComponentType { NamedType named_type; bool is_optional; - absl::optional value; + absl::optional default_value; absl::optional components_of; + StorageMode optional_storage; }; struct Tag @@ -405,18 +537,35 @@ struct Parameter std::string reference; }; +struct Dependency +{ + std::string name; + absl::optional module_reference; + + template + friend H AbslHashValue(H h, const Dependency& d) + { + return H::combine(std::move(h), d.name, d.module_reference); + } + bool operator==(const Dependency& rhs) const + { + return name == rhs.name && module_reference == rhs.module_reference; + } +}; + struct Assignment { std::string name; absl::variant specific; - std::vector depends_on; + std::vector depends_on; std::vector parameters; }; struct Import { std::string module_reference; - std::vector imports; + std::vector imported_types; + std::vector imported_values; }; struct Export @@ -435,33 +584,87 @@ struct Module struct Asn1Tree { std::vector modules; - bool is_circular = false; }; struct Identifier { - Class class_; - int64_t tag_number; + Class class_ = Class::universal; + int64_t tag_number = 0; + UniversalTag universal = UniversalTag::reserved; + + Identifier() = default; + explicit Identifier(Class c, int64_t tag) : class_(c), tag_number(tag) {} + explicit Identifier(UniversalTag tag) : class_(Class::universal), tag_number(0), universal(tag) {} + + std::string name() const + { + if (universal == UniversalTag::reserved) + { + return "Id<" + to_string(class_, true) + ", " + std::to_string(tag_number) + ">"; + } + else + { + return "ExplicitId"; + } + } - std::string name() const { return "Id<" + to_string(class_, true) + ", " + std::to_string(tag_number) + ">"; } + template + friend H AbslHashValue(H h, const Identifier& i) + { + return H::combine(std::move(h), i.class_, i.tag_number, i.universal); + } + bool operator==(const Identifier& rhs) const + { + return class_ == rhs.class_ && tag_number == rhs.tag_number && universal == rhs.universal; + } }; struct TaggingInfo { absl::optional outer_tag; - std::string inner_tag; + Identifier inner_tag; + std::vector choice_ids; bool is_default_tagged; std::string name() const { - if (!outer_tag) + if (outer_tag) { - return inner_tag; + return "DoubleId<" + outer_tag->name() + ", " + inner_tag.name() + ">"; + } + if (choice_ids.size() > 0) + { + std::string res = "ChoiceId<"; + bool is_first = true; + for (const Identifier& id : choice_ids) + { + if (!is_first) + { + res += ", "; + } + + res += id.name(); + is_first = false; + } + return res + ">"; } else { - return "DoubleId<" + outer_tag->name() + ", " + inner_tag + ">"; + return inner_tag.name(); + } + } + + std::vector outer_tags() const + { + if (outer_tag) + { + return {*outer_tag}; + } + if (choice_ids.size() > 0) + { + return choice_ids; } + return {inner_tag}; } }; @@ -516,7 +719,7 @@ struct ObjectIdComponents // Rename any names which are reserved in C++ std::string santize_name(const std::string& name); -std::string make_type_optional(const std::string& type, const Asn1Tree& tree); +std::string make_type_optional(const std::string& type, StorageMode mode); bool is_bit_string(const Type& type); bool is_set(const Type& type); @@ -527,6 +730,8 @@ bool is_enumerated(const Type& type); bool is_choice(const Type& type); bool is_prefixed(const Type& type); bool is_integer(const Type& type); +bool is_octet_string(const Type& type); +bool is_boolean(const Type& type); bool is_oid(const Type& type); bool is_defined(const Type& type); diff --git a/include/fast_ber/compiler/CppGeneration.hpp b/src/compiler/include/fast_ber/compiler/CppGeneration.hpp similarity index 100% rename from include/fast_ber/compiler/CppGeneration.hpp rename to src/compiler/include/fast_ber/compiler/CppGeneration.hpp diff --git a/src/compiler/include/fast_ber/compiler/Dependencies.hpp b/src/compiler/include/fast_ber/compiler/Dependencies.hpp new file mode 100644 index 00000000..8fda971c --- /dev/null +++ b/src/compiler/include/fast_ber/compiler/Dependencies.hpp @@ -0,0 +1,47 @@ +#pragma once + +#include "fast_ber/compiler/CompilerTypes.hpp" + +#include "absl/container/flat_hash_set.h" + +std::vector depends_on(const AnyType&); +std::vector depends_on(const BitStringType&); +std::vector depends_on(const BooleanType&); +std::vector depends_on(const CharacterStringType&); +std::vector depends_on(const ChoiceType); +std::vector depends_on(const DateType&); +std::vector depends_on(const DateTimeType&); +std::vector depends_on(const DurationType&); +std::vector depends_on(const EmbeddedPDVType&); +std::vector depends_on(const EnumeratedType&); +std::vector depends_on(const ExternalType&); +std::vector depends_on(const GeneralizedTimeType&); +std::vector depends_on(const InstanceOfType&); +std::vector depends_on(const IntegerType&); +std::vector depends_on(const IRIType&); +std::vector depends_on(const NullType&); +std::vector depends_on(const ObjectClassFieldType&); +std::vector depends_on(const ObjectDescriptorType&); +std::vector depends_on(const ObjectIdentifierType&); +std::vector depends_on(const OctetStringType&); +std::vector depends_on(const RealType&); +std::vector depends_on(const RelativeIRIType&); +std::vector depends_on(const RelativeOIDType&); +std::vector depends_on(const SequenceType& sequence); +std::vector depends_on(const SequenceOfType& sequence); +std::vector depends_on(const SetType& set); +std::vector depends_on(const SetOfType& set); +std::vector depends_on(const PrefixedType&); +std::vector depends_on(const TimeType&); +std::vector depends_on(const TimeOfDayType&); +std::vector depends_on(const UTCTimeType&); +std::vector depends_on(const DefinedType&); +std::vector depends_on(const BuiltinType& type); +std::vector depends_on(const Type& type); + +std::vector dependencies(const Type& type); +std::vector dependencies(const Assignment& assignment); + +void get_dependencies_recursive(const std::string& type_name, const std::string& module_name, + const std::unordered_map& assignment_map, + absl::flat_hash_set& depends); diff --git a/src/compiler/include/fast_ber/compiler/Identifier.hpp b/src/compiler/include/fast_ber/compiler/Identifier.hpp new file mode 100644 index 00000000..d16d7b12 --- /dev/null +++ b/src/compiler/include/fast_ber/compiler/Identifier.hpp @@ -0,0 +1,77 @@ +#pragma once + +#include "fast_ber/compiler/CompilerTypes.hpp" +#include "fast_ber/compiler/ResolveType.hpp" +#include "fast_ber/compiler/TypeAsString.hpp" + +TaggingInfo identifier(const AnyType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const BitStringType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const BooleanType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const CharacterStringType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const ChoiceType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const DateType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const DateTimeType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const DurationType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const EmbeddedPDVType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const EnumeratedType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const ExternalType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const GeneralizedTimeType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const InstanceOfType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const IntegerType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const IRIType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const NullType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const ObjectClassFieldType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const ObjectDescriptorType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const ObjectIdentifierType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const OctetStringType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const RealType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const RelativeIRIType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const RelativeOIDType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const SequenceType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const SequenceOfType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const SetType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const SetOfType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const PrefixedType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const TaggedType& tagged_type, const Module&, const Asn1Tree&); +TaggingInfo identifier(const TimeType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const TimeOfDayType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const UTCTimeType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const DefinedType&, const Module&, const Asn1Tree&); +TaggingInfo identifier(const BuiltinType& type, const Module&, const Asn1Tree&); +TaggingInfo identifier(const Type& type, const Module&, const Asn1Tree&); + +std::vector outer_identifiers(const AnyType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const BitStringType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const BooleanType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const CharacterStringType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const ChoiceType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const DateType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const DateTimeType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const DurationType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const EmbeddedPDVType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const EnumeratedType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const ExternalType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const GeneralizedTimeType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const InstanceOfType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const IntegerType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const IRIType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const NullType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const ObjectClassFieldType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const ObjectDescriptorType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const ObjectIdentifierType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const OctetStringType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const RealType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const RelativeIRIType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const RelativeOIDType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const SequenceType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const SequenceOfType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const SetType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const SetOfType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const PrefixedType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const TaggedType& tagged_type, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const TimeType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const TimeOfDayType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const UTCTimeType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const DefinedType&, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const BuiltinType& type, const Module&, const Asn1Tree&); +std::vector outer_identifiers(const Type& type, const Module&, const Asn1Tree&); diff --git a/src/compiler/include/fast_ber/compiler/Logging.hpp b/src/compiler/include/fast_ber/compiler/Logging.hpp new file mode 100644 index 00000000..f852a02d --- /dev/null +++ b/src/compiler/include/fast_ber/compiler/Logging.hpp @@ -0,0 +1,24 @@ +#pragma once + +#include "fast_ber/compiler/CompilerTypes.hpp" + +#include +#include + +const static bool debug = false; + +inline void log_debug(const Asn1Tree&, const std::string& message) +{ + if (debug) + { + std::cout << message << "\n"; + } +} + +template +inline void feature_not_implemented(const Location& location, const Asn1Tree&, const std::string& feature, + const std::string& message = "") +{ + std::cerr << location << ": WARNING: The feature " << feature << " has not yet been implemented. " << message + << "Please contact fast_ber developer.\n"; +} diff --git a/include/fast_ber/compiler/ObjectClass.hpp b/src/compiler/include/fast_ber/compiler/ObjectClass.hpp similarity index 100% rename from include/fast_ber/compiler/ObjectClass.hpp rename to src/compiler/include/fast_ber/compiler/ObjectClass.hpp diff --git a/include/fast_ber/compiler/Parameters.hpp b/src/compiler/include/fast_ber/compiler/Parameters.hpp similarity index 100% rename from include/fast_ber/compiler/Parameters.hpp rename to src/compiler/include/fast_ber/compiler/Parameters.hpp diff --git a/include/fast_ber/compiler/ReorderAssignments.hpp b/src/compiler/include/fast_ber/compiler/ReorderAssignments.hpp similarity index 80% rename from include/fast_ber/compiler/ReorderAssignments.hpp rename to src/compiler/include/fast_ber/compiler/ReorderAssignments.hpp index c00ce872..e541d201 100644 --- a/include/fast_ber/compiler/ReorderAssignments.hpp +++ b/src/compiler/include/fast_ber/compiler/ReorderAssignments.hpp @@ -7,18 +7,22 @@ void check_duplicated_names(const std::vector& assignments, c void resolve_components_of(Asn1Tree& tree); void resolve_dependencies(const std::unordered_map& assignment_infos, const std::string& name, - std::unordered_set& assigned_names, + const Asn1Tree& tree, const Module& module, std::unordered_set& assigned_names, std::unordered_set& visited_names, std::vector& ordered_assignment_infos); // Reorder assignments, defining // Should be able to detect missing assignments and circular dependencies -std::vector reorder_assignments(std::vector& assignments, const std::vector& imports, - bool& is_circular); +std::vector reorder_assignments(std::vector& assignments, const Asn1Tree& tree, + const Module& module); // Finds any sequence or set types nested within a type void find_nested_structs(const Module& module, const Type& type, std::vector& nested_structs); +// Create assignments for imported types +std::vector split_imports(const Asn1Tree& tree, std::vector assignments, + const std::vector& imports); + // Statements such as integer type definitions can introduce new statements, such as value assignments std::vector split_definitions(const std::vector& assignments); diff --git a/include/fast_ber/compiler/ResolveType.hpp b/src/compiler/include/fast_ber/compiler/ResolveType.hpp similarity index 73% rename from include/fast_ber/compiler/ResolveType.hpp rename to src/compiler/include/fast_ber/compiler/ResolveType.hpp index 3d84afbd..76c267a7 100644 --- a/include/fast_ber/compiler/ResolveType.hpp +++ b/src/compiler/include/fast_ber/compiler/ResolveType.hpp @@ -4,6 +4,11 @@ #include +Module& find_module(Asn1Tree& tree, const std::string& module_reference); +const Module& find_module(const Asn1Tree& tree, const std::string& module_reference); +Module& find_module(Asn1Tree& tree, Module& module, const DefinedType& defined); +const Module& find_module(const Asn1Tree& tree, const Module& module, const DefinedType& defined); + Assignment& resolve(Asn1Tree& tree, Module& module, const std::string& reference); Assignment& resolve(Asn1Tree& tree, const std::string& module_reference, const std::string& reference); Assignment& resolve(Asn1Tree& tree, const std::string& current_module_reference, const DefinedType& defined); @@ -12,6 +17,10 @@ const Assignment& resolve(const Asn1Tree& tree, const std::string& module_refere const Assignment& resolve(const Asn1Tree& tree, const std::string& current_module_reference, const DefinedType& defined); +NamedType resolve_type(const Asn1Tree& tree, const std::string& current_module_reference, + const DefinedType& original_defined); +NamedType resolve_type(const Asn1Tree& tree, const std::string& current_module_reference, const NamedType& type); + bool exists(const Asn1Tree& tree, const Module& module, const std::string& reference); bool exists(const Asn1Tree& tree, const std::string& module_reference, const std::string& reference); bool exists(const Asn1Tree& tree, const std::string& current_module_reference, const DefinedType& defined); diff --git a/src/compiler/include/fast_ber/compiler/TypeAsString.hpp b/src/compiler/include/fast_ber/compiler/TypeAsString.hpp new file mode 100644 index 00000000..e0592455 --- /dev/null +++ b/src/compiler/include/fast_ber/compiler/TypeAsString.hpp @@ -0,0 +1,116 @@ +#pragma once + +#include "fast_ber/compiler/CompilerTypes.hpp" + +std::string type_as_string(const AnyType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const BitStringType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const BooleanType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const CharacterStringType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const ChoiceType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const DateType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const DateTimeType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const DurationType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const EmbeddedPDVType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const EnumeratedType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const ExternalType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const GeneralizedTimeType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const InstanceOfType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const IntegerType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const IRIType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const NullType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const ObjectClassFieldType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const ObjectDescriptorType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const ObjectIdentifierType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const OctetStringType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const RealType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const RelativeIRIType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const RelativeOIDType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const SequenceType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const SequenceOfType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const SetType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const SetOfType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const PrefixedType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const TimeType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const TimeOfDayType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const UTCTimeType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const DefinedType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const BuiltinType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string type_as_string(const Type&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); + +struct TypeNameHelper +{ + template + std::string operator()(const T& t) + { + return type_name(t); + } +}; + +inline std::string type_name(const AnyType&) { return "AnyType"; } +inline std::string type_name(const BitStringType&) { return "BitStringType"; } +inline std::string type_name(const BooleanType&) { return "BooleanType"; } +inline std::string type_name(const CharacterStringType&) { return "CharacterStringType"; } +inline std::string type_name(const ChoiceType&) { return "ChoiceType"; } +inline std::string type_name(const DateType&) { return "DateType"; } +inline std::string type_name(const DateTimeType&) { return "DateTimeType"; } +inline std::string type_name(const DurationType&) { return "DurationType"; } +inline std::string type_name(const EmbeddedPDVType&) { return "EmbeddedPDVType"; } +inline std::string type_name(const EnumeratedType&) { return "EnumeratedType"; } +inline std::string type_name(const ExternalType&) { return "ExternalType"; } +inline std::string type_name(const GeneralizedTimeType&) { return "GeneralizedTimeType"; } +inline std::string type_name(const InstanceOfType&) { return "InstanceOfType"; } +inline std::string type_name(const IntegerType&) { return "IntegerType"; } +inline std::string type_name(const IRIType&) { return "IRIType"; } +inline std::string type_name(const NullType&) { return "NullType"; } +inline std::string type_name(const ObjectClassFieldType&) { return "ObjectClassFieldType"; } +inline std::string type_name(const ObjectDescriptorType&) { return "ObjectDescriptorType"; } +inline std::string type_name(const ObjectIdentifierType&) { return "ObjectIdentifierType"; } +inline std::string type_name(const OctetStringType&) { return "OctetStringType"; } +inline std::string type_name(const RealType&) { return "RealType"; } +inline std::string type_name(const RelativeIRIType&) { return "RelativeIRIType"; } +inline std::string type_name(const RelativeOIDType&) { return "RelativeOIDType"; } +inline std::string type_name(const SequenceType&) { return "SequenceType"; } +inline std::string type_name(const SequenceOfType&) { return "SequenceOfType"; } +inline std::string type_name(const SetType&) { return "SetType"; } +inline std::string type_name(const SetOfType&) { return "SetOfType"; } +inline std::string type_name(const PrefixedType&) { return "PrefixedType"; } +inline std::string type_name(const TimeType&) { return "TimeType"; } +inline std::string type_name(const TimeOfDayType&) { return "TimeOfDayType"; } +inline std::string type_name(const UTCTimeType&) { return "UTCTimeType"; } +inline std::string type_name(const DefinedType&) { return "DefinedType"; } +inline std::string type_name(const BuiltinType& t) { return absl::visit(TypeNameHelper{}, (t)); } +inline std::string type_name(const Type& t) { return absl::visit(TypeNameHelper{}, (t)); } diff --git a/src/compiler/include/fast_ber/compiler/ValueAsString.hpp b/src/compiler/include/fast_ber/compiler/ValueAsString.hpp new file mode 100644 index 00000000..6ce15ba4 --- /dev/null +++ b/src/compiler/include/fast_ber/compiler/ValueAsString.hpp @@ -0,0 +1,5 @@ +#pragma once + +#include "fast_ber/compiler/CompilerTypes.hpp" + +std::string value_as_string(const NamedType& value_type, const Value& value); diff --git a/src/compiler/include/fast_ber/compiler/ValueType.hpp b/src/compiler/include/fast_ber/compiler/ValueType.hpp new file mode 100644 index 00000000..3b9be525 --- /dev/null +++ b/src/compiler/include/fast_ber/compiler/ValueType.hpp @@ -0,0 +1,71 @@ +#pragma once + +#include "fast_ber/compiler/CompilerTypes.hpp" + +std::string value_type(const AnyType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const BitStringType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const BooleanType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const CharacterStringType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const ChoiceType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const DateType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const DateTimeType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const DurationType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const EmbeddedPDVType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const EnumeratedType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const ExternalType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const GeneralizedTimeType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const InstanceOfType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const IntegerType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const IRIType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const NullType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const ObjectClassFieldType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const ObjectDescriptorType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const ObjectIdentifierType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const OctetStringType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const RealType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const RelativeIRIType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const RelativeOIDType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const SequenceType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const SequenceOfType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const SetType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const SetOfType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const PrefixedType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const TimeType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const TimeOfDayType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const UTCTimeType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const DefinedType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const BuiltinType&, const Module&, const Asn1Tree&, const std::string& = {}, + const std::string& = {}); +std::string value_type(const Type&, const Module&, const Asn1Tree&, const std::string& = {}, const std::string& = {}); diff --git a/src/compiler/CompilerMain.cpp b/src/compiler_main/CompilerMain.cpp similarity index 71% rename from src/compiler/CompilerMain.cpp rename to src/compiler_main/CompilerMain.cpp index 521c63cf..39059ee1 100644 --- a/src/compiler/CompilerMain.cpp +++ b/src/compiler_main/CompilerMain.cpp @@ -3,11 +3,14 @@ #include "fast_ber/compiler/CppGeneration.hpp" #include "fast_ber/compiler/Dependencies.hpp" #include "fast_ber/compiler/Identifier.hpp" +#include "fast_ber/compiler/Logging.hpp" #include "fast_ber/compiler/ObjectClass.hpp" #include "fast_ber/compiler/Parameters.hpp" #include "fast_ber/compiler/ReorderAssignments.hpp" #include "fast_ber/compiler/ResolveType.hpp" #include "fast_ber/compiler/TypeAsString.hpp" +#include "fast_ber/compiler/ValueAsString.hpp" +#include "fast_ber/compiler/ValueType.hpp" #include #include @@ -25,10 +28,8 @@ std::string strip_path(const std::string& path) std::string create_type_fwd(const std::string& name, const Type& type, const Module& module, const Asn1Tree& tree) { TaggingInfo tag = identifier(type, module, tree); - std::string res; - res += create_template_definition({"Identifier = " + tag.name()}); - res += "struct " + name + ";\n"; - return res; + + return create_template_definition({"Identifier = " + tag.name()}) + "struct " + name + ";\n"; } std::string create_type_assignment(const std::string& name, const Type& assignment_type, const Module& module, @@ -39,7 +40,7 @@ std::string create_type_assignment(const std::string& name, const Type& assignme if (is_set(assignment_type) || is_sequence(assignment_type)) { res += create_template_definition({"Identifier"}); - res += "struct " + name + type_as_string(assignment_type, module, tree); + res += "struct " + name + type_as_string(assignment_type, module, tree, name); } else if (is_enumerated(assignment_type)) { @@ -50,7 +51,8 @@ std::string create_type_assignment(const std::string& name, const Type& assignme else { res += create_template_definition({"Identifier"}); - res += "FAST_BER_ALIAS(" + name + ", " + type_as_string(assignment_type, module, tree, "Identifier") + ");\n"; + res += + "FAST_BER_ALIAS(" + name + ", " + type_as_string(assignment_type, module, tree, "", "Identifier") + ");\n"; } return res; } @@ -61,124 +63,30 @@ std::string create_type_assignment(const Assignment& assignment, const Module& m "\n"; } -std::string cpp_value(const HexStringValue& hex) -{ - std::string res = "\""; - size_t i = 0; - - if (hex.value.length() % 2 == 1) - { - const std::string& byte = std::string(hex.value.begin(), hex.value.begin() + 1); - res += "\\"; - res += std::to_string(std::stoi(byte, nullptr, 16)); - i++; - } - - for (; i < hex.value.length(); i += 2) - { - const std::string& byte = std::string(hex.value.begin() + i, hex.value.begin() + i + 2); - res += "\\"; - res += std::to_string(std::stoi(byte, nullptr, 16)); - } - - return res + "\""; -} - std::string create_assignment(const Asn1Tree& tree, const Module& module, const Assignment& assignment) { try { if (absl::holds_alternative(assignment.specific)) // Value assignment { + log_debug(tree, "Creating value assignment: " + module.module_reference + "." + assignment.name); + const ValueAssignment& value_assign = absl::get(assignment.specific); std::string result = - "static const " + type_as_string(value_assign.type, module, tree) + " " + assignment.name + " = "; + "static const " + value_type(value_assign.type, module, tree) + " " + assignment.name + " = "; const Type& assigned_to_type = (is_defined(value_assign.type)) ? type(resolve(tree, module.module_reference, absl::get(value_assign.type))) : value_assign.type; - if (is_oid(assigned_to_type)) - { - result += "ObjectIdentifier<>{"; - try - { - const ObjectIdComponents& object_id = ObjectIdComponents(value_assign.value); - - for (size_t i = 0; i < object_id.components.size(); i++) - { - if (object_id.components[i].value) - { - result += std::to_string(*object_id.components[i].value); - } - else - { - result += std::to_string(0); - } - - if (i < object_id.components.size() - 1) - { - result += ", "; - } - } - } - catch (const std::runtime_error& e) - { - std::cerr << "Warning: Not an object identifier : " + assignment.name + std::string(" : ") + - e.what() - << std::endl; - return ""; - } - result += "}"; - } - else if (is_bit_string(assigned_to_type)) - { - if (absl::holds_alternative(value_assign.value.value_selection)) - { - const BitStringValue& bstring = absl::get(value_assign.value.value_selection); - (void)bstring; // TODO: convert bstring to cstring - result += "\"\""; - } - else - { - result += "\"\""; - } - } - else if (absl::holds_alternative(value_assign.value.value_selection)) - { - const std::string& string = absl::get(value_assign.value.value_selection); - result += string; - } - else if (absl::holds_alternative(value_assign.value.value_selection)) - { - const HexStringValue& hstring = absl::get(value_assign.value.value_selection); - result += cpp_value(hstring); - } - else if (absl::holds_alternative(value_assign.value.value_selection)) - { - const CharStringValue& cstring = absl::get(value_assign.value.value_selection); - result += cstring.value; - } - else if (absl::holds_alternative(value_assign.value.value_selection)) - { - const int64_t integer = absl::get(value_assign.value.value_selection); - result += std::to_string(integer); - } - else if (absl::holds_alternative(value_assign.value.value_selection)) - { - const DefinedValue& defined = absl::get(value_assign.value.value_selection); - result += defined.reference; - } - else - { - throw std::runtime_error("Strange value assign"); - } - result += ";\n"; + result += value_as_string(NamedType{assignment.name, assigned_to_type}, value_assign.value) + ";\n"; return result; } else if (absl::holds_alternative(assignment.specific)) { + log_debug(tree, "Creating type assignment: " + module.module_reference + "." + assignment.name); + return create_type_assignment(assignment, module, tree); } else if (absl::holds_alternative(assignment.specific)) @@ -192,7 +100,7 @@ std::string create_assignment(const Asn1Tree& tree, const Module& module, const } catch (const std::runtime_error& e) { - throw(std::runtime_error("failed: " + assignment.name + e.what())); + throw(std::runtime_error("failed creating assignment [" + assignment.name + "] [" + e.what() + "]")); } } @@ -237,8 +145,6 @@ std::string create_identifier_functions_recursive(const std::string& assignment_ std::string create_identifier_functions(const Assignment& assignment, const Module& module) { - return ""; - std::string res; if (absl::holds_alternative(assignment.specific)) @@ -293,86 +199,147 @@ create_collection_encode_functions(const std::vector& namespaces, c } } - std::string namespace_name = module.module_reference + "::template "; + std::string namespace_name = module.module_reference + "::"; + int count = 0; for (const std::string& ns : namespaces) { - namespace_name += ns + "<>::template "; + namespace_name += ns + "::"; } - std::vector template_args = {"Identifier"}; - const std::string name = namespace_name + assignment_name + create_template_arguments(template_args); + const std::string type_identifier = "Identifier" + std::to_string(count); + const std::string name = + "fast_ber::" + namespace_name + assignment_name + create_template_arguments({type_identifier}); - res += create_template_definition(template_args); - res += "inline EncodeResult encode(absl::Span output, const " + name + "& input) noexcept\n{\n"; + for (int i = 0; i <= count; i++) + { + res += create_template_definition({"Identifier" + std::to_string(i)}); + } + res += "inline EncodeResult " + name + "::encode(absl::Span output) const noexcept\n{\n"; + res += " constexpr size_t header_length_guess = fast_ber::encoded_length(0," + type_identifier + "{});\n"; + res += " if (output.length() < header_length_guess)\n"; + res += " {\n"; + res += " return EncodeResult{false, 0};\n"; + res += " }\n"; - if (collection.components.size() == 0) + if (collection.components.size() != 0) { - res += " (void)input;\n"; + res += " EncodeResult res;\n"; + res += " auto content = output;\n"; + res += " content.remove_prefix(header_length_guess);\n"; } + res += " size_t content_length = 0;\n"; - res += " return encode_sequence_combine(output, Identifier{}"; for (const ComponentType& component : collection.components) { - res += ",\n input." + component.named_type.name; + res += " res = fast_ber::encode(content, this->" + component.named_type.name + ");\n"; + res += " if (!res.success)\n"; + res += " {\n"; + res += " return res;\n"; + res += " }\n"; + res += " content.remove_prefix(res.length);\n"; + res += " content_length += res.length;\n"; } - res += ");\n}\n\n"; + res += " return wrap_with_ber_header(output, content_length, " + type_identifier + "{}, header_length_guess);\n"; + res += "}\n\n"; - res += create_template_definition(template_args); - res += "inline size_t encoded_length(const " + name + "& input) noexcept\n{\n"; - if (collection.components.size() == 0) + for (int i = 0; i <= count; i++) { - res += " (void)input;\n"; + res += create_template_definition({"Identifier" + std::to_string(i)}); } - + res += "size_t " + name + "::encoded_length() const noexcept\n{\n"; res += " size_t content_length = 0;\n\n"; for (const ComponentType& component : collection.components) { - res += " content_length += encoded_length(input." + component.named_type.name + ");\n"; + res += " content_length += " + component.named_type.name + ".encoded_length();\n"; } - res += "\n return wrap_with_ber_header_length(content_length, Identifier{});\n"; + res += "\n return fast_ber::encoded_length(content_length, " + type_identifier + "{});\n"; res += "}\n\n"; return res; } template -std::string create_collection_decode_functions(const std::vector& namespaces, - const std::string& assignment_name, - const std::vector& parameters, - const CollectionType& collection, const Module& module) +std::string +create_collection_decode_functions(const std::vector& namespaces, const std::string& assignment_name, + const std::vector& parameters, const CollectionType& collection, + const Module& module, const Asn1Tree tree) { - std::string namespace_name = module.module_reference + "::template "; + std::string namespace_name = module.module_reference + "::"; std::vector child_namespaces = namespaces; child_namespaces.push_back(assignment_name); + int count = 0; for (const std::string& ns : namespaces) { - namespace_name += ns + "<>::template "; + namespace_name += ns + "::"; } - std::string res; - const std::string name = namespace_name + assignment_name + create_template_arguments({"Identifier"}); + const std::string type_identifier = "Identifier" + std::to_string(count); + const std::string name = + "fast_ber::" + namespace_name + assignment_name + create_template_arguments({type_identifier}); - std::vector template_args = {"Identifier"}; + std::string res; + for (int i = 0; i <= count; i++) + { + res += create_template_definition({"Identifier" + std::to_string(i)}); + } + res += "DecodeResult " + name + "::decode(BerView input) noexcept\n{\n"; + res += " if (!has_correct_header(input, " + type_identifier + "{}, Construction::constructed))\n"; + res += " {\n"; + res += " return DecodeResult{false};\n"; + res += " }\n"; - res += create_template_definition(template_args); - res += "inline DecodeResult decode(BerViewIterator& input, " + name + "& output) noexcept\n{\n"; - if (collection.components.size() == 0) + if (collection.components.size() > 0) { - res += " (void)output;\n"; + res += " auto iterator = (" + type_identifier + "::depth() == 1) ? input.begin()\n"; + res += " : input.begin()->begin();\n"; + res += " DecodeResult res;\n"; } - res += " DecodeResult result = decode_" + collection_name(collection) + "_combine(*input, \"" + name + - "\", Identifier{}"; for (const ComponentType& component : collection.components) { - res += ",\n output." + component.named_type.name; + if (component.is_optional || component.default_value) + { + res += " if (iterator->is_valid() && (false "; + for (const Identifier& id : outer_identifiers(component.named_type.type, module, tree)) + { + res += " || " + id.name() + "::check_id_match(iterator->class_(), iterator->tag())"; + } + res += "))\n"; + res += " {\n"; + res += " res = this->" + component.named_type.name + ".decode(*iterator);\n"; + res += " if (!res.success)\n"; + res += " {\n"; + res += " return res;\n"; + res += " }\n"; + res += " ++iterator;\n"; + res += " }\n"; + res += " else\n"; + res += " {\n"; + if (component.is_optional) + { + res += " this->" + component.named_type.name + " = fast_ber::empty;\n"; + } + else + { + res += " this->" + component.named_type.name + ".set_to_default();\n"; + } + res += " }\n"; + } + else + { + res += " res = this->" + component.named_type.name + ".decode(*iterator);\n"; + res += " if (!res.success)\n"; + res += " {\n"; + res += " return res;\n"; + res += " }\n"; + res += " ++iterator;\n"; + } } - res += ");\n"; - res += " ++input;\n"; - res += " return result;\n"; - res += "}\n\n"; + res += " return DecodeResult{true};\n"; + res += "}\n"; + // Make child decode functions for (const ComponentType& component : collection.components) { @@ -381,14 +348,14 @@ std::string create_collection_decode_functions(const std::vector& n const SequenceType& sequence = absl::get(absl::get(component.named_type.type)); res += create_collection_decode_functions(child_namespaces, component.named_type.name + "_type", parameters, - sequence, module); + sequence, module, tree); } else if (is_set(component.named_type.type)) { const SetType& set = absl::get(absl::get(component.named_type.type)); res += create_collection_decode_functions(child_namespaces, component.named_type.name + "_type", parameters, - set, module); + set, module, tree); } } return res; @@ -415,7 +382,7 @@ std::string create_encode_functions(const Assignment& assignment, const Module& return ""; } -std::string create_decode_functions(const Assignment& assignment, const Module& module, const Asn1Tree&) +std::string create_decode_functions(const Assignment& assignment, const Module& module, const Asn1Tree& tree) { if (absl::holds_alternative(assignment.specific)) { @@ -424,12 +391,13 @@ std::string create_decode_functions(const Assignment& assignment, const Module& if (is_sequence(type_assignment.type)) { const SequenceType& sequence = absl::get(absl::get(type_assignment.type)); - return create_collection_decode_functions({}, assignment.name, assignment.parameters, sequence, module); + return create_collection_decode_functions({}, assignment.name, assignment.parameters, sequence, module, + tree); } else if (is_set(type_assignment.type)) { const SetType& set = absl::get(absl::get(type_assignment.type)); - return create_collection_decode_functions({}, assignment.name, assignment.parameters, set, module); + return create_collection_decode_functions({}, assignment.name, assignment.parameters, set, module, tree); } } return ""; @@ -467,20 +435,22 @@ template std::string create_collection_equality_operators(const CollectionType& collection, std::vector parents, const std::string& name) { - std::string name_with_template_params; + std::string full_namespace; for (const std::string& parent : parents) { - name_with_template_params += parent + "<>::template "; + full_namespace += parent + "<>::template "; } - name_with_template_params += name + create_template_arguments({"Identifier"}); + std::string name_with_template_params = full_namespace + name + create_template_arguments({"Identifier"}); + std::string name_with_template_params_1 = full_namespace + name + create_template_arguments({"Identifier1"}); + std::string name_with_template_params_2 = full_namespace + name + create_template_arguments({"Identifier2"}); std::string res; - res += create_template_definition({"Identifier"}); + res += create_template_definition({"Identifier1", "Identifier2"}); res += "bool operator==("; - res += "const " + name_with_template_params + "& lhs, "; - res += "const " + name_with_template_params + "& rhs)\n"; + res += "const " + name_with_template_params_1 + "& lhs, "; + res += "const " + name_with_template_params_2 + "& rhs)\n"; res += "{\n"; if (collection.components.size() == 0) @@ -497,10 +467,10 @@ std::string create_collection_equality_operators(const CollectionType& collectio } res += ";\n}\n\n"; - res += create_template_definition({"Identifier"}); + res += create_template_definition({"Identifier1", "Identifier2"}); res += "bool operator!=("; - res += "const " + name_with_template_params + "& lhs, "; - res += "const " + name_with_template_params + "& rhs)\n"; + res += "const " + name_with_template_params_1 + "& lhs, "; + res += "const " + name_with_template_params_2 + "& rhs)\n"; res += "{\n"; res += " return !(lhs == rhs);\n}\n\n"; @@ -574,38 +544,22 @@ std::string create_helper_functions(const Assignment& assignment) return ""; } -std::string create_imports(const Asn1Tree& tree, const Module& module, bool fwd = false) +std::string create_imports(const Asn1Tree& tree, const Module& module) { + std::string output; for (const Import& import : module.imports) { - for (const auto& import_name : import.imports) + for (const auto& import_name : import.imported_values) { - if (fwd) - { - if (is_type(resolve(tree, import.module_reference, import_name))) - { - output += create_type_fwd(import_name, type(resolve(tree, module.module_reference, import_name)), - module, tree); - } - } - else - { - if (is_type(resolve(tree, import.module_reference, import_name))) - { - output += create_template_definition({"Identifier"}); - output += "FAST_BER_ALIAS(" + import_name + ", " + import.module_reference + "::" + import_name + - "<>);\n"; - } - else if (is_value(resolve(tree, import.module_reference, import_name))) - { - output += "static const auto " + import_name + " = " + import.module_reference + - "::" + import_name + ";\n"; - } - } + + log_debug(tree, "Value import " + module.module_reference + "." + import_name + " <- " + + import.module_reference + "." + import_name); + + output += "static const auto " + import_name + " = " + import.module_reference + "::" + import_name + ";\n"; } - if (import.imports.size() > 0) + if (import.imported_values.size() > 0) { output += "\n"; } @@ -630,12 +584,12 @@ std::string create_body(const Asn1Tree& tree, const Module& module) std::string create_fwd_declarations(const Asn1Tree& tree, const Module& module) { std::string output; - output += create_imports(tree, module, true); for (const Assignment& assignment : module.assignments) { if (absl::holds_alternative(assignment.specific)) { + log_debug(tree, "Creating forward definition: " + module.module_reference + "." + assignment.name); output += create_type_fwd(assignment.name, absl::get(assignment.specific).type, module, tree); } @@ -646,6 +600,7 @@ std::string create_fwd_declarations(const Asn1Tree& tree, const Module& module) std::string create_fwd_body(const Asn1Tree& tree) { + log_debug(tree, "Creating .fwd.hpp"); std::string output; output += "/* Forward declration of ASN.1 types */\n\n"; output += "#pragma once\n\n"; @@ -661,11 +616,13 @@ std::string create_fwd_body(const Asn1Tree& tree) } output += add_namespace("fast_ber", definitions) + '\n'; + log_debug(tree, "Done creating .fwd.hpp"); return output; } std::string create_detail_body(const Asn1Tree& tree) { + log_debug(tree, "Creating .detail.hpp"); std::string output; output += "/* Functionality provided for Encoding and Decoding BER */\n\n"; @@ -688,19 +645,21 @@ std::string create_detail_body(const Asn1Tree& tree) for (const Assignment& assignment : module.assignments) { body += create_encode_functions(assignment, module, tree); - body += create_decode_functions(assignment, module, tree) + "\n"; + body += create_decode_functions(assignment, module, tree); helpers += create_helper_functions(assignment); } body += add_namespace(module.module_reference, helpers); } output += add_namespace("fast_ber", body) + "\n\n"; + log_debug(tree, "Done creating .detail.hpp"); return output; } std::string create_output_file(const Asn1Tree& tree, const std::string& fwd_filename, const std::string& detail_filename) { + log_debug(tree, "Creating .hpp"); std::string output; output += "#pragma once\n\n"; output += create_include("fast_ber/ber_types/All.hpp"); @@ -717,6 +676,7 @@ std::string create_output_file(const Asn1Tree& tree, const std::string& fwd_file output += add_namespace("fast_ber", definitions) + '\n'; output += create_include(strip_path(detail_filename)) + '\n'; + log_debug(tree, "Done creating .hpp"); return output; } @@ -782,15 +742,20 @@ int main(int argc, char** argv) for (auto& module : context.asn1_tree.modules) { + module.assignments = split_imports(context.asn1_tree, module.assignments, module.imports); module.assignments = split_definitions(module.assignments); check_duplicated_names(module.assignments, module.module_reference); - module.assignments = reorder_assignments(module.assignments, module.imports, context.asn1_tree.is_circular); module.assignments = split_nested_structures(module); } resolve_components_of(context.asn1_tree); resolve_object_classes(context.asn1_tree); + for (auto& module : context.asn1_tree.modules) + { + module.assignments = reorder_assignments(module.assignments, context.asn1_tree, module); + } + output_file << create_output_file(context.asn1_tree, fwd_filame, detail_filame); fwd_output_file << create_fwd_body(context.asn1_tree); detail_output_file << create_detail_body(context.asn1_tree); diff --git a/src/empty.cpp b/src/empty.cpp deleted file mode 100644 index e69de29b..00000000 diff --git a/src/util/BerView.cpp b/src/util/BerView.cpp new file mode 100644 index 00000000..351cf32d --- /dev/null +++ b/src/util/BerView.cpp @@ -0,0 +1,131 @@ +#include "fast_ber/util/BerView.hpp" +#include "fast_ber/ber_types/All.hpp" + +namespace fast_ber +{ +std::ostream& operator<<(std::ostream& os, BerView view) noexcept +{ + if (!view.is_valid()) + { + os << "null"; + return os; + } + + os << "{ \"length\": " << view.ber_length(); + os << ", \"identifier\": " << view.identifier(); + os << ", \"content\": "; + if (view.construction() == Construction::primitive) + { + if (view.class_() == Class::universal) + { + try + { + switch (static_cast(view.tag())) + { + case UniversalTag::boolean: + os << Boolean<>(view); + break; + case UniversalTag::integer: + os << Integer<>(view); + break; + case UniversalTag::bit_string: + os << BitString<>(view); + break; + case UniversalTag::octet_string: + os << OctetString<>(view); + break; + case UniversalTag::null: + os << Null<>(view); + break; + case UniversalTag::object_identifier: + os << ObjectIdentifier<>(view); + break; + case UniversalTag::real: + // os << Real<>(view); + break; + case UniversalTag::enumerated: + os << Integer<>(view); + break; + case UniversalTag::utf8_string: + os << UTF8String<>(view); + break; + case UniversalTag::numeric_string: + os << NumericString<>(view); + break; + case UniversalTag::printable_string: + os << PrintableString<>(view); + break; + case UniversalTag::teletex_string: + os << TeletexString<>(view); + break; + case UniversalTag::videotex_string: + os << VideotexString<>(view); + break; + case UniversalTag::ia5_string: + os << IA5String<>(view); + break; + case UniversalTag::utc_time: + os << UTCTime<>(view); + break; + case UniversalTag::generalized_time: + os << GeneralizedTime<>(view); + break; + case UniversalTag::graphic_string: + os << GraphicString<>(view); + break; + case UniversalTag::visible_string: + os << VisibleString<>(view); + break; + case UniversalTag::general_string: + os << GeneralString<>(view); + break; + case UniversalTag::universal_string: + os << UniversalString<>(view); + break; + case UniversalTag::character_string: + os << CharacterString<>(view); + break; + case UniversalTag::bmp_string: + os << BMPString<>(view); + break; + + case UniversalTag::embedded_pdv: + case UniversalTag::relative_oid: + case UniversalTag::sequence: + case UniversalTag::set: + case UniversalTag::reserved: + case UniversalTag::object_descriptor: + case UniversalTag::instance_of: + default: + os << OctetString<>(view.content()); + } + } + catch (const std::exception& e) + { + os << OctetString<>(view.content()); + } + } + else + { + os << OctetString<>(view.content()); + } + } + else + { + bool first = true; + os << "["; + for (const BerView& child : view) + { + if (!first) + { + os << ", "; + } + os << child; + first = false; + } + os << "]"; + } + return os << "}"; +} + +} // namespace fast_ber diff --git a/src/view/view.cpp b/src/view/view.cpp new file mode 100644 index 00000000..ddf4c363 --- /dev/null +++ b/src/view/view.cpp @@ -0,0 +1,34 @@ +#include "fast_ber/util/BerView.hpp" + +#include +#include +#include + +void usage() +{ + std::cout << "Tool to inspect the contents of a BER PDU. Does not require schema.\n"; + std::cout << " usage: ./ber_view [pdu_to_decode.ber]\n"; +} + +int main(int argc, const char** argv) +{ + if (argc != 2) + { + usage(); + return -1; + } + + auto input_path = std::string(argv[1]); + std::ifstream input(input_path, std::ios::binary); + if (!input.good()) + { + std::cout << "Failed to open input: " << input_path << std::endl; + return -1; + } + + const auto buffer = std::vector{std::istreambuf_iterator(input), std::istreambuf_iterator()}; + auto view = fast_ber::BerView(buffer); + + std::cout << view; + return view.is_valid() ? 0 : -1; +} diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 89a6fdd8..d53ed8e1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,6 @@ project(fast_ber_tests) +include(${CMAKE_SOURCE_DIR}/cmake/fast_ber_generate.cmake) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/autogen) function(fast_ber_generate2 input_file1 input_file2 output_name) @@ -22,6 +23,7 @@ fast_ber_generate(${CMAKE_SOURCE_DIR}/testfiles/import.asn import) fast_ber_generate(${CMAKE_SOURCE_DIR}/testfiles/value_assignment.asn value_assign) fast_ber_generate(${CMAKE_SOURCE_DIR}/testfiles/embedded.asn embedded) fast_ber_generate(${CMAKE_SOURCE_DIR}/testfiles/parameterized_types.asn parameterized_types) +fast_ber_generate(${CMAKE_SOURCE_DIR}/testfiles/sequence.asn sequence) fast_ber_generate(${CMAKE_SOURCE_DIR}/testfiles/sequence_of.asn sequence_of) fast_ber_generate(${CMAKE_SOURCE_DIR}/testfiles/time.asn time) fast_ber_generate(${CMAKE_SOURCE_DIR}/testfiles/circular.asn circular) @@ -31,32 +33,62 @@ fast_ber_generate(${CMAKE_SOURCE_DIR}/testfiles/SGSN-CDR-def-v2009A.asn real_sch fast_ber_generate2(${CMAKE_SOURCE_DIR}/testfiles/multi_file_import_1.asn ${CMAKE_SOURCE_DIR}/testfiles/multi_file_import_2.asn multi_file_import) -aux_source_directory(ber_types TEST_SRC) -aux_source_directory(util TEST_SRC) -aux_source_directory(compiler TEST_SRC) +aux_source_directory(compiler COMPILER_TEST_SRC) +aux_source_directory(ber_types BER_TYPES_TEST_SRC) +aux_source_directory(util UTIL_TEST_SRC) +aux_source_directory(generated GENERATED_TEST_SRC) -add_executable(fast_ber_tests Test ${TEST_SRC} autogen/choice.hpp - autogen/simple.hpp - autogen/tags.hpp - autogen/prefixed_types.hpp - autogen/top_level_encodings.hpp - autogen/enum.hpp - autogen/real_schema.hpp - autogen/all_types.hpp - autogen/import.hpp - autogen/multi_file_import.hpp - autogen/object_identifier.hpp - autogen/value_assign.hpp - autogen/embedded.hpp - autogen/parameterized_types.hpp - autogen/sequence_of.hpp - autogen/time.hpp - autogen/circular.hpp - autogen/defaults.hpp - autogen/anonymous_members.hpp) -target_include_directories(fast_ber_tests PRIVATE SYSTEM ${CMAKE_SOURCE_DIR}/3rd_party/Catch2/single_include) -target_include_directories(fast_ber_tests PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) -target_link_libraries (fast_ber_tests fast_ber_lib) +add_executable(fast_ber_compiler_tests Test ${COMPILER_TEST_SRC}) +add_executable(fast_ber_ber_types_tests Test ${BER_TYPES_TEST_SRC}) +add_executable(fast_ber_util_tests Test ${UTIL_TEST_SRC}) +add_executable(fast_ber_generated_tests Test ${GENERATED_TEST_SRC} + autogen/choice.hpp + autogen/simple.hpp + autogen/tags.hpp + autogen/prefixed_types.hpp + autogen/top_level_encodings.hpp + autogen/enum.hpp + autogen/real_schema.hpp + autogen/all_types.hpp + autogen/import.hpp + autogen/multi_file_import.hpp + autogen/object_identifier.hpp + autogen/value_assign.hpp + autogen/embedded.hpp + autogen/parameterized_types.hpp + autogen/sequence.hpp + autogen/sequence_of.hpp + autogen/time.hpp + autogen/circular.hpp + autogen/defaults.hpp + autogen/anonymous_members.hpp) + +target_include_directories(fast_ber_compiler_tests PRIVATE SYSTEM ${CMAKE_SOURCE_DIR}/3rd_party/Catch2/single_include) +target_include_directories(fast_ber_ber_types_tests PRIVATE SYSTEM ${CMAKE_SOURCE_DIR}/3rd_party/Catch2/single_include) +target_include_directories(fast_ber_util_tests PRIVATE SYSTEM ${CMAKE_SOURCE_DIR}/3rd_party/Catch2/single_include) +target_include_directories(fast_ber_generated_tests PRIVATE SYSTEM ${CMAKE_SOURCE_DIR}/3rd_party/Catch2/single_include) +target_include_directories(fast_ber_generated_tests PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + +target_link_libraries(fast_ber_compiler_tests fast_ber_compiler_lib) +target_link_libraries(fast_ber_ber_types_tests fast_ber_lib) +target_link_libraries(fast_ber_util_tests fast_ber_lib) +target_link_libraries(fast_ber_generated_tests fast_ber_lib) + +add_test(NAME fast_ber_compiler_tests COMMAND fast_ber_compiler_tests) +add_test(NAME fast_ber_ber_types_tests COMMAND fast_ber_ber_types_tests) +add_test(NAME fast_ber_util_tests COMMAND fast_ber_util_tests) +add_test(NAME fast_ber_generated_tests COMMAND fast_ber_generated_tests) +add_test(NAME fast_ber_compiler_0 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/simple0.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/simple0) +add_test(NAME fast_ber_compiler_1 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/simple1.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/simple1) +add_test(NAME fast_ber_compiler_2 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/simple2.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/simple2) +add_test(NAME fast_ber_compiler_3 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/simple3.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/simple3) +add_test(NAME fast_ber_compiler_4 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/simple4.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/simple4) +add_test(NAME fast_ber_compiler_5 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/simple5.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/simple5) +add_test(NAME fast_ber_compiler_6 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/sequence_of.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/sequence_of) +add_test(NAME fast_ber_compiler_7 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/extension.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/extension) +add_test(NAME fast_ber_compiler_8 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/SGSN-CDR-def-v2009A.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/real_schema) +add_test(NAME fast_ber_compiler_9 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/class.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/class) +add_test(NAME fast_ber_compiler_10 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/integer.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/integer) # Generate a header file from an asn1 input spec # Create a library including the header @@ -84,9 +116,9 @@ generate_and_compile(00-empty-OK TRUE) generate_and_compile(01-empty-OK TRUE) generate_and_compile(02-garbage-NP FALSE) generate_and_compile(03-enum-OK TRUE) -#generate_and_compile(04-enum-SE FALSE) +generate_and_compile(04-enum-SE FALSE) generate_and_compile(05-enum-SE FALSE) -#generate_and_compile(06-enum-SE FALSE) +generate_and_compile(06-enum-SE FALSE) generate_and_compile(07-int-OK TRUE) #generate_and_compile(08-int-SE FALSE) #generate_and_compile(09-int-SE FALSE) @@ -107,8 +139,8 @@ generate_and_compile(23-bits-OK TRUE) generate_and_compile(24-sequence-OK TRUE) generate_and_compile(25-misc-OK TRUE) generate_and_compile(26-sequence-SE TRUE) -generate_and_compile(27-set-SE TRUE) -generate_and_compile(28-tags-SE TRUE) +generate_and_compile(27-set-SE FALSE) +#generate_and_compile(28-tags-SE FALSE) generate_and_compile(29-tags-OK TRUE) generate_and_compile(30-set-OK TRUE) generate_and_compile(31-set-of-OK TRUE) @@ -120,8 +152,8 @@ generate_and_compile(33-misc-OK TRUE) generate_and_compile(37-indirect-choice-OK TRUE) #generate_and_compile(38-comments-OK TRUE) generate_and_compile(39-sequence-of-OK TRUE) -generate_and_compile(40-int-optional-SE TRUE) -generate_and_compile(41-int-optional-OK TRUE) +generate_and_compile(40-int-optional-SE FALSE) +#generate_and_compile(41-int-optional-OK TRUE) generate_and_compile(42-real-life-OK TRUE) #generate_and_compile(43-recursion-OK TRUE) generate_and_compile(44-choice-in-sequence-OK TRUE) @@ -130,13 +162,13 @@ generate_and_compile(46-redefine-OK TRUE) generate_and_compile(47-set-ext-OK TRUE) generate_and_compile(48-real-life-OK TRUE) #generate_and_compile(49-real-life-OK TRUE) -generate_and_compile(50-constraint-OK TRUE) +#generate_and_compile(50-constraint-OK TRUE) generate_and_compile(51-constraint-SE TRUE) generate_and_compile(52-constraint-SE TRUE) generate_and_compile(53-constraint-SE TRUE) generate_and_compile(54-constraint-SE TRUE) generate_and_compile(55-components-of-OK TRUE) -#generate_and_compile(56-components-of-SE FALSE) +generate_and_compile(56-components-of-SE FALSE) #generate_and_compile(57-components-of-OK TRUE) generate_and_compile(58-param-OK TRUE) #generate_and_compile(59-choice-extended-OK TRUE) @@ -147,7 +179,7 @@ generate_and_compile(63-any-2-SE TRUE) generate_and_compile(64-oid-constr-OK TRUE) generate_and_compile(65-multi-tag-OK TRUE) generate_and_compile(66-ref-simple-OK TRUE) -generate_and_compile(67-embedded-choice-OK TRUE) +#generate_and_compile(67-embedded-choice-OK TRUE) generate_and_compile(68-enum-default-OK TRUE) generate_and_compile(69-reserved-words-OK TRUE) #generate_and_compile(70-xer-test-OK TRUE) @@ -155,8 +187,8 @@ generate_and_compile(71-duplicate-types-SE TRUE) #generate_and_compile(72-same-names-OK TRUE) #generate_and_compile(73-circular-OK TRUE) generate_and_compile(74-int-enum-constraints-OK TRUE) -#generate_and_compile(75-duplicate-modules-SE FALSE) -#generate_and_compile(76-duplicate-modules-SW FALSE) +generate_and_compile(75-duplicate-modules-SE FALSE) +generate_and_compile(76-duplicate-modules-SW FALSE) generate_and_compile(77-str-default-OK TRUE) generate_and_compile(78-str-default-SE TRUE) generate_and_compile(79-constrained-by-OK TRUE) @@ -182,16 +214,16 @@ generate_and_compile(94-set-optionals-OK TRUE) #generate_and_compile(99-class-sample-OK TRUE) #generate_and_compile(100-class-ref-OK TRUE) #generate_and_compile(101-class-ref-SE FALSE) -#generate_and_compile(102-class-ref-SE FALSE) -#generate_and_compile(103-reference-SE FALSE) +generate_and_compile(102-class-ref-SE FALSE) +generate_and_compile(103-reference-SE FALSE) generate_and_compile(104-param-1-OK TRUE) generate_and_compile(105-param-2-OK TRUE) -generate_and_compile(106-param-constr-OK TRUE) +#generate_and_compile(106-param-constr-OK TRUE) generate_and_compile(107-param-constr-2-OK TRUE) #generate_and_compile(108-param-constr-3-OK TRUE) #generate_and_compile(109-bit-string-SE TRUE) -generate_and_compile(110-param-3-OK TRUE) -generate_and_compile(111-param-4-SE TRUE) +#generate_and_compile(110-param-3-OK TRUE) +#generate_and_compile(111-param-4-SE TRUE) #generate_and_compile(112-param-class-OK TRUE) generate_and_compile(113-bit-string-SE TRUE) #generate_and_compile(114-bit-string-SE TRUE) @@ -215,15 +247,3 @@ generate_and_compile(132-per-choice-OK TRUE) generate_and_compile(133-per-constraints-OK TRUE) generate_and_compile(134-per-long-OK TRUE) -add_test(NAME fast_ber_compiler_0 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/simple0.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/simple0) -add_test(NAME fast_ber_compiler_1 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/simple1.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/simple1) -add_test(NAME fast_ber_compiler_2 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/simple2.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/simple2) -add_test(NAME fast_ber_compiler_3 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/simple3.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/simple3) -add_test(NAME fast_ber_compiler_4 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/simple4.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/simple4) -add_test(NAME fast_ber_compiler_5 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/simple5.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/simple5) -add_test(NAME fast_ber_compiler_6 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/sequence_of.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/sequence_of) -add_test(NAME fast_ber_compiler_7 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/extension.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/extension) -add_test(NAME fast_ber_compiler_8 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/SGSN-CDR-def-v2009A.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/real_schema) -add_test(NAME fast_ber_compiler_9 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/class.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/class) -add_test(NAME fast_ber_compiler_10 COMMAND fast_ber_compiler ${CMAKE_SOURCE_DIR}/testfiles/integer.asn ${CMAKE_CURRENT_BINARY_DIR}/autogen/integer) -add_test(NAME fast_ber_tests COMMAND fast_ber_tests) diff --git a/test/ber_types/AllTest.cpp b/test/ber_types/AllTest.cpp deleted file mode 100644 index 198d2879..00000000 --- a/test/ber_types/AllTest.cpp +++ /dev/null @@ -1,89 +0,0 @@ -#include "fast_ber/ber_types/All.hpp" - -#include "autogen/all_types.hpp" - -#include - -#include "absl/time/clock.h" - -template -void test_type(const T& a) -{ - using ID = fast_ber::Identifier; - - // Check that type can be default constructed - REQUIRE(T{} == T{}); - - // Check that type can be copied - T b = a; - b = a; - T c(b); - REQUIRE(c == a); - - // Check that type can be moved - T d = std::move(b); - d = std::move(c); - T e(std::move(d)); - REQUIRE(e == a); - - // Check that type can be compared - REQUIRE(e == a); - REQUIRE(!(e != a)); - - // Check that type can be serialized - T f; - std::array buffer = {}; - size_t encoded_length = fast_ber::encoded_length(a); - fast_ber::EncodeResult encode_result = fast_ber::encode(absl::Span(buffer), a); - fast_ber::DecodeResult decode_result = fast_ber::decode(absl::Span(buffer), f); - REQUIRE(encode_result.success); - REQUIRE(decode_result.success); - REQUIRE(encode_result.length == encoded_length); - REQUIRE(a == f); - REQUIRE(ID::check_id_match(fast_ber::BerView(buffer).class_(), fast_ber::BerView(buffer).tag())); - - // Printing checks - std::cout << "All test : " << a << "\n id : " << ID{} << "\n\n"; -} - -TEST_CASE("AllTypes: Check all types share a unified interface") -{ - test_type(fast_ber::BitString<>("TestString")); - test_type(fast_ber::Boolean<>(true)); - test_type(fast_ber::CharacterString<>("TestString")); - test_type( - fast_ber::Choice, fast_ber::Integer<>, fast_ber::OctetString<>>(fast_ber::Boolean<>(true))); - // test_type(fast_ber::Date<>); - // test_type(fast_ber::DateTime<>); - // test_type(fast_ber::Duration<>); - // test_type(fast_ber::EmbeddedPDV); - test_type(fast_ber::All::The_Enum<>(fast_ber::All::The_Enum<>::Values::pear)); - test_type(fast_ber::GeneralizedTime<>(absl::Now())); - // test_type(fast_ber::IRI); - test_type(fast_ber::Integer<>(5)); - test_type(fast_ber::Null, - fast_ber::ExplicitId>>()); - // test_type(fast_ber::ObjectField); - test_type(fast_ber::ObjectIdentifier<>(fast_ber::ObjectIdentifierComponents{1, 2, 500, 9999})); - test_type(fast_ber::OctetString<>("TestString")); - test_type(fast_ber::Optional>(fast_ber::Null<>())); - test_type(fast_ber::Optional>>( - fast_ber::All::The_Set>{"Hello", 42})); - // test_type(fast_ber::Real); - // test_type(fast_ber::RelativeIRI); - // test_type(fast_ber::RelativeOID); - test_type(fast_ber::All::The_Sequence<>{"Hello", 42}); - test_type(fast_ber::SequenceOf, fast_ber::ExplicitId, - fast_ber::StorageMode::small_buffer_optimised>({1, 4, 6, 100, 2555})); - test_type(fast_ber::SequenceOf, fast_ber::ExplicitId, - fast_ber::StorageMode::dynamic>({1, 4, 6, 100, 2555})); - test_type(fast_ber::All::The_Set<>{"Hello", 42}); - test_type( - fast_ber::SetOf, fast_ber::ExplicitId>>>( - {"A", "list", "of", "strings"})); - test_type(fast_ber::All::The_Set>({"Hello", 42})); - // test_type(fast_ber::Time); - // test_type(fast_ber::TimeOfDay); - test_type(fast_ber::VisibleString<>("TestString")); -} diff --git a/test/ber_types/BooleanTest.cpp b/test/ber_types/BooleanTest.cpp index f87809c5..41771fb0 100644 --- a/test/ber_types/BooleanTest.cpp +++ b/test/ber_types/BooleanTest.cpp @@ -27,7 +27,7 @@ TEST_CASE("Boolean: Encoding false") std::array buffer = {}; std::array expected = {0x01, 0x01, 0xFF}; - size_t size = encode(absl::MakeSpan(buffer.data(), buffer.size()), test).length; + size_t size = test.encode(absl::MakeSpan(buffer.data(), buffer.size())).length; REQUIRE(size == 3); REQUIRE(absl::MakeSpan(buffer.data(), 3) == absl::MakeSpan(expected)); @@ -39,7 +39,7 @@ TEST_CASE("Boolean: Encoding true") std::array buffer = {}; std::array expected = {0x01, 0x01, 0x00}; - size_t size = encode(absl::MakeSpan(buffer.data(), buffer.size()), test).length; + size_t size = test.encode(absl::MakeSpan(buffer.data(), buffer.size())).length; REQUIRE(size == 3); REQUIRE(absl::MakeSpan(buffer.data(), 3) == absl::MakeSpan(expected)); } diff --git a/test/ber_types/ChoiceTest.cpp b/test/ber_types/ChoiceTest.cpp index bdfabc70..3f4cbe0d 100644 --- a/test/ber_types/ChoiceTest.cpp +++ b/test/ber_types/ChoiceTest.cpp @@ -1,6 +1,4 @@ -#include "autogen/choice.hpp" - -#include "fast_ber/ber_types/Choice.hpp" +#include "fast_ber/ber_types/Choice.hpp" #include "fast_ber/ber_types/Identifier.hpp" #include "fast_ber/ber_types/Integer.hpp" #include "fast_ber/ber_types/OctetString.hpp" @@ -9,7 +7,8 @@ TEST_CASE("Choice: Check string choice matches simple string type") { - const auto choice = fast_ber::Choice, fast_ber::OctetString<>>("Test string"); + const auto choice = + fast_ber::Choice, fast_ber::OctetString<>>>("Test string"); std::vector choice_encoded(100, 0x00); std::vector string_encoded(100, 0x00); @@ -22,36 +21,52 @@ TEST_CASE("Choice: Check string choice matches simple string type") choice_encoded.resize(choice_encode_length); string_encoded.resize(string_encoded_length); - REQUIRE(choice_encoded == string_encoded); + CHECK(choice_encoded == string_encoded); +} + +TEST_CASE("Choice: Encode decode") +{ + using Identifier = fast_ber::DoubleId, + fast_ber::ExplicitId>; + fast_ber::Choice, fast_ber::OctetString<>>, Identifier> choice("Test string"); + + std::vector buffer(100, 0x00); + + fast_ber::EncodeResult encode_result = fast_ber::encode(absl::MakeSpan(buffer.data(), buffer.size()), choice); + fast_ber::DecodeResult decode_result = fast_ber::decode(absl::MakeSpan(buffer.data(), buffer.size()), choice); + + CHECK(encode_result.success); + CHECK(decode_result.success); + CHECK(fast_ber::has_correct_header(fast_ber::BerView(buffer), Identifier{}, fast_ber::Construction::constructed)); } TEST_CASE("Choice: Basic choice") { - fast_ber::Choice, fast_ber::OctetString<>> choice_1; - fast_ber::Choice, fast_ber::OctetString<>> choice_2; + fast_ber::Choice, fast_ber::OctetString<>>> choice_1; + fast_ber::Choice, fast_ber::OctetString<>>> choice_2; choice_1 = "Test string"; choice_2 = 10; - REQUIRE(absl::holds_alternative>(choice_1)); - REQUIRE(absl::holds_alternative>(choice_2)); + CHECK(fast_ber::holds_alternative>(choice_1)); + CHECK(fast_ber::holds_alternative>(choice_2)); std::vector choice_encoded(100, 0x00); bool enc_success = fast_ber::encode(absl::MakeSpan(choice_encoded.data(), choice_encoded.size()), choice_1).success; bool dec_success = fast_ber::decode(absl::MakeSpan(choice_encoded.data(), choice_encoded.size()), choice_2).success; - REQUIRE(enc_success); - REQUIRE(dec_success); - REQUIRE(absl::holds_alternative>(choice_1)); - REQUIRE(absl::holds_alternative>(choice_2)); - REQUIRE(choice_1 == choice_2); + CHECK(enc_success); + CHECK(dec_success); + CHECK(fast_ber::holds_alternative>(choice_1)); + CHECK(fast_ber::holds_alternative>(choice_2)); + CHECK(choice_1 == choice_2); } TEST_CASE("Choice: Clashing type") { - using choice_type = fast_ber::Choice, - fast_ber::OctetString>, - fast_ber::OctetString>>; + using choice_type = fast_ber::Choice, fast_ber::OctetString>, + fast_ber::OctetString>>>; auto choice_1 = choice_type(fast_ber::OctetString>("Test string")); auto choice_2 = choice_type(); @@ -61,20 +76,22 @@ TEST_CASE("Choice: Clashing type") bool enc_success = fast_ber::encode(absl::MakeSpan(choice_encoded.data(), choice_encoded.size()), choice_1).success; bool dec_success = fast_ber::decode(absl::MakeSpan(choice_encoded.data(), choice_encoded.size()), choice_2).success; - REQUIRE(enc_success); - REQUIRE(dec_success); - REQUIRE(absl::holds_alternative::type>(choice_1)); - REQUIRE(absl::holds_alternative::type>(choice_2)); - REQUIRE(choice_1 == choice_2); + CHECK(enc_success); + CHECK(dec_success); + CHECK(fast_ber::holds_alternative::type>(choice_1)); + CHECK(fast_ber::holds_alternative::type>(choice_2)); + CHECK(choice_1 == choice_2); } TEST_CASE("Choice: Choice of choices") { - using Choice1 = fast_ber::Choice>, - fast_ber::OctetString>>; - using Choice2 = fast_ber::Choice>, - fast_ber::OctetString>>; - using Choice3 = fast_ber::Choice; + using Choice1 = + fast_ber::Choice>, + fast_ber::OctetString>>>; + using Choice2 = + fast_ber::Choice>, + fast_ber::OctetString>>>; + using Choice3 = fast_ber::Choice>; using ExpectedId = fast_ber::ChoiceId, fast_ber::Id>, @@ -84,8 +101,8 @@ TEST_CASE("Choice: Choice of choices") Choice3 choice_orig = fast_ber::OctetString>{}; Choice3 choice_copy = fast_ber::OctetString>{}; - REQUIRE(absl::holds_alternative(choice_orig)); - REQUIRE(absl::holds_alternative(choice_copy)); + CHECK(fast_ber::holds_alternative(choice_orig)); + CHECK(fast_ber::holds_alternative(choice_copy)); std::vector choice_encoded(100, 0x00); @@ -94,27 +111,10 @@ TEST_CASE("Choice: Choice of choices") bool dec_success = fast_ber::decode(absl::MakeSpan(choice_encoded.data(), choice_encoded.size()), choice_copy).success; - REQUIRE(enc_success); - REQUIRE(dec_success); - REQUIRE(absl::holds_alternative(choice_orig)); - REQUIRE(absl::holds_alternative(choice_copy)); - REQUIRE(choice_orig == choice_copy); - REQUIRE(std::is_same, ExpectedId>::value); -} - -TEST_CASE("Choice: Generated choice") -{ - fast_ber::MakeAChoice::Collection<> collection; - collection.the_choice = fast_ber::Integer>(5); - - std::vector buffer(1000, 0x00); - size_t length = fast_ber::encode(absl::MakeSpan(buffer.data(), buffer.size()), collection).length; - buffer.resize(length); - - fast_ber::MakeAChoice::Collection<> copy; - bool success = fast_ber::decode(absl::MakeSpan(buffer.data(), buffer.size()), copy).success; - - REQUIRE(length > 0); - REQUIRE(success); - REQUIRE(copy.the_choice == collection.the_choice); + CHECK(enc_success); + CHECK(dec_success); + CHECK(fast_ber::holds_alternative(choice_orig)); + CHECK(fast_ber::holds_alternative(choice_copy)); + CHECK(choice_orig == choice_copy); + CHECK(std::is_same, ExpectedId>::value); } diff --git a/test/ber_types/ConstructionTest.cpp b/test/ber_types/ConstructionTest.cpp index 2ced1b5e..f1135f3e 100644 --- a/test/ber_types/ConstructionTest.cpp +++ b/test/ber_types/ConstructionTest.cpp @@ -14,22 +14,22 @@ TEST_CASE("Construction: get constructed") TEST_CASE("Construction: set primitive") { - uint8_t first = 0x00; - first = fast_ber::add_construction(first, fast_ber::Construction::primitive); - REQUIRE(fast_ber::get_construction(first) == fast_ber::Construction::primitive); + uint8_t test_byte_1 = 0x00; + test_byte_1 = fast_ber::add_construction(test_byte_1, fast_ber::Construction::primitive); + REQUIRE(fast_ber::get_construction(test_byte_1) == fast_ber::Construction::primitive); - first = 0xFF; - first = fast_ber::add_construction(first, fast_ber::Construction::primitive); - REQUIRE(fast_ber::get_construction(first) == fast_ber::Construction::primitive); + uint8_t test_byte_2 = 0xFF; + test_byte_2 = fast_ber::add_construction(test_byte_2, fast_ber::Construction::primitive); + REQUIRE(fast_ber::get_construction(test_byte_2) == fast_ber::Construction::primitive); } TEST_CASE("Construction: set constructed") { - uint8_t first = 0x00; - first = fast_ber::add_construction(first, fast_ber::Construction::constructed); - REQUIRE(fast_ber::get_construction(first) == fast_ber::Construction::constructed); + uint8_t test_byte_1 = 0x00; + test_byte_1 = fast_ber::add_construction(test_byte_1, fast_ber::Construction::constructed); + REQUIRE(fast_ber::get_construction(test_byte_1) == fast_ber::Construction::constructed); - first = 0xFF; - first = fast_ber::add_construction(first, fast_ber::Construction::constructed); - REQUIRE(fast_ber::get_construction(first) == fast_ber::Construction::constructed); + uint8_t test_byte_2 = 0xFF; + test_byte_2 = fast_ber::add_construction(test_byte_2, fast_ber::Construction::constructed); + REQUIRE(fast_ber::get_construction(test_byte_2) == fast_ber::Construction::constructed); } diff --git a/test/ber_types/DefaultTest.cpp b/test/ber_types/DefaultTest.cpp new file mode 100644 index 00000000..6c4f3318 --- /dev/null +++ b/test/ber_types/DefaultTest.cpp @@ -0,0 +1,140 @@ +#include "fast_ber/ber_types/Default.hpp" + +#include "fast_ber/ber_types/Integer.hpp" +#include "fast_ber/ber_types/OctetString.hpp" + +#include + +struct StringDefault +{ + constexpr static absl::string_view get_value() noexcept { return "Hello"; } +}; + +struct IntDefault +{ + constexpr static int get_value() noexcept { return 10; } +}; + +TEST_CASE("Default: Construct") +{ + fast_ber::Default, StringDefault> default_str; + fast_ber::Default, IntDefault> default_int; + + CHECK(default_str == "Hello"); + CHECK(default_str != "Goodbye"); + CHECK(default_str.is_default()); + + CHECK(default_int == 10); + CHECK(default_int != -10); + CHECK(default_str.is_default()); +} + +TEST_CASE("Default: Assign") +{ + fast_ber::Default, StringDefault> default_str = "racoon"; + fast_ber::Default, IntDefault> default_int = -20; + + CHECK(!default_str.is_default()); + CHECK(default_str == "racoon"); + CHECK(!default_int.is_default()); + CHECK(default_int == -20); + + default_str = "Hello"; + default_int = 10; + + CHECK(default_str.is_default()); + CHECK(default_str == "Hello"); + CHECK(default_int.is_default()); + CHECK(default_int == 10); +} + +TEST_CASE("Default: Encode default") +{ + fast_ber::Default, StringDefault> default_str; + fast_ber::Default, IntDefault> default_int; + std::array buffer{}; + + size_t encoded_length_1 = fast_ber::encoded_length(default_str); + size_t encoded_length_2 = fast_ber::encoded_length(default_int); + + fast_ber::EncodeResult encode_res_1 = fast_ber::encode(absl::Span(buffer), default_str); + fast_ber::EncodeResult encode_res_2 = fast_ber::encode(absl::Span(buffer), default_int); + + CHECK(encoded_length_1 == 0); + CHECK(encoded_length_2 == 0); + + CHECK(encode_res_1.success); + CHECK(encode_res_2.success); + + CHECK(encode_res_1.length == 0); + CHECK(encode_res_2.length == 0); +} + +TEST_CASE("Default: Encode non default") +{ + fast_ber::Default, StringDefault> default_str = "racoon"; + fast_ber::Default, IntDefault> default_int = -20; + std::array buffer1{}; + std::array buffer2{}; + std::array buffer3{}; + std::array buffer4{}; + + size_t encoded_length_1 = fast_ber::encoded_length(default_str); + size_t encoded_length_2 = fast_ber::encoded_length(default_int); + size_t encoded_length_3 = fast_ber::encoded_length(fast_ber::OctetString<>("racoon")); + size_t encoded_length_4 = fast_ber::encoded_length(fast_ber::Integer<>(-20)); + + fast_ber::EncodeResult encode_res_1 = fast_ber::encode(absl::Span(buffer1), default_str); + fast_ber::EncodeResult encode_res_2 = fast_ber::encode(absl::Span(buffer2), default_int); + fast_ber::EncodeResult encode_res_3 = + fast_ber::encode(absl::Span(buffer3), fast_ber::OctetString<>("racoon")); + fast_ber::EncodeResult encode_res_4 = fast_ber::encode(absl::Span(buffer4), fast_ber::Integer<>(-20)); + + CHECK(encoded_length_1 == encoded_length_3); + CHECK(encoded_length_2 == encoded_length_4); + + CHECK(encode_res_1.success); + CHECK(encode_res_2.success); + CHECK(encode_res_3.success); + CHECK(encode_res_4.success); + + CHECK(encode_res_1.length == encode_res_3.length); + CHECK(encode_res_2.length == encode_res_4.length); +} + +TEST_CASE("Default: Decode default") +{ + fast_ber::Default, StringDefault> default_str; + fast_ber::Default, IntDefault> default_int; + std::array buffer{}; + + fast_ber::DecodeResult decode_res_1 = fast_ber::decode(absl::Span(buffer.data(), 0), default_str); + fast_ber::DecodeResult decode_res_2 = fast_ber::decode(absl::Span(buffer.data(), 0), default_int); + + CHECK(decode_res_1.success); + CHECK(decode_res_2.success); + + CHECK(default_str == StringDefault::get_value()); + CHECK(default_int == IntDefault::get_value()); +} + +TEST_CASE("Default: Decode non default") +{ + fast_ber::Default, StringDefault> default_str; + fast_ber::Default, IntDefault> default_int; + std::array buffer{}; + + fast_ber::OctetString<>("Unexpected string!").encode(absl::Span(buffer)); + fast_ber::DecodeResult decode_res_1 = fast_ber::decode(absl::Span(buffer), default_str); + + fast_ber::Integer<>(-99999999).encode(absl::Span(buffer)); + fast_ber::DecodeResult decode_res_2 = fast_ber::decode(absl::Span(buffer), default_int); + + CHECK(decode_res_1.success); + CHECK(decode_res_2.success); + + CHECK(default_str == "Unexpected string!"); + CHECK(default_int == -99999999); + CHECK(default_str != StringDefault::get_value()); + CHECK(default_int != IntDefault::get_value()); +} diff --git a/test/ber_types/IdentifierTest.cpp b/test/ber_types/IdentifierTest.cpp index ae850746..d5978bb6 100644 --- a/test/ber_types/IdentifierTest.cpp +++ b/test/ber_types/IdentifierTest.cpp @@ -60,7 +60,7 @@ TEST_CASE("Identifier: Decode ExplicitIdentifier") TEST_CASE("Identifier: Decode TaggedExplicitIdentifier") { - std::array data = {0x94, 0x03, 0x02, 0x01, 0x04}; + std::array data = {0xB4, 0x03, 0x02, 0x01, 0x04}; auto iterator = fast_ber::BerViewIterator(absl::Span(data.data(), data.size())); fast_ber::Integer, fast_ber::ExplicitId>> diff --git a/test/ber_types/IntegerTest.cpp b/test/ber_types/IntegerTest.cpp index 6280567c..2a4e089c 100644 --- a/test/ber_types/IntegerTest.cpp +++ b/test/ber_types/IntegerTest.cpp @@ -69,10 +69,10 @@ TEST_CASE("Integer: Encoding") TEST_CASE("Integer: Assign from raw") { fast_ber::Integer<> i(100); - std::array test_data = {0x00, 0x02, 0x12, 0x34}; + std::array test_data = {0x02, 0x02, 0x12, 0x34}; - size_t size = i.assign_ber(absl::MakeSpan(test_data.data(), test_data.size())); - REQUIRE(size == 4); + fast_ber::DecodeResult res = i.decode(fast_ber::BerView(absl::MakeSpan(test_data.data(), test_data.size()))); + REQUIRE(res.success); REQUIRE(i == 0x1234); } @@ -91,3 +91,21 @@ TEST_CASE("Integer: Tagging") static_assert(std::is_same, Tag>::value, "Tagged Integer"); static_assert(std::is_same, ExplicitTag>::value, "Tagged Identifier"); } + +TEST_CASE("Integer: Encode Decode") +{ + using Identifier = fast_ber::DoubleId, + fast_ber::ExplicitId>; + + fast_ber::Integer i1 = -100; + fast_ber::Integer i2 = +100; + + std::vector buffer(100, 0x00); + + bool enc_success = fast_ber::encode(absl::Span(buffer), i1).success; + bool dec_success = fast_ber::decode(absl::Span(buffer), i2).success; + + REQUIRE(enc_success); + REQUIRE(dec_success); + REQUIRE(i1 == i2); +} diff --git a/test/ber_types/NullTest.cpp b/test/ber_types/NullTest.cpp index f64b2007..479a6d6b 100644 --- a/test/ber_types/NullTest.cpp +++ b/test/ber_types/NullTest.cpp @@ -19,6 +19,23 @@ TEST_CASE("Null: Assign from raw") fast_ber::Null<> null; std::array test_data = {0x05, 0x00}; - size_t size = null.assign_ber(absl::MakeSpan(test_data.data(), test_data.size())); - REQUIRE(size == 2); + fast_ber::DecodeResult res = null.decode(fast_ber::BerView(test_data)); + REQUIRE(res.success); +} + +TEST_CASE("Null: Double id") +{ + fast_ber::Null, + fast_ber::Id>> + null; + std::array buffer{}; + + constexpr size_t encoded_length = fast_ber::encoded_length(null); + fast_ber::EncodeResult encode_result = fast_ber::encode(absl::Span(buffer), null); + fast_ber::DecodeResult decode_result = fast_ber::decode(buffer, null); + + REQUIRE(encode_result.success); + REQUIRE(decode_result.success); + REQUIRE(encode_result.length == 10); + REQUIRE(encoded_length == 10); } diff --git a/test/ber_types/ObjectIdentifierTest.cpp b/test/ber_types/ObjectIdentifierTest.cpp index 2605b8ef..138d45ef 100644 --- a/test/ber_types/ObjectIdentifierTest.cpp +++ b/test/ber_types/ObjectIdentifierTest.cpp @@ -32,12 +32,32 @@ TEST_CASE("Object Identifier: Assign from raw") fast_ber::ObjectIdentifier<> oid; std::array test_data = {0x06, 0x06, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d}; - size_t size = oid.assign_ber(absl::MakeSpan(test_data.data(), test_data.size())); + fast_ber::DecodeResult res = oid.decode(fast_ber::BerView(test_data)); REQUIRE(oid.value() == fast_ber::ObjectIdentifierComponents{1, 2, 840, 113549}); - REQUIRE(size == test_data.size()); + REQUIRE(res.success); } TEST_CASE("Object Identifier: Default value") { REQUIRE(fast_ber::ObjectIdentifier<>().value() == fast_ber::ObjectIdentifierComponents{}); } + +TEST_CASE("Object Identifier: Encode decode") +{ + using Identifier = fast_ber::DoubleId, + fast_ber::ExplicitId>; + + fast_ber::ObjectIdentifier oid1 = + fast_ber::ObjectIdentifierComponents{1, 2, 9999999999999, 9999999999999, 999999999999999, 9999999999999}; + fast_ber::ObjectIdentifier oid2; + + std::vector buffer(100, 0x00); + + fast_ber::EncodeResult encode_result = fast_ber::encode(absl::MakeSpan(buffer.data(), buffer.size()), oid1); + fast_ber::DecodeResult decode_result = fast_ber::decode(absl::MakeSpan(buffer.data(), buffer.size()), oid2); + + CHECK(encode_result.success); + CHECK(decode_result.success); + CHECK(oid1 == oid2); + CHECK(fast_ber::has_correct_header(fast_ber::BerView(buffer), Identifier{}, fast_ber::Construction::primitive)); +} diff --git a/test/ber_types/OctetStringTest.cpp b/test/ber_types/OctetStringTest.cpp index 0297d0b6..da1f6c06 100644 --- a/test/ber_types/OctetStringTest.cpp +++ b/test/ber_types/OctetStringTest.cpp @@ -59,7 +59,7 @@ TEST_CASE("OctetString: Construction from const char*") TEST_CASE("OctetString: Construction from sample packet") { fast_ber::OctetString<> octet_string; - octet_string.assign_ber(hello_world_packet); + octet_string.decode(fast_ber::BerView(hello_world_packet)); REQUIRE(octet_string.value() == "Hello world"); } diff --git a/test/ber_types/RealTest.cpp b/test/ber_types/RealTest.cpp new file mode 100644 index 00000000..1ee0749f --- /dev/null +++ b/test/ber_types/RealTest.cpp @@ -0,0 +1,109 @@ +#include "fast_ber/ber_types/Real.hpp" + +#include "absl/types/optional.h" + +#include + +#include +#include + +TEST_CASE("Real: Construction from double") +{ + std::initializer_list test_vals{0.0, + -0.0, + std::numeric_limits::infinity(), + -std::numeric_limits::infinity(), + -9999999999.99999, + -27837.48, + -256.0, + -255.0, + -254.0, + -50.0, + -20.434, + -1.0, + 0, + 1.0, + 255.022, + 256.2343, + 20.888, + 50.00, + 99999.9999, + 27836.1232312, + 27837.43645454, + 27838.34324, + 37699.34234, + 999999999.9999}; + + for (double val : test_vals) + { + fast_ber::Real<> real1(val); + fast_ber::Real> real2(real1); + fast_ber::Real> real3; + absl::optional> real4; + absl::optional> real5(real1); + + real3 = real2; + real4 = real3; + + REQUIRE(real1 == val); + REQUIRE(real2 == val); + REQUIRE(real3 == val); + REQUIRE(real4 == val); + REQUIRE(real4 == val); + } +} + +struct TestData +{ + std::vector data; + double value; +}; + +TEST_CASE("Real: Decoding") +{ + std::vector test_data = {{{0x09, 0x00}, 0.0}, + {{0x09, 0x08, 0x03, 0x31, 0x32, 0x33, 0x2e, 0x45, 0x2d, 0x33}, 0.123}, + {{0x09, 0x01, 0x40}, std::numeric_limits::infinity()}, + {{0x09, 0x01, 0x41}, -std::numeric_limits::infinity()}, + {{0x09, 0x01, 0x43}, -0.0}, + {{0x09, 0x05, 0x01, '0', '0', '0', '0'}, 0}, + {{0x09, 0x05, 0x01, '2', '0', '9', '4'}, 2094}, + {{0x09, 0x06, 0x01, '-', '2', '0', '9', '4'}, -2094}, + {{0x09, 0x06, 0x01, '+', '4', '3', '2', '1'}, 4321}, + {{0x09, 0x07, 0x02, '3', '2', '1', ',', '5', '4'}, 321.54}, + {{0x09, 0x08, 0x03, '+', '6', '.', '5', 'e', '3', '0'}, 6.5e30}}; + + for (TestData test : test_data) + { + fast_ber::Real<> r; + fast_ber::DecodeResult res = fast_ber::decode(test.data, r); + + REQUIRE(res.success); + REQUIRE(r == test.value); + } +} + +TEST_CASE("Real: Default value") { REQUIRE(fast_ber::Real<>() == 0); } + +TEST_CASE("Real: Tagging") +{ + using Tag = fast_ber::Id; + using DefaultTag = fast_ber::ExplicitId; + using ExplicitTag = fast_ber::DoubleId, + fast_ber::ExplicitId>; + using TaggedReal = fast_ber::Real; + using ExplicitTaggedReal = fast_ber::Real; + + static_assert(std::is_same>, DefaultTag>::value, "Tagged Real"); + static_assert(std::is_same, Tag>::value, "Tagged Real"); + static_assert(std::is_same, ExplicitTag>::value, "Tagged Real"); +} + +TEST_CASE("Default: Serialize") +{ + std::stringstream ss; + fast_ber::Real<> r = 0.5; + + ss << r; + REQUIRE(ss.str() == "0.5"); +} diff --git a/test/ber_types/SequenceOfTest.cpp b/test/ber_types/SequenceOfTest.cpp index d8873047..404027ed 100644 --- a/test/ber_types/SequenceOfTest.cpp +++ b/test/ber_types/SequenceOfTest.cpp @@ -9,24 +9,25 @@ #include -template -void test_sequences(const std::initializer_list>& sequences) +template +void test_sequences(const std::initializer_list>& sequences) { std::array buffer = {}; for (const auto& sequence : sequences) { - fast_ber::SequenceOf copy; - - size_t expected_size = encoded_length(sequence); - size_t encode_size = fast_ber::encode(absl::MakeSpan(buffer.data(), buffer.size()), sequence).length; - fast_ber::BerViewIterator iter = fast_ber::BerViewIterator(absl::MakeSpan(buffer.data(), encode_size)); - bool success = fast_ber::decode(iter, copy).success; - - REQUIRE(success); - REQUIRE(expected_size == encode_size); - REQUIRE(copy.size() == sequence.size()); - REQUIRE(sequence == copy); - REQUIRE(iter == fast_ber::BerViewIterator(fast_ber::End::end)); + fast_ber::SequenceOf copy; + + size_t expected_size = encoded_length(sequence); + fast_ber::EncodeResult encode_result = fast_ber::encode(absl::MakeSpan(buffer.data(), buffer.size()), sequence); + fast_ber::BerViewIterator iter = fast_ber::BerViewIterator(absl::MakeSpan(buffer.data(), encode_result.length)); + fast_ber::DecodeResult decode_result = fast_ber::decode(iter, copy); + + CHECK(encode_result.success); + CHECK(decode_result.success); + CHECK(expected_size == encode_result.length); + CHECK(copy.size() == sequence.size()); + CHECK(sequence == copy); + CHECK(iter == fast_ber::BerViewIterator(fast_ber::End::end)); } } @@ -44,16 +45,28 @@ TEST_CASE("SequenceOf: Encode decode integer") TEST_CASE("SequenceOf: Various tags") { - auto tagged = + auto tagged_content = fast_ber::SequenceOf>>{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, -999, 999, 999999999}; - auto double_tagged = fast_ber::SequenceOf, fast_ber::Id>>>{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, -999, 999}; - test_sequences({fast_ber::SequenceOf>{"", ";;", "!", "@"}}); - test_sequences({fast_ber::SequenceOf>{"", ";;", "!", "@"}}); + auto tagged_sequence = + fast_ber::SequenceOf, fast_ber::Id>{ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, -999, 999, 999999999}; + + auto double_tagged_sequence = + fast_ber::SequenceOf, + fast_ber::DoubleId, + fast_ber::Id>>{ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, -999, 999}; + + test_sequences({tagged_content}); + test_sequences({double_tagged_content}); + test_sequences({tagged_sequence}); + test_sequences({double_tagged_sequence}); } TEST_CASE("SequenceOf: Various types") diff --git a/test/ber_types/TaggedType.cpp b/test/ber_types/TaggedType.cpp index ad08a122..56023433 100644 --- a/test/ber_types/TaggedType.cpp +++ b/test/ber_types/TaggedType.cpp @@ -14,7 +14,7 @@ TEST_CASE("TaggedType: Assign") TaggedInt b = a; REQUIRE(b == 4); - REQUIRE(fast_ber::val(fast_ber::Identifier::tag()) == 5); + REQUIRE(fast_ber::Identifier::tag() == 5); static_assert(std::is_same, Tag>::value, "Double Tagged Identifier"); } diff --git a/test/compiler/Anonymous.cpp b/test/compiler/Anonymous.cpp deleted file mode 100644 index 459bd6ca..00000000 --- a/test/compiler/Anonymous.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "autogen/anonymous_members.hpp" - -#include "catch2/catch.hpp" - -static_assert(std::is_same::anonymous_member_0), fast_ber::Null<>>::value, "Anon"); -static_assert(std::is_same::anonymous_member_1), - fast_ber::SequenceOf>>::value, - "Anon"); -static_assert(std::is_same::anonymous_member_2), fast_ber::Integer<>>::value, - "Anon"); diff --git a/test/compiler/Circular.cpp b/test/compiler/Circular.cpp deleted file mode 100644 index b751ccec..00000000 --- a/test/compiler/Circular.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "autogen/circular.hpp" - -#include "catch2/catch.hpp" - -TEST_CASE("Circular Types: Optional Members") -{ - fast_ber::Circular::CircularSequence1<> copy; - fast_ber::Circular::CircularSequence1<> circular = {"layer1", - {{"layer2", {{"layer3", {{"layer4", {{"layer5", {}}}}}}}}}}; - - REQUIRE(copy != circular); - - std::vector buffer(500, 0); - const fast_ber::EncodeResult& encode_res = fast_ber::encode(absl::Span(buffer), circular); - const fast_ber::DecodeResult& decode_res = fast_ber::decode(absl::Span(buffer), copy); - - REQUIRE(encode_res.success); - REQUIRE(decode_res.success); - REQUIRE(copy == circular); - REQUIRE(copy.cs2->cs1.cs2->cs1.cs2->cs1.cs2->cs1.name == "layer5"); -} - -TEST_CASE("Circular Types: Sequence Of") -{ - fast_ber::Circular::CircularSequenceOf1<> copy; - fast_ber::Circular::CircularSequenceOf1<> circular = {{{{{}, {}, {}, {}}}, {}, {{{}, {}}}, {}, {{{}, {}, {}}}}}; - REQUIRE(copy != circular); - - std::vector buffer(500, 0); - const fast_ber::EncodeResult& encode_res = fast_ber::encode(absl::Span(buffer), circular); - const fast_ber::DecodeResult& decode_res = fast_ber::decode(absl::Span(buffer), copy); - - REQUIRE(encode_res.success); - REQUIRE(decode_res.success); - REQUIRE(copy == circular); - REQUIRE(copy.sequence[0].sequence.size() == 4); -} diff --git a/test/compiler/ReorderAssignmentsTest.cpp b/test/compiler/ReorderAssignmentsTest.cpp new file mode 100644 index 00000000..664e55b0 --- /dev/null +++ b/test/compiler/ReorderAssignmentsTest.cpp @@ -0,0 +1,115 @@ +#include "fast_ber/compiler/ReorderAssignments.hpp" + +#include "catch2/catch.hpp" + +TEST_CASE("ReorderAssignments: No depdendencies") +{ + // No dependencies between assignments. + // Assignments should maintain their order + + std::vector assignments = { + Assignment{"Int", TypeAssignment{IntegerType{}}, {}, {}}, + Assignment{"String", TypeAssignment{OctetStringType{}}, {}, {}}, + Assignment{"Boolean", TypeAssignment{BooleanType{}}, {}, {}}, + }; + + REQUIRE(is_integer(absl::get(assignments[0].specific).type)); + REQUIRE(is_octet_string(absl::get(assignments[1].specific).type)); + REQUIRE(is_boolean(absl::get(assignments[2].specific).type)); + + auto reordered = reorder_assignments(assignments, Asn1Tree{}, Module{"module"}); + + REQUIRE(assignments.size() == reordered.size()); + + REQUIRE(reordered[0].depends_on.size() == 0); + REQUIRE(reordered[1].depends_on.size() == 0); + REQUIRE(reordered[2].depends_on.size() == 0); + + REQUIRE(is_integer(absl::get(reordered[0].specific).type)); + REQUIRE(is_octet_string(absl::get(reordered[1].specific).type)); + REQUIRE(is_boolean(absl::get(reordered[2].specific).type)); +} + +TEST_CASE("ReorderAssignments: Defined") +{ + std::vector assignments = { + Assignment{"Defined", TypeAssignment{DefinedType{{}, {"Boolean"}, {}}}, {}, {}}, + Assignment{"Boolean", TypeAssignment{BooleanType{}}, {}, {}}, + }; + + REQUIRE(is_defined(absl::get(assignments[0].specific).type)); + REQUIRE(is_boolean(absl::get(assignments[1].specific).type)); + + auto reordered = reorder_assignments(assignments, Asn1Tree{}, Module{"module"}); + + REQUIRE(assignments.size() == reordered.size()); + + REQUIRE(reordered[0].depends_on.size() == 0); + REQUIRE(reordered[1].depends_on.size() == 1); + + REQUIRE(is_boolean(absl::get(reordered[0].specific).type)); + REQUIRE(is_defined(absl::get(reordered[1].specific).type)); +} + +TEST_CASE("ReorderAssignments: Sequence") +{ + std::vector assignments = { + Assignment{"Defined", + TypeAssignment{ + SequenceType{{ComponentType{ + NamedType{"member", DefinedType{{}, {"Boolean"}, {}}}, true, {}, {}, StorageMode::static_}}}, + }, + {}, + {}}, + Assignment{"Boolean", TypeAssignment{BooleanType{}}, {}, {}}, + }; + + REQUIRE(is_sequence(absl::get(assignments[0].specific).type)); + REQUIRE(is_boolean(absl::get(assignments[1].specific).type)); + + auto reordered = reorder_assignments(assignments, Asn1Tree{}, Module{"module"}); + + REQUIRE(assignments.size() == reordered.size()); + + REQUIRE(reordered[0].depends_on.size() == 0); + REQUIRE(reordered[1].depends_on.size() == 1); + + REQUIRE(is_boolean(absl::get(reordered[0].specific).type)); + REQUIRE(is_sequence(absl::get(reordered[1].specific).type)); + + REQUIRE(absl::get(absl::get(absl::get(reordered[1].specific).type)) + .components[0] + .optional_storage == StorageMode::static_); +} + +TEST_CASE("ReorderAssignments: Circular Sequence") +{ + ComponentType component = { + NamedType{"member", DefinedType{{}, {"Defined"}, {}}}, true, {}, {}, StorageMode::static_}; + std::vector assignments = { + Assignment{"Defined", + TypeAssignment{ + SequenceType{{component}}, + }, + {}, + {}}, + }; + + // Reference is optional, Should reorder and specify ciruclar ok + REQUIRE(is_sequence(absl::get(assignments[0].specific).type)); + + auto reordered = reorder_assignments(assignments, Asn1Tree{}, Module{"module"}); + + REQUIRE(assignments.size() == reordered.size()); + REQUIRE(is_sequence(absl::get(reordered[0].specific).type)); + REQUIRE(absl::get(absl::get(absl::get(reordered[0].specific).type)) + .components[0] + .optional_storage == StorageMode::dynamic); + + absl::get(absl::get(absl::get(assignments[0].specific).type)) + .components[0] + .is_optional = false; + + // Reference is not optional, should throw + CHECK_THROWS(reorder_assignments(assignments, Asn1Tree{}, Module{"module"})); +} diff --git a/test/compiler/SequenceOf.cpp b/test/compiler/SequenceOf.cpp deleted file mode 100644 index c2c9d8b5..00000000 --- a/test/compiler/SequenceOf.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "autogen/sequence_of.hpp" - -#include "catch2/catch.hpp" - -#include - -TEST_CASE("Sequence Of: Encode and decode sequences") -{ - std::array buffer = {}; - fast_ber::Sequence_::SequenceFive<> sequence = {{{""}}}; - - fast_ber::EncodeResult encode_result = fast_ber::encode(absl::MakeSpan(buffer.data(), buffer.size()), sequence); - fast_ber::DecodeResult decode_result = fast_ber::decode(absl::MakeSpan(buffer.data(), buffer.size()), sequence); - - REQUIRE(encode_result.success); - REQUIRE(decode_result.success); -} diff --git a/test/generated/AllTest.cpp b/test/generated/AllTest.cpp new file mode 100644 index 00000000..105ace2f --- /dev/null +++ b/test/generated/AllTest.cpp @@ -0,0 +1,198 @@ +#include "fast_ber/ber_types/All.hpp" + +#include "autogen/all_types.hpp" + +#include + +#include "absl/time/clock.h" + +namespace dflt +{ +struct StringDefault +{ + constexpr static const char* get_value() noexcept { return "Hello"; } +}; + +struct IntDefault +{ + constexpr static int get_value() noexcept { return 10; } +}; +} // namespace dflt + +template +struct IsOptional : std::false_type +{ +}; + +template +struct IsOptional> : std::true_type +{ +}; + +template +struct IsDefault : std::false_type +{ +}; + +template +struct IsDefault> : std::true_type +{ +}; + +template +void test_type(const T& a) +{ + using ID = fast_ber::Identifier; + + INFO(a); + INFO(ID{}); + + // Check that type can be default constructed + CHECK(T{} == T{}); + CHECK(std::is_nothrow_constructible::value); + + // Check that type can be copied + T b = a; + b = a; + T c(b); + CHECK(c == a); + CHECK(std::is_copy_constructible::value); + CHECK(std::is_copy_assignable::value); + + // Check that type can be moved + T d = std::move(b); + d = std::move(c); + T e(std::move(d)); + CHECK(e == a); + CHECK(std::is_nothrow_move_constructible::value); + CHECK(std::is_nothrow_move_assignable::value); + + // Check that type can be compared + CHECK(e == a); + CHECK(!(e != a)); + + // Check that type can be serialized + T f; + std::array buffer = {}; + size_t encoded_len = a.encoded_length(); + fast_ber::EncodeResult encode_result = a.encode(absl::Span(buffer)); + fast_ber::DecodeResult decode_result = f.decode(fast_ber::BerView(absl::MakeSpan(buffer.data(), encoded_len))); + CHECK(encode_result.success); + CHECK(decode_result.success); + CHECK(encode_result.length == encoded_len); + CHECK(a == f); + if ((!IsDefault::value && !IsOptional::value)) // Default / Optional types may have empty encoding + { + CHECK(encoded_len > 0); + } + if (encoded_len > 0) + { + CHECK(ID::check_id_match(fast_ber::BerView(buffer).class_(), fast_ber::BerView(buffer).tag())); + } + + // Destructive tests - Check for undefined behaviour when using too small buffer + for (size_t i = 0; i < encoded_len; i++) + { + INFO(i); + + fast_ber::EncodeResult destructive_encode_result = fast_ber::encode(absl::MakeSpan(buffer.data(), i), a); + fast_ber::DecodeResult destructive_decode_result = fast_ber::decode(absl::MakeSpan(buffer.data(), i), f); + + CHECK(!destructive_encode_result.success); + + // buffer may be valid for decoding, by chance + (void)destructive_decode_result; + } + + // Printing check + std::cout << "All test : " << a << "\n id : " << ID{} << "\n\n"; +} + +template +void test_type_with_id() +{ + test_type(fast_ber::BitString("TestString")); + test_type(fast_ber::Boolean(true)); + test_type(fast_ber::CharacterString("TestString")); + test_type(fast_ber::Choice, fast_ber::OctetString<>>, Identifier>( + fast_ber::Boolean<>(true))); + test_type(fast_ber::Choice, fast_ber::OctetString<>>, Identifier, + fast_ber::StorageMode::dynamic>(fast_ber::Boolean<>(true))); + // test_type(fast_ber::Date<>); + // test_type(fast_ber::DateTime<>); + test_type(fast_ber::Default, dflt::IntDefault>(dflt::IntDefault::get_value())); + test_type(fast_ber::Default, dflt::IntDefault>(-123456)); + test_type( + fast_ber::Default, dflt::StringDefault>(dflt::StringDefault::get_value())); + test_type(fast_ber::Default, dflt::StringDefault>("Non default string value")); + // test_type(fast_ber::Duration<>); + test_type(fast_ber::All::The_Enum(fast_ber::All::The_Enum<>::Values::pear)); + test_type(fast_ber::GeneralizedTime(absl::Now())); + test_type(fast_ber::Integer(5)); + test_type(fast_ber::Null()); + test_type(fast_ber::ObjectIdentifier(fast_ber::ObjectIdentifierComponents{1, 2, 500, 9999})); + test_type(fast_ber::OctetString("TestString")); + test_type(fast_ber::Optional>(fast_ber::Null<>())); + test_type(fast_ber::Optional>(fast_ber::All::The_Set<>{"Hello", 42})); + test_type(fast_ber::Real(0.7774750819971197)); + test_type(fast_ber::All::The_Sequence{"Hello", 42}); + test_type(fast_ber::SequenceOf, Identifier, fast_ber::StorageMode::small_buffer_optimised>( + {1, 4, 6, 100, 2555})); + test_type( + fast_ber::SequenceOf, Identifier, fast_ber::StorageMode::dynamic>({1, 4, 6, 100, 2555})); + test_type(fast_ber::All::The_Set{"Hello", 42}); + test_type(fast_ber::SetOf>({"A", "list", "of", "strings"})); + test_type(fast_ber::All::The_Set({"Hello", 42})); + // test_type(fast_ber::Time); + // test_type(fast_ber::TimeOfDay); + test_type(fast_ber::VisibleString("TestString")); +} + +TEST_CASE("AllTypes: Check all types share a unified interface") +{ + test_type_with_id>(); +#if 0 // Commented out to reduce compile time (Heavy Templating) + test_type_with_id>(); + test_type_with_id>(); + test_type_with_id>(); + test_type_with_id, + fast_ber::ExplicitId>>(); + test_type_with_id, + fast_ber::Id>>(); + + test_type(fast_ber::Choice, fast_ber::Integer<>, fast_ber::OctetString<>>>( + fast_ber::Boolean<>(true))); + test_type(fast_ber::Choice, fast_ber::Integer<>, fast_ber::OctetString<>>, + fast_ber::Id, fast_ber::StorageMode::dynamic>( + fast_ber::Boolean<>(false))); +#endif +} + +TEST_CASE("AllTypes: Default Id") +{ + test_type(fast_ber::BitString<>("TestString")); + test_type(fast_ber::Boolean<>(true)); + test_type(fast_ber::CharacterString<>("TestString")); + test_type(fast_ber::Choice, fast_ber::OctetString<>>>(true)); + // test_type(fast_ber::Date<>); + // test_type(fast_ber::DateTime<>); + // test_type(fast_ber::Duration<>); + test_type(fast_ber::All::The_Enum<>(fast_ber::All::The_Enum<>::Values::pear)); + test_type(fast_ber::GeneralizedTime<>(absl::Now())); + test_type(fast_ber::Integer<>(5)); + test_type(fast_ber::Null<>()); + test_type(fast_ber::ObjectIdentifier<>(fast_ber::ObjectIdentifierComponents{1, 2, 500, 9999})); + test_type(fast_ber::OctetString<>("TestString")); + test_type(fast_ber::Optional>()); + test_type(fast_ber::Optional>(fast_ber::Null<>())); + test_type(fast_ber::Optional>(fast_ber::All::The_Set<>{"Hello", 42})); + test_type(fast_ber::Real<>(-9999.456)); + test_type(fast_ber::All::The_Sequence<>{"Hello", 42}); + test_type(fast_ber::SequenceOf>({1, 4, 6, 100, 2555})); + test_type(fast_ber::All::The_Set<>{"Hello", 42}); + test_type(fast_ber::SetOf>({"A", "list", "of", "strings"})); + test_type(fast_ber::All::The_Set<>({"Hello", 42})); + // test_type(fast_ber::Time); + // test_type(fast_ber::TimeOfDay); + test_type(fast_ber::VisibleString<>("TestString")); +} diff --git a/test/generated/Anonymous.cpp b/test/generated/Anonymous.cpp new file mode 100644 index 00000000..06d395a7 --- /dev/null +++ b/test/generated/Anonymous.cpp @@ -0,0 +1,13 @@ +#include "autogen/anonymous_members.hpp" + +#include "catch2/catch.hpp" + +TEST_CASE("Anonymous: Unnamed members of sequence") +{ + CHECK(std::is_same::anonymous_member_0), fast_ber::Null<>>::value); + CHECK(std::is_same< + decltype(fast_ber::Anonymous::Anon<>::anonymous_member_1), + fast_ber::SequenceOf, fast_ber::ExplicitId, + fast_ber::StorageMode::small_buffer_optimised>>::value); + CHECK(std::is_same::anonymous_member_2), fast_ber::Integer<>>::value); +} diff --git a/test/generated/ChoiceTest.cpp b/test/generated/ChoiceTest.cpp new file mode 100644 index 00000000..9e2bed77 --- /dev/null +++ b/test/generated/ChoiceTest.cpp @@ -0,0 +1,125 @@ +#include "autogen/choice.hpp" + +#include + +TEST_CASE("Choice: Generated choice") +{ + fast_ber::MakeAChoice::Collection<> collection; + collection.the_choice = fast_ber::Integer>(5); + + std::vector buffer; + size_t expected_length = fast_ber::encoded_length(collection); + buffer.resize(expected_length); + size_t length = fast_ber::encode(absl::MakeSpan(buffer.data(), buffer.size()), collection).length; + + fast_ber::MakeAChoice::Collection<> copy; + bool success = fast_ber::decode(absl::MakeSpan(buffer.data(), buffer.size()), copy).success; + + CHECK(length > 0); + CHECK(length == expected_length); + + CHECK(success); + CHECK(copy.the_choice == collection.the_choice); +} + +TEST_CASE("Choice: Generated choice explicit tags") +{ + fast_ber::ExplicitChoice::MyChoice<> choice; + choice = fast_ber::ExplicitChoice::MySequence<>{}; + + std::vector buffer(1000, 0x00); + size_t expected_length = fast_ber::encoded_length(choice); + buffer.resize(expected_length); + size_t length = fast_ber::encode(absl::MakeSpan(buffer.data(), buffer.size()), choice).length; + + fast_ber::ExplicitChoice::MyChoice<> copy; + bool success = fast_ber::decode(absl::MakeSpan(buffer.data(), buffer.size()), copy).success; + + CHECK(length > 0); + CHECK(length == expected_length); + CHECK(success); + CHECK(copy == choice); +} + +TEST_CASE("Choice: Tags") +{ + fast_ber::MakeAChoice::Collection<> c; + CHECK(std::is_same< + fast_ber::Identifier, + fast_ber::ChoiceId< + fast_ber::Id, fast_ber::Id, + fast_ber::Id, fast_ber::Id, + fast_ber::Id>>::value); + CHECK(std::is_same>, + fast_ber::Id>::value); + CHECK(std::is_same>, + fast_ber::Id>::value); + CHECK(std::is_same>, + fast_ber::Id>::value); + CHECK(std::is_same>, + fast_ber::Id>::value); + CHECK(std::is_same>, + fast_ber::Id>::value); +} + +TEST_CASE("Choice: Type deduction") +{ + using TestChoices = fast_ber::Choices>, + fast_ber::OctetString>, + fast_ber::Boolean>>; + using TestChoiceIds = typename TestChoices::DefaultIdentifier; + + fast_ber::Choice choice1; + choice1 = fast_ber::OctetString<>{}; + choice1 = fast_ber::Integer<>{}; + choice1 = fast_ber::Boolean<>{}; + + fast_ber::Choice choice2; + choice2 = fast_ber::OctetString<>{}; + choice2 = fast_ber::Integer<>{}; + choice2 = fast_ber::Boolean<>{}; + + fast_ber::MakeAChoice::Collection<> collection{fast_ber::Boolean<>(true)}; + + collection.the_choice = fast_ber::OctetString>("one"); + CHECK(fast_ber::get<0>(collection.the_choice) == "one"); + + collection.the_choice = fast_ber::OctetString>("two"); + CHECK(fast_ber::get<1>(collection.the_choice) == "two"); + + collection.the_choice = fast_ber::Integer<>(5); + CHECK(fast_ber::get<2>(collection.the_choice) == 5); + + collection.the_choice = fast_ber::Boolean<>(true); + CHECK(fast_ber::get<3>(collection.the_choice)); + + collection.the_choice = fast_ber::Boolean<>(false); + CHECK(!fast_ber::get<3>(collection.the_choice)); +} + +TEST_CASE("Choice: Explicit Tags") +{ + fast_ber::ExplicitChoice::MyChoice<> c; + CHECK(std::is_same< + fast_ber::Identifier>, + fast_ber::ChoiceId< + fast_ber::Id, fast_ber::Id, + fast_ber::Id, fast_ber::Id, + fast_ber::Id>>::value); + + CHECK(std::is_same>, + fast_ber::DoubleId, + fast_ber::ExplicitId>>::value); + CHECK(std::is_same>, + fast_ber::DoubleId, + fast_ber::ExplicitId>>::value); + CHECK(std::is_same>, + fast_ber::DoubleId, + fast_ber::ExplicitId>>::value); + CHECK(std::is_same>, + fast_ber::DoubleId, + fast_ber::ExplicitId>>::value); + CHECK(std::is_same>, + fast_ber::DoubleId, + fast_ber::ExplicitId>>::value); +} diff --git a/test/generated/Circular.cpp b/test/generated/Circular.cpp new file mode 100644 index 00000000..d596725c --- /dev/null +++ b/test/generated/Circular.cpp @@ -0,0 +1,95 @@ +#include "autogen/circular.hpp" + +#include "catch2/catch.hpp" + +TEST_CASE("Circular Types: Optional Members") +{ + fast_ber::Circular::CircularSequence1<> copy; + fast_ber::Circular::CircularSequence1<> circular = { + "layer1", + fast_ber::Circular::CircularSequence2<>{fast_ber::Circular::CircularSequence1<>{ + "layer2", + fast_ber::Circular::CircularSequence2<>{fast_ber::Circular::CircularSequence1<>{ + "layer3", fast_ber::Circular::CircularSequence2<>{fast_ber::Circular::CircularSequence1<>{ + "layer4", fast_ber::Circular::CircularSequence2<>{ + fast_ber::Circular::CircularSequence1<>{"layer5", fast_ber::empty}}}}}}}}}; + + REQUIRE(copy != circular); + + std::vector buffer(500, 0); + const fast_ber::EncodeResult& encode_res = fast_ber::encode(absl::Span(buffer), circular); + const fast_ber::DecodeResult& decode_res = fast_ber::decode(absl::Span(buffer), copy); + + REQUIRE(encode_res.success); + REQUIRE(decode_res.success); + REQUIRE(copy == circular); + REQUIRE(copy.cs2->cs1.cs2->cs1.cs2->cs1.cs2->cs1.name == "layer5"); +} + +TEST_CASE("Circular Types: Sequence Of") +{ + fast_ber::Circular::CircularSequenceOf1<> copy; + fast_ber::Circular::CircularSequenceOf1<> circular{fast_ber::Circular::CircularSequenceOf2<>{ + fast_ber::Circular::CircularSequenceOf1<>{fast_ber::Circular::CircularSequenceOf2<>{ + fast_ber::Circular::CircularSequenceOf1<>{}, fast_ber::Circular::CircularSequenceOf1<>{}, + fast_ber::Circular::CircularSequenceOf1<>{}, fast_ber::Circular::CircularSequenceOf1<>{}}}, + fast_ber::Circular::CircularSequenceOf1<>{}, + fast_ber::Circular::CircularSequenceOf1<>{fast_ber::Circular::CircularSequenceOf2<>{ + fast_ber::Circular::CircularSequenceOf1<>{}, fast_ber::Circular::CircularSequenceOf1<>{}}}, + fast_ber::Circular::CircularSequenceOf1<>{}, + fast_ber::Circular::CircularSequenceOf1<>{fast_ber::Circular::CircularSequenceOf2<>{ + fast_ber::Circular::CircularSequenceOf1<>{}, fast_ber::Circular::CircularSequenceOf1<>{}, + fast_ber::Circular::CircularSequenceOf1<>{}}}}}; + REQUIRE(copy != circular); + + std::vector buffer(500, 0); + const fast_ber::EncodeResult& encode_res = fast_ber::encode(absl::Span(buffer), circular); + const fast_ber::DecodeResult& decode_res = fast_ber::decode(absl::Span(buffer), copy); + + REQUIRE(encode_res.success); + REQUIRE(decode_res.success); + REQUIRE(copy == circular); + REQUIRE(copy.sequence[0].sequence.size() == 4); +} + +TEST_CASE("Circular Types: Choice") +{ + fast_ber::Circular::CircularChoice1<> copy; + fast_ber::Circular::CircularChoice1<> circular; + circular.emplace<1>("bla", fast_ber::Circular::CircularChoice1<>{}); + + REQUIRE(copy != circular); + + std::vector buffer(500, 0); + const fast_ber::EncodeResult& encode_res = fast_ber::encode(absl::Span(buffer), circular); + const fast_ber::DecodeResult& decode_res = fast_ber::decode(absl::Span(buffer), copy); + + REQUIRE(encode_res.success); + REQUIRE(decode_res.success); + REQUIRE(copy == circular); + REQUIRE(fast_ber::get<0>(fast_ber::get<1>(copy).choice) == 0); +} + +TEST_CASE("Circular Types: Choice Self Reference") +{ + using String = fast_ber::OctetString>; + using Self = fast_ber::Circular::SelfReference>; + + Self copy; + Self circular; + + circular.emplace<1>().emplace<1>().emplace<1>().emplace<0>(String("Hello!")); + + REQUIRE(copy != circular); + + std::vector buffer(500, 0); + const size_t encode_res_len = fast_ber::encoded_length(circular); + const fast_ber::EncodeResult& encode_res = fast_ber::encode(absl::Span(buffer), circular); + const fast_ber::DecodeResult& decode_res = fast_ber::decode(absl::Span(buffer), copy); + + REQUIRE(encode_res.success); + REQUIRE(decode_res.success); + REQUIRE(encode_res_len == encode_res.length); + REQUIRE(copy == circular); + REQUIRE(fast_ber::get<0>(fast_ber::get<1>(fast_ber::get<1>(fast_ber::get<1>(copy)))) == "Hello!"); +} diff --git a/test/generated/DefaultTest.cpp b/test/generated/DefaultTest.cpp new file mode 100644 index 00000000..eb4b437c --- /dev/null +++ b/test/generated/DefaultTest.cpp @@ -0,0 +1,70 @@ +#include "autogen/defaults.hpp" + +#include "catch2/catch.hpp" + +#include +#include + +TEST_CASE("Default: Generated Defaults") +{ + fast_ber::Defaults::SequenceWithDefault<> s; + + REQUIRE(s.integer == 88); + REQUIRE(s.flag == false); + REQUIRE(s.string == "dog"); + REQUIRE(s.defined == -172803790); + REQUIRE(s.colour == fast_ber::Defaults::ColourValues::blue); + REQUIRE(s.real == 5523432.12323); + + REQUIRE(s.integer.is_default()); + REQUIRE(s.flag.is_default()); + REQUIRE(s.string.is_default()); + REQUIRE(s.defined.is_default()); + REQUIRE(s.colour.is_default()); + REQUIRE(s.real.is_default()); +} + +TEST_CASE("Default: Encode") +{ + std::array buffer{}; + fast_ber::Defaults::SequenceWithDefault<> s; + + fast_ber::EncodeResult encode_result = s.encode(absl::Span(buffer)); + + REQUIRE(encode_result.success); + REQUIRE(encode_result.length == 2); +} + +TEST_CASE("Default: Decode") +{ + std::array buffer{0x30, 0x00}; + fast_ber::Defaults::SequenceWithDefault<> s{20, true, "cat", -10, fast_ber::Defaults::ColourValues::red, 25.0}; + + REQUIRE(!s.integer.is_default()); + REQUIRE(!s.flag.is_default()); + REQUIRE(!s.string.is_default()); + REQUIRE(!s.defined.is_default()); + REQUIRE(!s.colour.is_default()); + REQUIRE(!s.real.is_default()); + + fast_ber::DecodeResult decode_result = fast_ber::decode(absl::Span(buffer), s); + + REQUIRE(decode_result.success); + + REQUIRE(s.integer.is_default()); + REQUIRE(s.flag.is_default()); + REQUIRE(s.string.is_default()); + REQUIRE(s.defined.is_default()); + REQUIRE(s.colour.is_default()); + REQUIRE(s.real.is_default()); +} + +TEST_CASE("Default: Serialize") +{ + std::stringstream ss; + fast_ber::Defaults::SequenceWithDefault<> s{{}, true, {}, -10, fast_ber::Defaults::ColourValues::red, -16.0}; + + ss << s; + REQUIRE(ss.str() == + R"({"integer" : 88, "flag" : true, "string" : "dog", "defined" : -10, "colour" : "red", "real" : -16})"); +} diff --git a/test/compiler/DifferentTopLevelTypesTest.cpp b/test/generated/DifferentTopLevelTypesTest.cpp similarity index 81% rename from test/compiler/DifferentTopLevelTypesTest.cpp rename to test/generated/DifferentTopLevelTypesTest.cpp index c22d178b..6971447d 100644 --- a/test/compiler/DifferentTopLevelTypesTest.cpp +++ b/test/generated/DifferentTopLevelTypesTest.cpp @@ -33,18 +33,21 @@ TEST_CASE("Different Top Level Types: String as top level type") TEST_CASE("Different Top Level Types: Choice as top level type") { + using StringType = fast_ber::OctetString>; + using IntegerType = fast_ber::Integer>; + std::array buffer = {}; fast_ber::TopLevel::MyChoice<> my_string = fast_ber::OctetString<>("The String"); fast_ber::TopLevel::MyChoice<> my_new_string = 500; - REQUIRE(absl::get>(my_string) == fast_ber::OctetString<>("The String")); - REQUIRE(absl::get>(my_new_string) == fast_ber::Integer<>(500)); + REQUIRE(fast_ber::get(my_string) == "The String"); + REQUIRE(fast_ber::get(my_new_string) == 500); fast_ber::encode(absl::MakeSpan(buffer.data(), buffer.size()), my_string); fast_ber::decode(absl::MakeSpan(buffer.data(), buffer.size()), my_new_string); - REQUIRE(absl::get>(my_string) == fast_ber::OctetString<>("The String")); - REQUIRE(absl::get>(my_new_string) == fast_ber::OctetString<>("The String")); + REQUIRE(fast_ber::get(my_string) == "The String"); + REQUIRE(fast_ber::get(my_new_string) == "The String"); } TEST_CASE("Different Top Level Types: Collection") diff --git a/test/compiler/EmbeddedTypesTest.cpp b/test/generated/EmbeddedTypesTest.cpp similarity index 100% rename from test/compiler/EmbeddedTypesTest.cpp rename to test/generated/EmbeddedTypesTest.cpp diff --git a/test/compiler/EnumerationTest.cpp b/test/generated/EnumerationTest.cpp similarity index 100% rename from test/compiler/EnumerationTest.cpp rename to test/generated/EnumerationTest.cpp diff --git a/test/compiler/ImportTest.cpp b/test/generated/ImportTest.cpp similarity index 100% rename from test/compiler/ImportTest.cpp rename to test/generated/ImportTest.cpp diff --git a/test/compiler/ObjectIdentifierTest.cpp b/test/generated/ObjectIdentifierTest.cpp similarity index 100% rename from test/compiler/ObjectIdentifierTest.cpp rename to test/generated/ObjectIdentifierTest.cpp diff --git a/test/compiler/ParameterizedTypesTest.cpp b/test/generated/ParameterizedTypesTest.cpp similarity index 100% rename from test/compiler/ParameterizedTypesTest.cpp rename to test/generated/ParameterizedTypesTest.cpp diff --git a/test/compiler/PrefixedTypesTest.cpp b/test/generated/PrefixedTypesTest.cpp similarity index 100% rename from test/compiler/PrefixedTypesTest.cpp rename to test/generated/PrefixedTypesTest.cpp diff --git a/test/compiler/RealSchemaTest.cpp b/test/generated/RealSchemaTest.cpp similarity index 95% rename from test/compiler/RealSchemaTest.cpp rename to test/generated/RealSchemaTest.cpp index 3a0f600e..8f7f90c6 100644 --- a/test/compiler/RealSchemaTest.cpp +++ b/test/generated/RealSchemaTest.cpp @@ -28,7 +28,8 @@ const fast_ber::SGSN_2009A_CDR::SGSNPDPRecord>(2), 88888888888, "NodeID", - fast_ber::SGSN_2009A_CDR::ManagementExtensions<>{{{1, 2, 3, 4}, true, {{}}}}, + fast_ber::SGSN_2009A_CDR::ManagementExtensions<>{fast_ber::SGSN_2009A_CDR::ManagementExtension<>{ + {1, 2, 3, 4}, true, fast_ber::SGSN_2009A_CDR::GprsSCdrExtensions<>{{}}}}, 100, fast_ber::SGSN_2009A_CDR::APNSelectionMode<>::Values::mSorNetworkProvidedSubscriptionVerified, {}, diff --git a/test/generated/Sequence.cpp b/test/generated/Sequence.cpp new file mode 100644 index 00000000..33c118ec --- /dev/null +++ b/test/generated/Sequence.cpp @@ -0,0 +1,47 @@ +#include "autogen/sequence.hpp" + +#include "catch2/catch.hpp" + +#include + +TEST_CASE("Sequence: Empty") +{ + std::array buffer = {}; + fast_ber::Sequence_::Empty<> sequence = {}; + + fast_ber::EncodeResult encode_result = fast_ber::encode(absl::MakeSpan(buffer.data(), buffer.size()), sequence); + fast_ber::DecodeResult decode_result = fast_ber::decode(absl::MakeSpan(buffer.data(), buffer.size()), sequence); + + REQUIRE(encode_result.success); + REQUIRE(decode_result.success); +} + +TEST_CASE("Sequence: Tagged Collection") +{ + fast_ber::Sequence_::Collection<> collection = {{}, {}, 5, true, "O"}; + fast_ber::Sequence_::Collection> tagged_collection = { + {}, {}, -5, false, "P"}; + + REQUIRE(collection != tagged_collection); + + tagged_collection = collection; + REQUIRE(collection == tagged_collection); +} + +TEST_CASE("Sequence: Tagged") +{ + std::array buffer = {}; + fast_ber::Sequence_::Empty, + fast_ber::ExplicitId>> + sequence = {}; + + fast_ber::EncodeResult encode_result = fast_ber::encode(absl::MakeSpan(buffer.data(), buffer.size()), sequence); + fast_ber::DecodeResult decode_result = fast_ber::decode(absl::MakeSpan(buffer.data(), buffer.size()), sequence); + + REQUIRE(encode_result.success); + REQUIRE(decode_result.success); + REQUIRE(encode_result.length == 4); + REQUIRE(fast_ber::BerView(buffer).is_valid()); + REQUIRE(fast_ber::BerView(buffer).identifier() == fast_ber::RuntimeId{fast_ber::Class::context_specific, 10}); + REQUIRE(fast_ber::BerView(buffer).begin()->identifier() == fast_ber::RuntimeId{fast_ber::UniversalTag::sequence}); +} diff --git a/test/generated/SequenceOf.cpp b/test/generated/SequenceOf.cpp new file mode 100644 index 00000000..dbe7b6aa --- /dev/null +++ b/test/generated/SequenceOf.cpp @@ -0,0 +1,31 @@ +#include "autogen/sequence_of.hpp" + +#include "catch2/catch.hpp" + +#include + +TEST_CASE("Sequence Of: Encode and decode sequence of") +{ + std::array buffer = {}; + fast_ber::Sequence_::SequenceFive<> sequence = {fast_ber::Sequence_::UnnamedSet0<>{{""}}}; + + fast_ber::EncodeResult encode_result = fast_ber::encode(absl::MakeSpan(buffer.data(), buffer.size()), sequence); + fast_ber::DecodeResult decode_result = fast_ber::decode(absl::MakeSpan(buffer.data(), buffer.size()), sequence); + + REQUIRE(encode_result.success); + REQUIRE(decode_result.success); +} + +TEST_CASE("Sequence Of: Empty sequence of") +{ + std::array buffer = {}; + fast_ber::Sequence_::SequenceFive<> sequence = {}; + + size_t encoded_length = fast_ber::encoded_length(sequence); + fast_ber::EncodeResult encode_result = fast_ber::encode(absl::MakeSpan(buffer.data(), buffer.size()), sequence); + fast_ber::DecodeResult decode_result = fast_ber::decode(absl::MakeSpan(buffer.data(), buffer.size()), sequence); + + REQUIRE(encoded_length == 2); + REQUIRE(encode_result.success); + REQUIRE(decode_result.success); +} diff --git a/test/compiler/SimpleCompilerOutputTest.cpp b/test/generated/SimpleCompilerOutputTest.cpp similarity index 91% rename from test/compiler/SimpleCompilerOutputTest.cpp rename to test/generated/SimpleCompilerOutputTest.cpp index 63db2e65..4930f94b 100644 --- a/test/compiler/SimpleCompilerOutputTest.cpp +++ b/test/generated/SimpleCompilerOutputTest.cpp @@ -21,7 +21,7 @@ TEST_CASE("SimpleCompilerOutput: Testing a generated ber container") collection.child.meaning_of_life = -42; collection.optional_child = fast_ber::Simple::Child>{ 999999999, {"The", "second", "child", std::string(2000, 'x')}}; - collection.the_choice = decltype(collection.the_choice){absl::in_place_index_t<1>(), "I chose a string!"}; + collection.the_choice = decltype(collection.the_choice){fast_ber::in_place_index_t<1>(), "I chose a string!"}; fast_ber::EncodeResult encode_result = fast_ber::encode(absl::MakeSpan(buffer.data(), buffer.size()), collection); fast_ber::DecodeResult decode_result = @@ -41,7 +41,7 @@ TEST_CASE("SimpleCompilerOutput: Testing a generated ber container") REQUIRE(new_collection.optional_child->list == fast_ber::SequenceOf>{"The", "second", "child", std::string(2000, 'x')}); REQUIRE(*new_collection.optional_child->meaning_of_life == 999999999); - REQUIRE(absl::get<1>(new_collection.the_choice) == "I chose a string!"); + REQUIRE(fast_ber::get<1>(new_collection.the_choice) == "I chose a string!"); fast_ber::BerView view = absl::Span(buffer); REQUIRE(std::distance(view.begin(), view.end()) == 7); diff --git a/test/compiler/TagsTest.cpp b/test/generated/TagsTest.cpp similarity index 100% rename from test/compiler/TagsTest.cpp rename to test/generated/TagsTest.cpp diff --git a/test/compiler/TimeTest.cpp b/test/generated/TimeTest.cpp similarity index 100% rename from test/compiler/TimeTest.cpp rename to test/generated/TimeTest.cpp diff --git a/test/compiler/ValueTest.cpp b/test/generated/ValueTest.cpp similarity index 88% rename from test/compiler/ValueTest.cpp rename to test/generated/ValueTest.cpp index 175232ec..f2a42f13 100644 --- a/test/compiler/ValueTest.cpp +++ b/test/generated/ValueTest.cpp @@ -2,9 +2,6 @@ #include "catch2/catch.hpp" -#include -#include - TEST_CASE("Value Assignments") { REQUIRE(fast_ber::Values::defined_oid == fast_ber::ObjectIdentifier<>{0, 1, 2}); diff --git a/test/util/BerContainerTest.cpp b/test/util/BerContainerTest.cpp index 1abcda1d..dc16b067 100644 --- a/test/util/BerContainerTest.cpp +++ b/test/util/BerContainerTest.cpp @@ -1,76 +1,292 @@ #include "fast_ber/util/BerContainer.hpp" +#include "fast_ber/util/FixedIdBerContainer.hpp" +#include "fast_ber/util/SmallFixedIdBerContainer.hpp" #include #include -TEST_CASE("BerContainer: Empty construction") +template +void empty_construction() { - fast_ber::BerContainer container; - const auto expected = std::array({0x80, 0x00}); + Container container; + const auto expected = std::array({0x00, 0x00}); - REQUIRE(container.is_valid()); - REQUIRE(container.tag() == 0); - REQUIRE(container.content_length() == 0); - REQUIRE(container.ber() == absl::MakeSpan(expected.data(), expected.size())); + CHECK(container.view().is_valid()); + CHECK(container.view().construction() == fast_ber::Construction::primitive); + CHECK(container.view().identifier() == fast_ber::RuntimeId{fast_ber::Class::universal, 0}); + CHECK(container.class_() == fast_ber::Class::universal); + CHECK(container.tag() == 0); + CHECK(container.content_length() == 0); + CHECK(container.ber() == absl::MakeSpan(expected.data(), expected.size())); } -TEST_CASE("BerContainer: Resize larger") +template +void resize_larger(size_t new_size = 99999) { - const auto test_data = std::array({'a', 'b', 'c'}); - fast_ber::BerContainer container(test_data, fast_ber::ConstructionMethod::construct_with_provided_content); + const auto test_data = std::array({'a', 'b', 'c'}); + Container container(test_data, fast_ber::ConstructionMethod::construct_with_provided_content); - size_t new_size = 99999; - - REQUIRE(container.is_valid()); - REQUIRE(container.tag() == 0); - REQUIRE(container.content_length() == test_data.size()); - REQUIRE(container.content() == test_data); + CHECK(container.view().is_valid()); + CHECK(container.tag() == 0); + CHECK(container.content_length() == test_data.size()); + CHECK(container.content() == test_data); container.resize_content(new_size); - REQUIRE(container.is_valid()); - REQUIRE(container.tag() == 0); - REQUIRE(container.content_length() == new_size); - REQUIRE(absl::MakeSpan(container.content_data(), test_data.size()) == test_data); + CHECK(container.view().is_valid()); + CHECK(container.tag() == 0); + CHECK(container.content_length() == new_size); + CHECK(absl::MakeSpan(container.content_data(), test_data.size()) == test_data); + CHECK(container.view().identifier() == fast_ber::RuntimeId{fast_ber::Class::universal, 0}); } -TEST_CASE("BerContainer: Resize smaller") +template +void resize_smaller() { const auto test_data = std::array({'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'}); fast_ber::BerContainer container(test_data, fast_ber::ConstructionMethod::construct_with_provided_content); size_t new_size = 5; - REQUIRE(container.is_valid()); - REQUIRE(container.tag() == 0); - REQUIRE(container.content_length() == test_data.size()); - REQUIRE(container.content() == test_data); + CHECK(container.is_valid()); + CHECK(container.tag() == 0); + CHECK(container.content_length() == test_data.size()); + CHECK(container.content() == test_data); container.resize_content(new_size); - REQUIRE(container.is_valid()); - REQUIRE(container.tag() == 0); - REQUIRE(container.content_length() == new_size); - REQUIRE(container.content() == absl::MakeSpan(test_data.data(), new_size)); + CHECK(container.is_valid()); + CHECK(container.tag() == 0); + CHECK(container.content_length() == new_size); + CHECK(container.content() == absl::MakeSpan(test_data.data(), new_size)); + CHECK(container.view().identifier() == fast_ber::RuntimeId{fast_ber::Class::universal, 0}); } -TEST_CASE("BerContainer: Resize same size") +template +void resize_same_size() { const auto test_data = std::array({'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'}); fast_ber::BerContainer container(test_data, fast_ber::ConstructionMethod::construct_with_provided_content); size_t new_size = test_data.size(); - REQUIRE(container.is_valid()); - REQUIRE(container.tag() == 0); - REQUIRE(container.content_length() == test_data.size()); - REQUIRE(container.content() == test_data); + CHECK(container.is_valid()); + CHECK(container.tag() == 0); + CHECK(container.content_length() == test_data.size()); + CHECK(container.content() == test_data); container.resize_content(new_size); - REQUIRE(container.is_valid()); - REQUIRE(container.tag() == 0); - REQUIRE(container.content_length() == new_size); - REQUIRE(container.content() == test_data); + CHECK(container.is_valid()); + CHECK(container.tag() == 0); + CHECK(container.content_length() == new_size); + CHECK(container.content() == test_data); + CHECK(container.view().identifier() == fast_ber::RuntimeId{fast_ber::Class::universal, 0}); +} + +template +void assign() +{ + std::array test_pdu = {'H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'}; + + Container container1(test_pdu, fast_ber::ConstructionMethod::construct_with_provided_content); + Container container2 = container1; + Container container3 = std::move(Container{container1}); + Container container4; + Container container5; + Container container6; + Container container7; + + fast_ber::DecodeResult res = container4.decode(fast_ber::BerView(container1.ber())); + container5.assign_content(container1.content()); + container6 = container1; + container7 = std::move(Container{container1}); + + CHECK(res.success); + CHECK(container1.content() == test_pdu); + CHECK(container2.content() == test_pdu); + CHECK(container3.content() == test_pdu); + CHECK(container4.content() == test_pdu); + CHECK(container5.content() == test_pdu); + CHECK(container6.content() == test_pdu); + CHECK(container7.content() == test_pdu); + + CHECK(container1.view().identifier() == fast_ber::RuntimeId{fast_ber::Class::universal, 0}); + CHECK(container2.view().identifier() == fast_ber::RuntimeId{fast_ber::Class::universal, 0}); + CHECK(container3.view().identifier() == fast_ber::RuntimeId{fast_ber::Class::universal, 0}); + CHECK(container4.view().identifier() == fast_ber::RuntimeId{fast_ber::Class::universal, 0}); + CHECK(container5.view().identifier() == fast_ber::RuntimeId{fast_ber::Class::universal, 0}); + CHECK(container6.view().identifier() == fast_ber::RuntimeId{fast_ber::Class::universal, 0}); + CHECK(container7.view().identifier() == fast_ber::RuntimeId{fast_ber::Class::universal, 0}); +} + +template +void encode_decode() +{ + std::array buffer = {}; + + Container container; + container.assign_content(std::vector(50, 0)); + + fast_ber::EncodeResult encode_res = container.encode(absl::Span(buffer)); + fast_ber::DecodeResult decode_res = container.decode(fast_ber::BerView(buffer)); + + REQUIRE(encode_res.success); + REQUIRE(decode_res.success); + REQUIRE(encode_res.length == container.ber().length()); +} + +using SingleTestId = fast_ber::Id; +using DoubleTestId = fast_ber::DoubleId, + fast_ber::ExplicitId>; +using LongTestId = fast_ber::DoubleId, + fast_ber::Id>; + +TEST_CASE("BerContainer: Empty construction") +{ + empty_construction(); + empty_construction>(); + empty_construction>(); +} + +TEST_CASE("BerContainer: Resize larger") +{ + resize_larger(); + resize_larger>(); + resize_larger>(); + resize_larger>(); + resize_larger>(75); + resize_larger>(73); + resize_larger>(66); +} + +TEST_CASE("BerContainer: Resize smaller") +{ + resize_smaller(); + resize_smaller>(); + resize_smaller>(); + resize_smaller>(); + resize_smaller>(); + resize_smaller>(); + resize_smaller>(); +} + +TEST_CASE("BerContainer: Resize same size") +{ + resize_same_size(); + resize_same_size>(); + resize_same_size>(); + resize_same_size>(); + resize_same_size>(); + resize_same_size>(); + resize_same_size>(); +} + +TEST_CASE("BerContainer: Assign") +{ + assign(); + assign>(); + assign>(); + assign>(); + assign>(); + assign>(); + assign>(); +} + +TEST_CASE("BerContainer: Encode and Decode") +{ + encode_decode(); + encode_decode>(); + encode_decode>(); + encode_decode>(); + encode_decode>(); + encode_decode>(); + encode_decode>(); +} + +TEST_CASE("BerContainer: FixedIdBerContainer IDs") +{ + fast_ber::FixedIdBerContainer single_id; + fast_ber::FixedIdBerContainer double_id; + fast_ber::FixedIdBerContainer long_id; + + CHECK(SingleTestId{} == fast_ber::BerView(single_id.ber()).identifier()); + + CHECK(DoubleTestId{}.outer_id() == double_id.view().identifier()); + CHECK(DoubleTestId{}.inner_id() == double_id.view().begin()->identifier()); + + CHECK(LongTestId{}.outer_id() == long_id.view().identifier()); + CHECK(LongTestId{}.inner_id() == long_id.view().begin()->identifier()); +} + +TEST_CASE("BerContainer: SmallFixedIdBerContainer IDs") +{ + fast_ber::SmallFixedIdBerContainer single_id; + fast_ber::SmallFixedIdBerContainer double_id; + fast_ber::SmallFixedIdBerContainer long_id; + + CHECK(SingleTestId{} == fast_ber::BerView(single_id.ber()).identifier()); + + CHECK(DoubleTestId{}.outer_id() == double_id.view().identifier()); + CHECK(DoubleTestId{}.inner_id() == double_id.view().begin()->identifier()); + + CHECK(LongTestId{}.outer_id() == long_id.view().identifier()); + CHECK(LongTestId{}.inner_id() == long_id.view().begin()->identifier()); +} + +TEST_CASE("BerContainer: FixedIdBerContainer Different ID Assign") +{ + fast_ber::FixedIdBerContainer single_id; + fast_ber::FixedIdBerContainer double_id; + fast_ber::FixedIdBerContainer long_id; + + single_id.assign_content(std::vector(100, 'a')); + double_id.assign_content(std::vector(50, 'f')); + long_id.assign_content(std::vector(10, 'z')); + + CHECK(SingleTestId{} == fast_ber::BerView(single_id.ber()).identifier()); + CHECK(DoubleTestId{}.outer_id() == double_id.view().identifier()); + CHECK(DoubleTestId{}.inner_id() == double_id.view().begin()->identifier()); + CHECK(LongTestId{}.outer_id() == long_id.view().identifier()); + CHECK(LongTestId{}.inner_id() == long_id.view().begin()->identifier()); + + double_id = long_id = single_id; + + CHECK(SingleTestId{} == fast_ber::BerView(single_id.ber()).identifier()); + CHECK(DoubleTestId{}.outer_id() == double_id.view().identifier()); + CHECK(DoubleTestId{}.inner_id() == double_id.view().begin()->identifier()); + CHECK(LongTestId{}.outer_id() == long_id.view().identifier()); + CHECK(LongTestId{}.inner_id() == long_id.view().begin()->identifier()); + + CHECK(double_id.content() == single_id.content()); + CHECK(long_id.content() == single_id.content()); +} + +TEST_CASE("BerContainer: SmallFixedIdBerContainer Different ID Assign") +{ + fast_ber::SmallFixedIdBerContainer single_id; + fast_ber::SmallFixedIdBerContainer double_id; + fast_ber::SmallFixedIdBerContainer long_id; + + single_id.assign_content(std::vector(100, 'a')); + double_id.assign_content(std::vector(50, 'f')); + long_id.assign_content(std::vector(10, 'z')); + + CHECK(SingleTestId{} == fast_ber::BerView(single_id.ber()).identifier()); + CHECK(DoubleTestId{}.outer_id() == double_id.view().identifier()); + CHECK(DoubleTestId{}.inner_id() == double_id.view().begin()->identifier()); + CHECK(LongTestId{}.outer_id() == long_id.view().identifier()); + CHECK(LongTestId{}.inner_id() == long_id.view().begin()->identifier()); + + double_id = long_id = single_id; + + CHECK(SingleTestId{} == fast_ber::BerView(single_id.ber()).identifier()); + CHECK(DoubleTestId{}.outer_id() == double_id.view().identifier()); + CHECK(DoubleTestId{}.inner_id() == double_id.view().begin()->identifier()); + CHECK(LongTestId{}.outer_id() == long_id.view().identifier()); + CHECK(LongTestId{}.inner_id() == long_id.view().begin()->identifier()); + + CHECK(double_id.content() == single_id.content()); + CHECK(long_id.content() == single_id.content()); } diff --git a/test/util/BerViewTest.cpp b/test/util/BerViewTest.cpp index 3cf8d5b6..1702649c 100644 --- a/test/util/BerViewTest.cpp +++ b/test/util/BerViewTest.cpp @@ -3,12 +3,13 @@ #include #include +#include -const static std::initializer_list sample_packet = { - 0x30, 0x1d, 0x80, 0x06, 0x46, 0x61, 0x6c, 0x63, 0x6f, 0x6e, 0x82, 0x01, 0x00, 0xa3, 0x04, 0x80, - 0x02, 0x46, 0x50, 0xa4, 0x0a, 0x0c, 0x03, 0x43, 0x61, 0x72, 0x0c, 0x03, 0x47, 0x50, 0x53}; +const static std::array sample_packet = {0x30, 0x1d, 0x80, 0x06, 0x46, 0x61, 0x6c, 0x63, 0x6f, 0x6e, 0x82, + 0x01, 0x00, 0xa3, 0x04, 0x80, 0x02, 0x46, 0x50, 0xa4, 0x0a, 0x0c, + 0x03, 0x43, 0x61, 0x72, 0x0c, 0x03, 0x47, 0x50, 0x53}; -const static std::initializer_list empty_packet = {0x00, 0x00}; +const static std::array empty_packet = {0x00, 0x00}; TEST_CASE("BerView: Sample data") { @@ -20,7 +21,7 @@ TEST_CASE("BerView: Sample data") REQUIRE(view.tag() == 16); REQUIRE(view.ber() == sample_packet); - REQUIRE(view.content() == absl::MakeSpan(sample_packet.begin() + 2, sample_packet.size() - 2)); + REQUIRE(view.content() == absl::MakeSpan(sample_packet.data() + 2, sample_packet.size() - 2)); } TEST_CASE("BerView: Empty packet") @@ -35,3 +36,16 @@ TEST_CASE("BerView: Empty packet") REQUIRE(view.ber() == empty_packet); REQUIRE(view.content().empty()); } + +TEST_CASE("BerView: Output") +{ + fast_ber::BerView view(sample_packet); + std::stringstream ss; + + ss << view; + std::cout << view << std::endl; + + REQUIRE( + ss.str() == + R"({ "length": 31, "identifier": { "class": "Universal", "tag": "Sequence / Sequence Of"}, "content": [{ "length": 8, "identifier": { "class": "Context Specific", "tag": 0}, "content": "Falcon"}, { "length": 3, "identifier": { "class": "Context Specific", "tag": 2}, "content": "binary data"}, { "length": 6, "identifier": { "class": "Context Specific", "tag": 3}, "content": [{ "length": 4, "identifier": { "class": "Context Specific", "tag": 0}, "content": "FP"}]}, { "length": 12, "identifier": { "class": "Context Specific", "tag": 4}, "content": [{ "length": 5, "identifier": { "class": "Universal", "tag": "UTF8 String"}, "content": "Car"}, { "length": 5, "identifier": { "class": "Universal", "tag": "UTF8 String"}, "content": "GPS"}]}]})"); +} diff --git a/test/util/DynamicVariantTest.cpp b/test/util/DynamicVariantTest.cpp new file mode 100644 index 00000000..93d840d1 --- /dev/null +++ b/test/util/DynamicVariantTest.cpp @@ -0,0 +1,206 @@ +#include "fast_ber/util/DynamicVariant.hpp" + +#include + +#include + +#if true +template +using TestVariant = fast_ber::dynamic::DynamicVariant; +namespace ns = fast_ber::dynamic; +#else +template +using TestVariant = absl::variant; +namespace ns = absl; +#endif + +TEST_CASE("DynamicVariant: Construct") +{ + TestVariant var_a; + TestVariant var_b(5); + const TestVariant var_c('c'); + const TestVariant var_d(true); + + REQUIRE(var_a.index() == 0); + REQUIRE(var_b.index() == 0); + REQUIRE(var_c.index() == 1); + REQUIRE(var_d.index() == 2); +} + +TEST_CASE("DynamicVariant: Conversion Construct") +{ + const TestVariant var_a = "pear"; + const TestVariant var_b = short(-10); + + REQUIRE(ns::get(var_a) == "pear"); + REQUIRE(ns::get(var_b) == -10); +} + +TEST_CASE("DynamicVariant: Conversion Assign") +{ + TestVariant var_a; + + var_a = "pear"; + REQUIRE(ns::get(var_a) == "pear"); + + var_a = short(10); + REQUIRE(ns::get(var_a) == 10); +} + +TEST_CASE("DynamicVariant: Equality") +{ + TestVariant var_a(5); + TestVariant var_b(short(5)); + const TestVariant var_c('c'); + const TestVariant var_d(true); + + REQUIRE(var_a == var_a); + REQUIRE(var_b == var_b); + REQUIRE(var_c == var_c); + REQUIRE(var_d == var_d); + REQUIRE(var_a != var_b); + REQUIRE(var_c != var_d); + + REQUIRE(!(var_a == var_b)); + REQUIRE(!(var_c == var_d)); + REQUIRE(!(var_a != var_a)); + REQUIRE(!(var_c != var_c)); +} +TEST_CASE("DynamicVariant: Get") +{ + TestVariant var_a; + TestVariant var_b('c'); + const TestVariant var_c(true); + const TestVariant var_d(std::string("apple")); + + REQUIRE(ns::get(var_a) == 0); + REQUIRE(ns::get(var_b) == 'c'); + REQUIRE(ns::get(var_c) == true); + REQUIRE(ns::get(var_d) == "apple"); + + REQUIRE(ns::get<0>(var_a) == 0); + REQUIRE(ns::get<1>(var_b) == 'c'); + REQUIRE(ns::get<2>(var_c) == true); + REQUIRE(ns::get<3>(var_d) == "apple"); +} + +TEST_CASE("DynamicVariant: Get If") +{ + TestVariant var_a(5); + TestVariant var_b('c'); + const TestVariant var_c(true); + const TestVariant var_d(std::string("apple")); + + REQUIRE(*ns::get_if(&var_a) == 5); + REQUIRE(*ns::get_if(&var_b) == 'c'); + REQUIRE(*ns::get_if(&var_c) == true); + REQUIRE(*ns::get_if(&var_d) == "apple"); + + REQUIRE(ns::get_if(&var_a) == nullptr); + REQUIRE(ns::get_if(&var_b) == nullptr); + REQUIRE(ns::get_if(&var_c) == nullptr); + REQUIRE(ns::get_if(&var_d) == nullptr); + + REQUIRE(*ns::get_if<0>(&var_a) == 5); + REQUIRE(*ns::get_if<1>(&var_b) == 'c'); + REQUIRE(*ns::get_if<2>(&var_c) == true); + REQUIRE(*ns::get_if<3>(&var_d) == "apple"); + + REQUIRE(ns::get_if<3>(&var_a) == nullptr); + REQUIRE(ns::get_if<2>(&var_b) == nullptr); + REQUIRE(ns::get_if<1>(&var_c) == nullptr); + REQUIRE(ns::get_if<0>(&var_d) == nullptr); +} + +TEST_CASE("DynamicVariant: Copy") +{ + TestVariant var_a(5); + TestVariant var_b('c'); + const TestVariant var_c(var_b); + + var_b = var_a; + REQUIRE(ns::get(var_a) == 5); + REQUIRE(ns::get(var_b) == 5); + REQUIRE(ns::get(var_c) == 'c'); +} + +TEST_CASE("DynamicVariant: Move") +{ + TestVariant var_a(5); + TestVariant var_b('c'); + TestVariant var_c(std::move(var_b)); + + var_b = std::move(var_a); + REQUIRE(ns::get(var_b) == 5); + REQUIRE(ns::get(var_c) == 'c'); +} + +TEST_CASE("DynamicVariant: emplace") +{ + TestVariant var_a(5); + + REQUIRE(var_a.emplace(10) == 10); + REQUIRE(ns::get(var_a) == 10); + + REQUIRE(var_a.emplace('$') == '$'); + REQUIRE(ns::get(var_a) == '$'); + + REQUIRE(var_a.emplace(false) == false); + REQUIRE(ns::get(var_a) == false); + + REQUIRE(var_a.emplace<0>(10) == 10); + REQUIRE(ns::get(var_a) == 10); + + REQUIRE(var_a.emplace<1>('$') == '$'); + REQUIRE(ns::get(var_a) == '$'); + + REQUIRE(var_a.emplace<2>(false) == false); + REQUIRE(ns::get(var_a) == false); +} + +struct Square +{ + template + long operator()(T t) + { + return t * t; + } +}; + +TEST_CASE("DynamicVariant: Visit") +{ + TestVariant var_a(long(5)); + TestVariant var_b(long(-10)); + + REQUIRE(ns::visit(Square(), var_a) == 25); + REQUIRE(ns::visit(Square(), var_b) == 100); +} + +struct CircularVariant +{ + int a; + TestVariant var; +}; + +TEST_CASE("DynamicVariant: Circular") +{ + // CircularVariant circular_var{5, CircularVariant{5, CircularVariant{5, CircularVariant{5, CircularVariant{5, + // 10}}}}}; + + CircularVariant circular_var{5, CircularVariant{5, "Deep string"}}; + + // REQUIRE(ns::get<0>(ns::get<1>(ns::get<1>(ns::get<1>(ns::get<1>(circular_var.var).var).var).var).var) == 10); +} + +class ForwardOnlyClass; + +TEST_CASE("DynamicVariant: Incomplete") +{ + TestVariant var_a(5); + + REQUIRE(ns::get(var_a) == 5); +} + +class ForwardOnlyClass +{ +}; diff --git a/test/util/EncodeIdentifier.cpp b/test/util/EncodeIdentifier.cpp index 9e9eea79..a341c13c 100644 --- a/test/util/EncodeIdentifier.cpp +++ b/test/util/EncodeIdentifier.cpp @@ -47,17 +47,20 @@ TEST_CASE("EncodeIdentifiers: Length length") TEST_CASE("EncodeIdentifiers: Creating tags") { - const auto test_vals = std::initializer_list{ - 0, 1, 10, 55, 66, 127, 128, 255, 256, 500, 14000, 99244, 382348, 400532434, 99999999999ll}; + const std::array test_vals = { + 0, 1, 10, 55, 66, 127, 128, 255, + 256, 500, 14000, 99244, 382348, 400532434, 99999999999ll, std::numeric_limits::max()}; - for (const int64_t test_val : test_vals) + for (const fast_ber::Tag test_val : test_vals) { std::array buffer = {}; fast_ber::Tag tag = 1; INFO(test_val); - REQUIRE(fast_ber::encode_tag(absl::Span(buffer.data(), buffer.size()), test_val)); + size_t expected_length = fast_ber::encoded_tag_length(test_val); + size_t actual_length = fast_ber::encode_tag(absl::Span(buffer.data(), buffer.size()), test_val); + REQUIRE(expected_length == actual_length); REQUIRE(fast_ber::extract_tag(absl::Span(buffer.data(), buffer.size()), tag)); REQUIRE(test_val == tag); } @@ -65,9 +68,9 @@ TEST_CASE("EncodeIdentifiers: Creating tags") TEST_CASE("EncodeIdentifiers: Creating lengths") { - const auto test_vals = - std::initializer_list{0, 1, 10, 55, 66, 127, 128, 255, - 256, 500, 14000, 99244, 382348, 400532434 /*64 bit systems only, 99999999999*/}; + const std::array test_vals = { + 0, 1, 10, 55, 66, 127, 128, 255, + 256, 500, 14000, 99244, 382348, 400532434, 99999999999, std::numeric_limits::max()}; for (const size_t test_val : test_vals) { @@ -81,3 +84,17 @@ TEST_CASE("EncodeIdentifiers: Creating lengths") REQUIRE(test_val == length); } } + +TEST_CASE("EncodeIdentifiers: Tags - round trip") +{ + std::array buffer{}; + for (fast_ber::Tag i = 0; i < 10000; i++) + { + fast_ber::Tag out = -1; + + size_t length = fast_ber::encoded_tag_length(i); + REQUIRE(fast_ber::encode_tag(absl::Span(buffer), i) == length); + REQUIRE(fast_ber::extract_tag(buffer, out) == length); + REQUIRE(out == i); + } +} diff --git a/test/util/ExtractTest.cpp b/test/util/ExtractTest.cpp index f0216ec6..0396fd65 100644 --- a/test/util/ExtractTest.cpp +++ b/test/util/ExtractTest.cpp @@ -2,11 +2,11 @@ #include +#include #include struct TestPacket { - TestPacket(const std::vector& d, fast_ber::Tag t, uint64_t l) noexcept : data(d), tag(t), length(l) {} std::vector data; fast_ber::Tag tag; uint64_t length; diff --git a/testfiles/choice.asn b/testfiles/choice.asn index 59c17c41..160dbac6 100644 --- a/testfiles/choice.asn +++ b/testfiles/choice.asn @@ -1,13 +1,37 @@ MakeAChoice DEFINITIONS IMPLICIT TAGS ::= BEGIN +IMPORTS BoolMod2 FROM OtherModule; + Collection ::= SEQUENCE { - the-choice CHOICE { - hello [0] OCTET STRING, - goodbye [1] OCTET STRING, - integer [2] INTEGER, - boolean [3] BOOLEAN, - sequence [4] SEQUENCE { i INTEGER } - } + the-choice CHOICE { + hello [0] OCTET STRING, + goodbye [1] OCTET STRING, + integer [2] INTEGER, + boolean [3] BoolMod2, + sequence [4] SEQUENCE { i INTEGER } + } +} + +END + +OtherModule DEFINITIONS IMPLICIT TAGS ::= BEGIN + +BoolMod2 ::= BOOLEAN + +END + +ExplicitChoice DEFINITIONS ::= BEGIN + +MySequence ::= SEQUENCE { + +} + +MyChoice ::= CHOICE { + hello [0] OCTET STRING, + goodbye [1] OCTET STRING, + integer [2] INTEGER, + boolean [3] BOOLEAN, + sequence [4] MySequence } END diff --git a/testfiles/circular.asn b/testfiles/circular.asn index e35b41ed..8a598dec 100644 --- a/testfiles/circular.asn +++ b/testfiles/circular.asn @@ -15,4 +15,23 @@ CircularSequenceOf1 ::= SEQUENCE { CircularSequenceOf2 ::= SEQUENCE OF CircularSequenceOf1 +CircularChoice1 ::= CHOICE { + int INTEGER, + choice [1] EXPLICIT CircularChoice2, + seq SEQUENCE { inner SEQUENCE { number MyInt } }, + enum ENUMERATED { one, two } +} + +CircularChoice2 ::= SEQUENCE { + str OCTET STRING, + choice CircularChoice1 +} + +MyInt ::= INTEGER + +SelfReference ::= CHOICE { + str [0] OCTET STRING, + self [1] SelfReference +} + END-- Comment at end diff --git a/testfiles/circular.asn2 b/testfiles/circular.asn2 new file mode 100644 index 00000000..2c28f5c6 --- /dev/null +++ b/testfiles/circular.asn2 @@ -0,0 +1,28 @@ +Circular DEFINITIONS IMPLICIT TAGS ::= BEGIN + +CircularSequence1 ::= SEQUENCE { + name OCTET STRING, + cs2 CircularSequence2 OPTIONAL +} + +CircularSequence2 ::= SEQUENCE { + cs1 CircularSequence1 +} + +CircularSequenceOf1 ::= SEQUENCE { + sequence CircularSequenceOf2 +} + +CircularSequenceOf2 ::= SEQUENCE OF CircularSequenceOf1 + +CircularChoice1 ::= CHOICE { + int INTEGER, + choice CircularChoice2 +} + +CircularChoice2 ::= SEQUENCE { + str OCTET STRING, + choice CircularChoice1 +} + +END-- Comment at end diff --git a/testfiles/defaults.asn b/testfiles/defaults.asn index 32f9c53e..328cd447 100644 --- a/testfiles/defaults.asn +++ b/testfiles/defaults.asn @@ -4,11 +4,24 @@ DEFINITIONS EXPLICIT TAGS ::= BEGIN +defined_int INTEGER ::= -172803790 + SequenceWithDefault ::= SEQUENCE { + integer INTEGER DEFAULT 88, flag BOOLEAN DEFAULT FALSE, - seq SEQUENCE OF INTEGER, + string OCTET STRING DEFAULT "dog", + defined INTEGER DEFAULT defined_int, + colour Colour DEFAULT blue, + real REAL DEFAULT 5523432.12323, ... } +Colour ::= ENUMERATED +{ + red, + green, + blue +} + END diff --git a/testfiles/import.asn b/testfiles/import.asn index 1755a74a..e4dab3d8 100644 --- a/testfiles/import.asn +++ b/testfiles/import.asn @@ -1,7 +1,7 @@ ModuleA DEFINITIONS IMPLICIT TAGS ::= BEGIN IMPORTS StringInModuleB, string-value FROM ModuleB - IntegerInModuleC, integer-value FROM ModuleC; + integer-value, IntegerInModuleC FROM ModuleC; Collection ::= SEQUENCE { string StringInModuleB, diff --git a/testfiles/random_test_spec.asn b/testfiles/random_test_spec.asn new file mode 100644 index 00000000..71a28d04 --- /dev/null +++ b/testfiles/random_test_spec.asn @@ -0,0 +1,144 @@ +Wineco-common-top-level + {joint-iso-itu-t international-organization(23) set(42) + set-vendors(9) wineco(43) modules(2) top(0)} + DEFINITIONS + AUTOMATIC TAGS ::= + BEGIN + EXPORTS ; + IMPORTS Order-for-stock FROM + Wineco-ordering-protocol + --{wineco-OID modules(2) ordering(1)} + Return-of-sales FROM + Wineco-returns-protocol + --{wineco-OID modules(2) returns(2)}--; + + + wineco-OID OBJECT IDENTIFIER ::= + {joint-iso-itu-t international-organization(23) set(42) + set-vendors(9) wineco(43)} + Wineco-protocol ::= CHOICE + {ordering [APPLICATION 1] Order-for-stock, + sales [APPLICATION 2] Return-of-sales, + ... + } +END +--New page in published spec. +Wineco-ordering-protocol + {joint-iso-itu-t international-organization(23) set(42) + set-vendors(9) wineco(43)modules(2) ordering(1)} + DEFINITIONS + AUTOMATIC TAGS ::= + BEGIN + EXPORTS Order-for-stock; + IMPORTS OutletType, Address, Security-Type FROM + Wineco-common-types + {wineco-OID modules(2) common (3)}; + wineco-OID OBJECT IDENTIFIER ::= + {joint-iso-itu-t international-organization(23) set(42) + set-vendors(9) wineco(43)} + Order-for-stock ::= SEQUENCE + {order-no INTEGER, + name-address BranchIdentification, + details SEQUENCE OF + SEQUENCE + {item OBJECT IDENTIFIER, + cases INTEGER}, + urgency ENUMERATED + {tomorrow(0), + three-day(1), + week(2)} DEFAULT week, + authenticator Security-Type} + BranchIdentification ::= SET + {unique-id OBJECT IDENTIFIER, + details CHOICE + {uk [0] SEQUENCE + {name VisibleString, + type OutletType, + location Address}, + overseas [1] SEQUENCE + {name UTF8String, + type OutletType, + location Address}, + warehouse [2] CHOICE + {northern [0] NULL, + southern [1] NULL} } } + END +--New page in published spec. + Wineco-returns-protocol + {joint-iso-itu-t international-organization(23) set(42) + set-vendors(9) wineco(43) modules(2) returns(2)} + DEFINITIONS + AUTOMATIC TAGS ::= + BEGIN + EXPORTS Return-of-sales; + IMPORTS OutletType, Address, Security-Type FROM + Wineco-common-types + {wineco-OID modules(2) common (3)}; + wineco-OID OBJECT IDENTIFIER ::= + {joint-iso-itu-t international-organization(23) set(42) + set-vendors(9) wineco(43)} + Return-of-sales ::= SEQUENCE + {version BIT STRING + {version1 (0), version2 (1)} DEFAULT {version1}, + no-of-days-reported-on INTEGER + {week(7), month (28), maximum (56)} (1..56) DEFAULT week, + time-and-date-of-report CHOICE + {two-digit-year UTCTime, + four-digit-year GeneralizedTime}, + -- If the system clock provides a four-digit year, + -- the second alternative shall be used. With the + -- first alternative the time shall be interpreted + -- as a sliding window. + reason-for-delay ENUMERATED + {computer-failure, network-failure, other} OPTIONAL, + -- Include this field if and only if the + -- no-of-days-reported-on exceeds seven. + additional-information SEQUENCE OF PrintableString OPTIONAL, + -- Include this field if and only if the + -- reason-for-delay is "other". + sales-data SET OF Report-item, + ... } + Report-item ::= SEQUENCE + {item OBJECT IDENTIFIER, + item-description ObjectDescriptor OPTIONAL, + -- To be included for any newly-stocked item. + bar-code-data OCTET STRING, + -- Represents the bar-code for the item as specified + -- in the wineco manual chapter 29. + ran-out-of-stock BOOLEAN DEFAULT FALSE, + -- Send TRUE if stock for item became exhausted at any + -- time during the period reported on. + min-stock-level REAL, + max-stock-level REAL, + average-stock-level REAL + -- Give minimum, maximum, and average levels during the + -- period as a percentage of normal target stock-level-- } + wineco-items OBJECT IDENTIFIER ::= + {joint-iso-itu-t international-organization(23) set(42) + set-vendors(9) wineco(43)stock-items (0)} +END +Wineco-common-types + {joint-iso-itu-t internationalRA(23) set(42) + set-vendors(9) wineco(43) modules(2) common(3)} + DEFINITIONS + AUTOMATIC TAGS ::= + BEGIN + EXPORTS OutletType, Address, Security-Type; +-- IMPORTS Security-Type FROM +-- SET-module +-- {joint-iso-itu-t internationalRA(23) set(42) module(6) 0}; +--Removed for this appendix to avoid needing the import, +--and replaced by the type below. +Security-Type ::= SEQUENCE{ + algorithm OBJECT IDENTIFIER, + encoding OCTET STRING} +--OutletType is not populated in main text-- + OutletType ::= SEQUENCE + {type ENUMERATED{mail-order, retail}, + description CHARACTER STRING} +--Address is not populated in main text-- + Address ::= SEQUENCE + {name UTF8String, + town UTF8String, + country UTF8String} + END diff --git a/testfiles/sequence.asn b/testfiles/sequence.asn new file mode 100644 index 00000000..591f94d4 --- /dev/null +++ b/testfiles/sequence.asn @@ -0,0 +1,31 @@ +Sequence DEFINITIONS IMPLICIT TAGS ::= BEGIN + +Empty ::= SEQUENCE { +} + +Collection ::= SEQUENCE { + empty [0] Empty, + null [1] NULL, + integer [2] INTEGER, + boolean [3] BOOLEAN, + string [4] UTF8String +} + +Contents ::= SEQUENCE { + seq SEQUENCE { + enu ENUMERATED { + value (5) + }, + integer INTEGER + }, + cho CHOICE { + boolean BOOLEAN, + string UTF8String + } +} + +Components ::= SEQUENCE { + COMPONENTS OF Contents +} + +END