asmyasnikov e25934f4bb Added antlr4 to exported contribs into github.com/ydb-platform/ydb | 4 месяцев назад | |
---|---|---|
.. | ||
.yandex_meta | 4 месяцев назад | |
src | 4 месяцев назад | |
CHANGES.txt | 4 месяцев назад | |
CONTRIBUTING.md | 4 месяцев назад | |
LICENSE.txt | 4 месяцев назад | |
README-cpp.md | 4 месяцев назад | |
README.md | 4 месяцев назад | |
ya.make | 4 месяцев назад |
This folder contains the C++ runtime support for ANTLR. See the canonical antlr4 repository for in depth detail about how to use ANTLR 4.
ANTLR 4 is the result of substantial effort of the following people:
The C++ target has been the work of the following people:
The minimum C++ version to compile the ANTLR C++ runtime with is C++11. The supplied projects can built the runtime either as static or dynamic library, as both 32bit and 64bit arch. The macOS project contains a target for iOS and can also be built using cmake (instead of XCode).
Include the antlr4-runtime.h umbrella header in your target application to get everything needed to use the library.
If you are compiling with cmake, the minimum version required is cmake 2.8.
By default, the libraries produced by the CMake build target C++11. If you want to target a different C++ standard, you can explicitly pass the standard - e.g. -DCMAKE_CXX_STANDARD=17
.
Simply open the VS project from the runtime folder (VS 2019+) and build it.
Use the "Open Folder" Feature from the File->Open->Folder menu to open the runtime/Cpp directory. It will automatically use the CMake description to open up a Visual Studio Solution.
Either open the included XCode project and build that or use the cmake compilation as described for linux.
Try run cmake -DCMAKE_ANDROID_NDK=/folder/of/android_ndkr17_and_above -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_API=14 -DCMAKE_ANDROID_ARCH_ABI=x86 -DCMAKE_ANDROID_STL_TYPE=c++_shared -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang -DCMAKE_BUILD_TYPE=Release /folder/antlr4_src_dir -G Ninja.
If you don't want to build the demo then replace the "cmake .. -DANTLR_JAR_LOCATION<...>" command in the above recipe with "cmake .." without any further parameters. There is another cmake script available in the subfolder cmake/ for those who prefer the superbuild cmake pattern.
If the CMake variable 'ANTLR4_INSTALL' is set, CMake Packages will be build and installed during the install step. They expose two packages: antlr4_runtime and antlr4_generator which can be referenced to ease up the use of the ANTLR Generator and runtime. Use and Sample can be found here