[deploy]移除了导致编译错误的Antlr目录
This commit is contained in:
Binary file not shown.
@@ -1,216 +0,0 @@
|
||||
# -*- mode:cmake -*-
|
||||
cmake_minimum_required (VERSION 3.15)
|
||||
# 3.14 needed because of FetchContent
|
||||
# 3.15 needed to avid spew of warnings related to overriding cl command line flags
|
||||
|
||||
set(CMAKE_MACOSX_RPATH OFF)
|
||||
|
||||
enable_testing()
|
||||
|
||||
# Detect build type, fallback to release and throw a warning if use didn't specify any
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
message(WARNING "Build type not set, falling back to Release mode.
|
||||
To specify build type use:
|
||||
-DCMAKE_BUILD_TYPE=<mode> where <mode> is Debug or Release.")
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
|
||||
"Choose the type of build, options are: Debug Release."
|
||||
FORCE)
|
||||
endif(NOT CMAKE_BUILD_TYPE)
|
||||
|
||||
if(NOT WITH_DEMO)
|
||||
message(STATUS "Building without demo. To enable demo build use: -DWITH_DEMO=True")
|
||||
set(WITH_DEMO False CACHE STRING
|
||||
"Chose to build with or without demo executable"
|
||||
FORCE)
|
||||
endif(NOT WITH_DEMO)
|
||||
|
||||
option(WITH_LIBCXX "Building with clang++ and libc++(in Linux). To enable with: -DWITH_LIBCXX=On" Off)
|
||||
option(WITH_STATIC_CRT "(Visual C++) Enable to statically link CRT, which avoids requiring users to install the redistribution package.
|
||||
To disable with: -DWITH_STATIC_CRT=Off" On)
|
||||
option(DISABLE_WARNINGS "Suppress compiler warnings for all built ANTLR targets" OFF)
|
||||
|
||||
cmake_policy(SET CMP0091 NEW) # Enable use of CMAKE_MSVC_RUNTIME_LIBRARY
|
||||
if(WITH_STATIC_CRT)
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
else()
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
||||
endif(WITH_STATIC_CRT)
|
||||
|
||||
project(LIBANTLR4)
|
||||
|
||||
if(APPLE)
|
||||
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
|
||||
endif()
|
||||
|
||||
file(STRINGS "VERSION" ANTLR_VERSION)
|
||||
|
||||
if(WITH_DEMO)
|
||||
# Java is not necessary if building without demos.
|
||||
find_package(Java COMPONENTS Runtime REQUIRED)
|
||||
|
||||
if(NOT ANTLR_JAR_LOCATION)
|
||||
message(FATAL_ERROR "Missing antlr4.jar location. You can specify it's path using: -DANTLR_JAR_LOCATION=<path>")
|
||||
else()
|
||||
get_filename_component(ANTLR_NAME ${ANTLR_JAR_LOCATION} NAME_WE)
|
||||
if(NOT EXISTS "${ANTLR_JAR_LOCATION}")
|
||||
message(FATAL_ERROR "Unable to find ${ANTLR_NAME} in ${ANTLR_JAR_LOCATION}")
|
||||
else()
|
||||
message(STATUS "Found ${ANTLR_NAME}: ${ANTLR_JAR_LOCATION}")
|
||||
endif()
|
||||
endif()
|
||||
endif(WITH_DEMO)
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
set(MY_CXX_WARNING_FLAGS " /W4")
|
||||
|
||||
if(DISABLE_WARNINGS)
|
||||
set(MY_CXX_WARNING_FLAGS " /w")
|
||||
endif()
|
||||
else()
|
||||
set(MY_CXX_WARNING_FLAGS " -Wall -pedantic -W")
|
||||
|
||||
if(DISABLE_WARNINGS)
|
||||
set(MY_CXX_WARNING_FLAGS " -w")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Define USE_UTF8_INSTEAD_OF_CODECVT macro.
|
||||
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_UTF8_INSTEAD_OF_CODECVT")
|
||||
|
||||
# Initialize CXXFLAGS.
|
||||
if(NOT DEFINED CMAKE_CXX_STANDARD)
|
||||
# only set CMAKE_CXX_STANDARD if not already set
|
||||
# this allows the standard to be set by the caller, for example with -DCMAKE_CXX_STANDARD:STRING=17
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
endif()
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_WARNING_FLAGS}")
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MP ${MY_CXX_WARNING_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /O1 /Oi /Ob2 /Gy /MP /DNDEBUG ${MY_CXX_WARNING_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2 /Oi /Ob2 /Gy /MP /DNDEBUG ${MY_CXX_WARNING_FLGAS}")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /O2 /Oi /Ob2 /Gy /MP /Zi ${MY_CXX_WARNING_FLAGS}")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g ${MY_CXX_WARNING_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -DNDEBUG ${MY_CXX_WARNING_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG ${MY_CXX_WARNING_FLGAS}")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g ${MY_CXX_WARNING_FLAGS}")
|
||||
endif()
|
||||
|
||||
# Compiler-specific C++17 activation.
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
|
||||
# Just g++-5.0 and greater contain <codecvt> header. (test in ubuntu)
|
||||
if(NOT (GCC_VERSION VERSION_GREATER 5.0 OR GCC_VERSION VERSION_EQUAL 5.0))
|
||||
message(FATAL_ERROR "${PROJECT_NAME} requires g++ 5.0 or greater.")
|
||||
endif ()
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND ANDROID)
|
||||
# Need -Os cflag and cxxflags here to work with exception handling on armeabi.
|
||||
# see https://github.com/android-ndk/ndk/issues/573
|
||||
# and without -stdlib=libc++ cxxflags
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND APPLE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -stdlib=libc++")
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND ( CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") )
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CLANG_VERSION)
|
||||
if(NOT (CLANG_VERSION VERSION_GREATER 4.2.1 OR CLANG_VERSION VERSION_EQUAL 4.2.1))
|
||||
message(FATAL_ERROR "${PROJECT_NAME} requires clang 4.2.1 or greater.")
|
||||
endif()
|
||||
# You can use libc++ to compile this project when g++ is NOT greater than or equal to 5.0.
|
||||
if(WITH_LIBCXX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||
endif()
|
||||
elseif(MSVC_VERSION GREATER 1800 OR MSVC_VERSION EQUAL 1800)
|
||||
# Visual Studio 2012+ supports C++17 features
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Emscripten")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -stdlib=libc++")
|
||||
else()
|
||||
message(FATAL_ERROR "Your C++ compiler does not support C++17.")
|
||||
endif()
|
||||
|
||||
|
||||
add_subdirectory(runtime)
|
||||
if(WITH_DEMO)
|
||||
add_subdirectory(demo)
|
||||
endif(WITH_DEMO)
|
||||
|
||||
# Generate CMake Package Files only if install is active
|
||||
if (ANTLR4_INSTALL)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
if(NOT ANTLR4_CMAKE_DIR)
|
||||
set(ANTLR4_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake CACHE STRING
|
||||
"Installation directory for cmake files." FORCE )
|
||||
endif(NOT ANTLR4_CMAKE_DIR)
|
||||
|
||||
set(version_runtime_config ${PROJECT_BINARY_DIR}/antlr4-runtime-config-version.cmake)
|
||||
set(version_generator_config ${PROJECT_BINARY_DIR}/antlr4-generator-config-version.cmake)
|
||||
set(project_runtime_config ${PROJECT_BINARY_DIR}/antlr4-runtime-config.cmake)
|
||||
set(project_generator_config ${PROJECT_BINARY_DIR}/antlr4-generator-config.cmake)
|
||||
set(targets_export_name antlr4-targets)
|
||||
|
||||
set(ANTLR4_LIB_DIR ${CMAKE_INSTALL_LIBDIR} CACHE STRING
|
||||
"Installation directory for libraries, relative to ${CMAKE_INSTALL_PREFIX}.")
|
||||
|
||||
set(ANTLR4_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/antlr4-runtime CACHE STRING
|
||||
"Installation directory for include files, relative to ${CMAKE_INSTALL_PREFIX}.")
|
||||
|
||||
configure_package_config_file(
|
||||
cmake/antlr4-runtime.cmake.in
|
||||
${project_runtime_config}
|
||||
INSTALL_DESTINATION ${ANTLR4_CMAKE_DIR}/antlr4-runtime
|
||||
PATH_VARS
|
||||
ANTLR4_INCLUDE_DIR
|
||||
ANTLR4_LIB_DIR )
|
||||
|
||||
configure_package_config_file(
|
||||
cmake/antlr4-generator.cmake.in
|
||||
${project_generator_config}
|
||||
INSTALL_DESTINATION ${ANTLR4_CMAKE_DIR}/antlr4-generator
|
||||
PATH_VARS
|
||||
ANTLR4_INCLUDE_DIR
|
||||
ANTLR4_LIB_DIR )
|
||||
|
||||
write_basic_package_version_file(
|
||||
${version_runtime_config}
|
||||
VERSION ${ANTLR_VERSION}
|
||||
COMPATIBILITY SameMajorVersion )
|
||||
|
||||
write_basic_package_version_file(
|
||||
${version_generator_config}
|
||||
VERSION ${ANTLR_VERSION}
|
||||
COMPATIBILITY SameMajorVersion )
|
||||
|
||||
install(EXPORT ${targets_export_name}
|
||||
DESTINATION ${ANTLR4_CMAKE_DIR}/antlr4-runtime )
|
||||
|
||||
install(FILES ${project_runtime_config}
|
||||
${version_runtime_config}
|
||||
DESTINATION ${ANTLR4_CMAKE_DIR}/antlr4-runtime )
|
||||
|
||||
install(FILES ${project_generator_config}
|
||||
${version_generator_config}
|
||||
DESTINATION ${ANTLR4_CMAKE_DIR}/antlr4-generator )
|
||||
|
||||
endif(ANTLR4_INSTALL)
|
||||
|
||||
if(EXISTS LICENSE.txt)
|
||||
install(FILES LICENSE.txt
|
||||
DESTINATION "share/doc/libantlr4")
|
||||
elseif(EXISTS ../../LICENSE.txt)
|
||||
install(FILES ../../LICENSE.txt
|
||||
DESTINATION "share/doc/libantlr4")
|
||||
endif()
|
||||
|
||||
install(FILES README.md VERSION
|
||||
DESTINATION "share/doc/libantlr4")
|
||||
|
||||
set(CPACK_PACKAGE_CONTACT "antlr-discussion@googlegroups.com")
|
||||
set(CPACK_PACKAGE_VERSION ${ANTLR_VERSION})
|
||||
include(CPack)
|
||||
@@ -1,105 +0,0 @@
|
||||
{
|
||||
// See https://go.microsoft.com//fwlink//?linkid=834763 for more information about this file.
|
||||
"configurations": [
|
||||
{
|
||||
"name": "x86-Debug",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"inheritEnvironments": [ "msvc_x86" ],
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"variables": [
|
||||
{
|
||||
"name": "ANTLR4_INSTALL",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"name": "WITH_STATIC_CRT",
|
||||
"value": "OFF"
|
||||
},
|
||||
{
|
||||
"name": "WITH_DEMO",
|
||||
"value": "OFF"
|
||||
}
|
||||
],
|
||||
"buildCommandArgs": "-v",
|
||||
"ctestCommandArgs": ""
|
||||
},
|
||||
{
|
||||
"name": "x86-Release",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"inheritEnvironments": [ "msvc_x86" ],
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"variables": [
|
||||
{
|
||||
"name": "ANTLR4_INSTALL",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"name": "WITH_STATIC_CRT",
|
||||
"value": "OFF"
|
||||
},
|
||||
{
|
||||
"name": "WITH_DEMO",
|
||||
"value": "OFF"
|
||||
}
|
||||
],
|
||||
"buildCommandArgs": "-v",
|
||||
"ctestCommandArgs": ""
|
||||
},
|
||||
{
|
||||
"name": "x64-Debug",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"variables": [
|
||||
{
|
||||
"name": "ANTLR4_INSTALL",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"name": "WITH_STATIC_CRT",
|
||||
"value": "OFF"
|
||||
},
|
||||
{
|
||||
"name": "WITH_DEMO",
|
||||
"value": "OFF"
|
||||
}
|
||||
],
|
||||
"buildCommandArgs": "-v",
|
||||
"ctestCommandArgs": ""
|
||||
},
|
||||
{
|
||||
"name": "x64-Release",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"variables": [
|
||||
{
|
||||
"name": "ANTLR4_INSTALL",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"name": "WITH_STATIC_CRT",
|
||||
"value": "OFF"
|
||||
},
|
||||
{
|
||||
"name": "WITH_DEMO",
|
||||
"value": "OFF"
|
||||
}
|
||||
],
|
||||
"buildCommandArgs": "-v",
|
||||
"ctestCommandArgs": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
# C++ target for ANTLR 4
|
||||
|
||||
This folder contains the C++ runtime support for ANTLR. See [the canonical antlr4 repository](https://github.com/antlr/antlr4) for in depth detail about how to use ANTLR 4.
|
||||
|
||||
## Authors and major contributors
|
||||
|
||||
ANTLR 4 is the result of substantial effort of the following people:
|
||||
|
||||
* [Terence Parr](http://www.cs.usfca.edu/~parrt/), parrt@cs.usfca.edu
|
||||
ANTLR project lead and supreme dictator for life
|
||||
[University of San Francisco](http://www.usfca.edu/)
|
||||
* [Sam Harwell](http://tunnelvisionlabs.com/)
|
||||
Tool co-author, Java and C# target)
|
||||
|
||||
The C++ target has been the work of the following people:
|
||||
|
||||
* Dan McLaughlin, dan.mclaughlin@gmail.com (initial port, got code to compile)
|
||||
* David Sisson, dsisson@google.com (initial port, made the runtime C++ tests runnable)
|
||||
* [Mike Lischke](http://www.soft-gems.net), mike@lischke-online.de (brought the initial port to a working library, made most runtime tests passing)
|
||||
|
||||
## Other contributors
|
||||
|
||||
* Marcin Szalowicz, mszalowicz@mailplus.pl (cmake build setup)
|
||||
* Tim O'Callaghan, timo@linux.com (additional superbuild cmake pattern script)
|
||||
|
||||
## Project Status
|
||||
|
||||
* Building on macOS, Windows, Android and Linux
|
||||
* No errors and warnings
|
||||
* Library linking
|
||||
* Some unit tests in the macOS project, for important base classes with almost 100% code coverage.
|
||||
* All memory allocations checked
|
||||
* Simple command line demo application working on all supported platforms.
|
||||
* All runtime tests pass.
|
||||
|
||||
### Build + Usage Notes
|
||||
|
||||
The minimum C++ version to compile the ANTLR C++ runtime with is C++17. 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++17. If you want to target a different C++ standard, you can explicitly pass the standard - e.g. `-DCMAKE_CXX_STANDARD=17`.
|
||||
|
||||
#### Compiling on Windows with Visual Studio using he Visual Studio projects
|
||||
Simply open the VS project from the runtime folder (VS 2019+) and build it.
|
||||
|
||||
#### Compiling on Windows using cmake with Visual Studio VS2019 and later
|
||||
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.
|
||||
|
||||
#### Compiling on macOS
|
||||
Either open the included XCode project and build that or use the cmake compilation as described for linux.
|
||||
|
||||
#### Compiling on Android
|
||||
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.
|
||||
|
||||
#### Compiling on Linux
|
||||
- cd \<antlr4-dir\>/runtime/Cpp (this is where this readme is located)
|
||||
- mkdir build && mkdir run && cd build
|
||||
- cmake .. -DANTLR_JAR_LOCATION=full/path/to/antlr4-4.5.4-SNAPSHOT.jar -DWITH_DEMO=True
|
||||
- make
|
||||
- DESTDIR=\<antlr4-dir\>/runtime/Cpp/run make install
|
||||
|
||||
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.
|
||||
|
||||
#### CMake Package support
|
||||
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](cmake/Antlr4Package.md)
|
||||
@@ -1 +0,0 @@
|
||||
4.13.2
|
||||
@@ -1,136 +0,0 @@
|
||||
# CMake Antlr4 Package Usage
|
||||
|
||||
## The `antlr4-generator` Package
|
||||
|
||||
To use the Package you must insert a
|
||||
```cmake
|
||||
find_package(antlr4-generator REQUIRED)
|
||||
```
|
||||
line in your `CMakeList.txt` file.
|
||||
|
||||
The package exposes a function `antlr4_generate` that generates the required setup to call ANTLR for a
|
||||
given input file during build.
|
||||
|
||||
The following table lists the parameters that can be used with the function:
|
||||
|
||||
Argument# | Required | Default | Use
|
||||
----------|-----------|---------|---
|
||||
0 | Yes | n/a | Unique target name. It is used to generate CMake Variables to reference the various outputs of the generation
|
||||
1 | Yes | n/a | Input file containing the lexer/parser definition
|
||||
2 | Yes | n/a | Type of Rules contained in the input: LEXER, PARSER or BOTH
|
||||
4 | No | FALSE | Boolean to indicate if a listener interface should be generated
|
||||
5 | No | FALSE | Boolean to indicate if a visitor interface should be generated
|
||||
6 | No | none | C++ namespace in which the generated classes should be placed
|
||||
7 | No | none | Additional files on which the input depends
|
||||
8 | No | none | Library path to use during generation
|
||||
|
||||
The `ANTLR4_JAR_LOCATION` CMake variable must be set to the location where the `antlr-4*-complete.jar` generator is located. You can download the file from [here](http://www.antlr.org/download.html).
|
||||
|
||||
Additional options to the ANTLR4 generator can be passed in the `ANTLR4_GENERATED_OPTIONS` variable. Add the installation prefix of `antlr4-runtime` to `CMAKE_PREFIX_PATH` or set
|
||||
`antlr4-runtime_DIR` to a directory containing the files.
|
||||
|
||||
The following CMake variables are available following a call to `antlr4_generate`
|
||||
|
||||
Output variable | Meaning
|
||||
---|---
|
||||
`ANTLR4_INCLUDE_DIR_<Target name>` | Directory containing the generated header files
|
||||
`ANTLR4_SRC_FILES_<Target name>` | List of generated source files
|
||||
`ANTLR4_TOKEN_FILES_<Target name>` | List of generated token files
|
||||
`ANTLR4_TOKEN_DIRECTORY_<Target name>` | Directory containing the generated token files
|
||||
|
||||
#### Sample:
|
||||
```cmake
|
||||
# generate parser with visitor classes.
|
||||
# put the classes in C++ namespace 'antlrcpptest::'
|
||||
antlr4_generate(
|
||||
antlrcpptest_parser
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/TLexer.g4
|
||||
LEXER
|
||||
FALSE
|
||||
TRUE
|
||||
"antlrcpptest"
|
||||
)
|
||||
```
|
||||
|
||||
**Remember that the ANTLR generator requires a working Java installation on your machine!**
|
||||
|
||||
## The `antlr4-runtime` Package
|
||||
|
||||
To use the Package you must insert a
|
||||
```cmake
|
||||
find_package(antlr4-runtime REQUIRED)
|
||||
```
|
||||
line in your `CMakeList.txt` file.
|
||||
|
||||
The package exposes two different targets:
|
||||
|
||||
Target|Use
|
||||
--|--
|
||||
antlr4_shared|Shared library version of the runtime
|
||||
antlr4_static|Static library version of the runtime
|
||||
|
||||
Both set the following CMake variables:
|
||||
|
||||
Output variable | Meaning
|
||||
---|---
|
||||
`ANTLR4_INCLUDE_DIR` | Include directory containing the runtime header files
|
||||
`ANTLR4_LIB_DIR` | Library directory containing the runtime library files
|
||||
|
||||
#### Sample:
|
||||
```cmake
|
||||
# add runtime include directories on this project.
|
||||
include_directories( ${ANTLR4_INCLUDE_DIR} )
|
||||
|
||||
# add runtime to project dependencies
|
||||
add_dependencies( Parsertest antlr4_shared )
|
||||
|
||||
# add runtime to project link libraries
|
||||
target_link_libraries( Parsertest PRIVATE
|
||||
antlr4_shared)
|
||||
```
|
||||
|
||||
### Full Example:
|
||||
```cmake
|
||||
# Bring in the required packages
|
||||
find_package(antlr4-runtime REQUIRED)
|
||||
find_package(antlr4-generator REQUIRED)
|
||||
|
||||
# Set path to generator
|
||||
set(ANTLR4_JAR_LOCATION ${PROJECT_SOURCE_DIR}/thirdparty/antlr/antlr-4.13.2-complete.jar)
|
||||
|
||||
# generate lexer
|
||||
antlr4_generate(
|
||||
antlrcpptest_lexer
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/TLexer.g4
|
||||
LEXER
|
||||
FALSE
|
||||
FALSE
|
||||
"antlrcpptest"
|
||||
)
|
||||
|
||||
# generate parser
|
||||
antlr4_generate(
|
||||
antlrcpptest_parser
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/TParser.g4
|
||||
PARSER
|
||||
FALSE
|
||||
TRUE
|
||||
"antlrcpptest"
|
||||
"${ANTLR4_TOKEN_FILES_antlrcpptest_lexer}"
|
||||
"${ANTLR4_TOKEN_DIRECTORY_antlrcpptest_lexer}"
|
||||
)
|
||||
|
||||
# add directories for generated include files
|
||||
include_directories( ${PROJECT_BINARY_DIR} ${ANTLR4_INCLUDE_DIR} ${ANTLR4_INCLUDE_DIR_antlrcpptest_lexer} ${ANTLR4_INCLUDE_DIR_antlrcpptest_parser} )
|
||||
|
||||
# add generated source files
|
||||
add_executable( Parsertest main.cpp ${ANTLR4_SRC_FILES_antlrcpptest_lexer} ${ANTLR4_SRC_FILES_antlrcpptest_parser} )
|
||||
|
||||
# add required runtime library
|
||||
add_dependencies( Parsertest antlr4_shared )
|
||||
|
||||
target_link_libraries( Parsertest PRIVATE
|
||||
antlr4_shared)
|
||||
|
||||
```
|
||||
|
||||
@@ -1,177 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.7)
|
||||
|
||||
if(POLICY CMP0114)
|
||||
cmake_policy(SET CMP0114 NEW)
|
||||
endif()
|
||||
|
||||
include(ExternalProject)
|
||||
|
||||
set(ANTLR4_ROOT ${CMAKE_CURRENT_BINARY_DIR}/antlr4_runtime/src/antlr4_runtime)
|
||||
set(ANTLR4_INCLUDE_DIRS ${ANTLR4_ROOT}/runtime/Cpp/runtime/src)
|
||||
set(ANTLR4_GIT_REPOSITORY https://github.com/antlr/antlr4.git)
|
||||
if(NOT DEFINED ANTLR4_TAG)
|
||||
# Set to branch name to keep library updated at the cost of needing to rebuild after 'clean'
|
||||
# Set to commit hash to keep the build stable and does not need to rebuild after 'clean'
|
||||
set(ANTLR4_TAG master)
|
||||
endif()
|
||||
|
||||
# Ensure that the include dir already exists at configure time (to avoid cmake erroring
|
||||
# on non-existent include dirs)
|
||||
file(MAKE_DIRECTORY "${ANTLR4_INCLUDE_DIRS}")
|
||||
|
||||
if(${CMAKE_GENERATOR} MATCHES "Visual Studio.*")
|
||||
set(ANTLR4_OUTPUT_DIR ${ANTLR4_ROOT}/runtime/Cpp/runtime/$(Configuration))
|
||||
elseif(${CMAKE_GENERATOR} MATCHES "Xcode.*")
|
||||
set(ANTLR4_OUTPUT_DIR ${ANTLR4_ROOT}/runtime/Cpp/runtime/$(CONFIGURATION))
|
||||
else()
|
||||
set(ANTLR4_OUTPUT_DIR ${ANTLR4_ROOT}/runtime/Cpp/runtime)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
set(ANTLR4_STATIC_LIBRARIES
|
||||
${ANTLR4_OUTPUT_DIR}/antlr4-runtime-static.lib)
|
||||
set(ANTLR4_SHARED_LIBRARIES
|
||||
${ANTLR4_OUTPUT_DIR}/antlr4-runtime.lib)
|
||||
set(ANTLR4_RUNTIME_LIBRARIES
|
||||
${ANTLR4_OUTPUT_DIR}/antlr4-runtime.dll)
|
||||
else()
|
||||
set(ANTLR4_STATIC_LIBRARIES
|
||||
${ANTLR4_OUTPUT_DIR}/libantlr4-runtime.a)
|
||||
if(MINGW)
|
||||
set(ANTLR4_SHARED_LIBRARIES
|
||||
${ANTLR4_OUTPUT_DIR}/libantlr4-runtime.dll.a)
|
||||
set(ANTLR4_RUNTIME_LIBRARIES
|
||||
${ANTLR4_OUTPUT_DIR}/libantlr4-runtime.dll)
|
||||
elseif(CYGWIN)
|
||||
set(ANTLR4_SHARED_LIBRARIES
|
||||
${ANTLR4_OUTPUT_DIR}/libantlr4-runtime.dll.a)
|
||||
set(ANTLR4_RUNTIME_LIBRARIES
|
||||
${ANTLR4_OUTPUT_DIR}/cygantlr4-runtime-4.13.2.dll)
|
||||
elseif(APPLE)
|
||||
set(ANTLR4_RUNTIME_LIBRARIES
|
||||
${ANTLR4_OUTPUT_DIR}/libantlr4-runtime.dylib)
|
||||
else()
|
||||
set(ANTLR4_RUNTIME_LIBRARIES
|
||||
${ANTLR4_OUTPUT_DIR}/libantlr4-runtime.so)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(${CMAKE_GENERATOR} MATCHES ".* Makefiles")
|
||||
# This avoids
|
||||
# 'warning: jobserver unavailable: using -j1. Add '+' to parent make rule.'
|
||||
set(ANTLR4_BUILD_COMMAND $(MAKE))
|
||||
elseif(${CMAKE_GENERATOR} MATCHES "Visual Studio.*")
|
||||
set(ANTLR4_BUILD_COMMAND
|
||||
${CMAKE_COMMAND}
|
||||
--build .
|
||||
--config $(Configuration)
|
||||
--target)
|
||||
elseif(${CMAKE_GENERATOR} MATCHES "Xcode.*")
|
||||
set(ANTLR4_BUILD_COMMAND
|
||||
${CMAKE_COMMAND}
|
||||
--build .
|
||||
--config $(CONFIGURATION)
|
||||
--target)
|
||||
else()
|
||||
set(ANTLR4_BUILD_COMMAND
|
||||
${CMAKE_COMMAND}
|
||||
--build .
|
||||
--target)
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED ANTLR4_WITH_STATIC_CRT)
|
||||
set(ANTLR4_WITH_STATIC_CRT ON)
|
||||
endif()
|
||||
|
||||
if(ANTLR4_ZIP_REPOSITORY)
|
||||
ExternalProject_Add(
|
||||
antlr4_runtime
|
||||
PREFIX antlr4_runtime
|
||||
URL ${ANTLR4_ZIP_REPOSITORY}
|
||||
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}
|
||||
BUILD_COMMAND ""
|
||||
BUILD_IN_SOURCE 1
|
||||
SOURCE_DIR ${ANTLR4_ROOT}
|
||||
SOURCE_SUBDIR runtime/Cpp
|
||||
CMAKE_CACHE_ARGS
|
||||
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
|
||||
-DWITH_STATIC_CRT:BOOL=${ANTLR4_WITH_STATIC_CRT}
|
||||
-DDISABLE_WARNINGS:BOOL=ON
|
||||
# -DCMAKE_CXX_STANDARD:STRING=17 # if desired, compile the runtime with a different C++ standard
|
||||
# -DCMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD} # alternatively, compile the runtime with the same C++ standard as the outer project
|
||||
INSTALL_COMMAND ""
|
||||
EXCLUDE_FROM_ALL 1)
|
||||
else()
|
||||
ExternalProject_Add(
|
||||
antlr4_runtime
|
||||
PREFIX antlr4_runtime
|
||||
GIT_REPOSITORY ${ANTLR4_GIT_REPOSITORY}
|
||||
GIT_TAG ${ANTLR4_TAG}
|
||||
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}
|
||||
BUILD_COMMAND ""
|
||||
BUILD_IN_SOURCE 1
|
||||
SOURCE_DIR ${ANTLR4_ROOT}
|
||||
SOURCE_SUBDIR runtime/Cpp
|
||||
CMAKE_CACHE_ARGS
|
||||
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
|
||||
-DWITH_STATIC_CRT:BOOL=${ANTLR4_WITH_STATIC_CRT}
|
||||
-DDISABLE_WARNINGS:BOOL=ON
|
||||
# -DCMAKE_CXX_STANDARD:STRING=17 # if desired, compile the runtime with a different C++ standard
|
||||
# -DCMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD} # alternatively, compile the runtime with the same C++ standard as the outer project
|
||||
INSTALL_COMMAND ""
|
||||
EXCLUDE_FROM_ALL 1)
|
||||
endif()
|
||||
|
||||
# Separate build step as rarely people want both
|
||||
set(ANTLR4_BUILD_DIR ${ANTLR4_ROOT})
|
||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14.0")
|
||||
# CMake 3.14 builds in above's SOURCE_SUBDIR when BUILD_IN_SOURCE is true
|
||||
set(ANTLR4_BUILD_DIR ${ANTLR4_ROOT}/runtime/Cpp)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add_Step(
|
||||
antlr4_runtime
|
||||
build_static
|
||||
COMMAND ${ANTLR4_BUILD_COMMAND} antlr4_static
|
||||
# Depend on target instead of step (a custom command)
|
||||
# to avoid running dependent steps concurrently
|
||||
DEPENDS antlr4_runtime
|
||||
BYPRODUCTS ${ANTLR4_STATIC_LIBRARIES}
|
||||
EXCLUDE_FROM_MAIN 1
|
||||
WORKING_DIRECTORY ${ANTLR4_BUILD_DIR})
|
||||
ExternalProject_Add_StepTargets(antlr4_runtime build_static)
|
||||
|
||||
add_library(antlr4_static STATIC IMPORTED)
|
||||
add_dependencies(antlr4_static antlr4_runtime-build_static)
|
||||
set_target_properties(antlr4_static PROPERTIES
|
||||
IMPORTED_LOCATION ${ANTLR4_STATIC_LIBRARIES})
|
||||
target_include_directories(antlr4_static
|
||||
INTERFACE
|
||||
${ANTLR4_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
ExternalProject_Add_Step(
|
||||
antlr4_runtime
|
||||
build_shared
|
||||
COMMAND ${ANTLR4_BUILD_COMMAND} antlr4_shared
|
||||
# Depend on target instead of step (a custom command)
|
||||
# to avoid running dependent steps concurrently
|
||||
DEPENDS antlr4_runtime
|
||||
BYPRODUCTS ${ANTLR4_SHARED_LIBRARIES} ${ANTLR4_RUNTIME_LIBRARIES}
|
||||
EXCLUDE_FROM_MAIN 1
|
||||
WORKING_DIRECTORY ${ANTLR4_BUILD_DIR})
|
||||
ExternalProject_Add_StepTargets(antlr4_runtime build_shared)
|
||||
|
||||
add_library(antlr4_shared SHARED IMPORTED)
|
||||
add_dependencies(antlr4_shared antlr4_runtime-build_shared)
|
||||
set_target_properties(antlr4_shared PROPERTIES
|
||||
IMPORTED_LOCATION ${ANTLR4_RUNTIME_LIBRARIES})
|
||||
target_include_directories(antlr4_shared
|
||||
INTERFACE
|
||||
${ANTLR4_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if(ANTLR4_SHARED_LIBRARIES)
|
||||
set_target_properties(antlr4_shared PROPERTIES
|
||||
IMPORTED_IMPLIB ${ANTLR4_SHARED_LIBRARIES})
|
||||
endif()
|
||||
@@ -1,124 +0,0 @@
|
||||
find_package(Java QUIET COMPONENTS Runtime)
|
||||
|
||||
if(NOT ANTLR_EXECUTABLE)
|
||||
find_program(ANTLR_EXECUTABLE
|
||||
NAMES antlr.jar antlr4.jar antlr-4.jar antlr-4.13.2-complete.jar)
|
||||
endif()
|
||||
|
||||
if(ANTLR_EXECUTABLE AND Java_JAVA_EXECUTABLE)
|
||||
execute_process(
|
||||
COMMAND ${Java_JAVA_EXECUTABLE} -jar ${ANTLR_EXECUTABLE}
|
||||
OUTPUT_VARIABLE ANTLR_COMMAND_OUTPUT
|
||||
ERROR_VARIABLE ANTLR_COMMAND_ERROR
|
||||
RESULT_VARIABLE ANTLR_COMMAND_RESULT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
if(ANTLR_COMMAND_RESULT EQUAL 0)
|
||||
string(REGEX MATCH "Version [0-9]+(\\.[0-9]+)*" ANTLR_VERSION ${ANTLR_COMMAND_OUTPUT})
|
||||
string(REPLACE "Version " "" ANTLR_VERSION ${ANTLR_VERSION})
|
||||
else()
|
||||
message(
|
||||
SEND_ERROR
|
||||
"Command '${Java_JAVA_EXECUTABLE} -jar ${ANTLR_EXECUTABLE}' "
|
||||
"failed with the output '${ANTLR_COMMAND_ERROR}'")
|
||||
endif()
|
||||
|
||||
macro(ANTLR_TARGET Name InputFile)
|
||||
set(ANTLR_OPTIONS LEXER PARSER LISTENER VISITOR)
|
||||
set(ANTLR_ONE_VALUE_ARGS PACKAGE OUTPUT_DIRECTORY DEPENDS_ANTLR)
|
||||
set(ANTLR_MULTI_VALUE_ARGS COMPILE_FLAGS DEPENDS)
|
||||
cmake_parse_arguments(ANTLR_TARGET
|
||||
"${ANTLR_OPTIONS}"
|
||||
"${ANTLR_ONE_VALUE_ARGS}"
|
||||
"${ANTLR_MULTI_VALUE_ARGS}"
|
||||
${ARGN})
|
||||
|
||||
set(ANTLR_${Name}_INPUT ${InputFile})
|
||||
|
||||
get_filename_component(ANTLR_INPUT ${InputFile} NAME_WE)
|
||||
|
||||
if(ANTLR_TARGET_OUTPUT_DIRECTORY)
|
||||
set(ANTLR_${Name}_OUTPUT_DIR ${ANTLR_TARGET_OUTPUT_DIRECTORY})
|
||||
else()
|
||||
set(ANTLR_${Name}_OUTPUT_DIR
|
||||
${CMAKE_CURRENT_BINARY_DIR}/antlr4cpp_generated_src/${ANTLR_INPUT})
|
||||
endif()
|
||||
|
||||
unset(ANTLR_${Name}_CXX_OUTPUTS)
|
||||
|
||||
if((ANTLR_TARGET_LEXER AND NOT ANTLR_TARGET_PARSER) OR
|
||||
(ANTLR_TARGET_PARSER AND NOT ANTLR_TARGET_LEXER))
|
||||
list(APPEND ANTLR_${Name}_CXX_OUTPUTS
|
||||
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}.h
|
||||
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}.cpp)
|
||||
set(ANTLR_${Name}_OUTPUTS
|
||||
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}.interp
|
||||
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}.tokens)
|
||||
else()
|
||||
list(APPEND ANTLR_${Name}_CXX_OUTPUTS
|
||||
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Lexer.h
|
||||
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Lexer.cpp
|
||||
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Parser.h
|
||||
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Parser.cpp)
|
||||
list(APPEND ANTLR_${Name}_OUTPUTS
|
||||
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Lexer.interp
|
||||
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Lexer.tokens)
|
||||
endif()
|
||||
|
||||
if(ANTLR_TARGET_LISTENER)
|
||||
list(APPEND ANTLR_${Name}_CXX_OUTPUTS
|
||||
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}BaseListener.h
|
||||
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}BaseListener.cpp
|
||||
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Listener.h
|
||||
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Listener.cpp)
|
||||
list(APPEND ANTLR_TARGET_COMPILE_FLAGS -listener)
|
||||
endif()
|
||||
|
||||
if(ANTLR_TARGET_VISITOR)
|
||||
list(APPEND ANTLR_${Name}_CXX_OUTPUTS
|
||||
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}BaseVisitor.h
|
||||
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}BaseVisitor.cpp
|
||||
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Visitor.h
|
||||
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Visitor.cpp)
|
||||
list(APPEND ANTLR_TARGET_COMPILE_FLAGS -visitor)
|
||||
endif()
|
||||
|
||||
if(ANTLR_TARGET_PACKAGE)
|
||||
list(APPEND ANTLR_TARGET_COMPILE_FLAGS -package ${ANTLR_TARGET_PACKAGE})
|
||||
endif()
|
||||
|
||||
list(APPEND ANTLR_${Name}_OUTPUTS ${ANTLR_${Name}_CXX_OUTPUTS})
|
||||
|
||||
if(ANTLR_TARGET_DEPENDS_ANTLR)
|
||||
if(ANTLR_${ANTLR_TARGET_DEPENDS_ANTLR}_INPUT)
|
||||
list(APPEND ANTLR_TARGET_DEPENDS
|
||||
${ANTLR_${ANTLR_TARGET_DEPENDS_ANTLR}_INPUT})
|
||||
list(APPEND ANTLR_TARGET_DEPENDS
|
||||
${ANTLR_${ANTLR_TARGET_DEPENDS_ANTLR}_OUTPUTS})
|
||||
else()
|
||||
message(SEND_ERROR
|
||||
"ANTLR target '${ANTLR_TARGET_DEPENDS_ANTLR}' not found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${ANTLR_${Name}_OUTPUTS}
|
||||
COMMAND ${Java_JAVA_EXECUTABLE} -jar ${ANTLR_EXECUTABLE}
|
||||
${InputFile}
|
||||
-o ${ANTLR_${Name}_OUTPUT_DIR}
|
||||
-no-listener
|
||||
-Dlanguage=Cpp
|
||||
${ANTLR_TARGET_COMPILE_FLAGS}
|
||||
DEPENDS ${InputFile}
|
||||
${ANTLR_TARGET_DEPENDS}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMENT "Building ${Name} with ANTLR ${ANTLR_VERSION}")
|
||||
endmacro(ANTLR_TARGET)
|
||||
|
||||
endif(ANTLR_EXECUTABLE AND Java_JAVA_EXECUTABLE)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(
|
||||
ANTLR
|
||||
REQUIRED_VARS ANTLR_EXECUTABLE Java_JAVA_EXECUTABLE
|
||||
VERSION_VAR ANTLR_VERSION)
|
||||
@@ -1,165 +0,0 @@
|
||||
## Getting started with Antlr4Cpp
|
||||
|
||||
Here is how you can use this external project to create the antlr4cpp demo to start your project off.
|
||||
|
||||
1. Create your project source folder somewhere. e.g. ~/srcfolder/
|
||||
1. Make a subfolder cmake
|
||||
2. Copy the files in this folder to srcfolder/cmake
|
||||
3. Cut below and use it to create srcfolder/CMakeLists.txt
|
||||
4. Copy main.cpp, TLexer.g4 and TParser.g4 to srcfolder/ from [here](https://github.com/antlr/antlr4/tree/master/runtime/Cpp/demo)
|
||||
2. Make a build folder e.g. ~/buildfolder/
|
||||
3. From the buildfolder, run `cmake ~/srcfolder; make`
|
||||
|
||||
```cmake
|
||||
# minimum required CMAKE version
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.7 FATAL_ERROR)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
# compiler must be 17
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
# required if linking to static library
|
||||
add_definitions(-DANTLR4CPP_STATIC)
|
||||
|
||||
# using /MD flag for antlr4_runtime (for Visual C++ compilers only)
|
||||
set(ANTLR4_WITH_STATIC_CRT OFF)
|
||||
|
||||
# Specify the version of the antlr4 library needed for this project.
|
||||
# By default the latest version of antlr4 will be used. You can specify a
|
||||
# specific, stable version by setting a repository tag value or a link
|
||||
# to a zip file containing the libary source.
|
||||
# set(ANTLR4_TAG 4.13.2)
|
||||
# set(ANTLR4_ZIP_REPOSITORY https://github.com/antlr/antlr4/archive/refs/tags/4.13.2.zip)
|
||||
|
||||
# add external build for antlrcpp
|
||||
include(ExternalAntlr4Cpp)
|
||||
# add antlr4cpp artifacts to project environment
|
||||
include_directories(${ANTLR4_INCLUDE_DIRS})
|
||||
|
||||
# set variable pointing to the antlr tool that supports C++
|
||||
# this is not required if the jar file can be found under PATH environment
|
||||
set(ANTLR_EXECUTABLE /home/user/antlr-4.13.2-complete.jar)
|
||||
# add macros to generate ANTLR Cpp code from grammar
|
||||
find_package(ANTLR REQUIRED)
|
||||
|
||||
# Call macro to add lexer and grammar to your build dependencies.
|
||||
antlr_target(SampleGrammarLexer TLexer.g4 LEXER
|
||||
PACKAGE antlrcpptest)
|
||||
antlr_target(SampleGrammarParser TParser.g4 PARSER
|
||||
PACKAGE antlrcpptest
|
||||
DEPENDS_ANTLR SampleGrammarLexer
|
||||
COMPILE_FLAGS -lib ${ANTLR_SampleGrammarLexer_OUTPUT_DIR})
|
||||
|
||||
# include generated files in project environment
|
||||
include_directories(${ANTLR_SampleGrammarLexer_OUTPUT_DIR})
|
||||
include_directories(${ANTLR_SampleGrammarParser_OUTPUT_DIR})
|
||||
|
||||
# add generated grammar to demo binary target
|
||||
add_executable(demo main.cpp
|
||||
${ANTLR_SampleGrammarLexer_CXX_OUTPUTS}
|
||||
${ANTLR_SampleGrammarParser_CXX_OUTPUTS})
|
||||
target_link_libraries(demo antlr4_static)
|
||||
```
|
||||
|
||||
## Documentation for FindANTLR
|
||||
|
||||
The module defines the following variables:
|
||||
|
||||
```
|
||||
ANTLR_FOUND - true is ANTLR jar executable is found
|
||||
ANTLR_EXECUTABLE - the path to the ANTLR jar executable
|
||||
ANTLR_VERSION - the version of ANTLR
|
||||
```
|
||||
|
||||
If ANTLR is found, the module will provide the macros:
|
||||
|
||||
```
|
||||
ANTLR_TARGET(<name> <input>
|
||||
[PACKAGE namespace]
|
||||
[OUTPUT_DIRECTORY dir]
|
||||
[DEPENDS_ANTLR <target>]
|
||||
[COMPILE_FLAGS [args...]]
|
||||
[DEPENDS [depends...]]
|
||||
[LEXER]
|
||||
[PARSER]
|
||||
[LISTENER]
|
||||
[VISITOR])
|
||||
```
|
||||
|
||||
which creates a custom command to generate C++ files from `<input>`. Running the macro defines the following variables:
|
||||
|
||||
```
|
||||
ANTLR_${name}_INPUT - the ANTLR input used for the macro
|
||||
ANTLR_${name}_OUTPUTS - the outputs generated by ANTLR
|
||||
ANTLR_${name}_CXX_OUTPUTS - the C++ outputs generated by ANTLR
|
||||
ANTLR_${name}_OUTPUT_DIR - the output directory for ANTLR
|
||||
```
|
||||
|
||||
The options are:
|
||||
|
||||
* `PACKAGE` - defines a namespace for the generated C++ files
|
||||
* `OUTPUT_DIRECTORY` - the output directory for the generated files. By default it uses `${CMAKE_CURRENT_BINARY_DIR}`
|
||||
* `DEPENDS_ANTLR` - the dependent target generated from antlr_target for the current call
|
||||
* `COMPILE_FLAGS` - additional compile flags for ANTLR tool
|
||||
* `DEPENDS` - specify the files on which the command depends. It works the same way `DEPENDS` in [`add_custom_command()`](https://cmake.org/cmake/help/v3.11/command/add_custom_command.html)
|
||||
* `LEXER` - specify that the input file is a lexer grammar
|
||||
* `PARSER` - specify that the input file is a parser grammar
|
||||
* `LISTENER` - tell ANTLR tool to generate a parse tree listener
|
||||
* `VISITOR` - tell ANTLR tool to generate a parse tree visitor
|
||||
|
||||
### Examples
|
||||
|
||||
To generate C++ files from an ANTLR input file T.g4, which defines both lexer and parser grammar one may call:
|
||||
|
||||
```cmake
|
||||
find_package(ANTLR REQUIRED)
|
||||
antlr_target(Sample T.g4)
|
||||
```
|
||||
|
||||
Note that this command will do nothing unless the outputs of `Sample`, i.e. `ANTLR_Sample_CXX_OUTPUTS` gets used by some target.
|
||||
|
||||
## Documentation for ExternalAntlr4Cpp
|
||||
|
||||
Including ExternalAntlr4Cpp will add `antlr4_static` and `antlr4_shared` as an optional target. It will also define the following variables:
|
||||
|
||||
```
|
||||
ANTLR4_INCLUDE_DIRS - the include directory that should be included when compiling C++ source file
|
||||
ANTLR4_STATIC_LIBRARIES - path to antlr4 static library
|
||||
ANTLR4_SHARED_LIBRARIES - path to antlr4 shared library
|
||||
ANTLR4_RUNTIME_LIBRARIES - path to antlr4 shared runtime library (such as DLL, DYLIB and SO file)
|
||||
ANTLR4_TAG - branch/tag used for building antlr4 library
|
||||
```
|
||||
|
||||
`ANTLR4_TAG` is set to master branch by default to keep the antlr4 library up to date. However, this will require a rebuild after every `clean` is called. Set `ANTLR4_TAG` to a desired commit hash value to avoid rebuilding after every `clean` and keep the build stable, at the cost of not automatically updating to latest commit.
|
||||
|
||||
By defualt the ANTLR C++ runtime source is cloned from GitHub. However, users may specify `ANTLR4_ZIP_REPOSITORY` in order to download source as a zip file from [ANTLR downloads](http://www.antlr.org/download.html) (under *C++ Target*) or other locations. For example, this variable could list a zip file included in your the project directory. This is useful for maintaining a canonical source tree for each new build.
|
||||
|
||||
Visual C++ compiler users may want to additionally define `ANTLR4_WITH_STATIC_CRT` before including the file. Set `ANTLR4_WITH_STATIC_CRT` to true if ANTLR4 C++ runtime library should be compiled with `/MT` flag, otherwise will be compiled with `/MD` flag. This variable has a default value of `OFF`. Changing `ANTLR4_WITH_STATIC_CRT` after building the library may require reinitialization of CMake or `clean` for the library to get rebuilt.
|
||||
|
||||
You may need to modify your local copy of ExternalAntlr4Cpp.cpp to modify some build settings. For example, to specify the C++ standard to use when building the runtime, add `-DCMAKE_CXX_STANDARD:STRING=17` to `CMAKE_CACHE_ARGS`.
|
||||
|
||||
### Examples
|
||||
|
||||
To build and link ANTLR4 static library to a target one may call:
|
||||
|
||||
```cmake
|
||||
include(ExternalAntlr4Cpp)
|
||||
include_directories(${ANTLR4_INCLUDE_DIRS})
|
||||
add_executable(output main.cpp)
|
||||
target_link_libraries(output antlr4_static)
|
||||
```
|
||||
|
||||
It may also be a good idea to copy the runtime libraries (DLL, DYLIB or SO file) to the executable for it to run properly after build. i.e. To build and link antlr4 shared library to a target one may call:
|
||||
|
||||
```cmake
|
||||
include(ExternalAntlr4Cpp)
|
||||
include_directories(${ANTLR4_INCLUDE_DIRS})
|
||||
add_executable(output main.cpp)
|
||||
target_link_libraries(output antlr4_shared)
|
||||
add_custom_command(TARGET output
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-E copy ${ANTLR4_RUNTIME_LIBRARIES} .
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
```
|
||||
@@ -1,181 +0,0 @@
|
||||
set(ANTLR_VERSION @ANTLR_VERSION@)
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
if (NOT ANTLR4_CPP_GENERATED_SRC_DIR)
|
||||
set(ANTLR4_GENERATED_SRC_DIR ${CMAKE_BINARY_DIR}/antlr4_generated_src)
|
||||
endif()
|
||||
|
||||
FIND_PACKAGE(Java COMPONENTS Runtime REQUIRED)
|
||||
|
||||
#
|
||||
# The ANTLR generator will output the following files given the input file f.g4
|
||||
#
|
||||
# Input -> f.g4
|
||||
# Output -> f.h
|
||||
# -> f.cpp
|
||||
#
|
||||
# the following files will only be produced if there is a parser contained
|
||||
# Flag -visitor active
|
||||
# Output -> <f>BaseVisitor.h
|
||||
# -> <f>BaseVisitor.cpp
|
||||
# -> <f>Visitor.h
|
||||
# -> <f>Visitor.cpp
|
||||
#
|
||||
# Flag -listener active
|
||||
# Output -> <f>BaseListener.h
|
||||
# -> <f>BaseListener.cpp
|
||||
# -> <f>Listener.h
|
||||
# -> <f>Listener.cpp
|
||||
#
|
||||
# See documentation in markup
|
||||
#
|
||||
function(antlr4_generate
|
||||
Antlr4_ProjectTarget
|
||||
Antlr4_InputFile
|
||||
Antlr4_GeneratorType
|
||||
)
|
||||
|
||||
set( Antlr4_GeneratedSrcDir ${ANTLR4_GENERATED_SRC_DIR}/${Antlr4_ProjectTarget} )
|
||||
|
||||
get_filename_component(Antlr4_InputFileBaseName ${Antlr4_InputFile} NAME_WE )
|
||||
|
||||
list( APPEND Antlr4_GeneratorStatusMessage "Common Include-, Source- and Tokenfiles" )
|
||||
|
||||
if ( ${Antlr4_GeneratorType} STREQUAL "LEXER")
|
||||
set(Antlr4_LexerBaseName "${Antlr4_InputFileBaseName}")
|
||||
set(Antlr4_ParserBaseName "")
|
||||
else()
|
||||
if ( ${Antlr4_GeneratorType} STREQUAL "PARSER")
|
||||
set(Antlr4_LexerBaseName "")
|
||||
set(Antlr4_ParserBaseName "${Antlr4_InputFileBaseName}")
|
||||
else()
|
||||
if ( ${Antlr4_GeneratorType} STREQUAL "BOTH")
|
||||
set(Antlr4_LexerBaseName "${Antlr4_InputFileBaseName}Lexer")
|
||||
set(Antlr4_ParserBaseName "${Antlr4_InputFileBaseName}Parser")
|
||||
else()
|
||||
message(FATAL_ERROR "The third parameter must be LEXER, PARSER or BOTH")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Prepare list of generated targets
|
||||
list( APPEND Antlr4_GeneratedTargets "${Antlr4_GeneratedSrcDir}/${Antlr4_InputFileBaseName}.tokens" )
|
||||
list( APPEND Antlr4_GeneratedTargets "${Antlr4_GeneratedSrcDir}/${Antlr4_InputFileBaseName}.interp" )
|
||||
list( APPEND DependentTargets "${Antlr4_GeneratedSrcDir}/${Antlr4_InputFileBaseName}.tokens" )
|
||||
|
||||
if ( NOT ${Antlr4_LexerBaseName} STREQUAL "" )
|
||||
list( APPEND Antlr4_GeneratedTargets "${Antlr4_GeneratedSrcDir}/${Antlr4_LexerBaseName}.h" )
|
||||
list( APPEND Antlr4_GeneratedTargets "${Antlr4_GeneratedSrcDir}/${Antlr4_LexerBaseName}.cpp" )
|
||||
endif ()
|
||||
|
||||
if ( NOT ${Antlr4_ParserBaseName} STREQUAL "" )
|
||||
list( APPEND Antlr4_GeneratedTargets "${Antlr4_GeneratedSrcDir}/${Antlr4_ParserBaseName}.h" )
|
||||
list( APPEND Antlr4_GeneratedTargets "${Antlr4_GeneratedSrcDir}/${Antlr4_ParserBaseName}.cpp" )
|
||||
endif ()
|
||||
|
||||
# process optional arguments ...
|
||||
|
||||
if ( ( ARGC GREATER_EQUAL 4 ) AND ARGV3 )
|
||||
set(Antlr4_BuildListenerOption "-listener")
|
||||
|
||||
list( APPEND Antlr4_GeneratedTargets "${Antlr4_GeneratedSrcDir}/${Antlr4_InputFileBaseName}BaseListener.h" )
|
||||
list( APPEND Antlr4_GeneratedTargets "${Antlr4_GeneratedSrcDir}/${Antlr4_InputFileBaseName}BaseListener.cpp" )
|
||||
list( APPEND Antlr4_GeneratedTargets "${Antlr4_GeneratedSrcDir}/${Antlr4_InputFileBaseName}Listener.h" )
|
||||
list( APPEND Antlr4_GeneratedTargets "${Antlr4_GeneratedSrcDir}/${Antlr4_InputFileBaseName}Listener.cpp" )
|
||||
|
||||
list( APPEND Antlr4_GeneratorStatusMessage ", Listener Include- and Sourcefiles" )
|
||||
else()
|
||||
set(Antlr4_BuildListenerOption "-no-listener")
|
||||
endif ()
|
||||
|
||||
if ( ( ARGC GREATER_EQUAL 5 ) AND ARGV4 )
|
||||
set(Antlr4_BuildVisitorOption "-visitor")
|
||||
|
||||
list( APPEND Antlr4_GeneratedTargets "${Antlr4_GeneratedSrcDir}/${Antlr4_InputFileBaseName}BaseVisitor.h" )
|
||||
list( APPEND Antlr4_GeneratedTargets "${Antlr4_GeneratedSrcDir}/${Antlr4_InputFileBaseName}BaseVisitor.cpp" )
|
||||
list( APPEND Antlr4_GeneratedTargets "${Antlr4_GeneratedSrcDir}/${Antlr4_InputFileBaseName}Visitor.h" )
|
||||
list( APPEND Antlr4_GeneratedTargets "${Antlr4_GeneratedSrcDir}/${Antlr4_InputFileBaseName}Visitor.cpp" )
|
||||
|
||||
list( APPEND Antlr4_GeneratorStatusMessage ", Visitor Include- and Sourcefiles" )
|
||||
else()
|
||||
set(Antlr4_BuildVisitorOption "-no-visitor")
|
||||
endif ()
|
||||
|
||||
if ( (ARGC GREATER_EQUAL 6 ) AND (NOT ${ARGV5} STREQUAL "") )
|
||||
set(Antlr4_NamespaceOption "-package;${ARGV5}")
|
||||
|
||||
list( APPEND Antlr4_GeneratorStatusMessage " in Namespace ${ARGV5}" )
|
||||
else()
|
||||
set(Antlr4_NamespaceOption "")
|
||||
endif ()
|
||||
|
||||
if ( (ARGC GREATER_EQUAL 7 ) AND (NOT ${ARGV6} STREQUAL "") )
|
||||
set(Antlr4_AdditionalDependencies ${ARGV6})
|
||||
else()
|
||||
set(Antlr4_AdditionalDependencies "")
|
||||
endif ()
|
||||
|
||||
if ( (ARGC GREATER_EQUAL 8 ) AND (NOT ${ARGV7} STREQUAL "") )
|
||||
set(Antlr4_LibOption "-lib;${ARGV7}")
|
||||
|
||||
list( APPEND Antlr4_GeneratorStatusMessage " using Library ${ARGV7}" )
|
||||
else()
|
||||
set(Antlr4_LibOption "")
|
||||
endif ()
|
||||
|
||||
if(NOT Java_FOUND)
|
||||
message(FATAL_ERROR "Java is required to process grammar or lexer files! - Use 'FIND_PACKAGE(Java COMPONENTS Runtime REQUIRED)'")
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${ANTLR4_JAR_LOCATION}")
|
||||
message(FATAL_ERROR "Unable to find antlr tool. ANTLR4_JAR_LOCATION:${ANTLR4_JAR_LOCATION}")
|
||||
endif()
|
||||
|
||||
# The call to generate the files
|
||||
add_custom_command(
|
||||
OUTPUT ${Antlr4_GeneratedTargets}
|
||||
# Remove target directory
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E remove_directory ${Antlr4_GeneratedSrcDir}
|
||||
# Create target directory
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E make_directory ${Antlr4_GeneratedSrcDir}
|
||||
COMMAND
|
||||
# Generate files
|
||||
"${Java_JAVA_EXECUTABLE}" -jar "${ANTLR4_JAR_LOCATION}" -Werror -Dlanguage=Cpp ${Antlr4_BuildListenerOption} ${Antlr4_BuildVisitorOption} ${Antlr4_LibOption} ${ANTLR4_GENERATED_OPTIONS} -o "${Antlr4_GeneratedSrcDir}" ${Antlr4_NamespaceOption} "${Antlr4_InputFile}"
|
||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||
MAIN_DEPENDENCY "${Antlr4_InputFile}"
|
||||
DEPENDS ${Antlr4_AdditionalDependencies}
|
||||
)
|
||||
|
||||
# set output variables in parent scope
|
||||
set( ANTLR4_INCLUDE_DIR_${Antlr4_ProjectTarget} ${Antlr4_GeneratedSrcDir} PARENT_SCOPE)
|
||||
set( ANTLR4_SRC_FILES_${Antlr4_ProjectTarget} ${Antlr4_GeneratedTargets} PARENT_SCOPE)
|
||||
set( ANTLR4_TOKEN_FILES_${Antlr4_ProjectTarget} ${DependentTargets} PARENT_SCOPE)
|
||||
set( ANTLR4_TOKEN_DIRECTORY_${Antlr4_ProjectTarget} ${Antlr4_GeneratedSrcDir} PARENT_SCOPE)
|
||||
|
||||
# export generated cpp files into list
|
||||
foreach(generated_file ${Antlr4_GeneratedTargets})
|
||||
|
||||
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
set_source_files_properties(
|
||||
${generated_file}
|
||||
PROPERTIES
|
||||
COMPILE_FLAGS -Wno-overloaded-virtual
|
||||
)
|
||||
endif ()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
set_source_files_properties(
|
||||
${generated_file}
|
||||
PROPERTIES
|
||||
COMPILE_FLAGS -wd4251
|
||||
)
|
||||
endif ()
|
||||
|
||||
endforeach(generated_file)
|
||||
|
||||
message(STATUS "Antlr4 ${Antlr4_ProjectTarget} - Building " ${Antlr4_GeneratorStatusMessage} )
|
||||
|
||||
endfunction()
|
||||
@@ -1,13 +0,0 @@
|
||||
set(ANTLR_VERSION @ANTLR_VERSION@)
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
set_and_check(ANTLR4_INCLUDE_DIR "@PACKAGE_ANTLR4_INCLUDE_DIR@")
|
||||
set_and_check(ANTLR4_LIB_DIR "@PACKAGE_ANTLR4_LIB_DIR@")
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(Threads)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake)
|
||||
|
||||
check_required_components(antlr)
|
||||
@@ -1,80 +0,0 @@
|
||||
# -*- mode:cmake -*-
|
||||
if(NOT UNIX)
|
||||
message(WARNING "Unsupported operating system")
|
||||
endif()
|
||||
|
||||
set(antlr4-demo-GENERATED_SRC
|
||||
${PROJECT_SOURCE_DIR}/demo/generated/TLexer.cpp
|
||||
${PROJECT_SOURCE_DIR}/demo/generated/TParser.cpp
|
||||
${PROJECT_SOURCE_DIR}/demo/generated/TParserBaseListener.cpp
|
||||
${PROJECT_SOURCE_DIR}/demo/generated/TParserBaseVisitor.cpp
|
||||
${PROJECT_SOURCE_DIR}/demo/generated/TParserListener.cpp
|
||||
${PROJECT_SOURCE_DIR}/demo/generated/TParserVisitor.cpp
|
||||
)
|
||||
|
||||
foreach(src_file ${antlr4-demo-GENERATED_SRC})
|
||||
set_source_files_properties(
|
||||
${src_file}
|
||||
PROPERTIES
|
||||
GENERATED TRUE
|
||||
)
|
||||
endforeach(src_file ${antlr4-demo-GENERATED_SRC})
|
||||
|
||||
add_custom_target(GenerateParser DEPENDS ${antlr4-demo-GENERATED_SRC})
|
||||
add_custom_command(OUTPUT ${antlr4-demo-GENERATED_SRC}
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E make_directory ${PROJECT_SOURCE_DIR}/demo/generated/
|
||||
COMMAND
|
||||
"${Java_JAVA_EXECUTABLE}" -jar ${ANTLR_JAR_LOCATION} -Werror -Dlanguage=Cpp -listener -visitor -o ${PROJECT_SOURCE_DIR}/demo/generated/ -package antlrcpptest ${PROJECT_SOURCE_DIR}/demo/TLexer.g4 ${PROJECT_SOURCE_DIR}/demo/TParser.g4
|
||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||
DEPENDS ${PROJECT_SOURCE_DIR}/demo/TLexer.g4 ${PROJECT_SOURCE_DIR}/demo/TParser.g4
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${PROJECT_SOURCE_DIR}/runtime/src
|
||||
${PROJECT_SOURCE_DIR}/runtime/src/misc
|
||||
${PROJECT_SOURCE_DIR}/runtime/src/atn
|
||||
${PROJECT_SOURCE_DIR}/runtime/src/dfa
|
||||
${PROJECT_SOURCE_DIR}/runtime/src/tree
|
||||
${PROJECT_SOURCE_DIR}/runtime/src/support
|
||||
${PROJECT_SOURCE_DIR}/demo/generated
|
||||
)
|
||||
|
||||
#file(GLOB antlr4-demo_SRC "${PROJECT_SOURCE_DIR}/demo/generated/*")
|
||||
set(antlr4-demo_SRC
|
||||
${PROJECT_SOURCE_DIR}/demo/Linux/main.cpp
|
||||
${antlr4-demo-GENERATED_SRC}
|
||||
)
|
||||
|
||||
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
set (flags_1 "-Wno-overloaded-virtual")
|
||||
else()
|
||||
set (flags_1 "-MP /wd4251")
|
||||
endif()
|
||||
|
||||
foreach(src_file ${antlr4-demo_SRC})
|
||||
set_source_files_properties(
|
||||
${src_file}
|
||||
PROPERTIES
|
||||
COMPILE_FLAGS "${COMPILE_FLAGS} ${flags_1}"
|
||||
)
|
||||
endforeach(src_file ${antlr4-demo_SRC})
|
||||
|
||||
add_executable(antlr4-demo
|
||||
${antlr4-demo_SRC}
|
||||
)
|
||||
#add_precompiled_header(antlr4-demo ${PROJECT_SOURCE_DIR}/runtime/src/antlrcpp-Prefix.h)
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
target_compile_options(antlr4-demo PRIVATE "/MT$<$<CONFIG:Debug>:d>")
|
||||
endif()
|
||||
|
||||
add_dependencies(antlr4-demo GenerateParser)
|
||||
|
||||
target_link_libraries(antlr4-demo antlr4_static)
|
||||
|
||||
install(TARGETS antlr4-demo
|
||||
DESTINATION "share"
|
||||
COMPONENT dev
|
||||
)
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
//
|
||||
// main.cpp
|
||||
// antlr4-cpp-demo
|
||||
//
|
||||
// Created by Mike Lischke on 13.03.16.
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "antlr4-runtime.h"
|
||||
#include "TLexer.h"
|
||||
#include "TParser.h"
|
||||
|
||||
using namespace antlrcpptest;
|
||||
using namespace antlr4;
|
||||
|
||||
int main(int , const char **) {
|
||||
ANTLRInputStream input(u8"🍴 = 🍐 + \"😎\";(((x * π))) * µ + ∰; a + (x * (y ? 0 : 1) + z);");
|
||||
TLexer lexer(&input);
|
||||
CommonTokenStream tokens(&lexer);
|
||||
|
||||
tokens.fill();
|
||||
for (auto token : tokens.getTokens()) {
|
||||
std::cout << token->toString() << std::endl;
|
||||
}
|
||||
|
||||
TParser parser(&tokens);
|
||||
tree::ParseTree* tree = parser.main();
|
||||
|
||||
std::cout << tree->toStringTree(&parser) << std::endl << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
//
|
||||
// main.cpp
|
||||
// antlr4-cpp-demo
|
||||
//
|
||||
// Created by Mike Lischke on 13.03.16.
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "antlr4-runtime.h"
|
||||
#include "TLexer.h"
|
||||
#include "TParser.h"
|
||||
|
||||
using namespace antlrcpptest;
|
||||
using namespace antlr4;
|
||||
|
||||
int main(int , const char **) {
|
||||
ANTLRInputStream input(u8"🍴 = 🍐 + \"😎\";(((x * π))) * µ + ∰; a + (x * (y ? 0 : 1) + z);");
|
||||
TLexer lexer(&input);
|
||||
CommonTokenStream tokens(&lexer);
|
||||
|
||||
tokens.fill();
|
||||
for (auto token : tokens.getTokens()) {
|
||||
std::cout << token->toString() << std::endl;
|
||||
}
|
||||
|
||||
TParser parser(&tokens);
|
||||
tree::ParseTree *tree = parser.main();
|
||||
|
||||
std::cout << tree->toStringTree(&parser) << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,172 +0,0 @@
|
||||
/*
|
||||
* [The "BSD license"]
|
||||
* Copyright (c) 2016 Mike Lischke
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
#include "ANTLRInputStream.h"
|
||||
#include "Exceptions.h"
|
||||
#include "Interval.h"
|
||||
#include "UnbufferedTokenStream.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
using namespace antlrcpp;
|
||||
using namespace antlr4;
|
||||
using namespace antlr4::misc;
|
||||
|
||||
@interface InputHandlingTests : XCTestCase
|
||||
|
||||
@end
|
||||
|
||||
@implementation InputHandlingTests
|
||||
|
||||
- (void)setUp {
|
||||
[super setUp];
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
- (void)tearDown {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
[super tearDown];
|
||||
}
|
||||
|
||||
- (void)testANTLRInputStreamCreation {
|
||||
ANTLRInputStream stream1;
|
||||
XCTAssert(stream1.toString().empty());
|
||||
XCTAssertEqual(stream1.index(), 0U);
|
||||
|
||||
ANTLRInputStream stream2("To be or not to be");
|
||||
XCTAssert(stream2.toString() == "To be or not to be");
|
||||
XCTAssertEqual(stream2.index(), 0U);
|
||||
XCTAssertEqual(stream2.size(), 18U);
|
||||
|
||||
char data[] = "Lorem ipsum dolor sit amet";
|
||||
ANTLRInputStream stream3(data, sizeof(data) / sizeof(data[0]));
|
||||
XCTAssert(stream3.toString() == std::string("Lorem ipsum dolor sit amet\0", 27));
|
||||
XCTAssertEqual(stream3.index(), 0U);
|
||||
XCTAssertEqual(stream3.size(), 27U);
|
||||
|
||||
std::stringstream input("Lorem ipsum dolor sit amet");
|
||||
ANTLRInputStream stream4(input);
|
||||
std::string content = stream4.toString();
|
||||
XCTAssertEqual(content, "Lorem ipsum dolor sit amet"); // Now as utf-8 string.
|
||||
XCTAssertEqual(stream4.index(), 0U);
|
||||
XCTAssertEqual(stream4.size(), 26U);
|
||||
|
||||
std::string longString(33333, 'a');
|
||||
input.str(longString);
|
||||
stream4.load(input);
|
||||
XCTAssertEqual(stream4.index(), 0U);
|
||||
XCTAssertEqual(stream4.size(), 33333U);
|
||||
|
||||
input.clear();
|
||||
stream4.load(input);
|
||||
XCTAssertEqual(stream4.size(), 0U);
|
||||
}
|
||||
|
||||
- (void)testANTLRInputStreamUse {
|
||||
std::string text(u8"🚧Lorem ipsum dolor sit amet🕶");
|
||||
std::u32string wtext = utf8_to_utf32(text.c_str(), text.c_str() + text.size()); // Convert to UTF-32.
|
||||
ANTLRInputStream stream(text);
|
||||
XCTAssertEqual(stream.index(), 0U);
|
||||
XCTAssertEqual(stream.size(), wtext.size());
|
||||
|
||||
for (size_t i = 0; i < stream.size(); ++i) {
|
||||
stream.consume();
|
||||
XCTAssertEqual(stream.index(), i + 1);
|
||||
}
|
||||
|
||||
try {
|
||||
stream.consume();
|
||||
XCTFail();
|
||||
} catch (IllegalStateException &e) {
|
||||
// Expected.
|
||||
std::string message = e.what();
|
||||
XCTAssertEqual(message, "cannot consume EOF");
|
||||
}
|
||||
|
||||
XCTAssertEqual(stream.index(), wtext.size());
|
||||
stream.reset();
|
||||
XCTAssertEqual(stream.index(), 0U);
|
||||
|
||||
XCTAssertEqual(stream.LA(0), 0ULL);
|
||||
for (size_t i = 1; i < wtext.size(); ++i) {
|
||||
XCTAssertEqual(stream.LA(static_cast<ssize_t>(i)), wtext[i - 1]); // LA(1) means: current char.
|
||||
XCTAssertEqual(stream.LT(static_cast<ssize_t>(i)), wtext[i - 1]); // LT is mapped to LA.
|
||||
XCTAssertEqual(stream.index(), 0U); // No consumption when looking ahead.
|
||||
}
|
||||
|
||||
stream.seek(wtext.size() - 1);
|
||||
XCTAssertEqual(stream.index(), wtext.size() - 1);
|
||||
|
||||
stream.seek(wtext.size() / 2);
|
||||
XCTAssertEqual(stream.index(), wtext.size() / 2);
|
||||
|
||||
stream.seek(wtext.size() - 1);
|
||||
for (ssize_t i = 1; i < static_cast<ssize_t>(wtext.size()) - 1; ++i) {
|
||||
XCTAssertEqual(stream.LA(-i), wtext[wtext.size() - i - 1]); // LA(-1) means: previous char.
|
||||
XCTAssertEqual(stream.LT(-i), wtext[wtext.size() - i - 1]); // LT is mapped to LA.
|
||||
XCTAssertEqual(stream.index(), wtext.size() - 1); // No consumption when looking ahead.
|
||||
}
|
||||
|
||||
XCTAssertEqual(stream.LA(-10000), IntStream::EOF);
|
||||
|
||||
// Mark and release do nothing.
|
||||
stream.reset();
|
||||
XCTAssertEqual(stream.index(), 0U);
|
||||
ssize_t marker = stream.mark();
|
||||
XCTAssertEqual(marker, -1);
|
||||
stream.seek(10);
|
||||
XCTAssertEqual(stream.index(), 10U);
|
||||
XCTAssertEqual(stream.mark(), -1);
|
||||
|
||||
stream.release(marker);
|
||||
XCTAssertEqual(stream.index(), 10U);
|
||||
|
||||
misc::Interval interval1(2, 10UL); // From - to, inclusive.
|
||||
std::string output = stream.getText(interval1);
|
||||
std::string sub = utf32_to_utf8(wtext.substr(2, 9));
|
||||
XCTAssertEqual(output, sub);
|
||||
|
||||
misc::Interval interval2(200, 10UL); // Start beyond bounds.
|
||||
output = stream.getText(interval2);
|
||||
XCTAssert(output.empty());
|
||||
|
||||
misc::Interval interval3(0, 200UL); // End beyond bounds.
|
||||
output = stream.getText(interval3);
|
||||
XCTAssertEqual(output, text);
|
||||
|
||||
stream.name = "unit tests"; // Quite useless test, as "name" is a public field.
|
||||
XCTAssertEqual(stream.getSourceName(), "unit tests");
|
||||
}
|
||||
|
||||
- (void)testUnbufferedTokenSteam {
|
||||
//UnbufferedTokenStream stream;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,388 +0,0 @@
|
||||
/*
|
||||
* [The "BSD license"]
|
||||
* Copyright (c) 2016 Mike Lischke
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
#include "antlr4-runtime.h"
|
||||
|
||||
using namespace antlr4;
|
||||
using namespace antlr4::misc;
|
||||
using namespace antlrcpp;
|
||||
|
||||
@interface MiscClassTests : XCTestCase
|
||||
|
||||
@end
|
||||
|
||||
@implementation MiscClassTests
|
||||
|
||||
- (void)setUp {
|
||||
[super setUp];
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
- (void)tearDown {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
[super tearDown];
|
||||
}
|
||||
|
||||
- (void)testCPPUtils {
|
||||
|
||||
class A { public: virtual ~A() {}; };
|
||||
class B : public A { public: virtual ~B() {}; };
|
||||
class C : public A { public: virtual ~C() {}; };
|
||||
class D : public C { public: virtual ~D() {}; };
|
||||
|
||||
{
|
||||
A *a = new A(); B *b = new B(); C *c = new C(); D *d = new D();
|
||||
XCTAssert(is<A*>(b));
|
||||
XCTAssertFalse(is<B*>(a));
|
||||
XCTAssert(is<A*>(c));
|
||||
XCTAssertFalse(is<B*>(c));
|
||||
XCTAssert(is<A*>(d));
|
||||
XCTAssert(is<C*>(d));
|
||||
XCTAssertFalse(is<B*>(d));
|
||||
delete a; delete b; delete c; delete d;
|
||||
}
|
||||
{
|
||||
Ref<A> a(new A());
|
||||
Ref<B> b(new B());
|
||||
Ref<C> c(new C());
|
||||
Ref<D> d(new D());
|
||||
XCTAssert(is<A>(b));
|
||||
XCTAssertFalse(is<B>(a));
|
||||
XCTAssert(is<A>(c));
|
||||
XCTAssertFalse(is<B>(c));
|
||||
XCTAssert(is<A>(d));
|
||||
XCTAssert(is<C>(d));
|
||||
XCTAssertFalse(is<B>(d));
|
||||
}
|
||||
}
|
||||
|
||||
- (void)testMurmurHash {
|
||||
XCTAssertEqual(MurmurHash::initialize(), 0U);
|
||||
XCTAssertEqual(MurmurHash::initialize(31), 31U);
|
||||
|
||||
// In absence of real test vectors (64bit) for murmurhash I instead check if I can find duplicate hash values
|
||||
// in a deterministic and a random sequence of 100K values each.
|
||||
std::set<size_t> hashs;
|
||||
for (size_t i = 0; i < 100000; ++i) {
|
||||
std::vector<size_t> data = { i, static_cast<size_t>(i * M_PI), arc4random() };
|
||||
size_t hash = 0;
|
||||
for (auto value : data)
|
||||
hash = MurmurHash::update(hash, value);
|
||||
hash = MurmurHash::finish(hash, data.size());
|
||||
hashs.insert(hash);
|
||||
}
|
||||
XCTAssertEqual(hashs.size(), 100000U, @"At least one duplicate hash found.");
|
||||
|
||||
hashs.clear();
|
||||
for (size_t i = 0; i < 100000; ++i) {
|
||||
std::vector<size_t> data = { i, static_cast<size_t>(i * M_PI) };
|
||||
size_t hash = 0;
|
||||
for (auto value : data)
|
||||
hash = MurmurHash::update(hash, value);
|
||||
hash = MurmurHash::finish(hash, data.size());
|
||||
hashs.insert(hash);
|
||||
}
|
||||
XCTAssertEqual(hashs.size(), 100000U, @"At least one duplicate hash found.");
|
||||
|
||||
// Another test with fixed input but varying seeds.
|
||||
// Note: the higher the seed the less LSDs are in the result (for small input data).
|
||||
hashs.clear();
|
||||
std::vector<size_t> data = { L'µ', 'a', '@', '1' };
|
||||
for (size_t i = 0; i < 100000; ++i) {
|
||||
size_t hash = i;
|
||||
for (auto value : data)
|
||||
hash = MurmurHash::update(hash, value);
|
||||
hash = MurmurHash::finish(hash, data.size());
|
||||
hashs.insert(hash);
|
||||
}
|
||||
XCTAssertEqual(hashs.size(), 100000U, @"At least one duplicate hash found.");
|
||||
}
|
||||
|
||||
- (void)testInterval {
|
||||
// The Interval class contains no error handling (checks for invalid intervals), hence some of the results
|
||||
// look strange as we test of course such intervals as well.
|
||||
XCTAssertEqual(Interval().length(), 0UL);
|
||||
XCTAssertEqual(Interval(0, 0UL).length(), 1UL); // Remember: it's an inclusive interval.
|
||||
XCTAssertEqual(Interval(100, 100UL).length(), 1UL);
|
||||
XCTAssertEqual(Interval(-1L, -1).length(), 1UL); // Unwanted behavior: negative ranges.
|
||||
XCTAssertEqual(Interval(-1L, -2).length(), 0UL);
|
||||
XCTAssertEqual(Interval(100, 50UL).length(), 0UL);
|
||||
|
||||
XCTAssert(Interval() == Interval(-1L, -2));
|
||||
XCTAssert(Interval(0, 0UL) == Interval(0, 0UL));
|
||||
XCTAssertFalse(Interval(0, 1UL) == Interval(1, 2UL));
|
||||
|
||||
XCTAssertEqual(Interval().hashCode(), 22070U);
|
||||
XCTAssertEqual(Interval(0, 0UL).hashCode(), 22103U);
|
||||
XCTAssertEqual(Interval(10, 2000UL).hashCode(), 24413U);
|
||||
|
||||
// Results for the interval test functions in this order:
|
||||
// startsBeforeDisjoint
|
||||
// startsBeforeNonDisjoint
|
||||
// startsAfter
|
||||
// startsAfterDisjoint
|
||||
// startsAfterNonDisjoint
|
||||
// disjoint
|
||||
// adjacent
|
||||
// properlyContains
|
||||
|
||||
typedef std::vector<bool> TestResults;
|
||||
struct TestEntry { size_t runningNumber; Interval interval1, interval2; TestResults results; };
|
||||
std::vector<TestEntry> testData = {
|
||||
// Extreme cases + invalid intervals.
|
||||
{ 0, Interval(), Interval(10, 20UL), { true, false, false, false, false, true, false, false } },
|
||||
{ 1, Interval(1, 1UL), Interval(1, 1UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 2, Interval(10000, 10000UL), Interval(10000, 10000UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 3, Interval(100, 10UL), Interval(100, 10UL), { false, false, false, true, false, true, false, true } },
|
||||
{ 4, Interval(100, 10UL), Interval(10, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 5, Interval(10, 100UL), Interval(100, 10UL), { false, true, false, false, false, false, false, true } },
|
||||
|
||||
// First starts before second. End varies.
|
||||
{ 20, Interval(10, 12UL), Interval(12, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 21, Interval(10, 12UL), Interval(13, 100UL), { true, false, false, false, false, true, true, false } },
|
||||
{ 22, Interval(10, 12UL), Interval(14, 100UL), { true, false, false, false, false, true, false, false } },
|
||||
{ 23, Interval(10, 13UL), Interval(12, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 24, Interval(10, 14UL), Interval(12, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 25, Interval(10, 99UL), Interval(12, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 26, Interval(10, 100UL), Interval(12, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 27, Interval(10, 101UL), Interval(12, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 28, Interval(10, 1000UL), Interval(12, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
|
||||
// First and second start equal. End varies.
|
||||
{ 30, Interval(12, 12UL), Interval(12, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 31, Interval(12, 12UL), Interval(13, 100UL), { true, false, false, false, false, true, true, false } },
|
||||
{ 32, Interval(12, 12UL), Interval(14, 100UL), { true, false, false, false, false, true, false, false } },
|
||||
{ 33, Interval(12, 13UL), Interval(12, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 34, Interval(12, 14UL), Interval(12, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 35, Interval(12, 99UL), Interval(12, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 36, Interval(12, 100UL), Interval(12, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 37, Interval(12, 101UL), Interval(12, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 38, Interval(12, 1000UL), Interval(12, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
|
||||
// First starts after second. End varies.
|
||||
{ 40, Interval(15, 12UL), Interval(12, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 41, Interval(15, 12UL), Interval(13, 100UL), { false, false, true, false, true, false, true, false } },
|
||||
{ 42, Interval(15, 12UL), Interval(14, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 43, Interval(15, 13UL), Interval(12, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 44, Interval(15, 14UL), Interval(12, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 45, Interval(15, 99UL), Interval(12, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 46, Interval(15, 100UL), Interval(12, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 47, Interval(15, 101UL), Interval(12, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 48, Interval(15, 1000UL), Interval(12, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
|
||||
// First ends before second. Start varies.
|
||||
{ 50, Interval(10, 90UL), Interval(20, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 51, Interval(19, 90UL), Interval(20, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 52, Interval(20, 90UL), Interval(20, 100UL), { false, true, false, false, false, false, false, false } },
|
||||
{ 53, Interval(21, 90UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 54, Interval(98, 90UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 55, Interval(99, 90UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 56, Interval(100, 90UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 57, Interval(101, 90UL), Interval(20, 100UL), { false, false, true, true, false, true, true, false } },
|
||||
{ 58, Interval(1000, 90UL), Interval(20, 100UL), { false, false, true, true, false, true, false, false } },
|
||||
|
||||
// First and second end equal. Start varies.
|
||||
{ 60, Interval(10, 100UL), Interval(20, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 61, Interval(19, 100UL), Interval(20, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 62, Interval(20, 100UL), Interval(20, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 63, Interval(21, 100UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 64, Interval(98, 100UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 65, Interval(99, 100UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 66, Interval(100, 100UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 67, Interval(101, 100UL), Interval(20, 100UL), { false, false, true, true, false, true, true, false } },
|
||||
{ 68, Interval(1000, 100UL), Interval(20, 100UL), { false, false, true, true, false, true, false, false } },
|
||||
|
||||
// First ends after second. Start varies.
|
||||
{ 70, Interval(10, 1000UL), Interval(20, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 71, Interval(19, 1000UL), Interval(20, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 72, Interval(20, 1000UL), Interval(20, 100UL), { false, true, false, false, false, false, false, true } },
|
||||
{ 73, Interval(21, 1000UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 74, Interval(98, 1000UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 75, Interval(99, 1000UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 76, Interval(100, 1000UL), Interval(20, 100UL), { false, false, true, false, true, false, false, false } },
|
||||
{ 77, Interval(101, 1000UL), Interval(20, 100UL), { false, false, true, true, false, true, true, false } },
|
||||
{ 78, Interval(1000, 1000UL), Interval(20, 100UL), { false, false, true, true, false, true, false, false } },
|
||||
|
||||
// It's possible to add more tests with borders that touch each other (e.g. first starts before/on/after second
|
||||
// and first ends directly before/after second. However, such cases are not handled differently in the Interval
|
||||
// class
|
||||
// (only adjacent intervals, where first ends directly before second starts and vice versa. So I ommitted them here.
|
||||
};
|
||||
|
||||
for (auto &entry : testData) {
|
||||
XCTAssert(entry.interval1.startsBeforeDisjoint(entry.interval2) == entry.results[0], @"entry: %zu",
|
||||
entry.runningNumber);
|
||||
XCTAssert(entry.interval1.startsBeforeNonDisjoint(entry.interval2) == entry.results[1], @"entry: %zu",
|
||||
entry.runningNumber);
|
||||
XCTAssert(entry.interval1.startsAfter(entry.interval2) == entry.results[2], @"entry: %zu", entry.runningNumber);
|
||||
XCTAssert(entry.interval1.startsAfterDisjoint(entry.interval2) == entry.results[3], @"entry: %zu",
|
||||
entry.runningNumber);
|
||||
XCTAssert(entry.interval1.startsAfterNonDisjoint(entry.interval2) == entry.results[4], @"entry: %zu",
|
||||
entry.runningNumber);
|
||||
XCTAssert(entry.interval1.disjoint(entry.interval2) == entry.results[5], @"entry: %zu", entry.runningNumber);
|
||||
XCTAssert(entry.interval1.adjacent(entry.interval2) == entry.results[6], @"entry: %zu", entry.runningNumber);
|
||||
XCTAssert(entry.interval1.properlyContains(entry.interval2) == entry.results[7], @"entry: %zu",
|
||||
entry.runningNumber);
|
||||
}
|
||||
|
||||
XCTAssert(Interval().Union(Interval(10, 100UL)) == Interval(-1L, 100));
|
||||
XCTAssert(Interval(10, 10UL).Union(Interval(10, 100UL)) == Interval(10, 100UL));
|
||||
XCTAssert(Interval(10, 11UL).Union(Interval(10, 100UL)) == Interval(10, 100UL));
|
||||
XCTAssert(Interval(10, 1000UL).Union(Interval(10, 100UL)) == Interval(10, 1000UL));
|
||||
XCTAssert(Interval(1000, 30UL).Union(Interval(10, 100UL)) == Interval(10, 100UL));
|
||||
XCTAssert(Interval(1000, 2000UL).Union(Interval(10, 100UL)) == Interval(10, 2000UL));
|
||||
XCTAssert(Interval(500, 2000UL).Union(Interval(10, 1000UL)) == Interval(10, 2000UL));
|
||||
|
||||
XCTAssert(Interval().intersection(Interval(10, 100UL)) == Interval(10, -2L));
|
||||
XCTAssert(Interval(10, 10UL).intersection(Interval(10, 100UL)) == Interval(10, 10UL));
|
||||
XCTAssert(Interval(10, 11UL).intersection(Interval(10, 100UL)) == Interval(10, 11UL));
|
||||
XCTAssert(Interval(10, 1000UL).intersection(Interval(10, 100UL)) == Interval(10, 100UL));
|
||||
XCTAssert(Interval(1000, 30UL).intersection(Interval(10, 100UL)) == Interval(1000, 30UL));
|
||||
XCTAssert(Interval(1000, 2000UL).intersection(Interval(10, 100UL)) == Interval(1000, 100UL));
|
||||
XCTAssert(Interval(500, 2000UL).intersection(Interval(10, 1000UL)) == Interval(500, 1000UL));
|
||||
|
||||
XCTAssert(Interval().toString() == "-1..-2");
|
||||
XCTAssert(Interval(10, 10UL).toString() == "10..10");
|
||||
XCTAssert(Interval(1000, 2000UL).toString() == "1000..2000");
|
||||
XCTAssert(Interval(500UL, INT_MAX).toString() == "500.." + std::to_string(INT_MAX));
|
||||
}
|
||||
|
||||
- (void)testIntervalSet {
|
||||
XCTAssertFalse(IntervalSet().isReadOnly());
|
||||
XCTAssert(IntervalSet().isEmpty());
|
||||
|
||||
IntervalSet set1;
|
||||
set1.setReadOnly(true);
|
||||
XCTAssert(set1.isReadOnly());
|
||||
|
||||
XCTAssert(IntervalSet() == IntervalSet::EMPTY_SET);
|
||||
|
||||
std::vector<Interval> intervals = { Interval(), Interval(10, 20UL), Interval(20, 100UL), Interval(1000, 2000UL) };
|
||||
IntervalSet set2(intervals);
|
||||
XCTAssertFalse(set2.isEmpty());
|
||||
XCTAssertFalse(set2.contains(9UL));
|
||||
XCTAssert(set2.contains(10UL));
|
||||
XCTAssert(set2.contains(20UL));
|
||||
XCTAssertTrue(set2.contains(22UL));
|
||||
XCTAssert(set2.contains(1111UL));
|
||||
XCTAssertFalse(set2.contains(10000UL));
|
||||
XCTAssertEqual(set2.getSingleElement(), Token::INVALID_TYPE);
|
||||
XCTAssertEqual(set2.getMinElement(), -1);
|
||||
XCTAssertEqual(set2.getMaxElement(), 2000);
|
||||
|
||||
IntervalSet set3(set2);
|
||||
XCTAssertFalse(set3.isEmpty());
|
||||
XCTAssertFalse(set3.contains(9UL));
|
||||
XCTAssert(set3.contains(10UL));
|
||||
XCTAssert(set3.contains(20UL));
|
||||
XCTAssertTrue(set3.contains(22UL));
|
||||
XCTAssert(set3.contains(1111UL));
|
||||
XCTAssertFalse(set3.contains(10000UL));
|
||||
XCTAssertEqual(set3.getSingleElement(), Token::INVALID_TYPE);
|
||||
XCTAssertEqual(set3.getMinElement(), 10);
|
||||
XCTAssertEqual(set3.getMaxElement(), 2000);
|
||||
|
||||
set3.add(Interval(100, 1000UL));
|
||||
XCTAssertEqual(set3.getMinElement(), 10);
|
||||
set3.add(Interval(9, 1000UL));
|
||||
XCTAssertEqual(set3.getMinElement(), 9);
|
||||
set3.add(Interval(1, 1UL));
|
||||
XCTAssertEqual(set3.getMinElement(), 1);
|
||||
|
||||
IntervalSet set4;
|
||||
set4.add(10);
|
||||
XCTAssertEqual(set4.getSingleElement(), 10);
|
||||
XCTAssertEqual(set4.getMinElement(), 10);
|
||||
XCTAssertEqual(set4.getMaxElement(), 10);
|
||||
|
||||
set4.clear();
|
||||
XCTAssert(set4.isEmpty());
|
||||
set4.add(Interval(10, 10UL));
|
||||
XCTAssertEqual(set4.getSingleElement(), 10);
|
||||
XCTAssertEqual(set4.getMinElement(), 10);
|
||||
XCTAssertEqual(set4.getMaxElement(), 10);
|
||||
set4.setReadOnly(true);
|
||||
try {
|
||||
set4.clear();
|
||||
XCTFail(@"Expected exception");
|
||||
} catch (IllegalStateException &e) {
|
||||
}
|
||||
|
||||
try {
|
||||
set4.setReadOnly(false);
|
||||
XCTFail(@"Expected exception");
|
||||
} catch (IllegalStateException &e) {
|
||||
}
|
||||
|
||||
try {
|
||||
set4 = IntervalSet::of(12345);
|
||||
XCTFail(@"Expected exception");
|
||||
} catch (IllegalStateException &e) {
|
||||
}
|
||||
|
||||
IntervalSet set5 = IntervalSet::of(12345);
|
||||
XCTAssertEqual(set5.getSingleElement(), 12345);
|
||||
XCTAssertEqual(set5.getMinElement(), 12345);
|
||||
XCTAssertEqual(set5.getMaxElement(), 12345);
|
||||
|
||||
IntervalSet set6(10, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50);
|
||||
XCTAssertEqual(set6.getMinElement(), 5);
|
||||
XCTAssertEqual(set6.getMaxElement(), 50);
|
||||
XCTAssertEqual(set6.size(), 10U);
|
||||
set6.add(12, 18);
|
||||
XCTAssertEqual(set6.size(), 16U); // (15, 15) replaced by (12, 18)
|
||||
set6.add(9, 33);
|
||||
XCTAssertEqual(set6.size(), 30U); // (10, 10), (12, 18), (20, 20), (25, 25) and (30, 30) replaced by (9, 33)
|
||||
|
||||
XCTAssert(IntervalSet(3, 1, 2, 10).Or(IntervalSet(3, 1, 2, 5)) == IntervalSet(4, 1, 2, 5, 10));
|
||||
XCTAssert(IntervalSet({ Interval(2, 10UL) }).Or(IntervalSet({ Interval(5, 8UL) })) == IntervalSet({ Interval(2, 10UL) }));
|
||||
|
||||
XCTAssert(IntervalSet::of(1, 10).complement(IntervalSet::of(7, 55)) == IntervalSet::of(11, 55));
|
||||
XCTAssert(IntervalSet::of(1, 10).complement(IntervalSet::of(20, 55)) == IntervalSet::of(20, 55));
|
||||
XCTAssert(IntervalSet::of(1, 10).complement(IntervalSet::of(5, 6)) == IntervalSet::EMPTY_SET);
|
||||
XCTAssert(IntervalSet::of(15, 20).complement(IntervalSet::of(7, 55)) ==
|
||||
IntervalSet({ Interval(7, 14UL), Interval(21, 55UL) }));
|
||||
XCTAssert(IntervalSet({ Interval(1, 10UL), Interval(30, 35UL) }).complement(IntervalSet::of(7, 55)) ==
|
||||
IntervalSet({ Interval(11, 29UL), Interval(36, 55UL) }));
|
||||
|
||||
XCTAssert(IntervalSet::of(1, 10).And(IntervalSet::of(7, 55)) == IntervalSet::of(7, 10));
|
||||
XCTAssert(IntervalSet::of(1, 10).And(IntervalSet::of(20, 55)) == IntervalSet::EMPTY_SET);
|
||||
XCTAssert(IntervalSet::of(1, 10).And(IntervalSet::of(5, 6)) == IntervalSet::of(5, 6));
|
||||
XCTAssert(IntervalSet::of(15, 20).And(IntervalSet::of(7, 55)) == IntervalSet::of(15, 20));
|
||||
|
||||
XCTAssert(IntervalSet::of(1, 10).subtract(IntervalSet::of(7, 55)) == IntervalSet::of(1, 6));
|
||||
XCTAssert(IntervalSet::of(1, 10).subtract(IntervalSet::of(20, 55)) == IntervalSet::of(1, 10));
|
||||
XCTAssert(IntervalSet::of(1, 10).subtract(IntervalSet::of(5, 6)) ==
|
||||
IntervalSet({ Interval(1, 4UL), Interval(7, 10UL) }));
|
||||
XCTAssert(IntervalSet::of(15, 20).subtract(IntervalSet::of(7, 55)) == IntervalSet::EMPTY_SET);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* [The "BSD license"]
|
||||
* Copyright (c) 2015 Dan McLaughlin
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <XCTest/XCTest.h>
|
||||
|
||||
#include "ParserATNSimulator.h"
|
||||
#include "DFA.h"
|
||||
#include "ATN.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
using namespace antlr4;
|
||||
|
||||
@interface antlrcpp_Tests : XCTestCase
|
||||
|
||||
@end
|
||||
|
||||
@implementation antlrcpp_Tests
|
||||
|
||||
- (void)setUp {
|
||||
[super setUp];
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
- (void)tearDown {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
[super tearDown];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,585 +0,0 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
2707D9C22764C11300D99A45 /* libantlr4-runtime.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2707D9BC2764C04C00D99A45 /* libantlr4-runtime.dylib */; };
|
||||
270925B11CDB455B00522D32 /* TLexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27A23EA11CC2A8D60036D8A3 /* TLexer.cpp */; };
|
||||
2747A7131CA6C46C0030247B /* InputHandlingTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2747A7121CA6C46C0030247B /* InputHandlingTests.mm */; };
|
||||
274FC6D91CA96B6C008D4374 /* MiscClassTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 274FC6D81CA96B6C008D4374 /* MiscClassTests.mm */; };
|
||||
27C66A6A1C9591280021E494 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27C66A691C9591280021E494 /* main.cpp */; };
|
||||
27C6E1801C972FFC0079AF06 /* TParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27C6E1741C972FFC0079AF06 /* TParser.cpp */; };
|
||||
27C6E1811C972FFC0079AF06 /* TParserBaseListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27C6E1771C972FFC0079AF06 /* TParserBaseListener.cpp */; };
|
||||
27C6E1821C972FFC0079AF06 /* TParserBaseVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27C6E1791C972FFC0079AF06 /* TParserBaseVisitor.cpp */; };
|
||||
27C6E1831C972FFC0079AF06 /* TParserListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27C6E17B1C972FFC0079AF06 /* TParserListener.cpp */; };
|
||||
27C6E1841C972FFC0079AF06 /* TParserVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27C6E17D1C972FFC0079AF06 /* TParserVisitor.cpp */; };
|
||||
37F1356D1B4AC02800E0CACF /* antlrcpp_Tests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37F1356C1B4AC02800E0CACF /* antlrcpp_Tests.mm */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
2707D9BB2764C04C00D99A45 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2707D9B52764C04C00D99A45 /* antlrcpp.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 37D727AA1867AF1E007B6D10;
|
||||
remoteInfo = antlr4;
|
||||
};
|
||||
2707D9BD2764C04C00D99A45 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2707D9B52764C04C00D99A45 /* antlrcpp.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 37C147171B4D5A04008EDDDB;
|
||||
remoteInfo = antlr4_static;
|
||||
};
|
||||
2707D9BF2764C04C00D99A45 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 2707D9B52764C04C00D99A45 /* antlrcpp.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 270C67F01CDB4F1E00116E17;
|
||||
remoteInfo = antlr4_ios;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
27C66A651C9591280021E494 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = /usr/share/man/man1/;
|
||||
dstSubfolderSpec = 0;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 1;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
2707D9B52764C04C00D99A45 /* antlrcpp.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = antlrcpp.xcodeproj; path = ../../runtime/antlrcpp.xcodeproj; sourceTree = "<group>"; };
|
||||
2747A7121CA6C46C0030247B /* InputHandlingTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InputHandlingTests.mm; sourceTree = "<group>"; wrapsLines = 0; };
|
||||
274FC6D81CA96B6C008D4374 /* MiscClassTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MiscClassTests.mm; sourceTree = "<group>"; wrapsLines = 0; };
|
||||
27874F1D1CCB7A0700AF1C53 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
|
||||
27A23EA11CC2A8D60036D8A3 /* TLexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TLexer.cpp; path = ../generated/TLexer.cpp; sourceTree = "<group>"; wrapsLines = 0; };
|
||||
27A23EA21CC2A8D60036D8A3 /* TLexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TLexer.h; path = ../generated/TLexer.h; sourceTree = "<group>"; };
|
||||
27C66A671C9591280021E494 /* antlr4-cpp-demo */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "antlr4-cpp-demo"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
27C66A691C9591280021E494 /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; wrapsLines = 0; };
|
||||
27C66A731C9592400021E494 /* TLexer.g4 */ = {isa = PBXFileReference; lastKnownFileType = text; name = TLexer.g4; path = ../../TLexer.g4; sourceTree = "<group>"; };
|
||||
27C66A741C9592400021E494 /* TParser.g4 */ = {isa = PBXFileReference; lastKnownFileType = text; name = TParser.g4; path = ../../TParser.g4; sourceTree = "<group>"; };
|
||||
27C6E1741C972FFC0079AF06 /* TParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TParser.cpp; path = ../generated/TParser.cpp; sourceTree = "<group>"; wrapsLines = 0; };
|
||||
27C6E1751C972FFC0079AF06 /* TParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TParser.h; path = ../generated/TParser.h; sourceTree = "<group>"; wrapsLines = 0; };
|
||||
27C6E1771C972FFC0079AF06 /* TParserBaseListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TParserBaseListener.cpp; path = ../generated/TParserBaseListener.cpp; sourceTree = "<group>"; };
|
||||
27C6E1781C972FFC0079AF06 /* TParserBaseListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TParserBaseListener.h; path = ../generated/TParserBaseListener.h; sourceTree = "<group>"; };
|
||||
27C6E1791C972FFC0079AF06 /* TParserBaseVisitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TParserBaseVisitor.cpp; path = ../generated/TParserBaseVisitor.cpp; sourceTree = "<group>"; };
|
||||
27C6E17B1C972FFC0079AF06 /* TParserListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TParserListener.cpp; path = ../generated/TParserListener.cpp; sourceTree = "<group>"; };
|
||||
27C6E17C1C972FFC0079AF06 /* TParserListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TParserListener.h; path = ../generated/TParserListener.h; sourceTree = "<group>"; };
|
||||
27C6E17D1C972FFC0079AF06 /* TParserVisitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TParserVisitor.cpp; path = ../generated/TParserVisitor.cpp; sourceTree = "<group>"; };
|
||||
27C6E1851C97322F0079AF06 /* TParserBaseVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TParserBaseVisitor.h; path = ../generated/TParserBaseVisitor.h; sourceTree = "<group>"; wrapsLines = 0; };
|
||||
27C6E1861C97322F0079AF06 /* TParserVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TParserVisitor.h; path = ../generated/TParserVisitor.h; sourceTree = "<group>"; };
|
||||
37F135681B4AC02800E0CACF /* antlrcpp Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "antlrcpp Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
37F1356B1B4AC02800E0CACF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
37F1356C1B4AC02800E0CACF /* antlrcpp_Tests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = antlrcpp_Tests.mm; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
27C66A641C9591280021E494 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2707D9C22764C11300D99A45 /* libantlr4-runtime.dylib in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
37F135651B4AC02800E0CACF /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
2707D9B62764C04C00D99A45 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2707D9BC2764C04C00D99A45 /* libantlr4-runtime.dylib */,
|
||||
2707D9BE2764C04C00D99A45 /* libantlr4-runtime.a */,
|
||||
2707D9C02764C04C00D99A45 /* antlr4_ios.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2707D9C12764C11300D99A45 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
27874F221CCBB34200AF1C53 /* Linked Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
27874F1D1CCB7A0700AF1C53 /* CoreFoundation.framework */,
|
||||
);
|
||||
name = "Linked Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
27C66A5C1C958EB50021E494 /* generated */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
27A23EA11CC2A8D60036D8A3 /* TLexer.cpp */,
|
||||
27A23EA21CC2A8D60036D8A3 /* TLexer.h */,
|
||||
27C6E1741C972FFC0079AF06 /* TParser.cpp */,
|
||||
27C6E1751C972FFC0079AF06 /* TParser.h */,
|
||||
27C6E1771C972FFC0079AF06 /* TParserBaseListener.cpp */,
|
||||
27C6E1781C972FFC0079AF06 /* TParserBaseListener.h */,
|
||||
27C6E1791C972FFC0079AF06 /* TParserBaseVisitor.cpp */,
|
||||
27C6E1851C97322F0079AF06 /* TParserBaseVisitor.h */,
|
||||
27C6E17B1C972FFC0079AF06 /* TParserListener.cpp */,
|
||||
27C6E17C1C972FFC0079AF06 /* TParserListener.h */,
|
||||
27C6E17D1C972FFC0079AF06 /* TParserVisitor.cpp */,
|
||||
27C6E1861C97322F0079AF06 /* TParserVisitor.h */,
|
||||
);
|
||||
name = generated;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
27C66A681C9591280021E494 /* antlr4-cpp-demo */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
27C66A691C9591280021E494 /* main.cpp */,
|
||||
27C66A731C9592400021E494 /* TLexer.g4 */,
|
||||
27C66A741C9592400021E494 /* TParser.g4 */,
|
||||
);
|
||||
path = "antlr4-cpp-demo";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
37D727A11867AF1E007B6D10 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2707D9B52764C04C00D99A45 /* antlrcpp.xcodeproj */,
|
||||
27C66A681C9591280021E494 /* antlr4-cpp-demo */,
|
||||
37F135691B4AC02800E0CACF /* antlrcpp Tests */,
|
||||
27C66A5C1C958EB50021E494 /* generated */,
|
||||
27874F221CCBB34200AF1C53 /* Linked Frameworks */,
|
||||
37D727AB1867AF1E007B6D10 /* Products */,
|
||||
2707D9C12764C11300D99A45 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
37D727AB1867AF1E007B6D10 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
37F135681B4AC02800E0CACF /* antlrcpp Tests.xctest */,
|
||||
27C66A671C9591280021E494 /* antlr4-cpp-demo */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
37F135691B4AC02800E0CACF /* antlrcpp Tests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
37F1356A1B4AC02800E0CACF /* Supporting Files */,
|
||||
37F1356C1B4AC02800E0CACF /* antlrcpp_Tests.mm */,
|
||||
2747A7121CA6C46C0030247B /* InputHandlingTests.mm */,
|
||||
274FC6D81CA96B6C008D4374 /* MiscClassTests.mm */,
|
||||
);
|
||||
path = "antlrcpp Tests";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
37F1356A1B4AC02800E0CACF /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
37F1356B1B4AC02800E0CACF /* Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
27C66A661C9591280021E494 /* antlr4-cpp-demo */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 27C66A6B1C9591280021E494 /* Build configuration list for PBXNativeTarget "antlr4-cpp-demo" */;
|
||||
buildPhases = (
|
||||
27C66A721C9591EF0021E494 /* Generate Parser */,
|
||||
27C66A631C9591280021E494 /* Sources */,
|
||||
27C66A641C9591280021E494 /* Frameworks */,
|
||||
27C66A651C9591280021E494 /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "antlr4-cpp-demo";
|
||||
productName = "antlr4-cpp-demo";
|
||||
productReference = 27C66A671C9591280021E494 /* antlr4-cpp-demo */;
|
||||
productType = "com.apple.product-type.tool";
|
||||
};
|
||||
37F135671B4AC02800E0CACF /* antlrcpp Tests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 37F135731B4AC02800E0CACF /* Build configuration list for PBXNativeTarget "antlrcpp Tests" */;
|
||||
buildPhases = (
|
||||
37F135641B4AC02800E0CACF /* Sources */,
|
||||
37F135651B4AC02800E0CACF /* Frameworks */,
|
||||
37F135661B4AC02800E0CACF /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "antlrcpp Tests";
|
||||
productName = "antlrcpp Tests";
|
||||
productReference = 37F135681B4AC02800E0CACF /* antlrcpp Tests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
37D727A21867AF1E007B6D10 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1010;
|
||||
ORGANIZATIONNAME = "ANTLR4 Project";
|
||||
TargetAttributes = {
|
||||
27C66A661C9591280021E494 = {
|
||||
CreatedOnToolsVersion = 7.2.1;
|
||||
};
|
||||
37F135671B4AC02800E0CACF = {
|
||||
CreatedOnToolsVersion = 6.3.2;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 37D727A51867AF1E007B6D10 /* Build configuration list for PBXProject "antlrcpp-demo" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 37D727A11867AF1E007B6D10;
|
||||
productRefGroup = 37D727AB1867AF1E007B6D10 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectReferences = (
|
||||
{
|
||||
ProductGroup = 2707D9B62764C04C00D99A45 /* Products */;
|
||||
ProjectRef = 2707D9B52764C04C00D99A45 /* antlrcpp.xcodeproj */;
|
||||
},
|
||||
);
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
37F135671B4AC02800E0CACF /* antlrcpp Tests */,
|
||||
27C66A661C9591280021E494 /* antlr4-cpp-demo */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXReferenceProxy section */
|
||||
2707D9BC2764C04C00D99A45 /* libantlr4-runtime.dylib */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = "compiled.mach-o.dylib";
|
||||
path = "libantlr4-runtime.dylib";
|
||||
remoteRef = 2707D9BB2764C04C00D99A45 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2707D9BE2764C04C00D99A45 /* libantlr4-runtime.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = "libantlr4-runtime.a";
|
||||
remoteRef = 2707D9BD2764C04C00D99A45 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2707D9C02764C04C00D99A45 /* antlr4_ios.framework */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = wrapper.framework;
|
||||
path = antlr4_ios.framework;
|
||||
remoteRef = 2707D9BF2764C04C00D99A45 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
/* End PBXReferenceProxy section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
37F135661B4AC02800E0CACF /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
27C66A721C9591EF0021E494 /* Generate Parser */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Generate Parser";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "pushd ..\nif [ TParser.g4 -nt generated/TParser.cpp -o TLexer.g4 -nt generated/TLexer.cpp ]; then\n./generate.sh;\nfi\npopd\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
27C66A631C9591280021E494 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
27C66A6A1C9591280021E494 /* main.cpp in Sources */,
|
||||
27C6E1821C972FFC0079AF06 /* TParserBaseVisitor.cpp in Sources */,
|
||||
270925B11CDB455B00522D32 /* TLexer.cpp in Sources */,
|
||||
27C6E1831C972FFC0079AF06 /* TParserListener.cpp in Sources */,
|
||||
27C6E1811C972FFC0079AF06 /* TParserBaseListener.cpp in Sources */,
|
||||
27C6E1841C972FFC0079AF06 /* TParserVisitor.cpp in Sources */,
|
||||
27C6E1801C972FFC0079AF06 /* TParser.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
37F135641B4AC02800E0CACF /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
37F1356D1B4AC02800E0CACF /* antlrcpp_Tests.mm in Sources */,
|
||||
2747A7131CA6C46C0030247B /* InputHandlingTests.mm in Sources */,
|
||||
274FC6D91CA96B6C008D4374 /* MiscClassTests.mm in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
27C66A6C1C9591280021E494 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
27C66A6D1C9591280021E494 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
37D727B51867AF1E007B6D10 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_SIGN_COMPARE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_PARAMETER = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../../runtime/src/tree/pattern,
|
||||
../../runtime/src/tree,
|
||||
../../runtime/src/support,
|
||||
../../runtime/src/misc,
|
||||
../../runtime/src/dfa,
|
||||
../../runtime/src/atn,
|
||||
../../runtime/src,
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 11.1;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
37D727B61867AF1E007B6D10 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_SIGN_COMPARE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_PARAMETER = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
../../runtime/src/tree/pattern,
|
||||
../../runtime/src/tree,
|
||||
../../runtime/src/support,
|
||||
../../runtime/src/misc,
|
||||
../../runtime/src/dfa,
|
||||
../../runtime/src/atn,
|
||||
../../runtime/src,
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 11.1;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
37F135711B4AC02800E0CACF /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(DEVELOPER_FRAMEWORKS_DIR)",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
INFOPLIST_FILE = "antlrcpp Tests/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.antlr.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
37F135721B4AC02800E0CACF /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(DEVELOPER_FRAMEWORKS_DIR)",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
INFOPLIST_FILE = "antlrcpp Tests/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.antlr.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
27C66A6B1C9591280021E494 /* Build configuration list for PBXNativeTarget "antlr4-cpp-demo" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
27C66A6C1C9591280021E494 /* Debug */,
|
||||
27C66A6D1C9591280021E494 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
37D727A51867AF1E007B6D10 /* Build configuration list for PBXProject "antlrcpp-demo" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
37D727B51867AF1E007B6D10 /* Debug */,
|
||||
37D727B61867AF1E007B6D10 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
37F135731B4AC02800E0CACF /* Build configuration list for PBXNativeTarget "antlrcpp Tests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
37F135711B4AC02800E0CACF /* Debug */,
|
||||
37F135721B4AC02800E0CACF /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 37D727A21867AF1E007B6D10 /* Project object */;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,102 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1010"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "27C66A661C9591280021E494"
|
||||
BuildableName = "antlr4-cpp-demo"
|
||||
BlueprintName = "antlr4-cpp-demo"
|
||||
ReferencedContainer = "container:antlrcpp-demo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
codeCoverageEnabled = "YES"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "37F135671B4AC02800E0CACF"
|
||||
BuildableName = "antlrcpp Tests.xctest"
|
||||
BlueprintName = "antlrcpp Tests"
|
||||
ReferencedContainer = "container:antlrcpp-demo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "27C66A661C9591280021E494"
|
||||
BuildableName = "antlr4-cpp-demo"
|
||||
BlueprintName = "antlr4-cpp-demo"
|
||||
ReferencedContainer = "container:antlrcpp-demo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "27C66A661C9591280021E494"
|
||||
BuildableName = "antlr4-cpp-demo"
|
||||
BlueprintName = "antlr4-cpp-demo"
|
||||
ReferencedContainer = "container:antlrcpp-demo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "27C66A661C9591280021E494"
|
||||
BuildableName = "antlr4-cpp-demo"
|
||||
BlueprintName = "antlr4-cpp-demo"
|
||||
ReferencedContainer = "container:antlrcpp-demo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -1,56 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1010"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "37F135671B4AC02800E0CACF"
|
||||
BuildableName = "antlrcpp Tests.xctest"
|
||||
BlueprintName = "antlrcpp Tests"
|
||||
ReferencedContainer = "container:antlrcpp-demo.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/bin/sh
|
||||
# [The "BSD license"]
|
||||
# Copyright (c) 2013 Terence Parr
|
||||
# Copyright (c) 2013 Dan McLaughlin
|
||||
# All rights reserved.
|
||||
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
ANTLRCPP_XCODEPROJ="${CURRENT_DIR}/antlrcpp.xcodeproj"
|
||||
|
||||
# OS X
|
||||
xcrun xcodebuild -project ${ANTLRCPP_XCODEPROJ} -target antlrcpp -configuration Release $@
|
||||
xcrun xcodebuild -project ${ANTLRCPP_XCODEPROJ} -target antlrcpp -configuration Debug $@
|
||||
|
||||
# iOS
|
||||
#xcrun xcodebuild -project ${ANTLRCPP_XCODEPROJ} -target antlrcpp_iphone -configuration Release -sdk iphoneos $@
|
||||
#xcrun xcodebuild -project ${ANTLRCPP_XCODEPROJ} -target antlrcpp_iphone -configuration Debug -sdk iphoneos $@
|
||||
#xcrun xcodebuild -project ${ANTLRCPP_XCODEPROJ} -target antlrcpp_iphone_sim -configuration Release -sdk iphonesimulator $@
|
||||
#xcrun xcodebuild -project ${ANTLRCPP_XCODEPROJ} -target antlrcpp_iphone_sim -configuration Debug -sdk iphonesimulator $@
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
## Demo application for the ANTLR 4 C++ target
|
||||
|
||||
This demo app shows how to build the ANTLR runtime both as dynamic and static library and how to use a parser generated from a simple demo grammar.
|
||||
|
||||
A few steps are necessary to get this to work:
|
||||
|
||||
- Download the current ANTLR jar and place it in this folder.
|
||||
- Open the generation script for your platform (generate.cmd for Windows, generate.sh for *nix/OSX) and update the LOCATION var to the actual name of the jar you downloaded.
|
||||
- Run the generation script. This will generate a test parser + lexer, along with listener + visitor classes in a subfolder named "generated". This is where the demo application looks for these files.
|
||||
- Open the project in the folder that matches your system.
|
||||
- Compile and run.
|
||||
|
||||
Compilation is done as described in the [runtime/cpp/readme.md](../README.md) file.
|
||||
@@ -1,86 +0,0 @@
|
||||
lexer grammar TLexer;
|
||||
|
||||
// These are all supported lexer sections:
|
||||
|
||||
// Lexer file header. Appears at the top of h + cpp files. Use e.g. for copyrights.
|
||||
@lexer::header {/* lexer header section */}
|
||||
|
||||
// Appears before any #include in h + cpp files.
|
||||
@lexer::preinclude {/* lexer precinclude section */}
|
||||
|
||||
// Follows directly after the standard #includes in h + cpp files.
|
||||
@lexer::postinclude {
|
||||
/* lexer postinclude section */
|
||||
#ifndef _WIN32
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
}
|
||||
|
||||
// Directly preceds the lexer class declaration in the h file (e.g. for additional types etc.).
|
||||
@lexer::context {/* lexer context section */}
|
||||
|
||||
// Appears in the public part of the lexer in the h file.
|
||||
@lexer::members {/* public lexer declarations section */
|
||||
bool canTestFoo() { return true; }
|
||||
bool isItFoo() { return true; }
|
||||
bool isItBar() { return true; }
|
||||
|
||||
void myFooLexerAction() { /* do something*/ };
|
||||
void myBarLexerAction() { /* do something*/ };
|
||||
}
|
||||
|
||||
// Appears in the private part of the lexer in the h file.
|
||||
@lexer::declarations {/* private lexer declarations/members section */}
|
||||
|
||||
// Appears in line with the other class member definitions in the cpp file.
|
||||
@lexer::definitions {/* lexer definitions section */}
|
||||
|
||||
channels { CommentsChannel, DirectiveChannel }
|
||||
|
||||
tokens {
|
||||
DUMMY
|
||||
}
|
||||
|
||||
Return: 'return';
|
||||
Continue: 'continue';
|
||||
|
||||
INT: Digit+;
|
||||
Digit: [0-9];
|
||||
|
||||
ID: LETTER (LETTER | '0'..'9')*;
|
||||
fragment LETTER : [a-zA-Z\u0080-\u{10FFFF}];
|
||||
|
||||
LessThan: '<';
|
||||
GreaterThan: '>';
|
||||
Equal: '=';
|
||||
And: 'and';
|
||||
|
||||
Colon: ':';
|
||||
Semicolon: ';';
|
||||
Plus: '+';
|
||||
Minus: '-';
|
||||
Star: '*';
|
||||
OpenPar: '(';
|
||||
ClosePar: ')';
|
||||
OpenCurly: '{' -> pushMode(Mode1);
|
||||
CloseCurly: '}' -> popMode;
|
||||
QuestionMark: '?';
|
||||
Comma: ',' -> skip;
|
||||
Dollar: '$' -> more, mode(Mode1);
|
||||
Ampersand: '&' -> type(DUMMY);
|
||||
|
||||
String: '"' .*? '"';
|
||||
Foo: {canTestFoo()}? 'foo' {isItFoo()}? { myFooLexerAction(); };
|
||||
Bar: 'bar' {isItBar()}? { myBarLexerAction(); };
|
||||
Any: Foo Dot Bar? DotDot Baz;
|
||||
|
||||
Comment : '#' ~[\r\n]* '\r'? '\n' -> channel(CommentsChannel);
|
||||
WS: [ \t\r\n]+ -> channel(99);
|
||||
|
||||
fragment Baz: 'Baz';
|
||||
|
||||
mode Mode1;
|
||||
Dot: '.';
|
||||
|
||||
mode Mode2;
|
||||
DotDot: '..';
|
||||
@@ -1,119 +0,0 @@
|
||||
parser grammar TParser;
|
||||
|
||||
options {
|
||||
tokenVocab = TLexer;
|
||||
}
|
||||
|
||||
// These are all supported parser sections:
|
||||
|
||||
// Parser file header. Appears at the top in all parser related files. Use e.g. for copyrights.
|
||||
@parser::header {/* parser/listener/visitor header section */}
|
||||
|
||||
// Appears before any #include in h + cpp files.
|
||||
@parser::preinclude {/* parser precinclude section */}
|
||||
|
||||
// Follows directly after the standard #includes in h + cpp files.
|
||||
@parser::postinclude {
|
||||
/* parser postinclude section */
|
||||
#ifndef _WIN32
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
}
|
||||
|
||||
// Directly preceeds the parser class declaration in the h file (e.g. for additional types etc.).
|
||||
@parser::context {/* parser context section */}
|
||||
|
||||
// Appears in the private part of the parser in the h file.
|
||||
// The function bodies could also appear in the definitions section, but I want to maximize
|
||||
// Java compatibility, so we can also create a Java parser from this grammar.
|
||||
// Still, some tweaking is necessary after the Java file generation (e.g. bool -> boolean).
|
||||
@parser::members {
|
||||
/* public parser declarations/members section */
|
||||
bool myAction() { return true; }
|
||||
bool doesItBlend() { return true; }
|
||||
void cleanUp() {}
|
||||
void doInit() {}
|
||||
void doAfter() {}
|
||||
}
|
||||
|
||||
// Appears in the public part of the parser in the h file.
|
||||
@parser::declarations {/* private parser declarations section */}
|
||||
|
||||
// Appears in line with the other class member definitions in the cpp file.
|
||||
@parser::definitions {/* parser definitions section */}
|
||||
|
||||
// Additionally there are similar sections for (base)listener and (base)visitor files.
|
||||
@parser::listenerpreinclude {/* listener preinclude section */}
|
||||
@parser::listenerpostinclude {/* listener postinclude section */}
|
||||
@parser::listenerdeclarations {/* listener public declarations/members section */}
|
||||
@parser::listenermembers {/* listener private declarations/members section */}
|
||||
@parser::listenerdefinitions {/* listener definitions section */}
|
||||
|
||||
@parser::baselistenerpreinclude {/* base listener preinclude section */}
|
||||
@parser::baselistenerpostinclude {/* base listener postinclude section */}
|
||||
@parser::baselistenerdeclarations {/* base listener public declarations/members section */}
|
||||
@parser::baselistenermembers {/* base listener private declarations/members section */}
|
||||
@parser::baselistenerdefinitions {/* base listener definitions section */}
|
||||
|
||||
@parser::visitorpreinclude {/* visitor preinclude section */}
|
||||
@parser::visitorpostinclude {/* visitor postinclude section */}
|
||||
@parser::visitordeclarations {/* visitor public declarations/members section */}
|
||||
@parser::visitormembers {/* visitor private declarations/members section */}
|
||||
@parser::visitordefinitions {/* visitor definitions section */}
|
||||
|
||||
@parser::basevisitorpreinclude {/* base visitor preinclude section */}
|
||||
@parser::basevisitorpostinclude {/* base visitor postinclude section */}
|
||||
@parser::basevisitordeclarations {/* base visitor public declarations/members section */}
|
||||
@parser::basevisitormembers {/* base visitor private declarations/members section */}
|
||||
@parser::basevisitordefinitions {/* base visitor definitions section */}
|
||||
|
||||
// Actual grammar start.
|
||||
main: stat+ EOF;
|
||||
divide : ID (and_ GreaterThan)? {doesItBlend()}?;
|
||||
and_ @init{ doInit(); } @after { doAfter(); } : And ;
|
||||
|
||||
conquer:
|
||||
divide+
|
||||
| {doesItBlend()}? and_ { myAction(); }
|
||||
| ID (LessThan* divide)?? { $ID.text; }
|
||||
;
|
||||
|
||||
// Unused rule to demonstrate some of the special features.
|
||||
unused[double input = 111] returns [double calculated] locals [int _a, double _b, int _c] @init{ doInit(); } @after { doAfter(); } :
|
||||
stat
|
||||
;
|
||||
catch [...] {
|
||||
// Replaces the standard exception handling.
|
||||
}
|
||||
finally {
|
||||
cleanUp();
|
||||
}
|
||||
|
||||
unused2:
|
||||
(unused[1] .)+ (Colon | Semicolon | Plus)? ~Semicolon
|
||||
;
|
||||
|
||||
stat: expr Equal expr Semicolon
|
||||
| expr Semicolon
|
||||
;
|
||||
|
||||
expr: expr Star expr
|
||||
| expr Plus expr
|
||||
| OpenPar expr ClosePar
|
||||
| <assoc = right> expr QuestionMark expr Colon expr
|
||||
| <assoc = right> expr Equal expr
|
||||
| identifier = id
|
||||
| flowControl
|
||||
| INT
|
||||
| String
|
||||
;
|
||||
|
||||
flowControl:
|
||||
Return expr # Return
|
||||
| Continue # Continue
|
||||
;
|
||||
|
||||
id: ID;
|
||||
array : OpenCurly el += INT (Comma el += INT)* CloseCurly;
|
||||
idarray : OpenCurly element += id (Comma element += id)* CloseCurly;
|
||||
any: t = .;
|
||||
@@ -1,365 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug DLL|Win32">
|
||||
<Configuration>Debug DLL</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug DLL|x64">
|
||||
<Configuration>Debug DLL</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug Static|Win32">
|
||||
<Configuration>Debug Static</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug Static|x64">
|
||||
<Configuration>Debug Static</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release DLL|Win32">
|
||||
<Configuration>Release DLL</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release DLL|x64">
|
||||
<Configuration>Release DLL</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release Static|Win32">
|
||||
<Configuration>Release Static</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release Static|x64">
|
||||
<Configuration>Release Static</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{24EC5104-7402-4C76-B66B-27ADBE062D68}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>antlr4cppdemo</RootNamespace>
|
||||
<ProjectName>antlr4cpp-demo</ProjectName>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2022\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2022\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2022\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2022\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2022\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2022\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2022\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2022\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\generated;$(SolutionDir)..\..\runtime\src;$(SolutionDir)..\..\runtime\src\atn;$(SolutionDir)..\..\runtime\src\dfa;$(SolutionDir)..\..\runtime\src\misc;$(SolutionDir)..\..\runtime\src\support;$(SolutionDir)..\..\runtime\src\tree;$(SolutionDir)..\..\runtime\src\tree\xpath;$(SolutionDir)..\..\runtime\src\tree\pattern;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\generated;$(SolutionDir)..\..\runtime\src;$(SolutionDir)..\..\runtime\src\atn;$(SolutionDir)..\..\runtime\src\dfa;$(SolutionDir)..\..\runtime\src\misc;$(SolutionDir)..\..\runtime\src\support;$(SolutionDir)..\..\runtime\src\tree;$(SolutionDir)..\..\runtime\src\tree\xpath;$(SolutionDir)..\..\runtime\src\tree\pattern;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\generated;$(SolutionDir)..\..\runtime\src;$(SolutionDir)..\..\runtime\src\atn;$(SolutionDir)..\..\runtime\src\dfa;$(SolutionDir)..\..\runtime\src\misc;$(SolutionDir)..\..\runtime\src\support;$(SolutionDir)..\..\runtime\src\tree;$(SolutionDir)..\..\runtime\src\tree\xpath;$(SolutionDir)..\..\runtime\src\tree\pattern;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\generated;$(SolutionDir)..\..\runtime\src;$(SolutionDir)..\..\runtime\src\atn;$(SolutionDir)..\..\runtime\src\dfa;$(SolutionDir)..\..\runtime\src\misc;$(SolutionDir)..\..\runtime\src\support;$(SolutionDir)..\..\runtime\src\tree;$(SolutionDir)..\..\runtime\src\tree\xpath;$(SolutionDir)..\..\runtime\src\tree\pattern;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\generated;$(SolutionDir)..\..\runtime\src;$(SolutionDir)..\..\runtime\src\atn;$(SolutionDir)..\..\runtime\src\dfa;$(SolutionDir)..\..\runtime\src\misc;$(SolutionDir)..\..\runtime\src\support;$(SolutionDir)..\..\runtime\src\tree;$(SolutionDir)..\..\runtime\src\tree\xpath;$(SolutionDir)..\..\runtime\src\tree\pattern;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\generated;$(SolutionDir)..\..\runtime\src;$(SolutionDir)..\..\runtime\src\atn;$(SolutionDir)..\..\runtime\src\dfa;$(SolutionDir)..\..\runtime\src\misc;$(SolutionDir)..\..\runtime\src\support;$(SolutionDir)..\..\runtime\src\tree;$(SolutionDir)..\..\runtime\src\tree\xpath;$(SolutionDir)..\..\runtime\src\tree\pattern;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\generated;$(SolutionDir)..\..\runtime\src;$(SolutionDir)..\..\runtime\src\atn;$(SolutionDir)..\..\runtime\src\dfa;$(SolutionDir)..\..\runtime\src\misc;$(SolutionDir)..\..\runtime\src\support;$(SolutionDir)..\..\runtime\src\tree;$(SolutionDir)..\..\runtime\src\tree\xpath;$(SolutionDir)..\..\runtime\src\tree\pattern;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..\generated;$(SolutionDir)..\..\runtime\src;$(SolutionDir)..\..\runtime\src\atn;$(SolutionDir)..\..\runtime\src\dfa;$(SolutionDir)..\..\runtime\src\misc;$(SolutionDir)..\..\runtime\src\support;$(SolutionDir)..\..\runtime\src\tree;$(SolutionDir)..\..\runtime\src\tree\xpath;$(SolutionDir)..\..\runtime\src\tree\pattern;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\generated\TLexer.cpp" />
|
||||
<ClCompile Include="..\..\generated\TParser.cpp" />
|
||||
<ClCompile Include="..\..\generated\TParserBaseListener.cpp" />
|
||||
<ClCompile Include="..\..\generated\TParserBaseVisitor.cpp" />
|
||||
<ClCompile Include="..\..\generated\TParserListener.cpp" />
|
||||
<ClCompile Include="..\..\generated\TParserVisitor.cpp" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\generated\TLexer.h" />
|
||||
<ClInclude Include="..\..\generated\TParser.h" />
|
||||
<ClInclude Include="..\..\generated\TParserBaseListener.h" />
|
||||
<ClInclude Include="..\..\generated\TParserBaseVisitor.h" />
|
||||
<ClInclude Include="..\..\generated\TParserListener.h" />
|
||||
<ClInclude Include="..\..\generated\TParserVisitor.h" />
|
||||
<ClInclude Include="main.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\runtime\antlr4cpp-vs2022.vcxproj">
|
||||
<Project>{a9762991-1b57-4dce-90c0-ee42b96947be}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -1,66 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="generated">
|
||||
<UniqueIdentifier>{ef397b7b-1192-4d44-93ed-fadaec7622e8}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\generated\TParser.cpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\generated\TParserBaseListener.cpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\generated\TParserBaseVisitor.cpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\generated\TParserListener.cpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\generated\TParserVisitor.cpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\generated\TLexer.cpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\generated\TLexer.h">
|
||||
<Filter>generated</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\generated\TParser.h">
|
||||
<Filter>generated</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\generated\TParserBaseListener.h">
|
||||
<Filter>generated</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\generated\TParserBaseVisitor.h">
|
||||
<Filter>generated</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\generated\TParserListener.h">
|
||||
<Filter>generated</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\generated\TParserVisitor.h">
|
||||
<Filter>generated</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="main.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,39 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
//
|
||||
// main.cpp
|
||||
// antlr4-cpp-demo
|
||||
//
|
||||
// Created by Mike Lischke on 13.03.16.
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "antlr4-runtime.h"
|
||||
#include "TLexer.h"
|
||||
#include "TParser.h"
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
#pragma execution_character_set("utf-8")
|
||||
|
||||
using namespace antlrcpptest;
|
||||
using namespace antlr4;
|
||||
|
||||
int main(int argc, const char * argv[]) {
|
||||
|
||||
ANTLRInputStream input("a = b + \"c\";(((x * d))) * e + f; a + (x * (y ? 0 : 1) + z);");
|
||||
TLexer lexer(&input);
|
||||
CommonTokenStream tokens(&lexer);
|
||||
|
||||
TParser parser(&tokens);
|
||||
tree::ParseTree *tree = parser.main();
|
||||
|
||||
auto s = tree->toStringTree(&parser);
|
||||
std::cout << "Parse Tree: " << s << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.0.32014.148
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "antlr4cpp-vs2022", "..\..\runtime\antlr4cpp-vs2022.vcxproj", "{52618D4B-6EC4-49AD-8B83-52686244E8F3}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "antlr4cpp-demo", "antlr4-cpp-demo\antlr4-cpp-demo-vs2022.vcxproj", "{24EC5104-7402-4C76-B66B-27ADBE062D68}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug DLL|x64 = Debug DLL|x64
|
||||
Debug DLL|x86 = Debug DLL|x86
|
||||
Debug Static|x64 = Debug Static|x64
|
||||
Debug Static|x86 = Debug Static|x86
|
||||
Release DLL|x64 = Release DLL|x64
|
||||
Release DLL|x86 = Release DLL|x86
|
||||
Release Static|x64 = Release Static|x64
|
||||
Release Static|x86 = Release Static|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{52618D4B-6EC4-49AD-8B83-52686244E8F3}.Debug DLL|x64.ActiveCfg = Debug DLL|x64
|
||||
{52618D4B-6EC4-49AD-8B83-52686244E8F3}.Debug DLL|x64.Build.0 = Debug DLL|x64
|
||||
{52618D4B-6EC4-49AD-8B83-52686244E8F3}.Debug DLL|x86.ActiveCfg = Debug DLL|Win32
|
||||
{52618D4B-6EC4-49AD-8B83-52686244E8F3}.Debug DLL|x86.Build.0 = Debug DLL|Win32
|
||||
{52618D4B-6EC4-49AD-8B83-52686244E8F3}.Debug Static|x64.ActiveCfg = Debug Static|x64
|
||||
{52618D4B-6EC4-49AD-8B83-52686244E8F3}.Debug Static|x64.Build.0 = Debug Static|x64
|
||||
{52618D4B-6EC4-49AD-8B83-52686244E8F3}.Debug Static|x86.ActiveCfg = Debug Static|Win32
|
||||
{52618D4B-6EC4-49AD-8B83-52686244E8F3}.Debug Static|x86.Build.0 = Debug Static|Win32
|
||||
{52618D4B-6EC4-49AD-8B83-52686244E8F3}.Release DLL|x64.ActiveCfg = Release DLL|x64
|
||||
{52618D4B-6EC4-49AD-8B83-52686244E8F3}.Release DLL|x64.Build.0 = Release DLL|x64
|
||||
{52618D4B-6EC4-49AD-8B83-52686244E8F3}.Release DLL|x86.ActiveCfg = Release DLL|Win32
|
||||
{52618D4B-6EC4-49AD-8B83-52686244E8F3}.Release DLL|x86.Build.0 = Release DLL|Win32
|
||||
{52618D4B-6EC4-49AD-8B83-52686244E8F3}.Release Static|x64.ActiveCfg = Release Static|x64
|
||||
{52618D4B-6EC4-49AD-8B83-52686244E8F3}.Release Static|x64.Build.0 = Release Static|x64
|
||||
{52618D4B-6EC4-49AD-8B83-52686244E8F3}.Release Static|x86.ActiveCfg = Release Static|Win32
|
||||
{52618D4B-6EC4-49AD-8B83-52686244E8F3}.Release Static|x86.Build.0 = Release Static|Win32
|
||||
{24EC5104-7402-4C76-B66B-27ADBE062D68}.Debug DLL|x64.ActiveCfg = Debug DLL|x64
|
||||
{24EC5104-7402-4C76-B66B-27ADBE062D68}.Debug DLL|x64.Build.0 = Debug DLL|x64
|
||||
{24EC5104-7402-4C76-B66B-27ADBE062D68}.Debug DLL|x86.ActiveCfg = Debug DLL|Win32
|
||||
{24EC5104-7402-4C76-B66B-27ADBE062D68}.Debug DLL|x86.Build.0 = Debug DLL|Win32
|
||||
{24EC5104-7402-4C76-B66B-27ADBE062D68}.Debug Static|x64.ActiveCfg = Debug Static|x64
|
||||
{24EC5104-7402-4C76-B66B-27ADBE062D68}.Debug Static|x64.Build.0 = Debug Static|x64
|
||||
{24EC5104-7402-4C76-B66B-27ADBE062D68}.Debug Static|x86.ActiveCfg = Debug Static|Win32
|
||||
{24EC5104-7402-4C76-B66B-27ADBE062D68}.Debug Static|x86.Build.0 = Debug Static|Win32
|
||||
{24EC5104-7402-4C76-B66B-27ADBE062D68}.Release DLL|x64.ActiveCfg = Release DLL|x64
|
||||
{24EC5104-7402-4C76-B66B-27ADBE062D68}.Release DLL|x64.Build.0 = Release DLL|x64
|
||||
{24EC5104-7402-4C76-B66B-27ADBE062D68}.Release DLL|x86.ActiveCfg = Release DLL|Win32
|
||||
{24EC5104-7402-4C76-B66B-27ADBE062D68}.Release DLL|x86.Build.0 = Release DLL|Win32
|
||||
{24EC5104-7402-4C76-B66B-27ADBE062D68}.Release Static|x64.ActiveCfg = Release Static|x64
|
||||
{24EC5104-7402-4C76-B66B-27ADBE062D68}.Release Static|x64.Build.0 = Release Static|x64
|
||||
{24EC5104-7402-4C76-B66B-27ADBE062D68}.Release Static|x86.ActiveCfg = Release Static|Win32
|
||||
{24EC5104-7402-4C76-B66B-27ADBE062D68}.Release Static|x86.Build.0 = Release Static|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {93CE9298-807C-4EAD-B1E6-7109DD1A78FA}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,13 +0,0 @@
|
||||
@echo off
|
||||
:: Created 2016, Mike Lischke (public domain)
|
||||
|
||||
:: This script is used to generate source files from the test grammars in the same folder. The generated files are placed
|
||||
:: into a subfolder "generated" which the demo project uses to compile a demo binary.
|
||||
|
||||
:: Download the ANLTR jar and place it in the same folder as this script (or adjust the LOCATION var accordingly).
|
||||
|
||||
set LOCATION=antlr-4.13.2-complete.jar
|
||||
java -jar %LOCATION% -Dlanguage=Cpp -listener -visitor -o generated/ -package antlrcpptest TLexer.g4 TParser.g4
|
||||
::java -jar %LOCATION% -Dlanguage=Cpp -listener -visitor -o generated/ -package antlrcpptest -XdbgST TLexer.g4 TParser.g4
|
||||
::java -jar %LOCATION% -Dlanguage=Java -listener -visitor -o generated/ -package antlrcpptest TLexer.g4 TParser.g4
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -o errexit
|
||||
|
||||
# Created 2016, Mike Lischke (public domain)
|
||||
|
||||
# This script is used to generate source files from the test grammars in the same folder. The generated files are placed
|
||||
# into a subfolder "generated" which the demo project uses to compile a demo binary.
|
||||
|
||||
# There are 2 ways of running the ANTLR generator here.
|
||||
|
||||
# 1) Running from jar. Use the given jar (or replace it by another one you built or downloaded) for generation.
|
||||
#LOCATION=antlr4-4.5.4-SNAPSHOT.jar
|
||||
#java -jar $LOCATION -Dlanguage=Cpp -listener -visitor -o generated/ -package antlrcpptest TLexer.g4 TParser.g4
|
||||
#java -jar $LOCATION -Dlanguage=Cpp -listener -visitor -o generated/ -package antlrcpptest -XdbgST TLexer.g4 TParser.g4
|
||||
#java -jar $LOCATION -Dlanguage=Java -listener -visitor -o generated/ -package antlrcpptest TLexer.g4 TParser.g4
|
||||
|
||||
# 2) Running from class path. This requires that you have both antlr3 and antlr4 compiled. In this scenario no installation
|
||||
# is needed. You just compile the java class files (using "mvn compile" in both the antlr4 and the antlr3 root folders).
|
||||
# The script then runs the generation using these class files, by specifying them on the classpath.
|
||||
# Also the string template jar is needed. Adjust CLASSPATH if you have stored the jar in a different folder as this script assumes.
|
||||
# Furthermore is assumed that the antlr3 folder is located side-by-side with the antlr4 folder. Adjust CLASSPATH if not.
|
||||
# This approach is especially useful if you are working on a target stg file, as it doesn't require to regenerate the
|
||||
# antlr jar over and over again.
|
||||
CLASSPATH=../../../tool/resources/:ST-4.0.8.jar:../../../tool/target/classes:../../../runtime/Java/target/classes:../../../../antlr3/runtime/Java/target/classes
|
||||
|
||||
java -cp $CLASSPATH org.antlr.v4.Tool -Dlanguage=Cpp -listener -visitor -o generated/ -package antlrcpptest TLexer.g4 TParser.g4
|
||||
#java -cp $CLASSPATH org.antlr.v4.Tool -Dlanguage=Cpp -listener -visitor -o generated/ -package antlrcpptest -XdbgST TLexer.g4 TParser.g4
|
||||
#java -cp $CLASSPATH org.antlr.v4.Tool -Dlanguage=Java -listener -visitor -o generated/ TLexer.g4 TParser.g4
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Clean left overs from previous builds if there are any
|
||||
rm -rf antlr4-runtime build lib
|
||||
rm -f antlr4-cpp-runtime-macos.zip
|
||||
|
||||
# Binaries
|
||||
cmake . -D CMAKE_OSX_ARCHITECTURES="arm64; x86_64" -DCMAKE_BUILD_TYPE=Release &> /dev/null
|
||||
make -j 8
|
||||
|
||||
rm -rf lib
|
||||
mkdir lib
|
||||
cp runtime/libantlr4-runtime.dylib lib
|
||||
cp runtime/libantlr4-runtime.a lib
|
||||
|
||||
# Headers
|
||||
rm -f -R antlr4-runtime
|
||||
pushd runtime/src
|
||||
find . -name '*.h' | cpio -pdm ../../antlr4-runtime
|
||||
popd
|
||||
|
||||
# Zip up and clean up
|
||||
zip -r antlr4-cpp-runtime-macos.zip antlr4-runtime lib
|
||||
|
||||
rm -f -R antlr4-runtime build lib
|
||||
|
||||
# Deploy
|
||||
#cp antlr4-cpp-runtime-macos.zip ~/antlr/sites/website-antlr4/download
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Zip it
|
||||
rm -f antlr4-cpp-runtime-source.zip
|
||||
zip -r antlr4-cpp-runtime-source.zip "README.md" "cmake" "demo" "runtime" "CMakeLists.txt" "deploy-macos.sh" "deploy-source.sh" "deploy-windows.cmd" "VERSION" \
|
||||
-X -x "*.DS_Store*" "antlrcpp.xcodeproj/xcuserdata/*" "*Build*" "*DerivedData*" "*.jar" "demo/generated/*" "*.vscode*" "runtime/build/*" \
|
||||
"runtime/*.dylib" "*.a" "runtime/thirdparty/*" "runtime/CMakeFiles/*"
|
||||
|
||||
# Add the license file from the ANTLR root as well.
|
||||
pushd ../../
|
||||
zip runtime/cpp/antlr4-cpp-runtime-source.zip LICENSE.txt
|
||||
popd
|
||||
|
||||
# Deploy
|
||||
#cp antlr4-cpp-runtime-source.zip ~/antlr/sites/website-antlr4/download
|
||||
@@ -1,81 +0,0 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
if [%1] == [] goto Usage
|
||||
|
||||
rem Clean left overs from previous builds if there are any
|
||||
if exist bin rmdir /S /Q runtime\bin
|
||||
if exist obj rmdir /S /Q runtime\obj
|
||||
if exist lib rmdir /S /Q lib
|
||||
if exist antlr4-runtime rmdir /S /Q antlr4-runtime
|
||||
if exist antlr4-cpp-runtime-vs2019.zip erase antlr4-cpp-runtime-vs2019.zip
|
||||
if exist antlr4-cpp-runtime-vs2022.zip erase antlr4-cpp-runtime-vs2022.zip
|
||||
|
||||
rem Headers
|
||||
echo Copying header files ...
|
||||
xcopy runtime\src\*.h antlr4-runtime\ /s /q
|
||||
|
||||
rem Binaries
|
||||
rem VS 2019 disabled by default. Change the X to a C to enable it.
|
||||
if exist "X:\Program Files (x86)\Microsoft Visual Studio\2019\%1\Common7\Tools\VsDevCmd.bat" (
|
||||
echo.
|
||||
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\%1\Common7\Tools\VsDevCmd.bat"
|
||||
|
||||
pushd runtime
|
||||
msbuild antlr4cpp-vs2019.vcxproj /p:configuration="Release DLL" /p:platform=Win32
|
||||
msbuild antlr4cpp-vs2019.vcxproj /p:configuration="Release DLL" /p:platform=x64
|
||||
popd
|
||||
|
||||
7z a antlr4-cpp-runtime-vs2019.zip antlr4-runtime
|
||||
xcopy runtime\bin\*.dll lib\ /s
|
||||
xcopy runtime\bin\*.lib lib\ /s
|
||||
7z a antlr4-cpp-runtime-vs2019.zip lib
|
||||
|
||||
rmdir /S /Q lib
|
||||
rmdir /S /Q runtime\bin
|
||||
rmdir /S /Q runtime\obj
|
||||
|
||||
rem if exist antlr4-cpp-runtime-vs2019.zip copy antlr4-cpp-runtime-vs2019.zip ~/antlr/sites/website-antlr4/download
|
||||
)
|
||||
|
||||
set VCTargetsPath=C:\Program Files\Microsoft Visual Studio\2022\%1\MSBuild\Microsoft\VC\v170\
|
||||
if exist "C:\Program Files\Microsoft Visual Studio\2022\%1\Common7\Tools\VsDevCmd.bat" (
|
||||
echo.
|
||||
|
||||
call "C:\Program Files\Microsoft Visual Studio\2022\%1\Common7\Tools\VsDevCmd.bat"
|
||||
|
||||
pushd runtime
|
||||
msbuild antlr4cpp-vs2022.vcxproj /p:configuration="Release DLL" /p:platform=Win32
|
||||
msbuild antlr4cpp-vs2022.vcxproj /p:configuration="Release DLL" /p:platform=x64
|
||||
popd
|
||||
|
||||
7z a antlr4-cpp-runtime-vs2022.zip antlr4-runtime
|
||||
xcopy runtime\bin\*.dll lib\ /s
|
||||
xcopy runtime\bin\*.lib lib\ /s
|
||||
7z a antlr4-cpp-runtime-vs2022.zip lib
|
||||
|
||||
rmdir /S /Q lib
|
||||
rmdir /S /Q runtime\bin
|
||||
rmdir /S /Q runtime\obj
|
||||
|
||||
rem if exist antlr4-cpp-runtime-vs2022.zip copy antlr4-cpp-runtime-vs2022.zip ~/antlr/sites/website-antlr4/download
|
||||
)
|
||||
|
||||
rmdir /S /Q antlr4-runtime
|
||||
echo.
|
||||
echo === Build done ===
|
||||
|
||||
goto end
|
||||
|
||||
:Usage
|
||||
|
||||
echo This script builds Visual Studio 2019 and/or 2022 libraries of the ANTLR4 runtime.
|
||||
echo You have to specify the type of your VS installation (Community, Professional etc.) to construct
|
||||
echo the correct build tools path.
|
||||
echo.
|
||||
echo Example:
|
||||
echo %0 Professional
|
||||
echo.
|
||||
|
||||
:end
|
||||
@@ -1,199 +0,0 @@
|
||||
option(ANTLR_BUILD_CPP_TESTS "Build C++ tests." ON)
|
||||
option(TRACE_ATN "Trace ATN simulation" OFF)
|
||||
option(ANTLR_BUILD_SHARED "Build the shared library of the ANTLR runtime" ON)
|
||||
option(ANTLR_BUILD_STATIC "Build the static library of the ANTLR runtime" ON)
|
||||
|
||||
if (NOT ANTLR_BUILD_SHARED AND NOT ANTLR_BUILD_STATIC)
|
||||
message(FATAL_ERROR "Options ANTLR_BUILD_SHARED and ANTLR_BUILD_STATIC can't both be OFF")
|
||||
endif()
|
||||
|
||||
set(libantlrcpp_INCLUDE_INSTALL_DIR "include/antlr4-runtime")
|
||||
|
||||
set(libantlrcpp_INCLUDE_DIRS
|
||||
${PROJECT_SOURCE_DIR}/runtime/src
|
||||
${PROJECT_SOURCE_DIR}/runtime/src/atn
|
||||
${PROJECT_SOURCE_DIR}/runtime/src/dfa
|
||||
${PROJECT_SOURCE_DIR}/runtime/src/internal
|
||||
${PROJECT_SOURCE_DIR}/runtime/src/misc
|
||||
${PROJECT_SOURCE_DIR}/runtime/src/support
|
||||
${PROJECT_SOURCE_DIR}/runtime/src/tree
|
||||
${PROJECT_SOURCE_DIR}/runtime/src/tree/pattern
|
||||
${PROJECT_SOURCE_DIR}/runtime/src/tree/xpath
|
||||
)
|
||||
|
||||
|
||||
file(GLOB libantlrcpp_SRC
|
||||
"${PROJECT_SOURCE_DIR}/runtime/src/*.cpp"
|
||||
"${PROJECT_SOURCE_DIR}/runtime/src/atn/*.cpp"
|
||||
"${PROJECT_SOURCE_DIR}/runtime/src/dfa/*.cpp"
|
||||
"${PROJECT_SOURCE_DIR}/runtime/src/internal/*.cpp"
|
||||
"${PROJECT_SOURCE_DIR}/runtime/src/misc/*.cpp"
|
||||
"${PROJECT_SOURCE_DIR}/runtime/src/support/*.cpp"
|
||||
"${PROJECT_SOURCE_DIR}/runtime/src/tree/*.cpp"
|
||||
"${PROJECT_SOURCE_DIR}/runtime/src/tree/pattern/*.cpp"
|
||||
"${PROJECT_SOURCE_DIR}/runtime/src/tree/xpath/*.cpp"
|
||||
)
|
||||
|
||||
if (ANTLR_BUILD_SHARED)
|
||||
add_library(antlr4_shared SHARED ${libantlrcpp_SRC})
|
||||
target_include_directories(antlr4_shared PUBLIC
|
||||
"$<BUILD_INTERFACE:${libantlrcpp_INCLUDE_DIRS}>"
|
||||
"$<INSTALL_INTERFACE:${libantlrcpp_INCLUDE_INSTALL_DIR}>")
|
||||
endif()
|
||||
if (ANTLR_BUILD_STATIC)
|
||||
add_library(antlr4_static STATIC ${libantlrcpp_SRC})
|
||||
target_include_directories(antlr4_static PUBLIC
|
||||
"$<BUILD_INTERFACE:${libantlrcpp_INCLUDE_DIRS}>"
|
||||
"$<INSTALL_INTERFACE:${libantlrcpp_INCLUDE_INSTALL_DIR}>")
|
||||
endif()
|
||||
|
||||
if (CMAKE_HOST_UNIX)
|
||||
# Make sure to link against threads (pthreads) library in order to be able to
|
||||
# make use of std::call_once in the code without producing runtime errors
|
||||
# (see also https://github.com/antlr/antlr4/issues/3708 and/or https://stackoverflow.com/q/51584960).
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
if (TARGET antlr4_shared)
|
||||
target_link_libraries(antlr4_shared Threads::Threads)
|
||||
endif()
|
||||
if (TARGET antlr4_static)
|
||||
target_link_libraries(antlr4_static Threads::Threads)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
IF(TRACE_ATN)
|
||||
ADD_DEFINITIONS(-DTRACE_ATN_SIM=1)
|
||||
ENDIF(TRACE_ATN)
|
||||
|
||||
if (ANTLR_BUILD_CPP_TESTS)
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
googletest
|
||||
URL https://github.com/google/googletest/archive/e2239ee6043f73722e7aa812a459f54a28552929.zip
|
||||
)
|
||||
|
||||
if(WITH_STATIC_CRT)
|
||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
endif()
|
||||
|
||||
FetchContent_MakeAvailable(googletest)
|
||||
|
||||
file(GLOB libantlrcpp_TESTS
|
||||
"${PROJECT_SOURCE_DIR}/runtime/tests/*.cpp"
|
||||
)
|
||||
|
||||
add_executable(
|
||||
antlr4_tests
|
||||
${libantlrcpp_TESTS}
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
antlr4_tests
|
||||
$<IF:$<TARGET_EXISTS:antlr4_static>,antlr4_static,antlr4_shared>
|
||||
gtest_main
|
||||
)
|
||||
|
||||
include(GoogleTest)
|
||||
|
||||
gtest_discover_tests(antlr4_tests)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
if (TARGET antlr4_shared)
|
||||
target_link_libraries(antlr4_shared ${COREFOUNDATION_LIBRARY})
|
||||
endif()
|
||||
if (TARGET antlr4_static)
|
||||
target_link_libraries(antlr4_static ${COREFOUNDATION_LIBRARY})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
set(disabled_compile_warnings "/wd4251")
|
||||
else()
|
||||
set(disabled_compile_warnings "-Wno-overloaded-virtual")
|
||||
endif()
|
||||
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
set(disabled_compile_warnings "${disabled_compile_warnings} -Wno-dollar-in-identifier-extension -Wno-four-char-constants")
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||
set(disabled_compile_warnings "${disabled_compile_warnings} -Wno-multichar")
|
||||
endif()
|
||||
|
||||
set(extra_share_compile_flags "")
|
||||
set(extra_static_compile_flags "")
|
||||
set(static_lib_suffix "")
|
||||
|
||||
if (WIN32)
|
||||
set(static_lib_suffix "-static")
|
||||
if (TARGET antlr4_shared)
|
||||
target_compile_definitions(antlr4_shared PUBLIC ANTLR4CPP_EXPORTS)
|
||||
endif()
|
||||
if (TARGET antlr4_static)
|
||||
target_compile_definitions(antlr4_static PUBLIC ANTLR4CPP_STATIC)
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
set(extra_share_compile_flags "-MP /wd4251")
|
||||
set(extra_static_compile_flags "-MP")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (TARGET antlr4_shared)
|
||||
set_target_properties(antlr4_shared
|
||||
PROPERTIES VERSION ${ANTLR_VERSION}
|
||||
SOVERSION ${ANTLR_VERSION}
|
||||
OUTPUT_NAME antlr4-runtime
|
||||
COMPILE_FLAGS "${disabled_compile_warnings} ${extra_share_compile_flags}")
|
||||
endif()
|
||||
|
||||
if (TARGET antlr4_static)
|
||||
set_target_properties(antlr4_static
|
||||
PROPERTIES VERSION ${ANTLR_VERSION}
|
||||
SOVERSION ${ANTLR_VERSION}
|
||||
OUTPUT_NAME "antlr4-runtime${static_lib_suffix}"
|
||||
COMPILE_PDB_NAME "antlr4-runtime${static_lib_suffix}"
|
||||
COMPILE_FLAGS "${disabled_compile_warnings} ${extra_static_compile_flags}")
|
||||
endif()
|
||||
|
||||
if (ANTLR_BUILD_CPP_TESTS)
|
||||
# Copy the generated binaries to dist folder (required by test suite)
|
||||
if (TARGET antlr4_shared)
|
||||
add_custom_command(
|
||||
TARGET antlr4_shared
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_HOME_DIRECTORY}/dist
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:antlr4_shared> ${CMAKE_HOME_DIRECTORY}/dist
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_LINKER_FILE:antlr4_shared> ${CMAKE_HOME_DIRECTORY}/dist)
|
||||
endif()
|
||||
|
||||
if (TARGET antlr4_static)
|
||||
add_custom_command(
|
||||
TARGET antlr4_static
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_HOME_DIRECTORY}/dist
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:antlr4_static> ${CMAKE_HOME_DIRECTORY}/dist)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (TARGET antlr4_shared)
|
||||
install(TARGETS antlr4_shared
|
||||
EXPORT antlr4-targets
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
endif()
|
||||
|
||||
if (TARGET antlr4_static)
|
||||
install(TARGETS antlr4_static
|
||||
EXPORT antlr4-targets
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
endif()
|
||||
|
||||
install(DIRECTORY "${PROJECT_SOURCE_DIR}/runtime/src/"
|
||||
DESTINATION "${libantlrcpp_INCLUDE_INSTALL_DIR}"
|
||||
COMPONENT dev
|
||||
FILES_MATCHING PATTERN "*.h"
|
||||
)
|
||||
@@ -1,652 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug Static|Win32">
|
||||
<Configuration>Debug Static</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug Static|x64">
|
||||
<Configuration>Debug Static</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug DLL|Win32">
|
||||
<Configuration>Debug DLL</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug DLL|x64">
|
||||
<Configuration>Debug DLL</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release Static|Win32">
|
||||
<Configuration>Release Static</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release Static|x64">
|
||||
<Configuration>Release Static</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release DLL|Win32">
|
||||
<Configuration>Release DLL</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release DLL|x64">
|
||||
<Configuration>Release DLL</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{83BE66CD-9C4F-4F84-B72A-DD1855C8FC8A}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>antlr4cpp</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2019\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName>antlr4-runtime</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2019\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName>antlr4-runtime</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2019\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName>antlr4-runtime</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2019\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName>antlr4-runtime</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2019\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName>antlr4-runtime</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2019\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName>antlr4-runtime</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2019\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName>antlr4-runtime</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2019\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName>antlr4-runtime</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_DLL;ANTLR4CPP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_DLL;ANTLR4CPP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\ANTLRErrorListener.cpp" />
|
||||
<ClCompile Include="src\ANTLRErrorStrategy.cpp" />
|
||||
<ClCompile Include="src\ANTLRFileStream.cpp" />
|
||||
<ClCompile Include="src\ANTLRInputStream.cpp" />
|
||||
<ClCompile Include="src\atn\ActionTransition.cpp" />
|
||||
<ClCompile Include="src\atn\AmbiguityInfo.cpp" />
|
||||
<ClCompile Include="src\atn\ArrayPredictionContext.cpp" />
|
||||
<ClCompile Include="src\atn\ATN.cpp" />
|
||||
<ClCompile Include="src\atn\ATNConfig.cpp" />
|
||||
<ClCompile Include="src\atn\ATNConfigSet.cpp" />
|
||||
<ClCompile Include="src\atn\ATNDeserializationOptions.cpp" />
|
||||
<ClCompile Include="src\atn\ATNDeserializer.cpp" />
|
||||
<ClCompile Include="src\atn\ATNSimulator.cpp" />
|
||||
<ClCompile Include="src\atn\ATNState.cpp" />
|
||||
<ClCompile Include="src\atn\AtomTransition.cpp" />
|
||||
<ClCompile Include="src\atn\ContextSensitivityInfo.cpp" />
|
||||
<ClCompile Include="src\atn\DecisionEventInfo.cpp" />
|
||||
<ClCompile Include="src\atn\DecisionInfo.cpp" />
|
||||
<ClCompile Include="src\atn\DecisionState.cpp" />
|
||||
<ClCompile Include="src\atn\EpsilonTransition.cpp" />
|
||||
<ClCompile Include="src\atn\ErrorInfo.cpp" />
|
||||
<ClCompile Include="src\atn\LexerAction.cpp" />
|
||||
<ClCompile Include="src\atn\LexerActionExecutor.cpp" />
|
||||
<ClCompile Include="src\atn\LexerATNConfig.cpp" />
|
||||
<ClCompile Include="src\atn\LexerATNSimulator.cpp" />
|
||||
<ClCompile Include="src\atn\LexerChannelAction.cpp" />
|
||||
<ClCompile Include="src\atn\LexerCustomAction.cpp" />
|
||||
<ClCompile Include="src\atn\LexerIndexedCustomAction.cpp" />
|
||||
<ClCompile Include="src\atn\LexerModeAction.cpp" />
|
||||
<ClCompile Include="src\atn\LexerMoreAction.cpp" />
|
||||
<ClCompile Include="src\atn\LexerPopModeAction.cpp" />
|
||||
<ClCompile Include="src\atn\LexerPushModeAction.cpp" />
|
||||
<ClCompile Include="src\atn\LexerSkipAction.cpp" />
|
||||
<ClCompile Include="src\atn\LexerTypeAction.cpp" />
|
||||
<ClCompile Include="src\atn\LL1Analyzer.cpp" />
|
||||
<ClCompile Include="src\atn\LookaheadEventInfo.cpp" />
|
||||
<ClCompile Include="src\atn\NotSetTransition.cpp" />
|
||||
<ClCompile Include="src\atn\OrderedATNConfigSet.cpp" />
|
||||
<ClCompile Include="src\atn\ParseInfo.cpp" />
|
||||
<ClCompile Include="src\atn\ParserATNSimulator.cpp" />
|
||||
<ClCompile Include="src\atn\PrecedencePredicateTransition.cpp" />
|
||||
<ClCompile Include="src\atn\PredicateEvalInfo.cpp" />
|
||||
<ClCompile Include="src\atn\PredicateTransition.cpp" />
|
||||
<ClCompile Include="src\atn\PredictionContext.cpp" />
|
||||
<ClCompile Include="src\atn\PredictionContextCache.cpp" />
|
||||
<ClCompile Include="src\atn\PredictionContextMergeCache.cpp" />
|
||||
<ClCompile Include="src\atn\PredictionMode.cpp" />
|
||||
<ClCompile Include="src\atn\ProfilingATNSimulator.cpp" />
|
||||
<ClCompile Include="src\atn\RangeTransition.cpp" />
|
||||
<ClCompile Include="src\atn\RuleTransition.cpp" />
|
||||
<ClCompile Include="src\atn\SemanticContext.cpp" />
|
||||
<ClCompile Include="src\atn\SetTransition.cpp" />
|
||||
<ClCompile Include="src\atn\SingletonPredictionContext.cpp" />
|
||||
<ClCompile Include="src\atn\StarLoopbackState.cpp" />
|
||||
<ClCompile Include="src\atn\Transition.cpp" />
|
||||
<ClCompile Include="src\atn\WildcardTransition.cpp" />
|
||||
<ClCompile Include="src\BailErrorStrategy.cpp" />
|
||||
<ClCompile Include="src\BaseErrorListener.cpp" />
|
||||
<ClCompile Include="src\BufferedTokenStream.cpp" />
|
||||
<ClCompile Include="src\CharStream.cpp" />
|
||||
<ClCompile Include="src\CommonToken.cpp" />
|
||||
<ClCompile Include="src\CommonTokenFactory.cpp" />
|
||||
<ClCompile Include="src\CommonTokenStream.cpp" />
|
||||
<ClCompile Include="src\ConsoleErrorListener.cpp" />
|
||||
<ClCompile Include="src\DefaultErrorStrategy.cpp" />
|
||||
<ClCompile Include="src\dfa\DFA.cpp" />
|
||||
<ClCompile Include="src\dfa\DFASerializer.cpp" />
|
||||
<ClCompile Include="src\dfa\DFAState.cpp" />
|
||||
<ClCompile Include="src\dfa\LexerDFASerializer.cpp" />
|
||||
<ClCompile Include="src\DiagnosticErrorListener.cpp" />
|
||||
<ClCompile Include="src\Exceptions.cpp" />
|
||||
<ClCompile Include="src\FailedPredicateException.cpp" />
|
||||
<ClCompile Include="src\InputMismatchException.cpp" />
|
||||
<ClCompile Include="src\internal\Synchronization.cpp" />
|
||||
<ClCompile Include="src\InterpreterRuleContext.cpp" />
|
||||
<ClCompile Include="src\IntStream.cpp" />
|
||||
<ClCompile Include="src\Lexer.cpp" />
|
||||
<ClCompile Include="src\LexerInterpreter.cpp" />
|
||||
<ClCompile Include="src\LexerNoViableAltException.cpp" />
|
||||
<ClCompile Include="src\ListTokenSource.cpp" />
|
||||
<ClCompile Include="src\misc\InterpreterDataReader.cpp" />
|
||||
<ClCompile Include="src\misc\Interval.cpp" />
|
||||
<ClCompile Include="src\misc\IntervalSet.cpp" />
|
||||
<ClCompile Include="src\misc\MurmurHash.cpp" />
|
||||
<ClCompile Include="src\misc\Predicate.cpp" />
|
||||
<ClCompile Include="src\NoViableAltException.cpp" />
|
||||
<ClCompile Include="src\Parser.cpp" />
|
||||
<ClCompile Include="src\ParserInterpreter.cpp" />
|
||||
<ClCompile Include="src\ParserRuleContext.cpp" />
|
||||
<ClCompile Include="src\ProxyErrorListener.cpp" />
|
||||
<ClCompile Include="src\RecognitionException.cpp" />
|
||||
<ClCompile Include="src\Recognizer.cpp" />
|
||||
<ClCompile Include="src\RuleContext.cpp" />
|
||||
<ClCompile Include="src\RuleContextWithAltNum.cpp" />
|
||||
<ClCompile Include="src\RuntimeMetaData.cpp" />
|
||||
<ClCompile Include="src\support\Any.cpp" />
|
||||
<ClCompile Include="src\support\Arrays.cpp" />
|
||||
<ClCompile Include="src\support\CPPUtils.cpp" />
|
||||
<ClCompile Include="src\support\StringUtils.cpp" />
|
||||
<ClCompile Include="src\support\Utf8.cpp" />
|
||||
<ClCompile Include="src\Token.cpp" />
|
||||
<ClCompile Include="src\TokenSource.cpp" />
|
||||
<ClCompile Include="src\TokenStream.cpp" />
|
||||
<ClCompile Include="src\TokenStreamRewriter.cpp" />
|
||||
<ClCompile Include="src\tree\ErrorNodeImpl.cpp" />
|
||||
<ClCompile Include="src\tree\IterativeParseTreeWalker.cpp" />
|
||||
<ClCompile Include="src\tree\ParseTree.cpp" />
|
||||
<ClCompile Include="src\tree\ParseTreeListener.cpp" />
|
||||
<ClCompile Include="src\tree\ParseTreeVisitor.cpp" />
|
||||
<ClCompile Include="src\tree\ParseTreeWalker.cpp" />
|
||||
<ClCompile Include="src\tree\pattern\Chunk.cpp" />
|
||||
<ClCompile Include="src\tree\pattern\ParseTreeMatch.cpp" />
|
||||
<ClCompile Include="src\tree\pattern\ParseTreePattern.cpp" />
|
||||
<ClCompile Include="src\tree\pattern\ParseTreePatternMatcher.cpp" />
|
||||
<ClCompile Include="src\tree\pattern\RuleTagToken.cpp" />
|
||||
<ClCompile Include="src\tree\pattern\TagChunk.cpp" />
|
||||
<ClCompile Include="src\tree\pattern\TextChunk.cpp" />
|
||||
<ClCompile Include="src\tree\pattern\TokenTagToken.cpp" />
|
||||
<ClCompile Include="src\tree\TerminalNodeImpl.cpp" />
|
||||
<ClCompile Include="src\tree\Trees.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPath.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPathElement.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPathLexer.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPathLexerErrorListener.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPathRuleAnywhereElement.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPathRuleElement.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPathTokenAnywhereElement.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPathTokenElement.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPathWildcardAnywhereElement.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPathWildcardElement.cpp" />
|
||||
<ClCompile Include="src\UnbufferedCharStream.cpp" />
|
||||
<ClCompile Include="src\UnbufferedTokenStream.cpp" />
|
||||
<ClCompile Include="src\Vocabulary.cpp" />
|
||||
<ClCompile Include="src\WritableToken.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\antlr4-common.h" />
|
||||
<ClInclude Include="src\ANTLRErrorListener.h" />
|
||||
<ClInclude Include="src\ANTLRErrorStrategy.h" />
|
||||
<ClInclude Include="src\ANTLRFileStream.h" />
|
||||
<ClInclude Include="src\ANTLRInputStream.h" />
|
||||
<ClInclude Include="src\atn\ActionTransition.h" />
|
||||
<ClInclude Include="src\atn\AmbiguityInfo.h" />
|
||||
<ClInclude Include="src\atn\ArrayPredictionContext.h" />
|
||||
<ClInclude Include="src\atn\ATN.h" />
|
||||
<ClInclude Include="src\atn\ATNConfig.h" />
|
||||
<ClInclude Include="src\atn\ATNConfigSet.h" />
|
||||
<ClInclude Include="src\atn\ATNDeserializationOptions.h" />
|
||||
<ClInclude Include="src\atn\ATNDeserializer.h" />
|
||||
<ClInclude Include="src\atn\ATNSimulator.h" />
|
||||
<ClInclude Include="src\atn\ATNState.h" />
|
||||
<ClInclude Include="src\atn\ATNType.h" />
|
||||
<ClInclude Include="src\atn\AtomTransition.h" />
|
||||
<ClInclude Include="src\atn\BasicBlockStartState.h" />
|
||||
<ClInclude Include="src\atn\BasicState.h" />
|
||||
<ClInclude Include="src\atn\BlockEndState.h" />
|
||||
<ClInclude Include="src\atn\BlockStartState.h" />
|
||||
<ClInclude Include="src\atn\ContextSensitivityInfo.h" />
|
||||
<ClInclude Include="src\atn\DecisionEventInfo.h" />
|
||||
<ClInclude Include="src\atn\DecisionInfo.h" />
|
||||
<ClInclude Include="src\atn\DecisionState.h" />
|
||||
<ClInclude Include="src\atn\EpsilonTransition.h" />
|
||||
<ClInclude Include="src\atn\ErrorInfo.h" />
|
||||
<ClInclude Include="src\atn\LexerAction.h" />
|
||||
<ClInclude Include="src\atn\LexerActionExecutor.h" />
|
||||
<ClInclude Include="src\atn\LexerActionType.h" />
|
||||
<ClInclude Include="src\atn\LexerATNConfig.h" />
|
||||
<ClInclude Include="src\atn\LexerATNSimulator.h" />
|
||||
<ClInclude Include="src\atn\LexerChannelAction.h" />
|
||||
<ClInclude Include="src\atn\LexerCustomAction.h" />
|
||||
<ClInclude Include="src\atn\LexerIndexedCustomAction.h" />
|
||||
<ClInclude Include="src\atn\LexerModeAction.h" />
|
||||
<ClInclude Include="src\atn\LexerMoreAction.h" />
|
||||
<ClInclude Include="src\atn\LexerPopModeAction.h" />
|
||||
<ClInclude Include="src\atn\LexerPushModeAction.h" />
|
||||
<ClInclude Include="src\atn\LexerSkipAction.h" />
|
||||
<ClInclude Include="src\atn\LexerTypeAction.h" />
|
||||
<ClInclude Include="src\atn\LL1Analyzer.h" />
|
||||
<ClInclude Include="src\atn\LookaheadEventInfo.h" />
|
||||
<ClInclude Include="src\atn\LoopEndState.h" />
|
||||
<ClInclude Include="src\atn\NotSetTransition.h" />
|
||||
<ClInclude Include="src\atn\OrderedATNConfigSet.h" />
|
||||
<ClInclude Include="src\atn\ParseInfo.h" />
|
||||
<ClInclude Include="src\atn\ParserATNSimulator.h" />
|
||||
<ClInclude Include="src\atn\PlusBlockStartState.h" />
|
||||
<ClInclude Include="src\atn\PlusLoopbackState.h" />
|
||||
<ClInclude Include="src\atn\PrecedencePredicateTransition.h" />
|
||||
<ClInclude Include="src\atn\PredicateEvalInfo.h" />
|
||||
<ClInclude Include="src\atn\PredicateTransition.h" />
|
||||
<ClInclude Include="src\atn\PredictionContext.h" />
|
||||
<ClInclude Include="src\atn\PredictionContextCache.h" />
|
||||
<ClInclude Include="src\atn\PredictionContextMergeCache.h" />
|
||||
<ClInclude Include="src\atn\PredictionContextMergeCacheOptions.h" />
|
||||
<ClInclude Include="src\atn\PredictionMode.h" />
|
||||
<ClInclude Include="src\atn\ProfilingATNSimulator.h" />
|
||||
<ClInclude Include="src\atn\RangeTransition.h" />
|
||||
<ClInclude Include="src\atn\RuleStartState.h" />
|
||||
<ClInclude Include="src\atn\RuleStopState.h" />
|
||||
<ClInclude Include="src\atn\RuleTransition.h" />
|
||||
<ClInclude Include="src\atn\SemanticContext.h" />
|
||||
<ClInclude Include="src\atn\SetTransition.h" />
|
||||
<ClInclude Include="src\atn\SingletonPredictionContext.h" />
|
||||
<ClInclude Include="src\atn\StarBlockStartState.h" />
|
||||
<ClInclude Include="src\atn\StarLoopbackState.h" />
|
||||
<ClInclude Include="src\atn\StarLoopEntryState.h" />
|
||||
<ClInclude Include="src\atn\TokensStartState.h" />
|
||||
<ClInclude Include="src\atn\Transition.h" />
|
||||
<ClInclude Include="src\atn\WildcardTransition.h" />
|
||||
<ClInclude Include="src\BailErrorStrategy.h" />
|
||||
<ClInclude Include="src\BaseErrorListener.h" />
|
||||
<ClInclude Include="src\BufferedTokenStream.h" />
|
||||
<ClInclude Include="src\CharStream.h" />
|
||||
<ClInclude Include="src\CommonToken.h" />
|
||||
<ClInclude Include="src\CommonTokenFactory.h" />
|
||||
<ClInclude Include="src\CommonTokenStream.h" />
|
||||
<ClInclude Include="src\ConsoleErrorListener.h" />
|
||||
<ClInclude Include="src\DefaultErrorStrategy.h" />
|
||||
<ClInclude Include="src\dfa\DFA.h" />
|
||||
<ClInclude Include="src\dfa\DFASerializer.h" />
|
||||
<ClInclude Include="src\dfa\DFAState.h" />
|
||||
<ClInclude Include="src\dfa\LexerDFASerializer.h" />
|
||||
<ClInclude Include="src\DiagnosticErrorListener.h" />
|
||||
<ClInclude Include="src\Exceptions.h" />
|
||||
<ClInclude Include="src\FailedPredicateException.h" />
|
||||
<ClInclude Include="src\InputMismatchException.h" />
|
||||
<ClInclude Include="src\internal\Synchronization.h" />
|
||||
<ClInclude Include="src\InterpreterRuleContext.h" />
|
||||
<ClInclude Include="src\IntStream.h" />
|
||||
<ClInclude Include="src\Lexer.h" />
|
||||
<ClInclude Include="src\LexerInterpreter.h" />
|
||||
<ClInclude Include="src\LexerNoViableAltException.h" />
|
||||
<ClInclude Include="src\ListTokenSource.h" />
|
||||
<ClInclude Include="src\misc\InterpreterDataReader.h" />
|
||||
<ClInclude Include="src\misc\Interval.h" />
|
||||
<ClInclude Include="src\misc\IntervalSet.h" />
|
||||
<ClInclude Include="src\misc\MurmurHash.h" />
|
||||
<ClInclude Include="src\misc\Predicate.h" />
|
||||
<ClInclude Include="src\NoViableAltException.h" />
|
||||
<ClInclude Include="src\Parser.h" />
|
||||
<ClInclude Include="src\ParserInterpreter.h" />
|
||||
<ClInclude Include="src\ParserRuleContext.h" />
|
||||
<ClInclude Include="src\ProxyErrorListener.h" />
|
||||
<ClInclude Include="src\RecognitionException.h" />
|
||||
<ClInclude Include="src\Recognizer.h" />
|
||||
<ClInclude Include="src\RuleContext.h" />
|
||||
<ClInclude Include="src\RuleContextWithAltNum.h" />
|
||||
<ClInclude Include="src\RuntimeMetaData.h" />
|
||||
<ClInclude Include="src\support\Any.h" />
|
||||
<ClInclude Include="src\support\Arrays.h" />
|
||||
<ClInclude Include="src\support\BitSet.h" />
|
||||
<ClInclude Include="src\support\Casts.h" />
|
||||
<ClInclude Include="src\support\CPPUtils.h" />
|
||||
<ClInclude Include="src\support\Declarations.h" />
|
||||
<ClInclude Include="src\support\StringUtils.h" />
|
||||
<ClInclude Include="src\support\Unicode.h" />
|
||||
<ClInclude Include="src\support\Utf8.h" />
|
||||
<ClInclude Include="src\Token.h" />
|
||||
<ClInclude Include="src\TokenFactory.h" />
|
||||
<ClInclude Include="src\TokenSource.h" />
|
||||
<ClInclude Include="src\TokenStream.h" />
|
||||
<ClInclude Include="src\TokenStreamRewriter.h" />
|
||||
<ClInclude Include="src\tree\AbstractParseTreeVisitor.h" />
|
||||
<ClInclude Include="src\tree\ErrorNode.h" />
|
||||
<ClInclude Include="src\tree\ErrorNodeImpl.h" />
|
||||
<ClInclude Include="src\tree\IterativeParseTreeWalker.h" />
|
||||
<ClInclude Include="src\tree\ParseTree.h" />
|
||||
<ClInclude Include="src\tree\ParseTreeListener.h" />
|
||||
<ClInclude Include="src\tree\ParseTreeProperty.h" />
|
||||
<ClInclude Include="src\tree\ParseTreeVisitor.h" />
|
||||
<ClInclude Include="src\tree\ParseTreeWalker.h" />
|
||||
<ClInclude Include="src\tree\pattern\Chunk.h" />
|
||||
<ClInclude Include="src\tree\pattern\ParseTreeMatch.h" />
|
||||
<ClInclude Include="src\tree\pattern\ParseTreePattern.h" />
|
||||
<ClInclude Include="src\tree\pattern\ParseTreePatternMatcher.h" />
|
||||
<ClInclude Include="src\tree\pattern\RuleTagToken.h" />
|
||||
<ClInclude Include="src\tree\pattern\TagChunk.h" />
|
||||
<ClInclude Include="src\tree\pattern\TextChunk.h" />
|
||||
<ClInclude Include="src\tree\pattern\TokenTagToken.h" />
|
||||
<ClInclude Include="src\tree\TerminalNode.h" />
|
||||
<ClInclude Include="src\tree\TerminalNodeImpl.h" />
|
||||
<ClInclude Include="src\tree\Trees.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPath.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPathElement.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPathLexer.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPathLexerErrorListener.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPathRuleAnywhereElement.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPathRuleElement.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPathTokenAnywhereElement.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPathTokenElement.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPathWildcardAnywhereElement.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPathWildcardElement.h" />
|
||||
<ClInclude Include="src\UnbufferedCharStream.h" />
|
||||
<ClInclude Include="src\UnbufferedTokenStream.h" />
|
||||
<ClInclude Include="src\Vocabulary.h" />
|
||||
<ClInclude Include="src\WritableToken.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -1,948 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\atn">
|
||||
<UniqueIdentifier>{587a2726-4856-4d21-937a-fbaebaa90232}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\atn">
|
||||
<UniqueIdentifier>{2662156f-1508-4dad-b991-a8298a6db9bf}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\dfa">
|
||||
<UniqueIdentifier>{5b1e59b1-7fa5-46a5-8d92-965bd709cca0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\dfa">
|
||||
<UniqueIdentifier>{9de9fe74-5d67-441d-a972-3cebe6dfbfcc}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\misc">
|
||||
<UniqueIdentifier>{89fd3896-0ab1-476d-8d64-a57f10a5e73b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\misc">
|
||||
<UniqueIdentifier>{23939d7b-8e11-421e-80eb-b2cfdfdd64e9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\support">
|
||||
<UniqueIdentifier>{05f2bacb-b5b2-4ca3-abe1-ca9a7239ecaa}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\support">
|
||||
<UniqueIdentifier>{d3b2ae2d-836b-4c73-8180-aca4ebb7d658}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\tree">
|
||||
<UniqueIdentifier>{6674a0f0-c65d-4a00-a9e5-1f243b89d0a2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\tree">
|
||||
<UniqueIdentifier>{1893fffe-7a2b-4708-8ce5-003aa9b749f7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\tree\pattern">
|
||||
<UniqueIdentifier>{053a0632-27bc-4043-b5e8-760951b3b5b9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\tree\pattern">
|
||||
<UniqueIdentifier>{048c180d-44cf-49ca-a7aa-d0053fea07f5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\tree\xpath">
|
||||
<UniqueIdentifier>{3181cae5-cc15-4050-8c45-22af44a823de}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\tree\xpath">
|
||||
<UniqueIdentifier>{290632d2-c56e-4005-a417-eb83b9531e1a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\internal">
|
||||
<UniqueIdentifier>{b4b32b3f-e97a-448a-98e6-cbf901862bd4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\internal">
|
||||
<UniqueIdentifier>{f8c2bdf9-7e81-4f31-ba17-06b16ba2f081}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\ANTLRErrorListener.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\ANTLRErrorStrategy.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\ANTLRFileStream.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\ANTLRInputStream.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\BailErrorStrategy.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\BaseErrorListener.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\BufferedTokenStream.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\CharStream.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\CommonToken.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\CommonTokenFactory.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\CommonTokenStream.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\ConsoleErrorListener.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\DefaultErrorStrategy.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\DiagnosticErrorListener.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\Exceptions.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\FailedPredicateException.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\InputMismatchException.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\InterpreterRuleContext.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\IntStream.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\Lexer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\LexerInterpreter.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\LexerNoViableAltException.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\ListTokenSource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\NoViableAltException.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\Parser.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\ParserInterpreter.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\ParserRuleContext.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\ProxyErrorListener.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\RecognitionException.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\Recognizer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\RuleContext.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\Token.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\TokenFactory.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\TokenSource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\TokenStream.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\TokenStreamRewriter.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\UnbufferedCharStream.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\UnbufferedTokenStream.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\WritableToken.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\DecisionState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\EpsilonTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerATNConfig.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerATNSimulator.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LL1Analyzer.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LoopEndState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\NotSetTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\OrderedATNConfigSet.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ParserATNSimulator.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PlusBlockStartState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PlusLoopbackState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PrecedencePredicateTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PredicateTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PredictionContext.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PredictionMode.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\RangeTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\RuleStartState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\RuleStopState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\RuleTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\SemanticContext.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\SetTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\SingletonPredictionContext.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\StarBlockStartState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\StarLoopbackState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\StarLoopEntryState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\TokensStartState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\Transition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\WildcardTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ActionTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ArrayPredictionContext.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ATN.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ATNConfig.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ATNConfigSet.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ATNDeserializationOptions.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ATNDeserializer.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ATNSimulator.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ATNState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ATNType.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\AtomTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\BasicBlockStartState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\BasicState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\BlockEndState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\BlockStartState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\dfa\LexerDFASerializer.h">
|
||||
<Filter>Header Files\dfa</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\dfa\DFA.h">
|
||||
<Filter>Header Files\dfa</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\dfa\DFASerializer.h">
|
||||
<Filter>Header Files\dfa</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\dfa\DFAState.h">
|
||||
<Filter>Header Files\dfa</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\misc\Interval.h">
|
||||
<Filter>Header Files\misc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\misc\IntervalSet.h">
|
||||
<Filter>Header Files\misc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\misc\MurmurHash.h">
|
||||
<Filter>Header Files\misc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\support\Arrays.h">
|
||||
<Filter>Header Files\support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\support\BitSet.h">
|
||||
<Filter>Header Files\support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\support\CPPUtils.h">
|
||||
<Filter>Header Files\support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\support\Declarations.h">
|
||||
<Filter>Header Files\support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\AbstractParseTreeVisitor.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\ErrorNode.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\ErrorNodeImpl.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\ParseTree.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\ParseTreeListener.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\ParseTreeProperty.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\ParseTreeVisitor.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\ParseTreeWalker.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\TerminalNode.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\TerminalNodeImpl.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\Trees.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\pattern\Chunk.h">
|
||||
<Filter>Header Files\tree\pattern</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\pattern\ParseTreeMatch.h">
|
||||
<Filter>Header Files\tree\pattern</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\pattern\ParseTreePattern.h">
|
||||
<Filter>Header Files\tree\pattern</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\pattern\ParseTreePatternMatcher.h">
|
||||
<Filter>Header Files\tree\pattern</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\pattern\RuleTagToken.h">
|
||||
<Filter>Header Files\tree\pattern</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\pattern\TagChunk.h">
|
||||
<Filter>Header Files\tree\pattern</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\pattern\TextChunk.h">
|
||||
<Filter>Header Files\tree\pattern</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\pattern\TokenTagToken.h">
|
||||
<Filter>Header Files\tree\pattern</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPathLexer.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\Vocabulary.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\AmbiguityInfo.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ContextSensitivityInfo.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\DecisionEventInfo.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\DecisionInfo.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ErrorInfo.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerActionExecutor.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerActionType.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerChannelAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerCustomAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerIndexedCustomAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerModeAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerMoreAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerPopModeAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerPushModeAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerSkipAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerTypeAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LookaheadEventInfo.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ParseInfo.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PredicateEvalInfo.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ProfilingATNSimulator.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\misc\Predicate.h">
|
||||
<Filter>Header Files\misc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\RuleContextWithAltNum.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\RuntimeMetaData.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\support\StringUtils.h">
|
||||
<Filter>Header Files\support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPath.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPathElement.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPathLexerErrorListener.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPathRuleAnywhereElement.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPathRuleElement.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPathTokenAnywhereElement.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPathTokenElement.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPathWildcardAnywhereElement.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPathWildcardElement.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\antlr4-common.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\IterativeParseTreeWalker.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\misc\InterpreterDataReader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\internal\Synchronization.h">
|
||||
<Filter>Header Files\internal</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\support\Casts.h">
|
||||
<Filter>Header Files\support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\support\Unicode.h">
|
||||
<Filter>Header Files\support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\support\Any.h">
|
||||
<Filter>Header Files\support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\support\Utf8.h">
|
||||
<Filter>Header Files\support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PredictionContextMergeCache.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PredictionContextMergeCacheOptions.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PredictionContextCache.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\ANTLRFileStream.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\ANTLRInputStream.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\BailErrorStrategy.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\BaseErrorListener.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\BufferedTokenStream.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\CharStream.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\CommonToken.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\CommonTokenFactory.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\CommonTokenStream.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\ConsoleErrorListener.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\DefaultErrorStrategy.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\DiagnosticErrorListener.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\Exceptions.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\FailedPredicateException.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\InputMismatchException.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\InterpreterRuleContext.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\IntStream.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\Lexer.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\LexerInterpreter.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\LexerNoViableAltException.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\ListTokenSource.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\NoViableAltException.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\Parser.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\ParserInterpreter.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\ParserRuleContext.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\ProxyErrorListener.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\RecognitionException.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\Recognizer.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\RuleContext.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\TokenStream.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\TokenStreamRewriter.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\UnbufferedCharStream.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\UnbufferedTokenStream.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ActionTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ArrayPredictionContext.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ATN.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ATNConfig.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ATNConfigSet.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ATNDeserializationOptions.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ATNDeserializer.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ATNSimulator.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ATNState.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\AtomTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\DecisionState.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\EpsilonTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerATNConfig.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerATNSimulator.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LL1Analyzer.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\NotSetTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\OrderedATNConfigSet.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ParserATNSimulator.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\PrecedencePredicateTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\PredicateTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\PredictionContext.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\PredictionMode.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\RangeTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\RuleTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\SemanticContext.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\SetTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\SingletonPredictionContext.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\StarLoopbackState.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\Transition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\WildcardTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\dfa\DFA.cpp">
|
||||
<Filter>Source Files\dfa</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\dfa\DFASerializer.cpp">
|
||||
<Filter>Source Files\dfa</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\dfa\DFAState.cpp">
|
||||
<Filter>Source Files\dfa</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\dfa\LexerDFASerializer.cpp">
|
||||
<Filter>Source Files\dfa</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\misc\Interval.cpp">
|
||||
<Filter>Source Files\misc</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\misc\IntervalSet.cpp">
|
||||
<Filter>Source Files\misc</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\misc\MurmurHash.cpp">
|
||||
<Filter>Source Files\misc</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\support\Arrays.cpp">
|
||||
<Filter>Source Files\support</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\support\CPPUtils.cpp">
|
||||
<Filter>Source Files\support</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\ErrorNodeImpl.cpp">
|
||||
<Filter>Source Files\tree</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\ParseTreeWalker.cpp">
|
||||
<Filter>Source Files\tree</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\TerminalNodeImpl.cpp">
|
||||
<Filter>Source Files\tree</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\Trees.cpp">
|
||||
<Filter>Source Files\tree</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\pattern\ParseTreeMatch.cpp">
|
||||
<Filter>Source Files\tree\pattern</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\pattern\ParseTreePattern.cpp">
|
||||
<Filter>Source Files\tree\pattern</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\pattern\ParseTreePatternMatcher.cpp">
|
||||
<Filter>Source Files\tree\pattern</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\pattern\RuleTagToken.cpp">
|
||||
<Filter>Source Files\tree\pattern</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\pattern\TagChunk.cpp">
|
||||
<Filter>Source Files\tree\pattern</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\pattern\TextChunk.cpp">
|
||||
<Filter>Source Files\tree\pattern</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\pattern\TokenTagToken.cpp">
|
||||
<Filter>Source Files\tree\pattern</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\AmbiguityInfo.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ContextSensitivityInfo.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\DecisionEventInfo.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\DecisionInfo.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ErrorInfo.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerActionExecutor.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerChannelAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerCustomAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerIndexedCustomAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerModeAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerMoreAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerPopModeAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerPushModeAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerSkipAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerTypeAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LookaheadEventInfo.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ParseInfo.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\PredicateEvalInfo.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ProfilingATNSimulator.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\RuleContextWithAltNum.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\RuntimeMetaData.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\support\StringUtils.cpp">
|
||||
<Filter>Source Files\support</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPath.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPathElement.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPathLexer.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPathLexerErrorListener.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPathRuleAnywhereElement.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPathRuleElement.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPathTokenAnywhereElement.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPathTokenElement.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPathWildcardAnywhereElement.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPathWildcardElement.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\Vocabulary.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\ParseTree.cpp">
|
||||
<Filter>Source Files\tree</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\IterativeParseTreeWalker.cpp">
|
||||
<Filter>Source Files\tree</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\misc\InterpreterDataReader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\ANTLRErrorListener.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\ANTLRErrorStrategy.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\misc\Predicate.cpp">
|
||||
<Filter>Source Files\misc</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\Token.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\TokenSource.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\WritableToken.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\support\Any.cpp">
|
||||
<Filter>Source Files\support</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\ParseTreeListener.cpp">
|
||||
<Filter>Source Files\tree</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\ParseTreeVisitor.cpp">
|
||||
<Filter>Source Files\tree</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\pattern\Chunk.cpp">
|
||||
<Filter>Source Files\tree\pattern</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\internal\Synchronization.cpp">
|
||||
<Filter>Source Files\internal</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\support\Utf8.cpp">
|
||||
<Filter>Source Files\support</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\PredictionContextMergeCache.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\PredictionContextCache.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,652 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug Static|Win32">
|
||||
<Configuration>Debug Static</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug Static|x64">
|
||||
<Configuration>Debug Static</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug DLL|Win32">
|
||||
<Configuration>Debug DLL</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug DLL|x64">
|
||||
<Configuration>Debug DLL</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release Static|Win32">
|
||||
<Configuration>Release Static</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release Static|x64">
|
||||
<Configuration>Release Static</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release DLL|Win32">
|
||||
<Configuration>Release DLL</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release DLL|x64">
|
||||
<Configuration>Release DLL</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{52618D4B-6EC4-49AD-8B83-52686244E8F3}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>antlr4cpp</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2022\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName>antlr4-runtime</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2022\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName>antlr4-runtime</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2022\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName>antlr4-runtime</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2022\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName>antlr4-runtime</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2022\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName>antlr4-runtime</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2022\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName>antlr4-runtime</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2022\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName>antlr4-runtime</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\vs-2022\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(PlatformTarget)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
<TargetName>antlr4-runtime</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_DLL;ANTLR4CPP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_DLL;ANTLR4CPP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
<ForcedIncludeFiles>
|
||||
</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4251</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\ANTLRErrorListener.cpp" />
|
||||
<ClCompile Include="src\ANTLRErrorStrategy.cpp" />
|
||||
<ClCompile Include="src\ANTLRFileStream.cpp" />
|
||||
<ClCompile Include="src\ANTLRInputStream.cpp" />
|
||||
<ClCompile Include="src\atn\ActionTransition.cpp" />
|
||||
<ClCompile Include="src\atn\AmbiguityInfo.cpp" />
|
||||
<ClCompile Include="src\atn\ArrayPredictionContext.cpp" />
|
||||
<ClCompile Include="src\atn\ATN.cpp" />
|
||||
<ClCompile Include="src\atn\ATNConfig.cpp" />
|
||||
<ClCompile Include="src\atn\ATNConfigSet.cpp" />
|
||||
<ClCompile Include="src\atn\ATNDeserializationOptions.cpp" />
|
||||
<ClCompile Include="src\atn\ATNDeserializer.cpp" />
|
||||
<ClCompile Include="src\atn\ATNSimulator.cpp" />
|
||||
<ClCompile Include="src\atn\ATNState.cpp" />
|
||||
<ClCompile Include="src\atn\AtomTransition.cpp" />
|
||||
<ClCompile Include="src\atn\ContextSensitivityInfo.cpp" />
|
||||
<ClCompile Include="src\atn\DecisionEventInfo.cpp" />
|
||||
<ClCompile Include="src\atn\DecisionInfo.cpp" />
|
||||
<ClCompile Include="src\atn\DecisionState.cpp" />
|
||||
<ClCompile Include="src\atn\EpsilonTransition.cpp" />
|
||||
<ClCompile Include="src\atn\ErrorInfo.cpp" />
|
||||
<ClCompile Include="src\atn\LexerAction.cpp" />
|
||||
<ClCompile Include="src\atn\LexerActionExecutor.cpp" />
|
||||
<ClCompile Include="src\atn\LexerATNConfig.cpp" />
|
||||
<ClCompile Include="src\atn\LexerATNSimulator.cpp" />
|
||||
<ClCompile Include="src\atn\LexerChannelAction.cpp" />
|
||||
<ClCompile Include="src\atn\LexerCustomAction.cpp" />
|
||||
<ClCompile Include="src\atn\LexerIndexedCustomAction.cpp" />
|
||||
<ClCompile Include="src\atn\LexerModeAction.cpp" />
|
||||
<ClCompile Include="src\atn\LexerMoreAction.cpp" />
|
||||
<ClCompile Include="src\atn\LexerPopModeAction.cpp" />
|
||||
<ClCompile Include="src\atn\LexerPushModeAction.cpp" />
|
||||
<ClCompile Include="src\atn\LexerSkipAction.cpp" />
|
||||
<ClCompile Include="src\atn\LexerTypeAction.cpp" />
|
||||
<ClCompile Include="src\atn\LL1Analyzer.cpp" />
|
||||
<ClCompile Include="src\atn\LookaheadEventInfo.cpp" />
|
||||
<ClCompile Include="src\atn\NotSetTransition.cpp" />
|
||||
<ClCompile Include="src\atn\OrderedATNConfigSet.cpp" />
|
||||
<ClCompile Include="src\atn\ParseInfo.cpp" />
|
||||
<ClCompile Include="src\atn\ParserATNSimulator.cpp" />
|
||||
<ClCompile Include="src\atn\PrecedencePredicateTransition.cpp" />
|
||||
<ClCompile Include="src\atn\PredicateEvalInfo.cpp" />
|
||||
<ClCompile Include="src\atn\PredicateTransition.cpp" />
|
||||
<ClCompile Include="src\atn\PredictionContext.cpp" />
|
||||
<ClCompile Include="src\atn\PredictionContextCache.cpp" />
|
||||
<ClCompile Include="src\atn\PredictionContextMergeCache.cpp" />
|
||||
<ClCompile Include="src\atn\PredictionMode.cpp" />
|
||||
<ClCompile Include="src\atn\ProfilingATNSimulator.cpp" />
|
||||
<ClCompile Include="src\atn\RangeTransition.cpp" />
|
||||
<ClCompile Include="src\atn\RuleTransition.cpp" />
|
||||
<ClCompile Include="src\atn\SemanticContext.cpp" />
|
||||
<ClCompile Include="src\atn\SetTransition.cpp" />
|
||||
<ClCompile Include="src\atn\SingletonPredictionContext.cpp" />
|
||||
<ClCompile Include="src\atn\StarLoopbackState.cpp" />
|
||||
<ClCompile Include="src\atn\Transition.cpp" />
|
||||
<ClCompile Include="src\atn\WildcardTransition.cpp" />
|
||||
<ClCompile Include="src\BailErrorStrategy.cpp" />
|
||||
<ClCompile Include="src\BaseErrorListener.cpp" />
|
||||
<ClCompile Include="src\BufferedTokenStream.cpp" />
|
||||
<ClCompile Include="src\CharStream.cpp" />
|
||||
<ClCompile Include="src\CommonToken.cpp" />
|
||||
<ClCompile Include="src\CommonTokenFactory.cpp" />
|
||||
<ClCompile Include="src\CommonTokenStream.cpp" />
|
||||
<ClCompile Include="src\ConsoleErrorListener.cpp" />
|
||||
<ClCompile Include="src\DefaultErrorStrategy.cpp" />
|
||||
<ClCompile Include="src\dfa\DFA.cpp" />
|
||||
<ClCompile Include="src\dfa\DFASerializer.cpp" />
|
||||
<ClCompile Include="src\dfa\DFAState.cpp" />
|
||||
<ClCompile Include="src\dfa\LexerDFASerializer.cpp" />
|
||||
<ClCompile Include="src\DiagnosticErrorListener.cpp" />
|
||||
<ClCompile Include="src\Exceptions.cpp" />
|
||||
<ClCompile Include="src\FailedPredicateException.cpp" />
|
||||
<ClCompile Include="src\InputMismatchException.cpp" />
|
||||
<ClCompile Include="src\internal\Synchronization.cpp" />
|
||||
<ClCompile Include="src\InterpreterRuleContext.cpp" />
|
||||
<ClCompile Include="src\IntStream.cpp" />
|
||||
<ClCompile Include="src\Lexer.cpp" />
|
||||
<ClCompile Include="src\LexerInterpreter.cpp" />
|
||||
<ClCompile Include="src\LexerNoViableAltException.cpp" />
|
||||
<ClCompile Include="src\ListTokenSource.cpp" />
|
||||
<ClCompile Include="src\misc\InterpreterDataReader.cpp" />
|
||||
<ClCompile Include="src\misc\Interval.cpp" />
|
||||
<ClCompile Include="src\misc\IntervalSet.cpp" />
|
||||
<ClCompile Include="src\misc\MurmurHash.cpp" />
|
||||
<ClCompile Include="src\misc\Predicate.cpp" />
|
||||
<ClCompile Include="src\NoViableAltException.cpp" />
|
||||
<ClCompile Include="src\Parser.cpp" />
|
||||
<ClCompile Include="src\ParserInterpreter.cpp" />
|
||||
<ClCompile Include="src\ParserRuleContext.cpp" />
|
||||
<ClCompile Include="src\ProxyErrorListener.cpp" />
|
||||
<ClCompile Include="src\RecognitionException.cpp" />
|
||||
<ClCompile Include="src\Recognizer.cpp" />
|
||||
<ClCompile Include="src\RuleContext.cpp" />
|
||||
<ClCompile Include="src\RuleContextWithAltNum.cpp" />
|
||||
<ClCompile Include="src\RuntimeMetaData.cpp" />
|
||||
<ClCompile Include="src\support\Any.cpp" />
|
||||
<ClCompile Include="src\support\Arrays.cpp" />
|
||||
<ClCompile Include="src\support\CPPUtils.cpp" />
|
||||
<ClCompile Include="src\support\StringUtils.cpp" />
|
||||
<ClCompile Include="src\support\Utf8.cpp" />
|
||||
<ClCompile Include="src\Token.cpp" />
|
||||
<ClCompile Include="src\TokenSource.cpp" />
|
||||
<ClCompile Include="src\TokenStream.cpp" />
|
||||
<ClCompile Include="src\TokenStreamRewriter.cpp" />
|
||||
<ClCompile Include="src\tree\ErrorNodeImpl.cpp" />
|
||||
<ClCompile Include="src\tree\IterativeParseTreeWalker.cpp" />
|
||||
<ClCompile Include="src\tree\ParseTree.cpp" />
|
||||
<ClCompile Include="src\tree\ParseTreeListener.cpp" />
|
||||
<ClCompile Include="src\tree\ParseTreeVisitor.cpp" />
|
||||
<ClCompile Include="src\tree\ParseTreeWalker.cpp" />
|
||||
<ClCompile Include="src\tree\pattern\Chunk.cpp" />
|
||||
<ClCompile Include="src\tree\pattern\ParseTreeMatch.cpp" />
|
||||
<ClCompile Include="src\tree\pattern\ParseTreePattern.cpp" />
|
||||
<ClCompile Include="src\tree\pattern\ParseTreePatternMatcher.cpp" />
|
||||
<ClCompile Include="src\tree\pattern\RuleTagToken.cpp" />
|
||||
<ClCompile Include="src\tree\pattern\TagChunk.cpp" />
|
||||
<ClCompile Include="src\tree\pattern\TextChunk.cpp" />
|
||||
<ClCompile Include="src\tree\pattern\TokenTagToken.cpp" />
|
||||
<ClCompile Include="src\tree\TerminalNodeImpl.cpp" />
|
||||
<ClCompile Include="src\tree\Trees.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPath.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPathElement.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPathLexer.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPathLexerErrorListener.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPathRuleAnywhereElement.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPathRuleElement.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPathTokenAnywhereElement.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPathTokenElement.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPathWildcardAnywhereElement.cpp" />
|
||||
<ClCompile Include="src\tree\xpath\XPathWildcardElement.cpp" />
|
||||
<ClCompile Include="src\UnbufferedCharStream.cpp" />
|
||||
<ClCompile Include="src\UnbufferedTokenStream.cpp" />
|
||||
<ClCompile Include="src\Vocabulary.cpp" />
|
||||
<ClCompile Include="src\WritableToken.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\antlr4-common.h" />
|
||||
<ClInclude Include="src\ANTLRErrorListener.h" />
|
||||
<ClInclude Include="src\ANTLRErrorStrategy.h" />
|
||||
<ClInclude Include="src\ANTLRFileStream.h" />
|
||||
<ClInclude Include="src\ANTLRInputStream.h" />
|
||||
<ClInclude Include="src\atn\ActionTransition.h" />
|
||||
<ClInclude Include="src\atn\AmbiguityInfo.h" />
|
||||
<ClInclude Include="src\atn\ArrayPredictionContext.h" />
|
||||
<ClInclude Include="src\atn\ATN.h" />
|
||||
<ClInclude Include="src\atn\ATNConfig.h" />
|
||||
<ClInclude Include="src\atn\ATNConfigSet.h" />
|
||||
<ClInclude Include="src\atn\ATNDeserializationOptions.h" />
|
||||
<ClInclude Include="src\atn\ATNDeserializer.h" />
|
||||
<ClInclude Include="src\atn\ATNSimulator.h" />
|
||||
<ClInclude Include="src\atn\ATNState.h" />
|
||||
<ClInclude Include="src\atn\ATNType.h" />
|
||||
<ClInclude Include="src\atn\AtomTransition.h" />
|
||||
<ClInclude Include="src\atn\BasicBlockStartState.h" />
|
||||
<ClInclude Include="src\atn\BasicState.h" />
|
||||
<ClInclude Include="src\atn\BlockEndState.h" />
|
||||
<ClInclude Include="src\atn\BlockStartState.h" />
|
||||
<ClInclude Include="src\atn\ContextSensitivityInfo.h" />
|
||||
<ClInclude Include="src\atn\DecisionEventInfo.h" />
|
||||
<ClInclude Include="src\atn\DecisionInfo.h" />
|
||||
<ClInclude Include="src\atn\DecisionState.h" />
|
||||
<ClInclude Include="src\atn\EpsilonTransition.h" />
|
||||
<ClInclude Include="src\atn\ErrorInfo.h" />
|
||||
<ClInclude Include="src\atn\LexerAction.h" />
|
||||
<ClInclude Include="src\atn\LexerActionExecutor.h" />
|
||||
<ClInclude Include="src\atn\LexerActionType.h" />
|
||||
<ClInclude Include="src\atn\LexerATNConfig.h" />
|
||||
<ClInclude Include="src\atn\LexerATNSimulator.h" />
|
||||
<ClInclude Include="src\atn\LexerChannelAction.h" />
|
||||
<ClInclude Include="src\atn\LexerCustomAction.h" />
|
||||
<ClInclude Include="src\atn\LexerIndexedCustomAction.h" />
|
||||
<ClInclude Include="src\atn\LexerModeAction.h" />
|
||||
<ClInclude Include="src\atn\LexerMoreAction.h" />
|
||||
<ClInclude Include="src\atn\LexerPopModeAction.h" />
|
||||
<ClInclude Include="src\atn\LexerPushModeAction.h" />
|
||||
<ClInclude Include="src\atn\LexerSkipAction.h" />
|
||||
<ClInclude Include="src\atn\LexerTypeAction.h" />
|
||||
<ClInclude Include="src\atn\LL1Analyzer.h" />
|
||||
<ClInclude Include="src\atn\LookaheadEventInfo.h" />
|
||||
<ClInclude Include="src\atn\LoopEndState.h" />
|
||||
<ClInclude Include="src\atn\NotSetTransition.h" />
|
||||
<ClInclude Include="src\atn\OrderedATNConfigSet.h" />
|
||||
<ClInclude Include="src\atn\ParseInfo.h" />
|
||||
<ClInclude Include="src\atn\ParserATNSimulator.h" />
|
||||
<ClInclude Include="src\atn\PlusBlockStartState.h" />
|
||||
<ClInclude Include="src\atn\PlusLoopbackState.h" />
|
||||
<ClInclude Include="src\atn\PrecedencePredicateTransition.h" />
|
||||
<ClInclude Include="src\atn\PredicateEvalInfo.h" />
|
||||
<ClInclude Include="src\atn\PredicateTransition.h" />
|
||||
<ClInclude Include="src\atn\PredictionContext.h" />
|
||||
<ClInclude Include="src\atn\PredictionContextCache.h" />
|
||||
<ClInclude Include="src\atn\PredictionContextMergeCache.h" />
|
||||
<ClInclude Include="src\atn\PredictionContextMergeCacheOptions.h" />
|
||||
<ClInclude Include="src\atn\PredictionMode.h" />
|
||||
<ClInclude Include="src\atn\ProfilingATNSimulator.h" />
|
||||
<ClInclude Include="src\atn\RangeTransition.h" />
|
||||
<ClInclude Include="src\atn\RuleStartState.h" />
|
||||
<ClInclude Include="src\atn\RuleStopState.h" />
|
||||
<ClInclude Include="src\atn\RuleTransition.h" />
|
||||
<ClInclude Include="src\atn\SemanticContext.h" />
|
||||
<ClInclude Include="src\atn\SetTransition.h" />
|
||||
<ClInclude Include="src\atn\SingletonPredictionContext.h" />
|
||||
<ClInclude Include="src\atn\StarBlockStartState.h" />
|
||||
<ClInclude Include="src\atn\StarLoopbackState.h" />
|
||||
<ClInclude Include="src\atn\StarLoopEntryState.h" />
|
||||
<ClInclude Include="src\atn\TokensStartState.h" />
|
||||
<ClInclude Include="src\atn\Transition.h" />
|
||||
<ClInclude Include="src\atn\WildcardTransition.h" />
|
||||
<ClInclude Include="src\BailErrorStrategy.h" />
|
||||
<ClInclude Include="src\BaseErrorListener.h" />
|
||||
<ClInclude Include="src\BufferedTokenStream.h" />
|
||||
<ClInclude Include="src\CharStream.h" />
|
||||
<ClInclude Include="src\CommonToken.h" />
|
||||
<ClInclude Include="src\CommonTokenFactory.h" />
|
||||
<ClInclude Include="src\CommonTokenStream.h" />
|
||||
<ClInclude Include="src\ConsoleErrorListener.h" />
|
||||
<ClInclude Include="src\DefaultErrorStrategy.h" />
|
||||
<ClInclude Include="src\dfa\DFA.h" />
|
||||
<ClInclude Include="src\dfa\DFASerializer.h" />
|
||||
<ClInclude Include="src\dfa\DFAState.h" />
|
||||
<ClInclude Include="src\dfa\LexerDFASerializer.h" />
|
||||
<ClInclude Include="src\DiagnosticErrorListener.h" />
|
||||
<ClInclude Include="src\Exceptions.h" />
|
||||
<ClInclude Include="src\FailedPredicateException.h" />
|
||||
<ClInclude Include="src\InputMismatchException.h" />
|
||||
<ClInclude Include="src\internal\Synchronization.h" />
|
||||
<ClInclude Include="src\InterpreterRuleContext.h" />
|
||||
<ClInclude Include="src\IntStream.h" />
|
||||
<ClInclude Include="src\Lexer.h" />
|
||||
<ClInclude Include="src\LexerInterpreter.h" />
|
||||
<ClInclude Include="src\LexerNoViableAltException.h" />
|
||||
<ClInclude Include="src\ListTokenSource.h" />
|
||||
<ClInclude Include="src\misc\InterpreterDataReader.h" />
|
||||
<ClInclude Include="src\misc\Interval.h" />
|
||||
<ClInclude Include="src\misc\IntervalSet.h" />
|
||||
<ClInclude Include="src\misc\MurmurHash.h" />
|
||||
<ClInclude Include="src\misc\Predicate.h" />
|
||||
<ClInclude Include="src\NoViableAltException.h" />
|
||||
<ClInclude Include="src\Parser.h" />
|
||||
<ClInclude Include="src\ParserInterpreter.h" />
|
||||
<ClInclude Include="src\ParserRuleContext.h" />
|
||||
<ClInclude Include="src\ProxyErrorListener.h" />
|
||||
<ClInclude Include="src\RecognitionException.h" />
|
||||
<ClInclude Include="src\Recognizer.h" />
|
||||
<ClInclude Include="src\RuleContext.h" />
|
||||
<ClInclude Include="src\RuleContextWithAltNum.h" />
|
||||
<ClInclude Include="src\RuntimeMetaData.h" />
|
||||
<ClInclude Include="src\support\Any.h" />
|
||||
<ClInclude Include="src\support\Arrays.h" />
|
||||
<ClInclude Include="src\support\BitSet.h" />
|
||||
<ClInclude Include="src\support\Casts.h" />
|
||||
<ClInclude Include="src\support\CPPUtils.h" />
|
||||
<ClInclude Include="src\support\Declarations.h" />
|
||||
<ClInclude Include="src\support\StringUtils.h" />
|
||||
<ClInclude Include="src\support\Unicode.h" />
|
||||
<ClInclude Include="src\support\Utf8.h" />
|
||||
<ClInclude Include="src\Token.h" />
|
||||
<ClInclude Include="src\TokenFactory.h" />
|
||||
<ClInclude Include="src\TokenSource.h" />
|
||||
<ClInclude Include="src\TokenStream.h" />
|
||||
<ClInclude Include="src\TokenStreamRewriter.h" />
|
||||
<ClInclude Include="src\tree\AbstractParseTreeVisitor.h" />
|
||||
<ClInclude Include="src\tree\ErrorNode.h" />
|
||||
<ClInclude Include="src\tree\ErrorNodeImpl.h" />
|
||||
<ClInclude Include="src\tree\IterativeParseTreeWalker.h" />
|
||||
<ClInclude Include="src\tree\ParseTree.h" />
|
||||
<ClInclude Include="src\tree\ParseTreeListener.h" />
|
||||
<ClInclude Include="src\tree\ParseTreeProperty.h" />
|
||||
<ClInclude Include="src\tree\ParseTreeVisitor.h" />
|
||||
<ClInclude Include="src\tree\ParseTreeWalker.h" />
|
||||
<ClInclude Include="src\tree\pattern\Chunk.h" />
|
||||
<ClInclude Include="src\tree\pattern\ParseTreeMatch.h" />
|
||||
<ClInclude Include="src\tree\pattern\ParseTreePattern.h" />
|
||||
<ClInclude Include="src\tree\pattern\ParseTreePatternMatcher.h" />
|
||||
<ClInclude Include="src\tree\pattern\RuleTagToken.h" />
|
||||
<ClInclude Include="src\tree\pattern\TagChunk.h" />
|
||||
<ClInclude Include="src\tree\pattern\TextChunk.h" />
|
||||
<ClInclude Include="src\tree\pattern\TokenTagToken.h" />
|
||||
<ClInclude Include="src\tree\TerminalNode.h" />
|
||||
<ClInclude Include="src\tree\TerminalNodeImpl.h" />
|
||||
<ClInclude Include="src\tree\Trees.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPath.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPathElement.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPathLexer.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPathLexerErrorListener.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPathRuleAnywhereElement.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPathRuleElement.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPathTokenAnywhereElement.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPathTokenElement.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPathWildcardAnywhereElement.h" />
|
||||
<ClInclude Include="src\tree\xpath\XPathWildcardElement.h" />
|
||||
<ClInclude Include="src\UnbufferedCharStream.h" />
|
||||
<ClInclude Include="src\UnbufferedTokenStream.h" />
|
||||
<ClInclude Include="src\Vocabulary.h" />
|
||||
<ClInclude Include="src\WritableToken.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -1,948 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\atn">
|
||||
<UniqueIdentifier>{587a2726-4856-4d21-937a-fbaebaa90232}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\atn">
|
||||
<UniqueIdentifier>{2662156f-1508-4dad-b991-a8298a6db9bf}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\dfa">
|
||||
<UniqueIdentifier>{5b1e59b1-7fa5-46a5-8d92-965bd709cca0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\dfa">
|
||||
<UniqueIdentifier>{9de9fe74-5d67-441d-a972-3cebe6dfbfcc}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\misc">
|
||||
<UniqueIdentifier>{89fd3896-0ab1-476d-8d64-a57f10a5e73b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\misc">
|
||||
<UniqueIdentifier>{23939d7b-8e11-421e-80eb-b2cfdfdd64e9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\support">
|
||||
<UniqueIdentifier>{05f2bacb-b5b2-4ca3-abe1-ca9a7239ecaa}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\support">
|
||||
<UniqueIdentifier>{d3b2ae2d-836b-4c73-8180-aca4ebb7d658}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\tree">
|
||||
<UniqueIdentifier>{6674a0f0-c65d-4a00-a9e5-1f243b89d0a2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\tree">
|
||||
<UniqueIdentifier>{1893fffe-7a2b-4708-8ce5-003aa9b749f7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\tree\pattern">
|
||||
<UniqueIdentifier>{053a0632-27bc-4043-b5e8-760951b3b5b9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\tree\pattern">
|
||||
<UniqueIdentifier>{048c180d-44cf-49ca-a7aa-d0053fea07f5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\tree\xpath">
|
||||
<UniqueIdentifier>{3181cae5-cc15-4050-8c45-22af44a823de}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\tree\xpath">
|
||||
<UniqueIdentifier>{290632d2-c56e-4005-a417-eb83b9531e1a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\internal">
|
||||
<UniqueIdentifier>{b4b32b3f-e97a-448a-98e6-cbf901862bd4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\internal">
|
||||
<UniqueIdentifier>{f8c2bdf9-7e81-4f31-ba17-06b16ba2f081}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\ANTLRErrorListener.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\ANTLRErrorStrategy.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\ANTLRFileStream.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\ANTLRInputStream.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\BailErrorStrategy.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\BaseErrorListener.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\BufferedTokenStream.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\CharStream.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\CommonToken.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\CommonTokenFactory.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\CommonTokenStream.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\ConsoleErrorListener.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\DefaultErrorStrategy.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\DiagnosticErrorListener.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\Exceptions.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\FailedPredicateException.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\InputMismatchException.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\InterpreterRuleContext.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\IntStream.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\Lexer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\LexerInterpreter.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\LexerNoViableAltException.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\ListTokenSource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\NoViableAltException.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\Parser.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\ParserInterpreter.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\ParserRuleContext.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\ProxyErrorListener.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\RecognitionException.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\Recognizer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\RuleContext.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\Token.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\TokenFactory.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\TokenSource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\TokenStream.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\TokenStreamRewriter.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\UnbufferedCharStream.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\UnbufferedTokenStream.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\WritableToken.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\DecisionState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\EpsilonTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerATNConfig.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerATNSimulator.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LL1Analyzer.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LoopEndState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\NotSetTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\OrderedATNConfigSet.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ParserATNSimulator.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PlusBlockStartState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PlusLoopbackState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PrecedencePredicateTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PredicateTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PredictionContext.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PredictionMode.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\RangeTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\RuleStartState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\RuleStopState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\RuleTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\SemanticContext.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\SetTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\SingletonPredictionContext.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\StarBlockStartState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\StarLoopbackState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\StarLoopEntryState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\TokensStartState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\Transition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\WildcardTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ActionTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ArrayPredictionContext.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ATN.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ATNConfig.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ATNConfigSet.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ATNDeserializationOptions.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ATNDeserializer.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ATNSimulator.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ATNState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ATNType.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\AtomTransition.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\BasicBlockStartState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\BasicState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\BlockEndState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\BlockStartState.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\dfa\LexerDFASerializer.h">
|
||||
<Filter>Header Files\dfa</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\dfa\DFA.h">
|
||||
<Filter>Header Files\dfa</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\dfa\DFASerializer.h">
|
||||
<Filter>Header Files\dfa</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\dfa\DFAState.h">
|
||||
<Filter>Header Files\dfa</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\misc\Interval.h">
|
||||
<Filter>Header Files\misc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\misc\IntervalSet.h">
|
||||
<Filter>Header Files\misc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\misc\MurmurHash.h">
|
||||
<Filter>Header Files\misc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\support\Arrays.h">
|
||||
<Filter>Header Files\support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\support\BitSet.h">
|
||||
<Filter>Header Files\support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\support\CPPUtils.h">
|
||||
<Filter>Header Files\support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\support\Declarations.h">
|
||||
<Filter>Header Files\support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\AbstractParseTreeVisitor.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\ErrorNode.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\ErrorNodeImpl.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\ParseTree.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\ParseTreeListener.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\ParseTreeProperty.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\ParseTreeVisitor.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\ParseTreeWalker.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\TerminalNode.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\TerminalNodeImpl.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\Trees.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\pattern\Chunk.h">
|
||||
<Filter>Header Files\tree\pattern</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\pattern\ParseTreeMatch.h">
|
||||
<Filter>Header Files\tree\pattern</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\pattern\ParseTreePattern.h">
|
||||
<Filter>Header Files\tree\pattern</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\pattern\ParseTreePatternMatcher.h">
|
||||
<Filter>Header Files\tree\pattern</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\pattern\RuleTagToken.h">
|
||||
<Filter>Header Files\tree\pattern</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\pattern\TagChunk.h">
|
||||
<Filter>Header Files\tree\pattern</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\pattern\TextChunk.h">
|
||||
<Filter>Header Files\tree\pattern</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\pattern\TokenTagToken.h">
|
||||
<Filter>Header Files\tree\pattern</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPathLexer.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\Vocabulary.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\AmbiguityInfo.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ContextSensitivityInfo.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\DecisionEventInfo.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\DecisionInfo.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ErrorInfo.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerActionExecutor.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerActionType.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerChannelAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerCustomAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerIndexedCustomAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerModeAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerMoreAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerPopModeAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerPushModeAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerSkipAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LexerTypeAction.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\LookaheadEventInfo.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ParseInfo.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PredicateEvalInfo.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\ProfilingATNSimulator.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\misc\Predicate.h">
|
||||
<Filter>Header Files\misc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\RuleContextWithAltNum.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\RuntimeMetaData.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\support\StringUtils.h">
|
||||
<Filter>Header Files\support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPath.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPathElement.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPathLexerErrorListener.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPathRuleAnywhereElement.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPathRuleElement.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPathTokenAnywhereElement.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPathTokenElement.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPathWildcardAnywhereElement.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\xpath\XPathWildcardElement.h">
|
||||
<Filter>Header Files\tree\xpath</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\antlr4-common.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\IterativeParseTreeWalker.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\misc\InterpreterDataReader.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\internal\Synchronization.h">
|
||||
<Filter>Header Files\internal</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\support\Casts.h">
|
||||
<Filter>Header Files\support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\support\Unicode.h">
|
||||
<Filter>Header Files\support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\support\Any.h">
|
||||
<Filter>Header Files\support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\support\Utf8.h">
|
||||
<Filter>Header Files\support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PredictionContextMergeCache.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PredictionContextMergeCacheOptions.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\atn\PredictionContextCache.h">
|
||||
<Filter>Header Files\atn</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\ANTLRFileStream.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\ANTLRInputStream.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\BailErrorStrategy.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\BaseErrorListener.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\BufferedTokenStream.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\CharStream.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\CommonToken.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\CommonTokenFactory.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\CommonTokenStream.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\ConsoleErrorListener.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\DefaultErrorStrategy.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\DiagnosticErrorListener.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\Exceptions.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\FailedPredicateException.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\InputMismatchException.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\InterpreterRuleContext.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\IntStream.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\Lexer.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\LexerInterpreter.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\LexerNoViableAltException.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\ListTokenSource.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\NoViableAltException.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\Parser.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\ParserInterpreter.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\ParserRuleContext.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\ProxyErrorListener.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\RecognitionException.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\Recognizer.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\RuleContext.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\TokenStream.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\TokenStreamRewriter.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\UnbufferedCharStream.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\UnbufferedTokenStream.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ActionTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ArrayPredictionContext.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ATN.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ATNConfig.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ATNConfigSet.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ATNDeserializationOptions.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ATNDeserializer.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ATNSimulator.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ATNState.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\AtomTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\DecisionState.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\EpsilonTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerATNConfig.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerATNSimulator.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LL1Analyzer.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\NotSetTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\OrderedATNConfigSet.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ParserATNSimulator.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\PrecedencePredicateTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\PredicateTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\PredictionContext.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\PredictionMode.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\RangeTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\RuleTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\SemanticContext.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\SetTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\SingletonPredictionContext.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\StarLoopbackState.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\Transition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\WildcardTransition.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\dfa\DFA.cpp">
|
||||
<Filter>Source Files\dfa</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\dfa\DFASerializer.cpp">
|
||||
<Filter>Source Files\dfa</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\dfa\DFAState.cpp">
|
||||
<Filter>Source Files\dfa</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\dfa\LexerDFASerializer.cpp">
|
||||
<Filter>Source Files\dfa</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\misc\Interval.cpp">
|
||||
<Filter>Source Files\misc</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\misc\IntervalSet.cpp">
|
||||
<Filter>Source Files\misc</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\misc\MurmurHash.cpp">
|
||||
<Filter>Source Files\misc</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\support\Arrays.cpp">
|
||||
<Filter>Source Files\support</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\support\CPPUtils.cpp">
|
||||
<Filter>Source Files\support</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\ErrorNodeImpl.cpp">
|
||||
<Filter>Source Files\tree</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\ParseTreeWalker.cpp">
|
||||
<Filter>Source Files\tree</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\TerminalNodeImpl.cpp">
|
||||
<Filter>Source Files\tree</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\Trees.cpp">
|
||||
<Filter>Source Files\tree</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\pattern\ParseTreeMatch.cpp">
|
||||
<Filter>Source Files\tree\pattern</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\pattern\ParseTreePattern.cpp">
|
||||
<Filter>Source Files\tree\pattern</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\pattern\ParseTreePatternMatcher.cpp">
|
||||
<Filter>Source Files\tree\pattern</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\pattern\RuleTagToken.cpp">
|
||||
<Filter>Source Files\tree\pattern</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\pattern\TagChunk.cpp">
|
||||
<Filter>Source Files\tree\pattern</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\pattern\TextChunk.cpp">
|
||||
<Filter>Source Files\tree\pattern</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\pattern\TokenTagToken.cpp">
|
||||
<Filter>Source Files\tree\pattern</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\AmbiguityInfo.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ContextSensitivityInfo.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\DecisionEventInfo.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\DecisionInfo.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ErrorInfo.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerActionExecutor.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerChannelAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerCustomAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerIndexedCustomAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerModeAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerMoreAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerPopModeAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerPushModeAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerSkipAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerTypeAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LookaheadEventInfo.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ParseInfo.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\PredicateEvalInfo.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\ProfilingATNSimulator.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\RuleContextWithAltNum.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\RuntimeMetaData.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\support\StringUtils.cpp">
|
||||
<Filter>Source Files\support</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPath.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPathElement.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPathLexer.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPathLexerErrorListener.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPathRuleAnywhereElement.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPathRuleElement.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPathTokenAnywhereElement.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPathTokenElement.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPathWildcardAnywhereElement.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\xpath\XPathWildcardElement.cpp">
|
||||
<Filter>Source Files\tree\xpath</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\Vocabulary.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\ParseTree.cpp">
|
||||
<Filter>Source Files\tree</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\IterativeParseTreeWalker.cpp">
|
||||
<Filter>Source Files\tree</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\misc\InterpreterDataReader.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\ANTLRErrorListener.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\ANTLRErrorStrategy.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\LexerAction.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\misc\Predicate.cpp">
|
||||
<Filter>Source Files\misc</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\Token.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\TokenSource.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\WritableToken.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\support\Any.cpp">
|
||||
<Filter>Source Files\support</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\ParseTreeListener.cpp">
|
||||
<Filter>Source Files\tree</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\ParseTreeVisitor.cpp">
|
||||
<Filter>Source Files\tree</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\pattern\Chunk.cpp">
|
||||
<Filter>Source Files\tree\pattern</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\internal\Synchronization.cpp">
|
||||
<Filter>Source Files\internal</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\support\Utf8.cpp">
|
||||
<Filter>Source Files\support</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\PredictionContextMergeCache.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\PredictionContextCache.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,17 +0,0 @@
|
||||
//
|
||||
// antlrcpp-ios.h
|
||||
// antlrcpp-ios
|
||||
//
|
||||
// Created by Mike Lischke on 05.05.16.
|
||||
// Copyright © 2016 Mike Lischke. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
//! Project version number for antlrcpp-ios.
|
||||
FOUNDATION_EXPORT double antlrcpp_iosVersionNumber;
|
||||
|
||||
//! Project version string for antlrcpp-ios.
|
||||
FOUNDATION_EXPORT const unsigned char antlrcpp_iosVersionString[];
|
||||
|
||||
#include "antlr4-runtime.h"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,76 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1240"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "37D727A91867AF1E007B6D10"
|
||||
BuildableName = "libantlr4-runtime.dylib"
|
||||
BlueprintName = "antlr4"
|
||||
ReferencedContainer = "container:antlrcpp.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "37D727A91867AF1E007B6D10"
|
||||
BuildableName = "libantlr4-runtime.dylib"
|
||||
BlueprintName = "antlr4"
|
||||
ReferencedContainer = "container:antlrcpp.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "37D727A91867AF1E007B6D10"
|
||||
BuildableName = "libantlr4-runtime.dylib"
|
||||
BlueprintName = "antlr4"
|
||||
ReferencedContainer = "container:antlrcpp.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -1,76 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1240"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "270C67EF1CDB4F1E00116E17"
|
||||
BuildableName = "antlr4_ios.framework"
|
||||
BlueprintName = "antlr4_ios"
|
||||
ReferencedContainer = "container:antlrcpp.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "270C67EF1CDB4F1E00116E17"
|
||||
BuildableName = "antlr4_ios.framework"
|
||||
BlueprintName = "antlr4_ios"
|
||||
ReferencedContainer = "container:antlrcpp.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "270C67EF1CDB4F1E00116E17"
|
||||
BuildableName = "antlr4_ios.framework"
|
||||
BlueprintName = "antlr4_ios"
|
||||
ReferencedContainer = "container:antlrcpp.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -1,76 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1240"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "37C147161B4D5A04008EDDDB"
|
||||
BuildableName = "libantlr4-runtime.a"
|
||||
BlueprintName = "antlr4_static"
|
||||
ReferencedContainer = "container:antlrcpp.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "37C147161B4D5A04008EDDDB"
|
||||
BuildableName = "libantlr4-runtime.a"
|
||||
BlueprintName = "antlr4_static"
|
||||
ReferencedContainer = "container:antlrcpp.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "37C147161B4D5A04008EDDDB"
|
||||
BuildableName = "libantlr4-runtime.a"
|
||||
BlueprintName = "antlr4_static"
|
||||
ReferencedContainer = "container:antlrcpp.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>ANTLR4.Runtime.cpp.vs$vs$.noarch</id>
|
||||
<version>$version$$pre$</version>
|
||||
<title>ANTLR4 Runtime c++ vs$vs$ $link$</title>
|
||||
<authors>Terence Parr & Contributors</authors>
|
||||
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
||||
<license type='expression'>BSL-1.0</license>
|
||||
<icon>image\antlr4.jpg</icon>
|
||||
<projectUrl>https://www.antlr.org/</projectUrl>
|
||||
<description>ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files. It's widely used to build languages, tools, and frameworks. From a grammar, ANTLR generates a parser that can build and walk parse trees..</description>
|
||||
<releaseNotes>See project URL</releaseNotes>
|
||||
<copyright>Copyright 2014-2022</copyright>
|
||||
<language></language>
|
||||
<repository type='git' url='git@github.com:antlr/antlr4.git' branch='$version$' />
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="antlr4.jpg" target="image\antlr4.jpg" />
|
||||
<file src="..\src\**\*.h" target="build\native\inc\" />
|
||||
<file src="ANTLR4.Runtime.cpp.noarch.targets" target="build\native\ANTLR4.Runtime.cpp.vs$vs$.noarch.targets" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)inc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
</Project>
|
||||
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>ANTLR4.Runtime.cpp.vs$vs$.shared</id>
|
||||
<version>$version$$pre$</version>
|
||||
<title>ANTLR4 Runtime c++ vs$vs$ shared</title>
|
||||
<authors>Terence Parr & Contributors</authors>
|
||||
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
||||
<license type='expression'>BSL-1.0</license>
|
||||
<icon>image\antlr4.jpg</icon>
|
||||
<projectUrl>https://www.antlr.org/</projectUrl>
|
||||
<description>ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files. It's widely used to build languages, tools, and frameworks. From a grammar, ANTLR generates a parser that can build and walk parse trees..</description>
|
||||
<releaseNotes>releaseNotes</releaseNotes>
|
||||
<copyright>Copyright 2006-2022</copyright>
|
||||
<language></language>
|
||||
<repository type='git' url='git@github.com:antlr/antlr4.git' branch='$version$' />
|
||||
<dependencies>
|
||||
<dependency id="ANTLR4.Runtime.cpp.vs$vs$.noarch" version='$version$$pre$'/>
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="antlr4.jpg" target="image\antlr4.jpg" />
|
||||
<file src="..\bin\vs-$vs$\x86\Debug DLL\*" target="build\native\x86\dbg\" />
|
||||
<file src="..\bin\vs-$vs$\x86\Release DLL\*" target="build\native\x86\rel\" />
|
||||
<file src="..\bin\vs-$vs$\x64\Debug DLL\*" target="build\native\x64\dbg\" />
|
||||
<file src="..\bin\vs-$vs$\x64\Release DLL\*" target="build\native\x64\rel\" />
|
||||
<file src="ANTLR4.Runtime.cpp.shared.targets" target="build\native\ANTLR4.Runtime.cpp.vs$vs$.shared.targets" />
|
||||
<file src="ANTLR4.Runtime.cpp.shared.props" target="build\native\ANTLR4.Runtime.cpp.vs$vs$.shared.props" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="UserMacros" Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
|
||||
<ANTLR4>$(MSBuildThisFileDirectory)x86\dbg</ANTLR4>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="UserMacros" Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x86'">
|
||||
<ANTLR4>$(MSBuildThisFileDirectory)x86\dbg</ANTLR4>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="UserMacros" Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
|
||||
<ANTLR4>$(MSBuildThisFileDirectory)x64\dbg</ANTLR4>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="UserMacros" Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
|
||||
<ANTLR4>$(MSBuildThisFileDirectory)x86\rel</ANTLR4>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="UserMacros" Condition="'$(Configuration)|$(Platform)'=='Release DLL|x86'">
|
||||
<ANTLR4>$(MSBuildThisFileDirectory)x86\rel</ANTLR4>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="UserMacros" Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
|
||||
<ANTLR4>$(MSBuildThisFileDirectory)x64\rel</ANTLR4>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemDefinitionGroup>
|
||||
<Lib>
|
||||
<AdditionalDependencies>antlr4-runtime.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Lib>
|
||||
<Lib Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x86\dbg;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Lib>
|
||||
<Lib Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x86'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x86\dbg;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Lib>
|
||||
<Lib Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x64\dbg;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Lib>
|
||||
<Lib Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x86\rel;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Lib>
|
||||
<Lib Condition="'$(Configuration)|$(Platform)'=='Release DLL|x86'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x86\rel;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Lib>
|
||||
<Lib Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x64\rel;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Lib>
|
||||
<Link Condition="'$(Configuration)|$(Platform)'=='Debug DLL|Win32'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x86\dbg;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<Link Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x86'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x86\dbg;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<Link Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x64\dbg;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<Link Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x86\rel;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<Link Condition="'$(Configuration)|$(Platform)'=='Release DLL|x86'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x86\rel;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<Link Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x64\rel;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
</Project>
|
||||
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>ANTLR4.Runtime.cpp.vs$vs$.static</id>
|
||||
<version>$version$$pre$</version>
|
||||
<title>ANTLR4 Runtime c++ vs$vs$ static</title>
|
||||
<authors>Terence Parr & Contributors</authors>
|
||||
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
||||
<license type='expression'>BSL-1.0</license>
|
||||
<icon>image\antlr4.jpg</icon>
|
||||
<projectUrl>https://www.antlr.org/</projectUrl>
|
||||
<description>ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files. It's widely used to build languages, tools, and frameworks. From a grammar, ANTLR generates a parser that can build and walk parse trees..</description>
|
||||
<releaseNotes>releaseNotes</releaseNotes>
|
||||
<copyright>Copyright 2006-2022</copyright>
|
||||
<language></language>
|
||||
<repository type='git' url='git@github.com:antlr/antlr4.git' branch='$version$' />
|
||||
<dependencies>
|
||||
<dependency id="ANTLR4.Runtime.cpp.vs$vs$.noarch" version='$version$$pre$'/>
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="antlr4.jpg" target="image\antlr4.jpg" />
|
||||
<file src="..\bin\vs-$vs$\x86\Debug Static\*" target="build\native\x86\dbg\" />
|
||||
<file src="..\bin\vs-$vs$\x86\Release Static\*" target="build\native\x86\rel\" />
|
||||
<file src="..\bin\vs-$vs$\x64\Debug Static\*" target="build\native\x64\dbg\" />
|
||||
<file src="..\bin\vs-$vs$\x64\Release Static\*" target="build\native\x64\rel\" />
|
||||
<file src="ANTLR4.Runtime.cpp.static.targets" target="build\native\ANTLR4.Runtime.cpp.vs$vs$.static.targets" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemDefinitionGroup>
|
||||
<Lib>
|
||||
<AdditionalDependencies>antlr4-runtime.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Lib>
|
||||
<Lib Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x86\dbg;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Lib>
|
||||
<Lib Condition="'$(Configuration)|$(Platform)'=='Debug Static|x86'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x86\dbg;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Lib>
|
||||
<Lib Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x64\dbg;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Lib>
|
||||
<Lib Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x86\rel;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Lib>
|
||||
<Lib Condition="'$(Configuration)|$(Platform)'=='Release Static|x86'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x86\rel;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Lib>
|
||||
<Lib Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x64\rel;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Lib>
|
||||
<Link Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x86\dbg;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<Link Condition="'$(Configuration)|$(Platform)'=='Debug Static|x86'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x86\dbg;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<Link Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x64\dbg;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<Link Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x86\rel;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<Link Condition="'$(Configuration)|$(Platform)'=='Release Static|x86'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x86\rel;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
<Link Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'">
|
||||
<AdditionalLibraryDirectories>$(MSBuildThisFileDirectory)x64\rel;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
</Project>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB |
@@ -1,93 +0,0 @@
|
||||
echo off
|
||||
rem echo Usage:
|
||||
rem echo ------
|
||||
rem echo pack vsvers version [pre] // pack 2019 4.9.1 -beta
|
||||
rem echo ------
|
||||
setlocal enableextensions enabledelayedexpansion
|
||||
|
||||
if "%1"=="" goto usage
|
||||
if "%2"=="" goto usage
|
||||
set PRE=%3
|
||||
set PLATFORM=Win32
|
||||
|
||||
rem -version ^^[16.0^^,17.0^^)
|
||||
set VS_VERSION=vs%1
|
||||
rem should be set "VSWHERE='%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe -property installationPath -version ^[16.0^,17.0^)'"
|
||||
if %VS_VERSION%==vs2019 (
|
||||
set "VSWHERE='C:\PROGRA~2\"Microsoft Visual Studio"\Installer\vswhere.exe -latest -property installationPath -version ^[16.0^,17.0^)'"
|
||||
) else (
|
||||
if %VS_VERSION%==vs2022 (
|
||||
set "VSWHERE='C:\PROGRA~2\"Microsoft Visual Studio"\Installer\vswhere.exe -latest -property installationPath -version ^[17.0^,18.0^)'"
|
||||
)
|
||||
)
|
||||
for /f " delims=" %%a in (%VSWHERE%) do @set "VSCOMNTOOLS=%%a"
|
||||
|
||||
echo ============= %VSCOMNTOOLS% =============
|
||||
|
||||
if %VS_VERSION%==vs2019 (
|
||||
set VS_VARSALL=..\..\VC\Auxiliary\Build\vcvarsall.bat
|
||||
set "VS160COMNTOOLS=%VSCOMNTOOLS%\Common7\Tools\"
|
||||
) else (
|
||||
if %VS_VERSION%==vs2022 (
|
||||
set VS_VARSALL=..\..\VC\Auxiliary\Build\vcvarsall.bat
|
||||
set "VS170COMNTOOLS=%VSCOMNTOOLS%\Common7\Tools\"
|
||||
) else (
|
||||
set VS_VARSALL=..\..\VC\vcvarsall.bat
|
||||
)
|
||||
)
|
||||
|
||||
if not defined VCINSTALLDIR (
|
||||
if %VS_VERSION%==vs2019 (
|
||||
if %PLATFORM%==x64 (
|
||||
call "%VS160COMNTOOLS%%VS_VARSALL%" x86_amd64 8.1
|
||||
) else (
|
||||
call "%VS160COMNTOOLS%%VS_VARSALL%" x86 8.1
|
||||
)
|
||||
) else (
|
||||
if %VS_VERSION%==vs2022 (
|
||||
if %PLATFORM%==x64 (
|
||||
call "%VS170COMNTOOLS%%VS_VARSALL%" x86_amd64 8.1
|
||||
) else (
|
||||
call "%VS170COMNTOOLS%%VS_VARSALL%" x86 8.1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if not defined VSINSTALLDIR (
|
||||
echo Error: No Visual cpp environment found.
|
||||
echo Please run this script from a Visual Studio Command Prompt
|
||||
echo or run "%%VSnnCOMNTOOLS%%\vsvars32.bat" first.
|
||||
goto :buildfailed
|
||||
)
|
||||
|
||||
|
||||
pushd ..\
|
||||
call msbuild antlr4cpp-vs%1.vcxproj -t:rebuild -p:Platform=Win32 -p:Configuration="Debug DLL"
|
||||
call msbuild antlr4cpp-vs%1.vcxproj -t:rebuild -p:Platform=Win32 -p:Configuration="Release DLL"
|
||||
call msbuild antlr4cpp-vs%1.vcxproj -t:rebuild -p:Platform=Win32 -p:Configuration="Debug Static"
|
||||
call msbuild antlr4cpp-vs%1.vcxproj -t:rebuild -p:Platform=Win32 -p:Configuration="Release Static"
|
||||
call msbuild antlr4cpp-vs%1.vcxproj -t:rebuild -p:Platform=x64 -p:Configuration="Debug DLL"
|
||||
call msbuild antlr4cpp-vs%1.vcxproj -t:rebuild -p:Platform=x64 -p:Configuration="Release DLL"
|
||||
call msbuild antlr4cpp-vs%1.vcxproj -t:rebuild -p:Platform=x64 -p:Configuration="Debug Static"
|
||||
call msbuild antlr4cpp-vs%1.vcxproj -t:rebuild -p:Platform=x64 -p:Configuration="Release Static"
|
||||
popd
|
||||
|
||||
del *nupkg
|
||||
echo nuget pack ANTLR4.Runtime.cpp.noarch.nuspec -p vs=%1 -p version=%2 -p pre=%pre%
|
||||
call nuget pack ANTLR4.Runtime.cpp.noarch.nuspec -p vs=%1 -p version=%2 -p pre=%pre%
|
||||
echo nuget pack ANTLR4.Runtime.cpp.shared.nuspec -symbols -p vs=%1 -p version=%2 -p pre=%pre%
|
||||
call nuget pack ANTLR4.Runtime.cpp.shared.nuspec -symbols -p vs=%1 -p version=%2 -p pre=%pre%
|
||||
echo nuget pack ANTLR4.Runtime.cpp.static.nuspec -symbols -p vs=%1 -p version=%2 -p pre=%pre%
|
||||
call nuget pack ANTLR4.Runtime.cpp.static.nuspec -symbols -p vs=%1 -p version=%2 -p pre=%pre%
|
||||
|
||||
goto exit
|
||||
:usage
|
||||
echo Usage:
|
||||
echo ------
|
||||
echo "pack vsvers version [pre]" // pack 2019 4.9.1 -beta
|
||||
echo ------
|
||||
:exit
|
||||
:buildfailed
|
||||
endlocal
|
||||
rem echo on
|
||||
@@ -1,10 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include "ANTLRErrorListener.h"
|
||||
|
||||
antlr4::ANTLRErrorListener::~ANTLRErrorListener()
|
||||
{
|
||||
}
|
||||
@@ -1,167 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RecognitionException.h"
|
||||
|
||||
namespace antlrcpp {
|
||||
class BitSet;
|
||||
}
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
/// How to emit recognition errors (an interface in Java).
|
||||
class ANTLR4CPP_PUBLIC ANTLRErrorListener {
|
||||
public:
|
||||
virtual ~ANTLRErrorListener();
|
||||
|
||||
/// <summary>
|
||||
/// Upon syntax error, notify any interested parties. This is not how to
|
||||
/// recover from errors or compute error messages. <seealso cref="ANTLRErrorStrategy"/>
|
||||
/// specifies how to recover from syntax errors and how to compute error
|
||||
/// messages. This listener's job is simply to emit a computed message,
|
||||
/// though it has enough information to create its own message in many cases.
|
||||
/// <p/>
|
||||
/// The <seealso cref="RecognitionException"/> is non-null for all syntax errors except
|
||||
/// when we discover mismatched token errors that we can recover from
|
||||
/// in-line, without returning from the surrounding rule (via the single
|
||||
/// token insertion and deletion mechanism).
|
||||
/// </summary>
|
||||
/// <param name="recognizer">
|
||||
/// What parser got the error. From this
|
||||
/// object, you can access the context as well
|
||||
/// as the input stream. </param>
|
||||
/// <param name="offendingSymbol">
|
||||
/// The offending token in the input token
|
||||
/// stream, unless recognizer is a lexer (then it's null). If
|
||||
/// no viable alternative error, {@code e} has token at which we
|
||||
/// started production for the decision. </param>
|
||||
/// <param name="line">
|
||||
/// The line number in the input where the error occurred. </param>
|
||||
/// <param name="charPositionInLine">
|
||||
/// The character position within that line where the error occurred. </param>
|
||||
/// <param name="msg">
|
||||
/// The message to emit. </param>
|
||||
/// <param name="e">
|
||||
/// The exception generated by the parser that led to
|
||||
/// the reporting of an error. It is null in the case where
|
||||
/// the parser was able to recover in line without exiting the
|
||||
/// surrounding rule. </param>
|
||||
virtual void syntaxError(Recognizer *recognizer, Token *offendingSymbol, size_t line,
|
||||
size_t charPositionInLine, const std::string &msg, std::exception_ptr e) = 0;
|
||||
|
||||
/**
|
||||
* This method is called by the parser when a full-context prediction
|
||||
* results in an ambiguity.
|
||||
*
|
||||
* <p>Each full-context prediction which does not result in a syntax error
|
||||
* will call either {@link #reportContextSensitivity} or
|
||||
* {@link #reportAmbiguity}.</p>
|
||||
*
|
||||
* <p>When {@code ambigAlts} is not null, it contains the set of potentially
|
||||
* viable alternatives identified by the prediction algorithm. When
|
||||
* {@code ambigAlts} is null, use {@link ATNConfigSet#getAlts} to obtain the
|
||||
* represented alternatives from the {@code configs} argument.</p>
|
||||
*
|
||||
* <p>When {@code exact} is {@code true}, <em>all</em> of the potentially
|
||||
* viable alternatives are truly viable, i.e. this is reporting an exact
|
||||
* ambiguity. When {@code exact} is {@code false}, <em>at least two</em> of
|
||||
* the potentially viable alternatives are viable for the current input, but
|
||||
* the prediction algorithm terminated as soon as it determined that at
|
||||
* least the <em>minimum</em> potentially viable alternative is truly
|
||||
* viable.</p>
|
||||
*
|
||||
* <p>When the {@link PredictionMode#LL_EXACT_AMBIG_DETECTION} prediction
|
||||
* mode is used, the parser is required to identify exact ambiguities so
|
||||
* {@code exact} will always be {@code true}.</p>
|
||||
*
|
||||
* <p>This method is not used by lexers.</p>
|
||||
*
|
||||
* @param recognizer the parser instance
|
||||
* @param dfa the DFA for the current decision
|
||||
* @param startIndex the input index where the decision started
|
||||
* @param stopIndex the input input where the ambiguity was identified
|
||||
* @param exact {@code true} if the ambiguity is exactly known, otherwise
|
||||
* {@code false}. This is always {@code true} when
|
||||
* {@link PredictionMode#LL_EXACT_AMBIG_DETECTION} is used.
|
||||
* @param ambigAlts the potentially ambiguous alternatives, or {@code null}
|
||||
* to indicate that the potentially ambiguous alternatives are the complete
|
||||
* set of represented alternatives in {@code configs}
|
||||
* @param configs the ATN configuration set where the ambiguity was
|
||||
* identified
|
||||
*/
|
||||
virtual void reportAmbiguity(Parser *recognizer, const dfa::DFA &dfa, size_t startIndex, size_t stopIndex, bool exact,
|
||||
const antlrcpp::BitSet &ambigAlts, atn::ATNConfigSet *configs) = 0;
|
||||
|
||||
/**
|
||||
* This method is called when an SLL conflict occurs and the parser is about
|
||||
* to use the full context information to make an LL decision.
|
||||
*
|
||||
* <p>If one or more configurations in {@code configs} contains a semantic
|
||||
* predicate, the predicates are evaluated before this method is called. The
|
||||
* subset of alternatives which are still viable after predicates are
|
||||
* evaluated is reported in {@code conflictingAlts}.</p>
|
||||
*
|
||||
* <p>This method is not used by lexers.</p>
|
||||
*
|
||||
* @param recognizer the parser instance
|
||||
* @param dfa the DFA for the current decision
|
||||
* @param startIndex the input index where the decision started
|
||||
* @param stopIndex the input index where the SLL conflict occurred
|
||||
* @param conflictingAlts The specific conflicting alternatives. If this is
|
||||
* {@code null}, the conflicting alternatives are all alternatives
|
||||
* represented in {@code configs}. At the moment, conflictingAlts is non-null
|
||||
* (for the reference implementation, but Sam's optimized version can see this
|
||||
* as null).
|
||||
* @param configs the ATN configuration set where the SLL conflict was
|
||||
* detected
|
||||
*/
|
||||
virtual void reportAttemptingFullContext(Parser *recognizer, const dfa::DFA &dfa, size_t startIndex, size_t stopIndex,
|
||||
const antlrcpp::BitSet &conflictingAlts, atn::ATNConfigSet *configs) = 0;
|
||||
|
||||
/**
|
||||
* This method is called by the parser when a full-context prediction has a
|
||||
* unique result.
|
||||
*
|
||||
* <p>Each full-context prediction which does not result in a syntax error
|
||||
* will call either {@link #reportContextSensitivity} or
|
||||
* {@link #reportAmbiguity}.</p>
|
||||
*
|
||||
* <p>For prediction implementations that only evaluate full-context
|
||||
* predictions when an SLL conflict is found (including the default
|
||||
* {@link ParserATNSimulator} implementation), this method reports cases
|
||||
* where SLL conflicts were resolved to unique full-context predictions,
|
||||
* i.e. the decision was context-sensitive. This report does not necessarily
|
||||
* indicate a problem, and it may appear even in completely unambiguous
|
||||
* grammars.</p>
|
||||
*
|
||||
* <p>{@code configs} may have more than one represented alternative if the
|
||||
* full-context prediction algorithm does not evaluate predicates before
|
||||
* beginning the full-context prediction. In all cases, the final prediction
|
||||
* is passed as the {@code prediction} argument.</p>
|
||||
*
|
||||
* <p>Note that the definition of "context sensitivity" in this method
|
||||
* differs from the concept in {@link DecisionInfo#contextSensitivities}.
|
||||
* This method reports all instances where an SLL conflict occurred but LL
|
||||
* parsing produced a unique result, whether or not that unique result
|
||||
* matches the minimum alternative in the SLL conflicting set.</p>
|
||||
*
|
||||
* <p>This method is not used by lexers.</p>
|
||||
*
|
||||
* @param recognizer the parser instance
|
||||
* @param dfa the DFA for the current decision
|
||||
* @param startIndex the input index where the decision started
|
||||
* @param stopIndex the input index where the context sensitivity was
|
||||
* finally determined
|
||||
* @param prediction the unambiguous result of the full-context prediction
|
||||
* @param configs the ATN configuration set where the unambiguous prediction
|
||||
* was determined
|
||||
*/
|
||||
virtual void reportContextSensitivity(Parser *recognizer, const dfa::DFA &dfa, size_t startIndex, size_t stopIndex,
|
||||
size_t prediction, atn::ATNConfigSet *configs) = 0;
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,10 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include "ANTLRErrorStrategy.h"
|
||||
|
||||
antlr4::ANTLRErrorStrategy::~ANTLRErrorStrategy()
|
||||
{
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Token.h"
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
/// <summary>
|
||||
/// The interface for defining strategies to deal with syntax errors encountered
|
||||
/// during a parse by ANTLR-generated parsers. We distinguish between three
|
||||
/// different kinds of errors:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>The parser could not figure out which path to take in the ATN (none of
|
||||
/// the available alternatives could possibly match)</li>
|
||||
/// <li>The current input does not match what we were looking for</li>
|
||||
/// <li>A predicate evaluated to false</li>
|
||||
/// </ul>
|
||||
///
|
||||
/// Implementations of this interface report syntax errors by calling
|
||||
/// <seealso cref="Parser#notifyErrorListeners"/>.
|
||||
/// <p/>
|
||||
/// TODO: what to do about lexers
|
||||
/// </summary>
|
||||
class ANTLR4CPP_PUBLIC ANTLRErrorStrategy {
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Reset the error handler state for the specified {@code recognizer}. </summary>
|
||||
/// <param name="recognizer"> the parser instance </param>
|
||||
virtual ~ANTLRErrorStrategy();
|
||||
|
||||
virtual void reset(Parser *recognizer) = 0;
|
||||
|
||||
/**
|
||||
* This method is called when an unexpected symbol is encountered during an
|
||||
* inline match operation, such as {@link Parser#match}. If the error
|
||||
* strategy successfully recovers from the match failure, this method
|
||||
* returns the {@link Token} instance which should be treated as the
|
||||
* successful result of the match.
|
||||
*
|
||||
* <p>This method handles the consumption of any tokens - the caller should
|
||||
* <b>not</b> call {@link Parser#consume} after a successful recovery.</p>
|
||||
*
|
||||
* <p>Note that the calling code will not report an error if this method
|
||||
* returns successfully. The error strategy implementation is responsible
|
||||
* for calling {@link Parser#notifyErrorListeners} as appropriate.</p>
|
||||
*
|
||||
* @param recognizer the parser instance
|
||||
* @throws RecognitionException if the error strategy was not able to
|
||||
* recover from the unexpected input symbol
|
||||
*/
|
||||
virtual Token* recoverInline(Parser *recognizer) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// This method is called to recover from exception {@code e}. This method is
|
||||
/// called after <seealso cref="#reportError"/> by the default exception handler
|
||||
/// generated for a rule method.
|
||||
/// </summary>
|
||||
/// <seealso cref= #reportError
|
||||
/// </seealso>
|
||||
/// <param name="recognizer"> the parser instance </param>
|
||||
/// <param name="e"> the recognition exception to recover from </param>
|
||||
/// <exception cref="RecognitionException"> if the error strategy could not recover from
|
||||
/// the recognition exception </exception>
|
||||
virtual void recover(Parser *recognizer, std::exception_ptr e) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// This method provides the error handler with an opportunity to handle
|
||||
/// syntactic or semantic errors in the input stream before they result in a
|
||||
/// <seealso cref="RecognitionException"/>.
|
||||
/// <p/>
|
||||
/// The generated code currently contains calls to <seealso cref="#sync"/> after
|
||||
/// entering the decision state of a closure block ({@code (...)*} or
|
||||
/// {@code (...)+}).
|
||||
/// <p/>
|
||||
/// For an implementation based on Jim Idle's "magic sync" mechanism, see
|
||||
/// <seealso cref="DefaultErrorStrategy#sync"/>.
|
||||
/// </summary>
|
||||
/// <seealso cref= DefaultErrorStrategy#sync
|
||||
/// </seealso>
|
||||
/// <param name="recognizer"> the parser instance </param>
|
||||
/// <exception cref="RecognitionException"> if an error is detected by the error
|
||||
/// strategy but cannot be automatically recovered at the current state in
|
||||
/// the parsing process </exception>
|
||||
virtual void sync(Parser *recognizer) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Tests whether or not {@code recognizer} is in the process of recovering
|
||||
/// from an error. In error recovery mode, <seealso cref="Parser#consume"/> adds
|
||||
/// symbols to the parse tree by calling
|
||||
/// {@link Parser#createErrorNode(ParserRuleContext, Token)} then
|
||||
/// {@link ParserRuleContext#addErrorNode(ErrorNode)} instead of
|
||||
/// {@link Parser#createTerminalNode(ParserRuleContext, Token)}.
|
||||
/// </summary>
|
||||
/// <param name="recognizer"> the parser instance </param>
|
||||
/// <returns> {@code true} if the parser is currently recovering from a parse
|
||||
/// error, otherwise {@code false} </returns>
|
||||
virtual bool inErrorRecoveryMode(Parser *recognizer) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// This method is called by when the parser successfully matches an input
|
||||
/// symbol.
|
||||
/// </summary>
|
||||
/// <param name="recognizer"> the parser instance </param>
|
||||
virtual void reportMatch(Parser *recognizer) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Report any kind of <seealso cref="RecognitionException"/>. This method is called by
|
||||
/// the default exception handler generated for a rule method.
|
||||
/// </summary>
|
||||
/// <param name="recognizer"> the parser instance </param>
|
||||
/// <param name="e"> the recognition exception to report </param>
|
||||
virtual void reportError(Parser *recognizer, const RecognitionException &e) = 0;
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,23 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include "ANTLRFileStream.h"
|
||||
|
||||
using namespace antlr4;
|
||||
|
||||
void ANTLRFileStream::loadFromFile(const std::string &fileName) {
|
||||
_fileName = fileName;
|
||||
if (_fileName.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::ifstream stream(fileName, std::ios::binary);
|
||||
|
||||
ANTLRInputStream::load(stream);
|
||||
}
|
||||
|
||||
std::string ANTLRFileStream::getSourceName() const {
|
||||
return _fileName;
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ANTLRInputStream.h"
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
/// This is an ANTLRInputStream that is loaded from a file all at once
|
||||
/// when you construct the object (or call load()).
|
||||
// TODO: this class needs testing.
|
||||
class ANTLR4CPP_PUBLIC ANTLRFileStream : public ANTLRInputStream {
|
||||
public:
|
||||
ANTLRFileStream() = default;
|
||||
ANTLRFileStream(const std::string &) = delete;
|
||||
ANTLRFileStream(const char *data, size_t length) = delete;
|
||||
ANTLRFileStream(std::istream &stream) = delete;
|
||||
|
||||
// Assumes a file name encoded in UTF-8 and file content in the same encoding (with or w/o BOM).
|
||||
virtual void loadFromFile(const std::string &fileName);
|
||||
virtual std::string getSourceName() const override;
|
||||
|
||||
private:
|
||||
std::string _fileName; // UTF-8 encoded file name.
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,180 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "Exceptions.h"
|
||||
#include "misc/Interval.h"
|
||||
#include "IntStream.h"
|
||||
|
||||
#include "support/Utf8.h"
|
||||
#include "support/CPPUtils.h"
|
||||
|
||||
#include "ANTLRInputStream.h"
|
||||
|
||||
using namespace antlr4;
|
||||
using namespace antlrcpp;
|
||||
|
||||
using misc::Interval;
|
||||
|
||||
ANTLRInputStream::ANTLRInputStream() {
|
||||
InitializeInstanceFields();
|
||||
}
|
||||
|
||||
ANTLRInputStream::ANTLRInputStream(std::string_view input): ANTLRInputStream() {
|
||||
load(input.data(), input.length());
|
||||
}
|
||||
|
||||
ANTLRInputStream::ANTLRInputStream(const char *data, size_t length) {
|
||||
load(data, length);
|
||||
}
|
||||
|
||||
ANTLRInputStream::ANTLRInputStream(std::istream &stream): ANTLRInputStream() {
|
||||
load(stream);
|
||||
}
|
||||
|
||||
void ANTLRInputStream::load(const std::string &input, bool lenient) {
|
||||
load(input.data(), input.size(), lenient);
|
||||
}
|
||||
|
||||
void ANTLRInputStream::load(const char *data, size_t length, bool lenient) {
|
||||
// Remove the UTF-8 BOM if present.
|
||||
const char *bom = "\xef\xbb\xbf";
|
||||
if (length >= 3 && strncmp(data, bom, 3) == 0) {
|
||||
data += 3;
|
||||
length -= 3;
|
||||
}
|
||||
if (lenient) {
|
||||
_data = Utf8::lenientDecode(std::string_view(data, length));
|
||||
} else {
|
||||
auto maybe_utf32 = Utf8::strictDecode(std::string_view(data, length));
|
||||
if (!maybe_utf32.has_value()) {
|
||||
throw IllegalArgumentException("UTF-8 string contains an illegal byte sequence");
|
||||
}
|
||||
_data = std::move(maybe_utf32).value();
|
||||
}
|
||||
p = 0;
|
||||
}
|
||||
|
||||
void ANTLRInputStream::load(std::istream &stream, bool lenient) {
|
||||
if (!stream.good() || stream.eof()) // No fail, bad or EOF.
|
||||
return;
|
||||
|
||||
_data.clear();
|
||||
|
||||
std::string s((std::istreambuf_iterator<char>(stream)), std::istreambuf_iterator<char>());
|
||||
load(s.data(), s.length(), lenient);
|
||||
}
|
||||
|
||||
void ANTLRInputStream::reset() {
|
||||
p = 0;
|
||||
}
|
||||
|
||||
void ANTLRInputStream::consume() {
|
||||
if (p >= _data.size()) {
|
||||
assert(LA(1) == IntStream::EOF);
|
||||
throw IllegalStateException("cannot consume EOF");
|
||||
}
|
||||
|
||||
if (p < _data.size()) {
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
||||
size_t ANTLRInputStream::LA(ssize_t i) {
|
||||
if (i == 0) {
|
||||
return 0; // undefined
|
||||
}
|
||||
|
||||
ssize_t position = static_cast<ssize_t>(p);
|
||||
if (i < 0) {
|
||||
i++; // e.g., translate LA(-1) to use offset i=0; then _data[p+0-1]
|
||||
if ((position + i - 1) < 0) {
|
||||
return IntStream::EOF; // invalid; no char before first char
|
||||
}
|
||||
}
|
||||
|
||||
if ((position + i - 1) >= static_cast<ssize_t>(_data.size())) {
|
||||
return IntStream::EOF;
|
||||
}
|
||||
|
||||
return _data[static_cast<size_t>((position + i - 1))];
|
||||
}
|
||||
|
||||
size_t ANTLRInputStream::LT(ssize_t i) {
|
||||
return LA(i);
|
||||
}
|
||||
|
||||
size_t ANTLRInputStream::index() {
|
||||
return p;
|
||||
}
|
||||
|
||||
size_t ANTLRInputStream::size() {
|
||||
return _data.size();
|
||||
}
|
||||
|
||||
// Mark/release do nothing. We have entire buffer.
|
||||
ssize_t ANTLRInputStream::mark() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
void ANTLRInputStream::release(ssize_t /* marker */) {
|
||||
}
|
||||
|
||||
void ANTLRInputStream::seek(size_t index) {
|
||||
if (index <= p) {
|
||||
p = index; // just jump; don't update stream state (line, ...)
|
||||
return;
|
||||
}
|
||||
// seek forward, consume until p hits index or n (whichever comes first)
|
||||
index = std::min(index, _data.size());
|
||||
while (p < index) {
|
||||
consume();
|
||||
}
|
||||
}
|
||||
|
||||
std::string ANTLRInputStream::getText(const Interval &interval) {
|
||||
if (interval.a < 0 || interval.b < 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
size_t start = static_cast<size_t>(interval.a);
|
||||
size_t stop = static_cast<size_t>(interval.b);
|
||||
|
||||
|
||||
if (stop >= _data.size()) {
|
||||
stop = _data.size() - 1;
|
||||
}
|
||||
|
||||
size_t count = stop - start + 1;
|
||||
if (start >= _data.size()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
auto maybeUtf8 = Utf8::strictEncode(std::u32string_view(_data).substr(start, count));
|
||||
if (!maybeUtf8.has_value()) {
|
||||
throw IllegalArgumentException("Input stream contains invalid Unicode code points");
|
||||
}
|
||||
return std::move(maybeUtf8).value();
|
||||
}
|
||||
|
||||
std::string ANTLRInputStream::getSourceName() const {
|
||||
if (name.empty()) {
|
||||
return IntStream::UNKNOWN_SOURCE_NAME;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
std::string ANTLRInputStream::toString() const {
|
||||
auto maybeUtf8 = Utf8::strictEncode(_data);
|
||||
if (!maybeUtf8.has_value()) {
|
||||
throw IllegalArgumentException("Input stream contains invalid Unicode code points");
|
||||
}
|
||||
return std::move(maybeUtf8).value();
|
||||
}
|
||||
|
||||
void ANTLRInputStream::InitializeInstanceFields() {
|
||||
p = 0;
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include "CharStream.h"
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
// Vacuum all input from a stream and then treat it
|
||||
// like a string. Can also pass in a string or char[] to use.
|
||||
// Input is expected to be encoded in UTF-8 and converted to UTF-32 internally.
|
||||
class ANTLR4CPP_PUBLIC ANTLRInputStream : public CharStream {
|
||||
protected:
|
||||
/// The data being scanned.
|
||||
// UTF-32
|
||||
std::u32string _data;
|
||||
|
||||
/// 0..n-1 index into string of next char </summary>
|
||||
size_t p;
|
||||
|
||||
public:
|
||||
/// What is name or source of this char stream?
|
||||
std::string name;
|
||||
|
||||
ANTLRInputStream();
|
||||
|
||||
ANTLRInputStream(std::string_view input);
|
||||
|
||||
ANTLRInputStream(const char *data, size_t length);
|
||||
ANTLRInputStream(std::istream &stream);
|
||||
|
||||
virtual void load(const std::string &input, bool lenient);
|
||||
virtual void load(const char *data, size_t length, bool lenient);
|
||||
virtual void load(std::istream &stream, bool lenient);
|
||||
|
||||
virtual void load(const std::string &input) { load(input, false); }
|
||||
virtual void load(const char *data, size_t length) { load(data, length, false); }
|
||||
virtual void load(std::istream &stream) { load(stream, false); }
|
||||
|
||||
/// Reset the stream so that it's in the same state it was
|
||||
/// when the object was created *except* the data array is not
|
||||
/// touched.
|
||||
virtual void reset();
|
||||
virtual void consume() override;
|
||||
virtual size_t LA(ssize_t i) override;
|
||||
virtual size_t LT(ssize_t i);
|
||||
|
||||
/// <summary>
|
||||
/// Return the current input symbol index 0..n where n indicates the
|
||||
/// last symbol has been read. The index is the index of char to
|
||||
/// be returned from LA(1).
|
||||
/// </summary>
|
||||
virtual size_t index() override;
|
||||
virtual size_t size() override;
|
||||
|
||||
/// <summary>
|
||||
/// mark/release do nothing; we have entire buffer </summary>
|
||||
virtual ssize_t mark() override;
|
||||
virtual void release(ssize_t marker) override;
|
||||
|
||||
/// <summary>
|
||||
/// consume() ahead until p==index; can't just set p=index as we must
|
||||
/// update line and charPositionInLine. If we seek backwards, just set p
|
||||
/// </summary>
|
||||
virtual void seek(size_t index) override;
|
||||
virtual std::string getText(const misc::Interval &interval) override;
|
||||
virtual std::string getSourceName() const override;
|
||||
virtual std::string toString() const override;
|
||||
|
||||
private:
|
||||
void InitializeInstanceFields();
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,61 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include "Exceptions.h"
|
||||
#include "ParserRuleContext.h"
|
||||
#include "InputMismatchException.h"
|
||||
#include "Parser.h"
|
||||
|
||||
#include "BailErrorStrategy.h"
|
||||
|
||||
using namespace antlr4;
|
||||
|
||||
void BailErrorStrategy::recover(Parser *recognizer, std::exception_ptr e) {
|
||||
ParserRuleContext *context = recognizer->getContext();
|
||||
do {
|
||||
context->exception = e;
|
||||
if (context->parent == nullptr)
|
||||
break;
|
||||
context = static_cast<ParserRuleContext *>(context->parent);
|
||||
} while (true);
|
||||
|
||||
try {
|
||||
std::rethrow_exception(e); // Throw the exception to be able to catch and rethrow nested.
|
||||
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER < 190023026
|
||||
} catch (RecognitionException &inner) {
|
||||
throw ParseCancellationException(inner.what());
|
||||
#else
|
||||
} catch (RecognitionException & /*inner*/) {
|
||||
std::throw_with_nested(ParseCancellationException());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Token* BailErrorStrategy::recoverInline(Parser *recognizer) {
|
||||
InputMismatchException e(recognizer);
|
||||
std::exception_ptr exception = std::make_exception_ptr(e);
|
||||
|
||||
ParserRuleContext *context = recognizer->getContext();
|
||||
do {
|
||||
context->exception = exception;
|
||||
if (context->parent == nullptr)
|
||||
break;
|
||||
context = static_cast<ParserRuleContext *>(context->parent);
|
||||
} while (true);
|
||||
|
||||
try {
|
||||
throw e;
|
||||
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER < 190023026
|
||||
} catch (InputMismatchException &inner) {
|
||||
throw ParseCancellationException(inner.what());
|
||||
#else
|
||||
} catch (InputMismatchException & /*inner*/) {
|
||||
std::throw_with_nested(ParseCancellationException());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void BailErrorStrategy::sync(Parser * /*recognizer*/) {
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DefaultErrorStrategy.h"
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
/**
|
||||
* This implementation of {@link ANTLRErrorStrategy} responds to syntax errors
|
||||
* by immediately canceling the parse operation with a
|
||||
* {@link ParseCancellationException}. The implementation ensures that the
|
||||
* {@link ParserRuleContext#exception} field is set for all parse tree nodes
|
||||
* that were not completed prior to encountering the error.
|
||||
*
|
||||
* <p>
|
||||
* This error strategy is useful in the following scenarios.</p>
|
||||
*
|
||||
* <ul>
|
||||
* <li><strong>Two-stage parsing:</strong> This error strategy allows the first
|
||||
* stage of two-stage parsing to immediately terminate if an error is
|
||||
* encountered, and immediately fall back to the second stage. In addition to
|
||||
* avoiding wasted work by attempting to recover from errors here, the empty
|
||||
* implementation of {@link BailErrorStrategy#sync} improves the performance of
|
||||
* the first stage.</li>
|
||||
* <li><strong>Silent validation:</strong> When syntax errors are not being
|
||||
* reported or logged, and the parse result is simply ignored if errors occur,
|
||||
* the {@link BailErrorStrategy} avoids wasting work on recovering from errors
|
||||
* when the result will be ignored either way.</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>
|
||||
* {@code myparser.setErrorHandler(new BailErrorStrategy());}</p>
|
||||
*
|
||||
* @see Parser#setErrorHandler(ANTLRErrorStrategy)
|
||||
*/
|
||||
class ANTLR4CPP_PUBLIC BailErrorStrategy : public DefaultErrorStrategy {
|
||||
/// <summary>
|
||||
/// Instead of recovering from exception {@code e}, re-throw it wrapped
|
||||
/// in a <seealso cref="ParseCancellationException"/> so it is not caught by the
|
||||
/// rule function catches. Use <seealso cref="Exception#getCause()"/> to get the
|
||||
/// original <seealso cref="RecognitionException"/>.
|
||||
/// </summary>
|
||||
public:
|
||||
virtual void recover(Parser *recognizer, std::exception_ptr e) override;
|
||||
|
||||
/// Make sure we don't attempt to recover inline; if the parser
|
||||
/// successfully recovers, it won't throw an exception.
|
||||
virtual Token* recoverInline(Parser *recognizer) override;
|
||||
|
||||
/// <summary>
|
||||
/// Make sure we don't attempt to recover from problems in subrules. </summary>
|
||||
virtual void sync(Parser *recognizer) override;
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,25 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include "BaseErrorListener.h"
|
||||
#include "RecognitionException.h"
|
||||
|
||||
using namespace antlr4;
|
||||
|
||||
void BaseErrorListener::syntaxError(Recognizer * /*recognizer*/, Token * /*offendingSymbol*/, size_t /*line*/,
|
||||
size_t /*charPositionInLine*/, const std::string &/*msg*/, std::exception_ptr /*e*/) {
|
||||
}
|
||||
|
||||
void BaseErrorListener::reportAmbiguity(Parser * /*recognizer*/, const dfa::DFA &/*dfa*/, size_t /*startIndex*/,
|
||||
size_t /*stopIndex*/, bool /*exact*/, const antlrcpp::BitSet &/*ambigAlts*/, atn::ATNConfigSet * /*configs*/) {
|
||||
}
|
||||
|
||||
void BaseErrorListener::reportAttemptingFullContext(Parser * /*recognizer*/, const dfa::DFA &/*dfa*/, size_t /*startIndex*/,
|
||||
size_t /*stopIndex*/, const antlrcpp::BitSet &/*conflictingAlts*/, atn::ATNConfigSet * /*configs*/) {
|
||||
}
|
||||
|
||||
void BaseErrorListener::reportContextSensitivity(Parser * /*recognizer*/, const dfa::DFA &/*dfa*/, size_t /*startIndex*/,
|
||||
size_t /*stopIndex*/, size_t /*prediction*/, atn::ATNConfigSet * /*configs*/) {
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ANTLRErrorListener.h"
|
||||
|
||||
namespace antlrcpp {
|
||||
class BitSet;
|
||||
}
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
/**
|
||||
* Provides an empty default implementation of {@link ANTLRErrorListener}. The
|
||||
* default implementation of each method does nothing, but can be overridden as
|
||||
* necessary.
|
||||
*/
|
||||
class ANTLR4CPP_PUBLIC BaseErrorListener : public ANTLRErrorListener {
|
||||
|
||||
virtual void syntaxError(Recognizer *recognizer, Token * offendingSymbol, size_t line, size_t charPositionInLine,
|
||||
const std::string &msg, std::exception_ptr e) override;
|
||||
|
||||
virtual void reportAmbiguity(Parser *recognizer, const dfa::DFA &dfa, size_t startIndex, size_t stopIndex, bool exact,
|
||||
const antlrcpp::BitSet &ambigAlts, atn::ATNConfigSet *configs) override;
|
||||
|
||||
virtual void reportAttemptingFullContext(Parser *recognizer, const dfa::DFA &dfa, size_t startIndex, size_t stopIndex,
|
||||
const antlrcpp::BitSet &conflictingAlts, atn::ATNConfigSet *configs) override;
|
||||
|
||||
virtual void reportContextSensitivity(Parser *recognizer, const dfa::DFA &dfa, size_t startIndex, size_t stopIndex,
|
||||
size_t prediction, atn::ATNConfigSet *configs) override;
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,414 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include "WritableToken.h"
|
||||
#include "Lexer.h"
|
||||
#include "RuleContext.h"
|
||||
#include "misc/Interval.h"
|
||||
#include "Exceptions.h"
|
||||
#include "support/CPPUtils.h"
|
||||
|
||||
#include "BufferedTokenStream.h"
|
||||
|
||||
using namespace antlr4;
|
||||
using namespace antlrcpp;
|
||||
|
||||
BufferedTokenStream::BufferedTokenStream(TokenSource *tokenSource) : _tokenSource(tokenSource){
|
||||
InitializeInstanceFields();
|
||||
}
|
||||
|
||||
TokenSource* BufferedTokenStream::getTokenSource() const {
|
||||
return _tokenSource;
|
||||
}
|
||||
|
||||
size_t BufferedTokenStream::index() {
|
||||
return _p;
|
||||
}
|
||||
|
||||
ssize_t BufferedTokenStream::mark() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void BufferedTokenStream::release(ssize_t /*marker*/) {
|
||||
// no resources to release
|
||||
}
|
||||
|
||||
void BufferedTokenStream::reset() {
|
||||
seek(0);
|
||||
}
|
||||
|
||||
void BufferedTokenStream::seek(size_t index) {
|
||||
lazyInit();
|
||||
_p = adjustSeekIndex(index);
|
||||
}
|
||||
|
||||
size_t BufferedTokenStream::size() {
|
||||
return _tokens.size();
|
||||
}
|
||||
|
||||
void BufferedTokenStream::consume() {
|
||||
bool skipEofCheck = false;
|
||||
if (!_needSetup) {
|
||||
if (_fetchedEOF) {
|
||||
// the last token in tokens is EOF. skip check if p indexes any
|
||||
// fetched token except the last.
|
||||
skipEofCheck = _p < _tokens.size() - 1;
|
||||
} else {
|
||||
// no EOF token in tokens. skip check if p indexes a fetched token.
|
||||
skipEofCheck = _p < _tokens.size();
|
||||
}
|
||||
} else {
|
||||
// not yet initialized
|
||||
skipEofCheck = false;
|
||||
}
|
||||
|
||||
if (!skipEofCheck && LA(1) == Token::EOF) {
|
||||
throw IllegalStateException("cannot consume EOF");
|
||||
}
|
||||
|
||||
if (sync(_p + 1)) {
|
||||
_p = adjustSeekIndex(_p + 1);
|
||||
}
|
||||
}
|
||||
|
||||
bool BufferedTokenStream::sync(size_t i) {
|
||||
if (i + 1 < _tokens.size())
|
||||
return true;
|
||||
size_t n = i - _tokens.size() + 1; // how many more elements we need?
|
||||
|
||||
if (n > 0) {
|
||||
size_t fetched = fetch(n);
|
||||
return fetched >= n;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t BufferedTokenStream::fetch(size_t n) {
|
||||
if (_fetchedEOF) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t i = 0;
|
||||
while (i < n) {
|
||||
std::unique_ptr<Token> t(_tokenSource->nextToken());
|
||||
|
||||
if (is<WritableToken *>(t.get())) {
|
||||
(static_cast<WritableToken *>(t.get()))->setTokenIndex(_tokens.size());
|
||||
}
|
||||
|
||||
_tokens.push_back(std::move(t));
|
||||
++i;
|
||||
|
||||
if (_tokens.back()->getType() == Token::EOF) {
|
||||
_fetchedEOF = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
Token* BufferedTokenStream::get(size_t i) const {
|
||||
if (i >= _tokens.size()) {
|
||||
throw IndexOutOfBoundsException(std::string("token index ") +
|
||||
std::to_string(i) +
|
||||
std::string(" out of range 0..") +
|
||||
std::to_string(_tokens.size() - 1));
|
||||
}
|
||||
return _tokens[i].get();
|
||||
}
|
||||
|
||||
std::vector<Token *> BufferedTokenStream::get(size_t start, size_t stop) {
|
||||
std::vector<Token *> subset;
|
||||
|
||||
lazyInit();
|
||||
|
||||
if (_tokens.empty()) {
|
||||
return subset;
|
||||
}
|
||||
|
||||
if (stop >= _tokens.size()) {
|
||||
stop = _tokens.size() - 1;
|
||||
}
|
||||
for (size_t i = start; i <= stop; i++) {
|
||||
Token *t = _tokens[i].get();
|
||||
if (t->getType() == Token::EOF) {
|
||||
break;
|
||||
}
|
||||
subset.push_back(t);
|
||||
}
|
||||
return subset;
|
||||
}
|
||||
|
||||
size_t BufferedTokenStream::LA(ssize_t i) {
|
||||
return LT(i)->getType();
|
||||
}
|
||||
|
||||
Token* BufferedTokenStream::LB(size_t k) {
|
||||
if (k > _p) {
|
||||
return nullptr;
|
||||
}
|
||||
return _tokens[_p - k].get();
|
||||
}
|
||||
|
||||
Token* BufferedTokenStream::LT(ssize_t k) {
|
||||
lazyInit();
|
||||
if (k == 0) {
|
||||
return nullptr;
|
||||
}
|
||||
if (k < 0) {
|
||||
return LB(-k);
|
||||
}
|
||||
|
||||
size_t i = _p + k - 1;
|
||||
sync(i);
|
||||
if (i >= _tokens.size()) { // return EOF token
|
||||
// EOF must be last token
|
||||
return _tokens.back().get();
|
||||
}
|
||||
|
||||
return _tokens[i].get();
|
||||
}
|
||||
|
||||
ssize_t BufferedTokenStream::adjustSeekIndex(size_t i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
void BufferedTokenStream::lazyInit() {
|
||||
if (_needSetup) {
|
||||
setup();
|
||||
}
|
||||
}
|
||||
|
||||
void BufferedTokenStream::setup() {
|
||||
_needSetup = false;
|
||||
sync(0);
|
||||
_p = adjustSeekIndex(0);
|
||||
}
|
||||
|
||||
void BufferedTokenStream::setTokenSource(TokenSource *tokenSource) {
|
||||
_tokenSource = tokenSource;
|
||||
_tokens.clear();
|
||||
_fetchedEOF = false;
|
||||
_needSetup = true;
|
||||
}
|
||||
|
||||
std::vector<Token *> BufferedTokenStream::getTokens() {
|
||||
std::vector<Token *> result;
|
||||
for (auto &t : _tokens)
|
||||
result.push_back(t.get());
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<Token *> BufferedTokenStream::getTokens(size_t start, size_t stop) {
|
||||
return getTokens(start, stop, std::vector<size_t>());
|
||||
}
|
||||
|
||||
std::vector<Token *> BufferedTokenStream::getTokens(size_t start, size_t stop, const std::vector<size_t> &types) {
|
||||
lazyInit();
|
||||
if (stop >= _tokens.size() || start >= _tokens.size()) {
|
||||
throw IndexOutOfBoundsException(std::string("start ") +
|
||||
std::to_string(start) +
|
||||
std::string(" or stop ") +
|
||||
std::to_string(stop) +
|
||||
std::string(" not in 0..") +
|
||||
std::to_string(_tokens.size() - 1));
|
||||
}
|
||||
|
||||
std::vector<Token *> filteredTokens;
|
||||
|
||||
if (start > stop) {
|
||||
return filteredTokens;
|
||||
}
|
||||
|
||||
for (size_t i = start; i <= stop; i++) {
|
||||
Token *tok = _tokens[i].get();
|
||||
|
||||
if (types.empty() || std::find(types.begin(), types.end(), tok->getType()) != types.end()) {
|
||||
filteredTokens.push_back(tok);
|
||||
}
|
||||
}
|
||||
return filteredTokens;
|
||||
}
|
||||
|
||||
std::vector<Token *> BufferedTokenStream::getTokens(size_t start, size_t stop, size_t ttype) {
|
||||
std::vector<size_t> s;
|
||||
s.push_back(ttype);
|
||||
return getTokens(start, stop, s);
|
||||
}
|
||||
|
||||
ssize_t BufferedTokenStream::nextTokenOnChannel(size_t i, size_t channel) {
|
||||
sync(i);
|
||||
if (i >= size()) {
|
||||
return size() - 1;
|
||||
}
|
||||
|
||||
Token *token = _tokens[i].get();
|
||||
while (token->getChannel() != channel) {
|
||||
if (token->getType() == Token::EOF) {
|
||||
return i;
|
||||
}
|
||||
i++;
|
||||
sync(i);
|
||||
token = _tokens[i].get();
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
ssize_t BufferedTokenStream::previousTokenOnChannel(size_t i, size_t channel) {
|
||||
sync(i);
|
||||
if (i >= size()) {
|
||||
// the EOF token is on every channel
|
||||
return size() - 1;
|
||||
}
|
||||
|
||||
while (true) {
|
||||
Token *token = _tokens[i].get();
|
||||
if (token->getType() == Token::EOF || token->getChannel() == channel) {
|
||||
return i;
|
||||
}
|
||||
|
||||
if (i == 0)
|
||||
return -1;
|
||||
i--;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
std::vector<Token *> BufferedTokenStream::getHiddenTokensToRight(size_t tokenIndex, ssize_t channel) {
|
||||
lazyInit();
|
||||
if (tokenIndex >= _tokens.size()) {
|
||||
throw IndexOutOfBoundsException(std::to_string(tokenIndex) + " not in 0.." + std::to_string(_tokens.size() - 1));
|
||||
}
|
||||
|
||||
ssize_t nextOnChannel = nextTokenOnChannel(tokenIndex + 1, Lexer::DEFAULT_TOKEN_CHANNEL);
|
||||
size_t to;
|
||||
size_t from = tokenIndex + 1;
|
||||
// if none onchannel to right, nextOnChannel=-1 so set to = last token
|
||||
if (nextOnChannel == -1) {
|
||||
to = static_cast<ssize_t>(size() - 1);
|
||||
} else {
|
||||
to = nextOnChannel;
|
||||
}
|
||||
|
||||
return filterForChannel(from, to, channel);
|
||||
}
|
||||
|
||||
std::vector<Token *> BufferedTokenStream::getHiddenTokensToRight(size_t tokenIndex) {
|
||||
return getHiddenTokensToRight(tokenIndex, -1);
|
||||
}
|
||||
|
||||
std::vector<Token *> BufferedTokenStream::getHiddenTokensToLeft(size_t tokenIndex, ssize_t channel) {
|
||||
lazyInit();
|
||||
if (tokenIndex >= _tokens.size()) {
|
||||
throw IndexOutOfBoundsException(std::to_string(tokenIndex) + " not in 0.." + std::to_string(_tokens.size() - 1));
|
||||
}
|
||||
|
||||
if (tokenIndex == 0) {
|
||||
// Obviously no tokens can appear before the first token.
|
||||
return { };
|
||||
}
|
||||
|
||||
ssize_t prevOnChannel = previousTokenOnChannel(tokenIndex - 1, Lexer::DEFAULT_TOKEN_CHANNEL);
|
||||
if (prevOnChannel == static_cast<ssize_t>(tokenIndex - 1)) {
|
||||
return { };
|
||||
}
|
||||
// if none onchannel to left, prevOnChannel=-1 then from=0
|
||||
size_t from = static_cast<size_t>(prevOnChannel + 1);
|
||||
size_t to = tokenIndex - 1;
|
||||
|
||||
return filterForChannel(from, to, channel);
|
||||
}
|
||||
|
||||
std::vector<Token *> BufferedTokenStream::getHiddenTokensToLeft(size_t tokenIndex) {
|
||||
return getHiddenTokensToLeft(tokenIndex, -1);
|
||||
}
|
||||
|
||||
std::vector<Token *> BufferedTokenStream::filterForChannel(size_t from, size_t to, ssize_t channel) {
|
||||
std::vector<Token *> hidden;
|
||||
for (size_t i = from; i <= to; i++) {
|
||||
Token *t = _tokens[i].get();
|
||||
if (channel == -1) {
|
||||
if (t->getChannel() != Lexer::DEFAULT_TOKEN_CHANNEL) {
|
||||
hidden.push_back(t);
|
||||
}
|
||||
} else {
|
||||
if (t->getChannel() == static_cast<size_t>(channel)) {
|
||||
hidden.push_back(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return hidden;
|
||||
}
|
||||
|
||||
bool BufferedTokenStream::isInitialized() const {
|
||||
return !_needSetup;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the text of all tokens in this buffer.
|
||||
*/
|
||||
std::string BufferedTokenStream::getSourceName() const
|
||||
{
|
||||
return _tokenSource->getSourceName();
|
||||
}
|
||||
|
||||
std::string BufferedTokenStream::getText() {
|
||||
fill();
|
||||
return getText(misc::Interval(0U, size() - 1));
|
||||
}
|
||||
|
||||
std::string BufferedTokenStream::getText(const misc::Interval &interval) {
|
||||
lazyInit();
|
||||
size_t start = interval.a;
|
||||
size_t stop = interval.b;
|
||||
if (start == INVALID_INDEX || stop == INVALID_INDEX) {
|
||||
return "";
|
||||
}
|
||||
sync(stop);
|
||||
if (stop >= _tokens.size()) {
|
||||
stop = _tokens.size() - 1;
|
||||
}
|
||||
|
||||
std::stringstream ss;
|
||||
for (size_t i = start; i <= stop; i++) {
|
||||
Token *t = _tokens[i].get();
|
||||
if (t->getType() == Token::EOF) {
|
||||
break;
|
||||
}
|
||||
ss << t->getText();
|
||||
}
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
std::string BufferedTokenStream::getText(RuleContext *ctx) {
|
||||
return getText(ctx->getSourceInterval());
|
||||
}
|
||||
|
||||
std::string BufferedTokenStream::getText(Token *start, Token *stop) {
|
||||
if (start != nullptr && stop != nullptr) {
|
||||
return getText(misc::Interval(start->getTokenIndex(), stop->getTokenIndex()));
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
void BufferedTokenStream::fill() {
|
||||
lazyInit();
|
||||
const size_t blockSize = 1000;
|
||||
while (true) {
|
||||
size_t fetched = fetch(blockSize);
|
||||
if (fetched < blockSize) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BufferedTokenStream::InitializeInstanceFields() {
|
||||
_needSetup = true;
|
||||
_fetchedEOF = false;
|
||||
}
|
||||
@@ -1,200 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "TokenStream.h"
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
/**
|
||||
* This implementation of {@link TokenStream} loads tokens from a
|
||||
* {@link TokenSource} on-demand, and places the tokens in a buffer to provide
|
||||
* access to any previous token by index.
|
||||
*
|
||||
* <p>
|
||||
* This token stream ignores the value of {@link Token#getChannel}. If your
|
||||
* parser requires the token stream filter tokens to only those on a particular
|
||||
* channel, such as {@link Token#DEFAULT_CHANNEL} or
|
||||
* {@link Token#HIDDEN_CHANNEL}, use a filtering token stream such a
|
||||
* {@link CommonTokenStream}.</p>
|
||||
*/
|
||||
class ANTLR4CPP_PUBLIC BufferedTokenStream : public TokenStream {
|
||||
public:
|
||||
BufferedTokenStream(TokenSource *tokenSource);
|
||||
BufferedTokenStream(const BufferedTokenStream& other) = delete;
|
||||
|
||||
BufferedTokenStream& operator = (const BufferedTokenStream& other) = delete;
|
||||
|
||||
virtual TokenSource* getTokenSource() const override;
|
||||
virtual size_t index() override;
|
||||
virtual ssize_t mark() override;
|
||||
|
||||
virtual void release(ssize_t marker) override;
|
||||
virtual void reset();
|
||||
virtual void seek(size_t index) override;
|
||||
|
||||
virtual size_t size() override;
|
||||
virtual void consume() override;
|
||||
|
||||
virtual Token* get(size_t i) const override;
|
||||
|
||||
/// Get all tokens from start..stop inclusively.
|
||||
virtual std::vector<Token *> get(size_t start, size_t stop);
|
||||
|
||||
virtual size_t LA(ssize_t i) override;
|
||||
virtual Token* LT(ssize_t k) override;
|
||||
|
||||
/// Reset this token stream by setting its token source.
|
||||
virtual void setTokenSource(TokenSource *tokenSource);
|
||||
virtual std::vector<Token *> getTokens();
|
||||
virtual std::vector<Token *> getTokens(size_t start, size_t stop);
|
||||
|
||||
/// <summary>
|
||||
/// Given a start and stop index, return a List of all tokens in
|
||||
/// the token type BitSet. Return null if no tokens were found. This
|
||||
/// method looks at both on and off channel tokens.
|
||||
/// </summary>
|
||||
virtual std::vector<Token *> getTokens(size_t start, size_t stop, const std::vector<size_t> &types);
|
||||
virtual std::vector<Token *> getTokens(size_t start, size_t stop, size_t ttype);
|
||||
|
||||
/// Collect all tokens on specified channel to the right of
|
||||
/// the current token up until we see a token on DEFAULT_TOKEN_CHANNEL or
|
||||
/// EOF. If channel is -1, find any non default channel token.
|
||||
virtual std::vector<Token *> getHiddenTokensToRight(size_t tokenIndex, ssize_t channel);
|
||||
|
||||
/// <summary>
|
||||
/// Collect all hidden tokens (any off-default channel) to the right of
|
||||
/// the current token up until we see a token on DEFAULT_TOKEN_CHANNEL
|
||||
/// or EOF.
|
||||
/// </summary>
|
||||
virtual std::vector<Token *> getHiddenTokensToRight(size_t tokenIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Collect all tokens on specified channel to the left of
|
||||
/// the current token up until we see a token on DEFAULT_TOKEN_CHANNEL.
|
||||
/// If channel is -1, find any non default channel token.
|
||||
/// </summary>
|
||||
virtual std::vector<Token *> getHiddenTokensToLeft(size_t tokenIndex, ssize_t channel);
|
||||
|
||||
/// <summary>
|
||||
/// Collect all hidden tokens (any off-default channel) to the left of
|
||||
/// the current token up until we see a token on DEFAULT_TOKEN_CHANNEL.
|
||||
/// </summary>
|
||||
virtual std::vector<Token *> getHiddenTokensToLeft(size_t tokenIndex);
|
||||
|
||||
virtual std::string getSourceName() const override;
|
||||
virtual std::string getText() override;
|
||||
virtual std::string getText(const misc::Interval &interval) override;
|
||||
virtual std::string getText(RuleContext *ctx) override;
|
||||
virtual std::string getText(Token *start, Token *stop) override;
|
||||
|
||||
/// Get all tokens from lexer until EOF.
|
||||
virtual void fill();
|
||||
|
||||
protected:
|
||||
/**
|
||||
* The {@link TokenSource} from which tokens for this stream are fetched.
|
||||
*/
|
||||
TokenSource *_tokenSource;
|
||||
|
||||
/**
|
||||
* A collection of all tokens fetched from the token source. The list is
|
||||
* considered a complete view of the input once {@link #fetchedEOF} is set
|
||||
* to {@code true}.
|
||||
*/
|
||||
std::vector<std::unique_ptr<Token>> _tokens;
|
||||
|
||||
/**
|
||||
* The index into {@link #tokens} of the current token (next token to
|
||||
* {@link #consume}). {@link #tokens}{@code [}{@link #p}{@code ]} should be
|
||||
* {@link #LT LT(1)}.
|
||||
*
|
||||
* <p>This field is set to -1 when the stream is first constructed or when
|
||||
* {@link #setTokenSource} is called, indicating that the first token has
|
||||
* not yet been fetched from the token source. For additional information,
|
||||
* see the documentation of {@link IntStream} for a description of
|
||||
* Initializing Methods.</p>
|
||||
*/
|
||||
// ml: since -1 requires to make this member signed for just this single aspect we use a member _needSetup instead.
|
||||
// Use bool isInitialized() to find out if this stream has started reading.
|
||||
size_t _p;
|
||||
|
||||
/**
|
||||
* Indicates whether the {@link Token#EOF} token has been fetched from
|
||||
* {@link #tokenSource} and added to {@link #tokens}. This field improves
|
||||
* performance for the following cases:
|
||||
*
|
||||
* <ul>
|
||||
* <li>{@link #consume}: The lookahead check in {@link #consume} to prevent
|
||||
* consuming the EOF symbol is optimized by checking the values of
|
||||
* {@link #fetchedEOF} and {@link #p} instead of calling {@link #LA}.</li>
|
||||
* <li>{@link #fetch}: The check to prevent adding multiple EOF symbols into
|
||||
* {@link #tokens} is trivial with this field.</li>
|
||||
* <ul>
|
||||
*/
|
||||
bool _fetchedEOF;
|
||||
|
||||
/// <summary>
|
||||
/// Make sure index {@code i} in tokens has a token.
|
||||
/// </summary>
|
||||
/// <returns> {@code true} if a token is located at index {@code i}, otherwise
|
||||
/// {@code false}. </returns>
|
||||
/// <seealso cref= #get(int i) </seealso>
|
||||
virtual bool sync(size_t i);
|
||||
|
||||
/// <summary>
|
||||
/// Add {@code n} elements to buffer.
|
||||
/// </summary>
|
||||
/// <returns> The actual number of elements added to the buffer. </returns>
|
||||
virtual size_t fetch(size_t n);
|
||||
|
||||
virtual Token* LB(size_t k);
|
||||
|
||||
/// Allowed derived classes to modify the behavior of operations which change
|
||||
/// the current stream position by adjusting the target token index of a seek
|
||||
/// operation. The default implementation simply returns {@code i}. If an
|
||||
/// exception is thrown in this method, the current stream index should not be
|
||||
/// changed.
|
||||
/// <p/>
|
||||
/// For example, <seealso cref="CommonTokenStream"/> overrides this method to ensure that
|
||||
/// the seek target is always an on-channel token.
|
||||
///
|
||||
/// <param name="i"> The target token index. </param>
|
||||
/// <returns> The adjusted target token index. </returns>
|
||||
virtual ssize_t adjustSeekIndex(size_t i);
|
||||
void lazyInit();
|
||||
virtual void setup();
|
||||
|
||||
/**
|
||||
* Given a starting index, return the index of the next token on channel.
|
||||
* Return {@code i} if {@code tokens[i]} is on channel. Return the index of
|
||||
* the EOF token if there are no tokens on channel between {@code i} and
|
||||
* EOF.
|
||||
*/
|
||||
virtual ssize_t nextTokenOnChannel(size_t i, size_t channel);
|
||||
|
||||
/**
|
||||
* Given a starting index, return the index of the previous token on
|
||||
* channel. Return {@code i} if {@code tokens[i]} is on channel. Return -1
|
||||
* if there are no tokens on channel between {@code i} and 0.
|
||||
*
|
||||
* <p>
|
||||
* If {@code i} specifies an index at or after the EOF token, the EOF token
|
||||
* index is returned. This is due to the fact that the EOF token is treated
|
||||
* as though it were on every channel.</p>
|
||||
*/
|
||||
virtual ssize_t previousTokenOnChannel(size_t i, size_t channel);
|
||||
|
||||
virtual std::vector<Token *> filterForChannel(size_t from, size_t to, ssize_t channel);
|
||||
|
||||
bool isInitialized() const;
|
||||
|
||||
private:
|
||||
bool _needSetup;
|
||||
void InitializeInstanceFields();
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,11 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include "CharStream.h"
|
||||
|
||||
using namespace antlr4;
|
||||
|
||||
CharStream::~CharStream() {
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "IntStream.h"
|
||||
#include "misc/Interval.h"
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
/// A source of characters for an ANTLR lexer.
|
||||
class ANTLR4CPP_PUBLIC CharStream : public IntStream {
|
||||
public:
|
||||
virtual ~CharStream();
|
||||
|
||||
/// This method returns the text for a range of characters within this input
|
||||
/// stream. This method is guaranteed to not throw an exception if the
|
||||
/// specified interval lies entirely within a marked range. For more
|
||||
/// information about marked ranges, see IntStream::mark.
|
||||
///
|
||||
/// <param name="interval"> an interval within the stream </param>
|
||||
/// <returns> the text of the specified interval
|
||||
/// </returns>
|
||||
/// <exception cref="NullPointerException"> if {@code interval} is {@code null} </exception>
|
||||
/// <exception cref="IllegalArgumentException"> if {@code interval.a < 0}, or if
|
||||
/// {@code interval.b < interval.a - 1}, or if {@code interval.b} lies at or
|
||||
/// past the end of the stream </exception>
|
||||
/// <exception cref="UnsupportedOperationException"> if the stream does not support
|
||||
/// getting the text of the specified interval </exception>
|
||||
virtual std::string getText(const misc::Interval &interval) = 0;
|
||||
|
||||
virtual std::string toString() const = 0;
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,193 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include "TokenSource.h"
|
||||
#include "CharStream.h"
|
||||
#include "Recognizer.h"
|
||||
#include "Vocabulary.h"
|
||||
|
||||
#include "misc/Interval.h"
|
||||
|
||||
#include "support/CPPUtils.h"
|
||||
#include "support/StringUtils.h"
|
||||
|
||||
#include "CommonToken.h"
|
||||
|
||||
using namespace antlr4;
|
||||
using namespace antlr4::misc;
|
||||
|
||||
using namespace antlrcpp;
|
||||
|
||||
const std::pair<TokenSource*, CharStream*> CommonToken::EMPTY_SOURCE;
|
||||
|
||||
CommonToken::CommonToken(size_t type) {
|
||||
InitializeInstanceFields();
|
||||
_type = type;
|
||||
}
|
||||
|
||||
CommonToken::CommonToken(std::pair<TokenSource*, CharStream*> source, size_t type, size_t channel, size_t start, size_t stop) {
|
||||
InitializeInstanceFields();
|
||||
_source = source;
|
||||
_type = type;
|
||||
_channel = channel;
|
||||
_start = start;
|
||||
_stop = stop;
|
||||
if (_source.first != nullptr) {
|
||||
_line = static_cast<int>(source.first->getLine());
|
||||
_charPositionInLine = source.first->getCharPositionInLine();
|
||||
}
|
||||
}
|
||||
|
||||
CommonToken::CommonToken(size_t type, const std::string &text) {
|
||||
InitializeInstanceFields();
|
||||
_type = type;
|
||||
_channel = DEFAULT_CHANNEL;
|
||||
_text = text;
|
||||
_source = EMPTY_SOURCE;
|
||||
}
|
||||
|
||||
CommonToken::CommonToken(Token *oldToken) {
|
||||
InitializeInstanceFields();
|
||||
_type = oldToken->getType();
|
||||
_line = oldToken->getLine();
|
||||
_index = oldToken->getTokenIndex();
|
||||
_charPositionInLine = oldToken->getCharPositionInLine();
|
||||
_channel = oldToken->getChannel();
|
||||
_start = oldToken->getStartIndex();
|
||||
_stop = oldToken->getStopIndex();
|
||||
|
||||
if (is<CommonToken *>(oldToken)) {
|
||||
_text = (static_cast<CommonToken *>(oldToken))->_text;
|
||||
_source = (static_cast<CommonToken *>(oldToken))->_source;
|
||||
} else {
|
||||
_text = oldToken->getText();
|
||||
_source = { oldToken->getTokenSource(), oldToken->getInputStream() };
|
||||
}
|
||||
}
|
||||
|
||||
size_t CommonToken::getType() const {
|
||||
return _type;
|
||||
}
|
||||
|
||||
void CommonToken::setLine(size_t line) {
|
||||
_line = line;
|
||||
}
|
||||
|
||||
std::string CommonToken::getText() const {
|
||||
if (!_text.empty()) {
|
||||
return _text;
|
||||
}
|
||||
|
||||
CharStream *input = getInputStream();
|
||||
if (input == nullptr) {
|
||||
return "";
|
||||
}
|
||||
size_t n = input->size();
|
||||
if (_start < n && _stop < n) {
|
||||
return input->getText(misc::Interval(_start, _stop));
|
||||
} else {
|
||||
return "<EOF>";
|
||||
}
|
||||
}
|
||||
|
||||
void CommonToken::setText(const std::string &text) {
|
||||
_text = text;
|
||||
}
|
||||
|
||||
size_t CommonToken::getLine() const {
|
||||
return _line;
|
||||
}
|
||||
|
||||
size_t CommonToken::getCharPositionInLine() const {
|
||||
return _charPositionInLine;
|
||||
}
|
||||
|
||||
void CommonToken::setCharPositionInLine(size_t charPositionInLine) {
|
||||
_charPositionInLine = charPositionInLine;
|
||||
}
|
||||
|
||||
size_t CommonToken::getChannel() const {
|
||||
return _channel;
|
||||
}
|
||||
|
||||
void CommonToken::setChannel(size_t channel) {
|
||||
_channel = channel;
|
||||
}
|
||||
|
||||
void CommonToken::setType(size_t type) {
|
||||
_type = type;
|
||||
}
|
||||
|
||||
size_t CommonToken::getStartIndex() const {
|
||||
return _start;
|
||||
}
|
||||
|
||||
void CommonToken::setStartIndex(size_t start) {
|
||||
_start = start;
|
||||
}
|
||||
|
||||
size_t CommonToken::getStopIndex() const {
|
||||
return _stop;
|
||||
}
|
||||
|
||||
void CommonToken::setStopIndex(size_t stop) {
|
||||
_stop = stop;
|
||||
}
|
||||
|
||||
size_t CommonToken::getTokenIndex() const {
|
||||
return _index;
|
||||
}
|
||||
|
||||
void CommonToken::setTokenIndex(size_t index) {
|
||||
_index = index;
|
||||
}
|
||||
|
||||
antlr4::TokenSource *CommonToken::getTokenSource() const {
|
||||
return _source.first;
|
||||
}
|
||||
|
||||
antlr4::CharStream *CommonToken::getInputStream() const {
|
||||
return _source.second;
|
||||
}
|
||||
|
||||
std::string CommonToken::toString() const {
|
||||
return toString(nullptr);
|
||||
}
|
||||
|
||||
std::string CommonToken::toString(Recognizer *r) const {
|
||||
std::stringstream ss;
|
||||
|
||||
std::string channelStr;
|
||||
if (_channel > 0) {
|
||||
channelStr = ",channel=" + std::to_string(_channel);
|
||||
}
|
||||
std::string txt = getText();
|
||||
if (!txt.empty()) {
|
||||
txt = antlrcpp::escapeWhitespace(txt);
|
||||
} else {
|
||||
txt = "<no text>";
|
||||
}
|
||||
|
||||
std::string typeString = std::to_string(symbolToNumeric(_type));
|
||||
if (r != nullptr)
|
||||
typeString = r->getVocabulary().getDisplayName(_type);
|
||||
|
||||
ss << "[@" << symbolToNumeric(getTokenIndex()) << "," << symbolToNumeric(_start) << ":" << symbolToNumeric(_stop)
|
||||
<< "='" << txt << "',<" << typeString << ">" << channelStr << "," << _line << ":"
|
||||
<< getCharPositionInLine() << "]";
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
void CommonToken::InitializeInstanceFields() {
|
||||
_type = 0;
|
||||
_line = 0;
|
||||
_charPositionInLine = INVALID_INDEX;
|
||||
_channel = DEFAULT_CHANNEL;
|
||||
_index = INVALID_INDEX;
|
||||
_start = 0;
|
||||
_stop = 0;
|
||||
_source = EMPTY_SOURCE;
|
||||
}
|
||||
@@ -1,158 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "WritableToken.h"
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
class ANTLR4CPP_PUBLIC CommonToken : public WritableToken {
|
||||
protected:
|
||||
/**
|
||||
* An empty {@link Pair} which is used as the default value of
|
||||
* {@link #source} for tokens that do not have a source.
|
||||
*/
|
||||
static const std::pair<TokenSource *, CharStream *> EMPTY_SOURCE;
|
||||
|
||||
/**
|
||||
* This is the backing field for {@link #getType} and {@link #setType}.
|
||||
*/
|
||||
size_t _type;
|
||||
|
||||
/**
|
||||
* This is the backing field for {@link #getLine} and {@link #setLine}.
|
||||
*/
|
||||
size_t _line;
|
||||
|
||||
/**
|
||||
* This is the backing field for {@link #getCharPositionInLine} and
|
||||
* {@link #setCharPositionInLine}.
|
||||
*/
|
||||
size_t _charPositionInLine; // set to invalid position
|
||||
|
||||
/**
|
||||
* This is the backing field for {@link #getChannel} and
|
||||
* {@link #setChannel}.
|
||||
*/
|
||||
size_t _channel;
|
||||
|
||||
/**
|
||||
* This is the backing field for {@link #getTokenSource} and
|
||||
* {@link #getInputStream}.
|
||||
*
|
||||
* <p>
|
||||
* These properties share a field to reduce the memory footprint of
|
||||
* {@link CommonToken}. Tokens created by a {@link CommonTokenFactory} from
|
||||
* the same source and input stream share a reference to the same
|
||||
* {@link Pair} containing these values.</p>
|
||||
*/
|
||||
|
||||
std::pair<TokenSource *, CharStream *> _source; // ml: pure references, usually from statically allocated classes.
|
||||
|
||||
/**
|
||||
* This is the backing field for {@link #getText} when the token text is
|
||||
* explicitly set in the constructor or via {@link #setText}.
|
||||
*
|
||||
* @see #getText()
|
||||
*/
|
||||
std::string _text;
|
||||
|
||||
/**
|
||||
* This is the backing field for {@link #getTokenIndex} and
|
||||
* {@link #setTokenIndex}.
|
||||
*/
|
||||
size_t _index;
|
||||
|
||||
/**
|
||||
* This is the backing field for {@link #getStartIndex} and
|
||||
* {@link #setStartIndex}.
|
||||
*/
|
||||
size_t _start;
|
||||
|
||||
/**
|
||||
* This is the backing field for {@link #getStopIndex} and
|
||||
* {@link #setStopIndex}.
|
||||
*/
|
||||
size_t _stop;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructs a new {@link CommonToken} with the specified token type.
|
||||
*
|
||||
* @param type The token type.
|
||||
*/
|
||||
CommonToken(size_t type);
|
||||
CommonToken(std::pair<TokenSource*, CharStream*> source, size_t type, size_t channel, size_t start, size_t stop);
|
||||
|
||||
/**
|
||||
* Constructs a new {@link CommonToken} with the specified token type and
|
||||
* text.
|
||||
*
|
||||
* @param type The token type.
|
||||
* @param text The text of the token.
|
||||
*/
|
||||
CommonToken(size_t type, const std::string &text);
|
||||
|
||||
/**
|
||||
* Constructs a new {@link CommonToken} as a copy of another {@link Token}.
|
||||
*
|
||||
* <p>
|
||||
* If {@code oldToken} is also a {@link CommonToken} instance, the newly
|
||||
* constructed token will share a reference to the {@link #text} field and
|
||||
* the {@link Pair} stored in {@link #source}. Otherwise, {@link #text} will
|
||||
* be assigned the result of calling {@link #getText}, and {@link #source}
|
||||
* will be constructed from the result of {@link Token#getTokenSource} and
|
||||
* {@link Token#getInputStream}.</p>
|
||||
*
|
||||
* @param oldToken The token to copy.
|
||||
*/
|
||||
CommonToken(Token *oldToken);
|
||||
|
||||
virtual size_t getType() const override;
|
||||
|
||||
/**
|
||||
* Explicitly set the text for this token. If {code text} is not
|
||||
* {@code null}, then {@link #getText} will return this value rather than
|
||||
* extracting the text from the input.
|
||||
*
|
||||
* @param text The explicit text of the token, or {@code null} if the text
|
||||
* should be obtained from the input along with the start and stop indexes
|
||||
* of the token.
|
||||
*/
|
||||
virtual void setText(const std::string &text) override;
|
||||
virtual std::string getText() const override;
|
||||
|
||||
virtual void setLine(size_t line) override;
|
||||
virtual size_t getLine() const override;
|
||||
|
||||
virtual size_t getCharPositionInLine() const override;
|
||||
virtual void setCharPositionInLine(size_t charPositionInLine) override;
|
||||
|
||||
virtual size_t getChannel() const override;
|
||||
virtual void setChannel(size_t channel) override;
|
||||
|
||||
virtual void setType(size_t type) override;
|
||||
|
||||
virtual size_t getStartIndex() const override;
|
||||
virtual void setStartIndex(size_t start);
|
||||
|
||||
virtual size_t getStopIndex() const override;
|
||||
virtual void setStopIndex(size_t stop);
|
||||
|
||||
virtual size_t getTokenIndex() const override;
|
||||
virtual void setTokenIndex(size_t index) override;
|
||||
|
||||
virtual TokenSource *getTokenSource() const override;
|
||||
virtual CharStream *getInputStream() const override;
|
||||
|
||||
virtual std::string toString() const override;
|
||||
|
||||
virtual std::string toString(Recognizer *r) const;
|
||||
private:
|
||||
void InitializeInstanceFields();
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,39 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include "misc/Interval.h"
|
||||
#include "CommonToken.h"
|
||||
#include "CharStream.h"
|
||||
|
||||
#include "CommonTokenFactory.h"
|
||||
|
||||
using namespace antlr4;
|
||||
|
||||
const std::unique_ptr<TokenFactory<CommonToken>> CommonTokenFactory::DEFAULT(new CommonTokenFactory);
|
||||
|
||||
CommonTokenFactory::CommonTokenFactory(bool copyText_) : copyText(copyText_) {
|
||||
}
|
||||
|
||||
CommonTokenFactory::CommonTokenFactory() : CommonTokenFactory(false) {
|
||||
}
|
||||
|
||||
std::unique_ptr<CommonToken> CommonTokenFactory::create(std::pair<TokenSource*, CharStream*> source, size_t type,
|
||||
const std::string &text, size_t channel, size_t start, size_t stop, size_t line, size_t charPositionInLine) {
|
||||
|
||||
std::unique_ptr<CommonToken> t(new CommonToken(source, type, channel, start, stop));
|
||||
t->setLine(line);
|
||||
t->setCharPositionInLine(charPositionInLine);
|
||||
if (text != "") {
|
||||
t->setText(text);
|
||||
} else if (copyText && source.second != nullptr) {
|
||||
t->setText(source.second->getText(misc::Interval(start, stop)));
|
||||
}
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
std::unique_ptr<CommonToken> CommonTokenFactory::create(size_t type, const std::string &text) {
|
||||
return std::unique_ptr<CommonToken>(new CommonToken(type, text));
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "TokenFactory.h"
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
/**
|
||||
* This default implementation of {@link TokenFactory} creates
|
||||
* {@link CommonToken} objects.
|
||||
*/
|
||||
class ANTLR4CPP_PUBLIC CommonTokenFactory : public TokenFactory<CommonToken> {
|
||||
public:
|
||||
/**
|
||||
* The default {@link CommonTokenFactory} instance.
|
||||
*
|
||||
* <p>
|
||||
* This token factory does not explicitly copy token text when constructing
|
||||
* tokens.</p>
|
||||
*/
|
||||
static const std::unique_ptr<TokenFactory<CommonToken>> DEFAULT;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Indicates whether {@link CommonToken#setText} should be called after
|
||||
* constructing tokens to explicitly set the text. This is useful for cases
|
||||
* where the input stream might not be able to provide arbitrary substrings
|
||||
* of text from the input after the lexer creates a token (e.g. the
|
||||
* implementation of {@link CharStream#getText} in
|
||||
* {@link UnbufferedCharStream} throws an
|
||||
* {@link UnsupportedOperationException}). Explicitly setting the token text
|
||||
* allows {@link Token#getText} to be called at any time regardless of the
|
||||
* input stream implementation.
|
||||
*
|
||||
* <p>
|
||||
* The default value is {@code false} to avoid the performance and memory
|
||||
* overhead of copying text for every token unless explicitly requested.</p>
|
||||
*/
|
||||
const bool copyText;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructs a {@link CommonTokenFactory} with the specified value for
|
||||
* {@link #copyText}.
|
||||
*
|
||||
* <p>
|
||||
* When {@code copyText} is {@code false}, the {@link #DEFAULT} instance
|
||||
* should be used instead of constructing a new instance.</p>
|
||||
*
|
||||
* @param copyText The value for {@link #copyText}.
|
||||
*/
|
||||
CommonTokenFactory(bool copyText);
|
||||
|
||||
/**
|
||||
* Constructs a {@link CommonTokenFactory} with {@link #copyText} set to
|
||||
* {@code false}.
|
||||
*
|
||||
* <p>
|
||||
* The {@link #DEFAULT} instance should be used instead of calling this
|
||||
* directly.</p>
|
||||
*/
|
||||
CommonTokenFactory();
|
||||
|
||||
virtual std::unique_ptr<CommonToken> create(std::pair<TokenSource*, CharStream*> source, size_t type,
|
||||
const std::string &text, size_t channel, size_t start, size_t stop, size_t line, size_t charPositionInLine) override;
|
||||
|
||||
virtual std::unique_ptr<CommonToken> create(size_t type, const std::string &text) override;
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,78 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include "Token.h"
|
||||
|
||||
#include "CommonTokenStream.h"
|
||||
|
||||
using namespace antlr4;
|
||||
|
||||
CommonTokenStream::CommonTokenStream(TokenSource *tokenSource) : CommonTokenStream(tokenSource, Token::DEFAULT_CHANNEL) {
|
||||
}
|
||||
|
||||
CommonTokenStream::CommonTokenStream(TokenSource *tokenSource, size_t channel_)
|
||||
: BufferedTokenStream(tokenSource), channel(channel_) {
|
||||
}
|
||||
|
||||
ssize_t CommonTokenStream::adjustSeekIndex(size_t i) {
|
||||
return nextTokenOnChannel(i, channel);
|
||||
}
|
||||
|
||||
Token* CommonTokenStream::LB(size_t k) {
|
||||
if (k == 0 || k > _p) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ssize_t i = static_cast<ssize_t>(_p);
|
||||
size_t n = 1;
|
||||
// find k good tokens looking backwards
|
||||
while (n <= k) {
|
||||
// skip off-channel tokens
|
||||
i = previousTokenOnChannel(i - 1, channel);
|
||||
n++;
|
||||
}
|
||||
if (i < 0) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return _tokens[i].get();
|
||||
}
|
||||
|
||||
Token* CommonTokenStream::LT(ssize_t k) {
|
||||
lazyInit();
|
||||
if (k == 0) {
|
||||
return nullptr;
|
||||
}
|
||||
if (k < 0) {
|
||||
return LB(static_cast<size_t>(-k));
|
||||
}
|
||||
size_t i = _p;
|
||||
ssize_t n = 1; // we know tokens[p] is a good one
|
||||
// find k good tokens
|
||||
while (n < k) {
|
||||
// skip off-channel tokens, but make sure to not look past EOF
|
||||
if (sync(i + 1)) {
|
||||
i = nextTokenOnChannel(i + 1, channel);
|
||||
}
|
||||
n++;
|
||||
}
|
||||
|
||||
return _tokens[i].get();
|
||||
}
|
||||
|
||||
int CommonTokenStream::getNumberOfOnChannelTokens() {
|
||||
int n = 0;
|
||||
fill();
|
||||
for (size_t i = 0; i < _tokens.size(); i++) {
|
||||
Token *t = _tokens[i].get();
|
||||
if (t->getChannel() == channel) {
|
||||
n++;
|
||||
}
|
||||
if (t->getType() == Token::EOF) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return n;
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BufferedTokenStream.h"
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
/**
|
||||
* This class extends {@link BufferedTokenStream} with functionality to filter
|
||||
* token streams to tokens on a particular channel (tokens where
|
||||
* {@link Token#getChannel} returns a particular value).
|
||||
*
|
||||
* <p>
|
||||
* This token stream provides access to all tokens by index or when calling
|
||||
* methods like {@link #getText}. The channel filtering is only used for code
|
||||
* accessing tokens via the lookahead methods {@link #LA}, {@link #LT}, and
|
||||
* {@link #LB}.</p>
|
||||
*
|
||||
* <p>
|
||||
* By default, tokens are placed on the default channel
|
||||
* ({@link Token#DEFAULT_CHANNEL}), but may be reassigned by using the
|
||||
* {@code ->channel(HIDDEN)} lexer command, or by using an embedded action to
|
||||
* call {@link Lexer#setChannel}.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Note: lexer rules which use the {@code ->skip} lexer command or call
|
||||
* {@link Lexer#skip} do not produce tokens at all, so input text matched by
|
||||
* such a rule will not be available as part of the token stream, regardless of
|
||||
* channel.</p>
|
||||
*/
|
||||
class ANTLR4CPP_PUBLIC CommonTokenStream : public BufferedTokenStream {
|
||||
public:
|
||||
/**
|
||||
* Constructs a new {@link CommonTokenStream} using the specified token
|
||||
* source and the default token channel ({@link Token#DEFAULT_CHANNEL}).
|
||||
*
|
||||
* @param tokenSource The token source.
|
||||
*/
|
||||
CommonTokenStream(TokenSource *tokenSource);
|
||||
|
||||
/**
|
||||
* Constructs a new {@link CommonTokenStream} using the specified token
|
||||
* source and filtering tokens to the specified channel. Only tokens whose
|
||||
* {@link Token#getChannel} matches {@code channel} or have the
|
||||
* {@link Token#getType} equal to {@link Token#EOF} will be returned by the
|
||||
* token stream lookahead methods.
|
||||
*
|
||||
* @param tokenSource The token source.
|
||||
* @param channel The channel to use for filtering tokens.
|
||||
*/
|
||||
CommonTokenStream(TokenSource *tokenSource, size_t channel);
|
||||
|
||||
virtual Token* LT(ssize_t k) override;
|
||||
|
||||
/// Count EOF just once.
|
||||
virtual int getNumberOfOnChannelTokens();
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Specifies the channel to use for filtering tokens.
|
||||
*
|
||||
* <p>
|
||||
* The default value is {@link Token#DEFAULT_CHANNEL}, which matches the
|
||||
* default channel assigned to tokens created by the lexer.</p>
|
||||
*/
|
||||
size_t channel;
|
||||
|
||||
virtual ssize_t adjustSeekIndex(size_t i) override;
|
||||
|
||||
virtual Token* LB(size_t k) override;
|
||||
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,15 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include "ConsoleErrorListener.h"
|
||||
|
||||
using namespace antlr4;
|
||||
|
||||
ConsoleErrorListener ConsoleErrorListener::INSTANCE;
|
||||
|
||||
void ConsoleErrorListener::syntaxError(Recognizer * /*recognizer*/, Token * /*offendingSymbol*/,
|
||||
size_t line, size_t charPositionInLine, const std::string &msg, std::exception_ptr /*e*/) {
|
||||
std::cerr << "line " << line << ":" << charPositionInLine << " " << msg << std::endl;
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BaseErrorListener.h"
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
class ANTLR4CPP_PUBLIC ConsoleErrorListener : public BaseErrorListener {
|
||||
public:
|
||||
/**
|
||||
* Provides a default instance of {@link ConsoleErrorListener}.
|
||||
*/
|
||||
static ConsoleErrorListener INSTANCE;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>
|
||||
* This implementation prints messages to {@link System#err} containing the
|
||||
* values of {@code line}, {@code charPositionInLine}, and {@code msg} using
|
||||
* the following format.</p>
|
||||
*
|
||||
* <pre>
|
||||
* line <em>line</em>:<em>charPositionInLine</em> <em>msg</em>
|
||||
* </pre>
|
||||
*/
|
||||
virtual void syntaxError(Recognizer *recognizer, Token * offendingSymbol, size_t line, size_t charPositionInLine,
|
||||
const std::string &msg, std::exception_ptr e) override;
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,336 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include "NoViableAltException.h"
|
||||
#include "misc/IntervalSet.h"
|
||||
#include "atn/ParserATNSimulator.h"
|
||||
#include "InputMismatchException.h"
|
||||
#include "FailedPredicateException.h"
|
||||
#include "ParserRuleContext.h"
|
||||
#include "atn/RuleTransition.h"
|
||||
#include "atn/ATN.h"
|
||||
#include "atn/ATNState.h"
|
||||
#include "support/StringUtils.h"
|
||||
#include "support/Casts.h"
|
||||
#include "Parser.h"
|
||||
#include "CommonToken.h"
|
||||
#include "Vocabulary.h"
|
||||
|
||||
#include "DefaultErrorStrategy.h"
|
||||
|
||||
using namespace antlr4;
|
||||
using namespace antlr4::atn;
|
||||
|
||||
using namespace antlrcpp;
|
||||
|
||||
DefaultErrorStrategy::DefaultErrorStrategy() {
|
||||
InitializeInstanceFields();
|
||||
}
|
||||
|
||||
DefaultErrorStrategy::~DefaultErrorStrategy() {
|
||||
}
|
||||
|
||||
void DefaultErrorStrategy::reset(Parser *recognizer) {
|
||||
_errorSymbols.clear();
|
||||
endErrorCondition(recognizer);
|
||||
}
|
||||
|
||||
void DefaultErrorStrategy::beginErrorCondition(Parser * /*recognizer*/) {
|
||||
errorRecoveryMode = true;
|
||||
}
|
||||
|
||||
bool DefaultErrorStrategy::inErrorRecoveryMode(Parser * /*recognizer*/) {
|
||||
return errorRecoveryMode;
|
||||
}
|
||||
|
||||
void DefaultErrorStrategy::endErrorCondition(Parser * /*recognizer*/) {
|
||||
errorRecoveryMode = false;
|
||||
lastErrorIndex = -1;
|
||||
}
|
||||
|
||||
void DefaultErrorStrategy::reportMatch(Parser *recognizer) {
|
||||
endErrorCondition(recognizer);
|
||||
}
|
||||
|
||||
void DefaultErrorStrategy::reportError(Parser *recognizer, const RecognitionException &e) {
|
||||
// If we've already reported an error and have not matched a token
|
||||
// yet successfully, don't report any errors.
|
||||
if (inErrorRecoveryMode(recognizer)) {
|
||||
return; // don't report spurious errors
|
||||
}
|
||||
|
||||
beginErrorCondition(recognizer);
|
||||
if (is<const NoViableAltException *>(&e)) {
|
||||
reportNoViableAlternative(recognizer, static_cast<const NoViableAltException &>(e));
|
||||
} else if (is<const InputMismatchException *>(&e)) {
|
||||
reportInputMismatch(recognizer, static_cast<const InputMismatchException &>(e));
|
||||
} else if (is<const FailedPredicateException *>(&e)) {
|
||||
reportFailedPredicate(recognizer, static_cast<const FailedPredicateException &>(e));
|
||||
} else if (is<const RecognitionException *>(&e)) {
|
||||
recognizer->notifyErrorListeners(e.getOffendingToken(), e.what(), std::current_exception());
|
||||
}
|
||||
}
|
||||
|
||||
void DefaultErrorStrategy::recover(Parser *recognizer, std::exception_ptr /*e*/) {
|
||||
if (lastErrorIndex == static_cast<int>(recognizer->getInputStream()->index()) &&
|
||||
lastErrorStates.contains(recognizer->getState())) {
|
||||
|
||||
// uh oh, another error at same token index and previously-visited
|
||||
// state in ATN; must be a case where LT(1) is in the recovery
|
||||
// token set so nothing got consumed. Consume a single token
|
||||
// at least to prevent an infinite loop; this is a failsafe.
|
||||
recognizer->consume();
|
||||
}
|
||||
lastErrorIndex = static_cast<int>(recognizer->getInputStream()->index());
|
||||
lastErrorStates.add(recognizer->getState());
|
||||
misc::IntervalSet followSet = getErrorRecoverySet(recognizer);
|
||||
consumeUntil(recognizer, followSet);
|
||||
}
|
||||
|
||||
void DefaultErrorStrategy::sync(Parser *recognizer) {
|
||||
atn::ATNState *s = recognizer->getInterpreter<atn::ATNSimulator>()->atn.states[recognizer->getState()];
|
||||
|
||||
// If already recovering, don't try to sync
|
||||
if (inErrorRecoveryMode(recognizer)) {
|
||||
return;
|
||||
}
|
||||
|
||||
TokenStream *tokens = recognizer->getTokenStream();
|
||||
size_t la = tokens->LA(1);
|
||||
|
||||
// try cheaper subset first; might get lucky. seems to shave a wee bit off
|
||||
auto nextTokens = recognizer->getATN().nextTokens(s);
|
||||
if (nextTokens.contains(Token::EPSILON) || nextTokens.contains(la)) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (s->getStateType()) {
|
||||
case atn::ATNStateType::BLOCK_START:
|
||||
case atn::ATNStateType::STAR_BLOCK_START:
|
||||
case atn::ATNStateType::PLUS_BLOCK_START:
|
||||
case atn::ATNStateType::STAR_LOOP_ENTRY:
|
||||
// report error and recover if possible
|
||||
if (singleTokenDeletion(recognizer) != nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
throw InputMismatchException(recognizer);
|
||||
|
||||
case atn::ATNStateType::PLUS_LOOP_BACK:
|
||||
case atn::ATNStateType::STAR_LOOP_BACK: {
|
||||
reportUnwantedToken(recognizer);
|
||||
misc::IntervalSet expecting = recognizer->getExpectedTokens();
|
||||
misc::IntervalSet whatFollowsLoopIterationOrRule = expecting.Or(getErrorRecoverySet(recognizer));
|
||||
consumeUntil(recognizer, whatFollowsLoopIterationOrRule);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// do nothing if we can't identify the exact kind of ATN state
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void DefaultErrorStrategy::reportNoViableAlternative(Parser *recognizer, const NoViableAltException &e) {
|
||||
TokenStream *tokens = recognizer->getTokenStream();
|
||||
std::string input;
|
||||
if (tokens != nullptr) {
|
||||
if (e.getStartToken()->getType() == Token::EOF) {
|
||||
input = "<EOF>";
|
||||
} else {
|
||||
input = tokens->getText(e.getStartToken(), e.getOffendingToken());
|
||||
}
|
||||
} else {
|
||||
input = "<unknown input>";
|
||||
}
|
||||
std::string msg = "no viable alternative at input " + escapeWSAndQuote(input);
|
||||
recognizer->notifyErrorListeners(e.getOffendingToken(), msg, std::make_exception_ptr(e));
|
||||
}
|
||||
|
||||
void DefaultErrorStrategy::reportInputMismatch(Parser *recognizer, const InputMismatchException &e) {
|
||||
std::string msg = "mismatched input " + getTokenErrorDisplay(e.getOffendingToken()) +
|
||||
" expecting " + e.getExpectedTokens().toString(recognizer->getVocabulary());
|
||||
recognizer->notifyErrorListeners(e.getOffendingToken(), msg, std::make_exception_ptr(e));
|
||||
}
|
||||
|
||||
void DefaultErrorStrategy::reportFailedPredicate(Parser *recognizer, const FailedPredicateException &e) {
|
||||
const std::string& ruleName = recognizer->getRuleNames()[recognizer->getContext()->getRuleIndex()];
|
||||
std::string msg = "rule " + ruleName + " " + e.what();
|
||||
recognizer->notifyErrorListeners(e.getOffendingToken(), msg, std::make_exception_ptr(e));
|
||||
}
|
||||
|
||||
void DefaultErrorStrategy::reportUnwantedToken(Parser *recognizer) {
|
||||
if (inErrorRecoveryMode(recognizer)) {
|
||||
return;
|
||||
}
|
||||
|
||||
beginErrorCondition(recognizer);
|
||||
|
||||
Token *t = recognizer->getCurrentToken();
|
||||
std::string tokenName = getTokenErrorDisplay(t);
|
||||
misc::IntervalSet expecting = getExpectedTokens(recognizer);
|
||||
|
||||
std::string msg = "extraneous input " + tokenName + " expecting " + expecting.toString(recognizer->getVocabulary());
|
||||
recognizer->notifyErrorListeners(t, msg, nullptr);
|
||||
}
|
||||
|
||||
void DefaultErrorStrategy::reportMissingToken(Parser *recognizer) {
|
||||
if (inErrorRecoveryMode(recognizer)) {
|
||||
return;
|
||||
}
|
||||
|
||||
beginErrorCondition(recognizer);
|
||||
|
||||
Token *t = recognizer->getCurrentToken();
|
||||
misc::IntervalSet expecting = getExpectedTokens(recognizer);
|
||||
std::string expectedText = expecting.toString(recognizer->getVocabulary());
|
||||
std::string msg = "missing " + expectedText + " at " + getTokenErrorDisplay(t);
|
||||
|
||||
recognizer->notifyErrorListeners(t, msg, nullptr);
|
||||
}
|
||||
|
||||
Token* DefaultErrorStrategy::recoverInline(Parser *recognizer) {
|
||||
// Single token deletion.
|
||||
Token *matchedSymbol = singleTokenDeletion(recognizer);
|
||||
if (matchedSymbol) {
|
||||
// We have deleted the extra token.
|
||||
// Now, move past ttype token as if all were ok.
|
||||
recognizer->consume();
|
||||
return matchedSymbol;
|
||||
}
|
||||
|
||||
// Single token insertion.
|
||||
if (singleTokenInsertion(recognizer)) {
|
||||
return getMissingSymbol(recognizer);
|
||||
}
|
||||
|
||||
// Even that didn't work; must throw the exception.
|
||||
throw InputMismatchException(recognizer);
|
||||
}
|
||||
|
||||
bool DefaultErrorStrategy::singleTokenInsertion(Parser *recognizer) {
|
||||
ssize_t currentSymbolType = recognizer->getInputStream()->LA(1);
|
||||
|
||||
// if current token is consistent with what could come after current
|
||||
// ATN state, then we know we're missing a token; error recovery
|
||||
// is free to conjure up and insert the missing token
|
||||
atn::ATNState *currentState = recognizer->getInterpreter<atn::ATNSimulator>()->atn.states[recognizer->getState()];
|
||||
atn::ATNState *next = currentState->transitions[0]->target;
|
||||
const atn::ATN &atn = recognizer->getInterpreter<atn::ATNSimulator>()->atn;
|
||||
misc::IntervalSet expectingAtLL2 = atn.nextTokens(next, recognizer->getContext());
|
||||
if (expectingAtLL2.contains(currentSymbolType)) {
|
||||
reportMissingToken(recognizer);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Token* DefaultErrorStrategy::singleTokenDeletion(Parser *recognizer) {
|
||||
size_t nextTokenType = recognizer->getInputStream()->LA(2);
|
||||
misc::IntervalSet expecting = getExpectedTokens(recognizer);
|
||||
if (expecting.contains(nextTokenType)) {
|
||||
reportUnwantedToken(recognizer);
|
||||
recognizer->consume(); // simply delete extra token
|
||||
// we want to return the token we're actually matching
|
||||
Token *matchedSymbol = recognizer->getCurrentToken();
|
||||
reportMatch(recognizer); // we know current token is correct
|
||||
return matchedSymbol;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Token* DefaultErrorStrategy::getMissingSymbol(Parser *recognizer) {
|
||||
Token *currentSymbol = recognizer->getCurrentToken();
|
||||
misc::IntervalSet expecting = getExpectedTokens(recognizer);
|
||||
size_t expectedTokenType = expecting.getMinElement(); // get any element
|
||||
std::string tokenText;
|
||||
if (expectedTokenType == Token::EOF) {
|
||||
tokenText = "<missing EOF>";
|
||||
} else {
|
||||
tokenText = "<missing " + recognizer->getVocabulary().getDisplayName(expectedTokenType) + ">";
|
||||
}
|
||||
Token *current = currentSymbol;
|
||||
Token *lookback = recognizer->getTokenStream()->LT(-1);
|
||||
if (current->getType() == Token::EOF && lookback != nullptr) {
|
||||
current = lookback;
|
||||
}
|
||||
|
||||
_errorSymbols.push_back(recognizer->getTokenFactory()->create(
|
||||
{ current->getTokenSource(), current->getTokenSource()->getInputStream() },
|
||||
expectedTokenType, tokenText, Token::DEFAULT_CHANNEL, INVALID_INDEX, INVALID_INDEX,
|
||||
current->getLine(), current->getCharPositionInLine()));
|
||||
|
||||
return _errorSymbols.back().get();
|
||||
}
|
||||
|
||||
misc::IntervalSet DefaultErrorStrategy::getExpectedTokens(Parser *recognizer) {
|
||||
return recognizer->getExpectedTokens();
|
||||
}
|
||||
|
||||
std::string DefaultErrorStrategy::getTokenErrorDisplay(Token *t) {
|
||||
if (t == nullptr) {
|
||||
return "<no Token>";
|
||||
}
|
||||
std::string s = getSymbolText(t);
|
||||
if (s == "") {
|
||||
if (getSymbolType(t) == Token::EOF) {
|
||||
s = "<EOF>";
|
||||
} else {
|
||||
s = "<" + std::to_string(getSymbolType(t)) + ">";
|
||||
}
|
||||
}
|
||||
return escapeWSAndQuote(s);
|
||||
}
|
||||
|
||||
std::string DefaultErrorStrategy::getSymbolText(Token *symbol) {
|
||||
return symbol->getText();
|
||||
}
|
||||
|
||||
size_t DefaultErrorStrategy::getSymbolType(Token *symbol) {
|
||||
return symbol->getType();
|
||||
}
|
||||
|
||||
std::string DefaultErrorStrategy::escapeWSAndQuote(const std::string &s) const {
|
||||
std::string result;
|
||||
result.reserve(s.size() + 2);
|
||||
result.push_back('\'');
|
||||
antlrcpp::escapeWhitespace(result, s);
|
||||
result.push_back('\'');
|
||||
result.shrink_to_fit();
|
||||
return result;
|
||||
}
|
||||
|
||||
misc::IntervalSet DefaultErrorStrategy::getErrorRecoverySet(Parser *recognizer) {
|
||||
const atn::ATN &atn = recognizer->getInterpreter<atn::ATNSimulator>()->atn;
|
||||
RuleContext *ctx = recognizer->getContext();
|
||||
misc::IntervalSet recoverSet;
|
||||
while (ctx->invokingState != ATNState::INVALID_STATE_NUMBER) {
|
||||
// compute what follows who invoked us
|
||||
atn::ATNState *invokingState = atn.states[ctx->invokingState];
|
||||
const atn::RuleTransition *rt = downCast<const atn::RuleTransition*>(invokingState->transitions[0].get());
|
||||
misc::IntervalSet follow = atn.nextTokens(rt->followState);
|
||||
recoverSet.addAll(follow);
|
||||
|
||||
if (ctx->parent == nullptr)
|
||||
break;
|
||||
ctx = static_cast<RuleContext *>(ctx->parent);
|
||||
}
|
||||
recoverSet.remove(Token::EPSILON);
|
||||
|
||||
return recoverSet;
|
||||
}
|
||||
|
||||
void DefaultErrorStrategy::consumeUntil(Parser *recognizer, const misc::IntervalSet &set) {
|
||||
size_t ttype = recognizer->getInputStream()->LA(1);
|
||||
while (ttype != Token::EOF && !set.contains(ttype)) {
|
||||
recognizer->consume();
|
||||
ttype = recognizer->getInputStream()->LA(1);
|
||||
}
|
||||
}
|
||||
|
||||
void DefaultErrorStrategy::InitializeInstanceFields() {
|
||||
errorRecoveryMode = false;
|
||||
lastErrorIndex = -1;
|
||||
}
|
||||
@@ -1,466 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ANTLRErrorStrategy.h"
|
||||
#include "misc/IntervalSet.h"
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
/**
|
||||
* This is the default implementation of {@link ANTLRErrorStrategy} used for
|
||||
* error reporting and recovery in ANTLR parsers.
|
||||
*/
|
||||
class ANTLR4CPP_PUBLIC DefaultErrorStrategy : public ANTLRErrorStrategy {
|
||||
public:
|
||||
DefaultErrorStrategy();
|
||||
DefaultErrorStrategy(DefaultErrorStrategy const& other) = delete;
|
||||
virtual ~DefaultErrorStrategy();
|
||||
|
||||
DefaultErrorStrategy& operator = (DefaultErrorStrategy const& other) = delete;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Indicates whether the error strategy is currently "recovering from an
|
||||
* error". This is used to suppress reporting multiple error messages while
|
||||
* attempting to recover from a detected syntax error.
|
||||
*
|
||||
* @see #inErrorRecoveryMode
|
||||
*/
|
||||
bool errorRecoveryMode;
|
||||
|
||||
/** The index into the input stream where the last error occurred.
|
||||
* This is used to prevent infinite loops where an error is found
|
||||
* but no token is consumed during recovery...another error is found,
|
||||
* ad nauseum. This is a failsafe mechanism to guarantee that at least
|
||||
* one token/tree node is consumed for two errors.
|
||||
*/
|
||||
int lastErrorIndex;
|
||||
|
||||
misc::IntervalSet lastErrorStates;
|
||||
|
||||
/// <summary>
|
||||
/// {@inheritDoc}
|
||||
/// <p/>
|
||||
/// The default implementation simply calls <seealso cref="#endErrorCondition"/> to
|
||||
/// ensure that the handler is not in error recovery mode.
|
||||
/// </summary>
|
||||
public:
|
||||
virtual void reset(Parser *recognizer) override;
|
||||
|
||||
/// <summary>
|
||||
/// This method is called to enter error recovery mode when a recognition
|
||||
/// exception is reported.
|
||||
/// </summary>
|
||||
/// <param name="recognizer"> the parser instance </param>
|
||||
protected:
|
||||
virtual void beginErrorCondition(Parser *recognizer);
|
||||
|
||||
/// <summary>
|
||||
/// {@inheritDoc}
|
||||
/// </summary>
|
||||
public:
|
||||
virtual bool inErrorRecoveryMode(Parser *recognizer) override;
|
||||
|
||||
/// <summary>
|
||||
/// This method is called to leave error recovery mode after recovering from
|
||||
/// a recognition exception.
|
||||
/// </summary>
|
||||
/// <param name="recognizer"> </param>
|
||||
protected:
|
||||
virtual void endErrorCondition(Parser *recognizer);
|
||||
|
||||
/// <summary>
|
||||
/// {@inheritDoc}
|
||||
/// <p/>
|
||||
/// The default implementation simply calls <seealso cref="#endErrorCondition"/>.
|
||||
/// </summary>
|
||||
public:
|
||||
virtual void reportMatch(Parser *recognizer) override;
|
||||
|
||||
/// {@inheritDoc}
|
||||
/// <p/>
|
||||
/// The default implementation returns immediately if the handler is already
|
||||
/// in error recovery mode. Otherwise, it calls <seealso cref="#beginErrorCondition"/>
|
||||
/// and dispatches the reporting task based on the runtime type of {@code e}
|
||||
/// according to the following table.
|
||||
///
|
||||
/// <ul>
|
||||
/// <li><seealso cref="NoViableAltException"/>: Dispatches the call to
|
||||
/// <seealso cref="#reportNoViableAlternative"/></li>
|
||||
/// <li><seealso cref="InputMismatchException"/>: Dispatches the call to
|
||||
/// <seealso cref="#reportInputMismatch"/></li>
|
||||
/// <li><seealso cref="FailedPredicateException"/>: Dispatches the call to
|
||||
/// <seealso cref="#reportFailedPredicate"/></li>
|
||||
/// <li>All other types: calls <seealso cref="Parser#notifyErrorListeners"/> to report
|
||||
/// the exception</li>
|
||||
/// </ul>
|
||||
virtual void reportError(Parser *recognizer, const RecognitionException &e) override;
|
||||
|
||||
/// <summary>
|
||||
/// {@inheritDoc}
|
||||
/// <p/>
|
||||
/// The default implementation resynchronizes the parser by consuming tokens
|
||||
/// until we find one in the resynchronization set--loosely the set of tokens
|
||||
/// that can follow the current rule.
|
||||
/// </summary>
|
||||
virtual void recover(Parser *recognizer, std::exception_ptr e) override;
|
||||
|
||||
/**
|
||||
* The default implementation of {@link ANTLRErrorStrategy#sync} makes sure
|
||||
* that the current lookahead symbol is consistent with what were expecting
|
||||
* at this point in the ATN. You can call this anytime but ANTLR only
|
||||
* generates code to check before subrules/loops and each iteration.
|
||||
*
|
||||
* <p>Implements Jim Idle's magic sync mechanism in closures and optional
|
||||
* subrules. E.g.,</p>
|
||||
*
|
||||
* <pre>
|
||||
* a : sync ( stuff sync )* ;
|
||||
* sync : {consume to what can follow sync} ;
|
||||
* </pre>
|
||||
*
|
||||
* At the start of a sub rule upon error, {@link #sync} performs single
|
||||
* token deletion, if possible. If it can't do that, it bails on the current
|
||||
* rule and uses the default error recovery, which consumes until the
|
||||
* resynchronization set of the current rule.
|
||||
*
|
||||
* <p>If the sub rule is optional ({@code (...)?}, {@code (...)*}, or block
|
||||
* with an empty alternative), then the expected set includes what follows
|
||||
* the subrule.</p>
|
||||
*
|
||||
* <p>During loop iteration, it consumes until it sees a token that can start a
|
||||
* sub rule or what follows loop. Yes, that is pretty aggressive. We opt to
|
||||
* stay in the loop as long as possible.</p>
|
||||
*
|
||||
* <p><strong>ORIGINS</strong></p>
|
||||
*
|
||||
* <p>Previous versions of ANTLR did a poor job of their recovery within loops.
|
||||
* A single mismatch token or missing token would force the parser to bail
|
||||
* out of the entire rules surrounding the loop. So, for rule</p>
|
||||
*
|
||||
* <pre>
|
||||
* classDef : 'class' ID '{' member* '}'
|
||||
* </pre>
|
||||
*
|
||||
* input with an extra token between members would force the parser to
|
||||
* consume until it found the next class definition rather than the next
|
||||
* member definition of the current class.
|
||||
*
|
||||
* <p>This functionality cost a little bit of effort because the parser has to
|
||||
* compare token set at the start of the loop and at each iteration. If for
|
||||
* some reason speed is suffering for you, you can turn off this
|
||||
* functionality by simply overriding this method as a blank { }.</p>
|
||||
*/
|
||||
virtual void sync(Parser *recognizer) override;
|
||||
|
||||
/// <summary>
|
||||
/// This is called by <seealso cref="#reportError"/> when the exception is a
|
||||
/// <seealso cref="NoViableAltException"/>.
|
||||
/// </summary>
|
||||
/// <seealso cref= #reportError
|
||||
/// </seealso>
|
||||
/// <param name="recognizer"> the parser instance </param>
|
||||
/// <param name="e"> the recognition exception </param>
|
||||
protected:
|
||||
virtual void reportNoViableAlternative(Parser *recognizer, const NoViableAltException &e);
|
||||
|
||||
/// <summary>
|
||||
/// This is called by <seealso cref="#reportError"/> when the exception is an
|
||||
/// <seealso cref="InputMismatchException"/>.
|
||||
/// </summary>
|
||||
/// <seealso cref= #reportError
|
||||
/// </seealso>
|
||||
/// <param name="recognizer"> the parser instance </param>
|
||||
/// <param name="e"> the recognition exception </param>
|
||||
virtual void reportInputMismatch(Parser *recognizer, const InputMismatchException &e);
|
||||
|
||||
/// <summary>
|
||||
/// This is called by <seealso cref="#reportError"/> when the exception is a
|
||||
/// <seealso cref="FailedPredicateException"/>.
|
||||
/// </summary>
|
||||
/// <seealso cref= #reportError
|
||||
/// </seealso>
|
||||
/// <param name="recognizer"> the parser instance </param>
|
||||
/// <param name="e"> the recognition exception </param>
|
||||
virtual void reportFailedPredicate(Parser *recognizer, const FailedPredicateException &e);
|
||||
|
||||
/**
|
||||
* This method is called to report a syntax error which requires the removal
|
||||
* of a token from the input stream. At the time this method is called, the
|
||||
* erroneous symbol is current {@code LT(1)} symbol and has not yet been
|
||||
* removed from the input stream. When this method returns,
|
||||
* {@code recognizer} is in error recovery mode.
|
||||
*
|
||||
* <p>This method is called when {@link #singleTokenDeletion} identifies
|
||||
* single-token deletion as a viable recovery strategy for a mismatched
|
||||
* input error.</p>
|
||||
*
|
||||
* <p>The default implementation simply returns if the handler is already in
|
||||
* error recovery mode. Otherwise, it calls {@link #beginErrorCondition} to
|
||||
* enter error recovery mode, followed by calling
|
||||
* {@link Parser#notifyErrorListeners}.</p>
|
||||
*
|
||||
* @param recognizer the parser instance
|
||||
*/
|
||||
virtual void reportUnwantedToken(Parser *recognizer);
|
||||
|
||||
/**
|
||||
* This method is called to report a syntax error which requires the
|
||||
* insertion of a missing token into the input stream. At the time this
|
||||
* method is called, the missing token has not yet been inserted. When this
|
||||
* method returns, {@code recognizer} is in error recovery mode.
|
||||
*
|
||||
* <p>This method is called when {@link #singleTokenInsertion} identifies
|
||||
* single-token insertion as a viable recovery strategy for a mismatched
|
||||
* input error.</p>
|
||||
*
|
||||
* <p>The default implementation simply returns if the handler is already in
|
||||
* error recovery mode. Otherwise, it calls {@link #beginErrorCondition} to
|
||||
* enter error recovery mode, followed by calling
|
||||
* {@link Parser#notifyErrorListeners}.</p>
|
||||
*
|
||||
* @param recognizer the parser instance
|
||||
*/
|
||||
virtual void reportMissingToken(Parser *recognizer);
|
||||
|
||||
public:
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation attempts to recover from the mismatched input
|
||||
* by using single token insertion and deletion as described below. If the
|
||||
* recovery attempt fails, this method throws an
|
||||
* {@link InputMismatchException}.</p>
|
||||
*
|
||||
* <p><strong>EXTRA TOKEN</strong> (single token deletion)</p>
|
||||
*
|
||||
* <p>{@code LA(1)} is not what we are looking for. If {@code LA(2)} has the
|
||||
* right token, however, then assume {@code LA(1)} is some extra spurious
|
||||
* token and delete it. Then consume and return the next token (which was
|
||||
* the {@code LA(2)} token) as the successful result of the match operation.</p>
|
||||
*
|
||||
* <p>This recovery strategy is implemented by {@link #singleTokenDeletion}.</p>
|
||||
*
|
||||
* <p><strong>MISSING TOKEN</strong> (single token insertion)</p>
|
||||
*
|
||||
* <p>If current token (at {@code LA(1)}) is consistent with what could come
|
||||
* after the expected {@code LA(1)} token, then assume the token is missing
|
||||
* and use the parser's {@link TokenFactory} to create it on the fly. The
|
||||
* "insertion" is performed by returning the created token as the successful
|
||||
* result of the match operation.</p>
|
||||
*
|
||||
* <p>This recovery strategy is implemented by {@link #singleTokenInsertion}.</p>
|
||||
*
|
||||
* <p><strong>EXAMPLE</strong></p>
|
||||
*
|
||||
* <p>For example, Input {@code i=(3;} is clearly missing the {@code ')'}. When
|
||||
* the parser returns from the nested call to {@code expr}, it will have
|
||||
* call chain:</p>
|
||||
*
|
||||
* <pre>
|
||||
* stat → expr → atom
|
||||
* </pre>
|
||||
*
|
||||
* and it will be trying to match the {@code ')'} at this point in the
|
||||
* derivation:
|
||||
*
|
||||
* <pre>
|
||||
* => ID '=' '(' INT ')' ('+' atom)* ';'
|
||||
* ^
|
||||
* </pre>
|
||||
*
|
||||
* The attempt to match {@code ')'} will fail when it sees {@code ';'} and
|
||||
* call {@link #recoverInline}. To recover, it sees that {@code LA(1)==';'}
|
||||
* is in the set of tokens that can follow the {@code ')'} token reference
|
||||
* in rule {@code atom}. It can assume that you forgot the {@code ')'}.
|
||||
*/
|
||||
virtual Token* recoverInline(Parser *recognizer) override;
|
||||
|
||||
/// <summary>
|
||||
/// This method implements the single-token insertion inline error recovery
|
||||
/// strategy. It is called by <seealso cref="#recoverInline"/> if the single-token
|
||||
/// deletion strategy fails to recover from the mismatched input. If this
|
||||
/// method returns {@code true}, {@code recognizer} will be in error recovery
|
||||
/// mode.
|
||||
/// <p/>
|
||||
/// This method determines whether or not single-token insertion is viable by
|
||||
/// checking if the {@code LA(1)} input symbol could be successfully matched
|
||||
/// if it were instead the {@code LA(2)} symbol. If this method returns
|
||||
/// {@code true}, the caller is responsible for creating and inserting a
|
||||
/// token with the correct type to produce this behavior.
|
||||
/// </summary>
|
||||
/// <param name="recognizer"> the parser instance </param>
|
||||
/// <returns> {@code true} if single-token insertion is a viable recovery
|
||||
/// strategy for the current mismatched input, otherwise {@code false} </returns>
|
||||
protected:
|
||||
virtual bool singleTokenInsertion(Parser *recognizer);
|
||||
|
||||
/// <summary>
|
||||
/// This method implements the single-token deletion inline error recovery
|
||||
/// strategy. It is called by <seealso cref="#recoverInline"/> to attempt to recover
|
||||
/// from mismatched input. If this method returns null, the parser and error
|
||||
/// handler state will not have changed. If this method returns non-null,
|
||||
/// {@code recognizer} will <em>not</em> be in error recovery mode since the
|
||||
/// returned token was a successful match.
|
||||
/// <p/>
|
||||
/// If the single-token deletion is successful, this method calls
|
||||
/// <seealso cref="#reportUnwantedToken"/> to report the error, followed by
|
||||
/// <seealso cref="Parser#consume"/> to actually "delete" the extraneous token. Then,
|
||||
/// before returning <seealso cref="#reportMatch"/> is called to signal a successful
|
||||
/// match.
|
||||
/// </summary>
|
||||
/// <param name="recognizer"> the parser instance </param>
|
||||
/// <returns> the successfully matched <seealso cref="Token"/> instance if single-token
|
||||
/// deletion successfully recovers from the mismatched input, otherwise
|
||||
/// {@code null} </returns>
|
||||
virtual Token* singleTokenDeletion(Parser *recognizer);
|
||||
|
||||
/// <summary>
|
||||
/// Conjure up a missing token during error recovery.
|
||||
///
|
||||
/// The recognizer attempts to recover from single missing
|
||||
/// symbols. But, actions might refer to that missing symbol.
|
||||
/// For example, x=ID {f($x);}. The action clearly assumes
|
||||
/// that there has been an identifier matched previously and that
|
||||
/// $x points at that token. If that token is missing, but
|
||||
/// the next token in the stream is what we want we assume that
|
||||
/// this token is missing and we keep going. Because we
|
||||
/// have to return some token to replace the missing token,
|
||||
/// we have to conjure one up. This method gives the user control
|
||||
/// over the tokens returned for missing tokens. Mostly,
|
||||
/// you will want to create something special for identifier
|
||||
/// tokens. For literals such as '{' and ',', the default
|
||||
/// action in the parser or tree parser works. It simply creates
|
||||
/// a CommonToken of the appropriate type. The text will be the token.
|
||||
/// If you change what tokens must be created by the lexer,
|
||||
/// override this method to create the appropriate tokens.
|
||||
/// </summary>
|
||||
virtual Token* getMissingSymbol(Parser *recognizer);
|
||||
|
||||
virtual misc::IntervalSet getExpectedTokens(Parser *recognizer);
|
||||
|
||||
/// <summary>
|
||||
/// How should a token be displayed in an error message? The default
|
||||
/// is to display just the text, but during development you might
|
||||
/// want to have a lot of information spit out. Override in that case
|
||||
/// to use t.toString() (which, for CommonToken, dumps everything about
|
||||
/// the token). This is better than forcing you to override a method in
|
||||
/// your token objects because you don't have to go modify your lexer
|
||||
/// so that it creates a new class.
|
||||
/// </summary>
|
||||
virtual std::string getTokenErrorDisplay(Token *t);
|
||||
|
||||
virtual std::string getSymbolText(Token *symbol);
|
||||
|
||||
virtual size_t getSymbolType(Token *symbol);
|
||||
|
||||
virtual std::string escapeWSAndQuote(const std::string &s) const;
|
||||
|
||||
/* Compute the error recovery set for the current rule. During
|
||||
* rule invocation, the parser pushes the set of tokens that can
|
||||
* follow that rule reference on the stack; this amounts to
|
||||
* computing FIRST of what follows the rule reference in the
|
||||
* enclosing rule. See LinearApproximator.FIRST().
|
||||
* This local follow set only includes tokens
|
||||
* from within the rule; i.e., the FIRST computation done by
|
||||
* ANTLR stops at the end of a rule.
|
||||
*
|
||||
* EXAMPLE
|
||||
*
|
||||
* When you find a "no viable alt exception", the input is not
|
||||
* consistent with any of the alternatives for rule r. The best
|
||||
* thing to do is to consume tokens until you see something that
|
||||
* can legally follow a call to r *or* any rule that called r.
|
||||
* You don't want the exact set of viable next tokens because the
|
||||
* input might just be missing a token--you might consume the
|
||||
* rest of the input looking for one of the missing tokens.
|
||||
*
|
||||
* Consider grammar:
|
||||
*
|
||||
* a : '[' b ']'
|
||||
* | '(' b ')'
|
||||
* ;
|
||||
* b : c '^' INT ;
|
||||
* c : ID
|
||||
* | INT
|
||||
* ;
|
||||
*
|
||||
* At each rule invocation, the set of tokens that could follow
|
||||
* that rule is pushed on a stack. Here are the various
|
||||
* context-sensitive follow sets:
|
||||
*
|
||||
* FOLLOW(b1_in_a) = FIRST(']') = ']'
|
||||
* FOLLOW(b2_in_a) = FIRST(')') = ')'
|
||||
* FOLLOW(c_in_b) = FIRST('^') = '^'
|
||||
*
|
||||
* Upon erroneous input "[]", the call chain is
|
||||
*
|
||||
* a -> b -> c
|
||||
*
|
||||
* and, hence, the follow context stack is:
|
||||
*
|
||||
* depth follow set start of rule execution
|
||||
* 0 <EOF> a (from main())
|
||||
* 1 ']' b
|
||||
* 2 '^' c
|
||||
*
|
||||
* Notice that ')' is not included, because b would have to have
|
||||
* been called from a different context in rule a for ')' to be
|
||||
* included.
|
||||
*
|
||||
* For error recovery, we cannot consider FOLLOW(c)
|
||||
* (context-sensitive or otherwise). We need the combined set of
|
||||
* all context-sensitive FOLLOW sets--the set of all tokens that
|
||||
* could follow any reference in the call chain. We need to
|
||||
* resync to one of those tokens. Note that FOLLOW(c)='^' and if
|
||||
* we resync'd to that token, we'd consume until EOF. We need to
|
||||
* sync to context-sensitive FOLLOWs for a, b, and c: {']','^'}.
|
||||
* In this case, for input "[]", LA(1) is ']' and in the set, so we would
|
||||
* not consume anything. After printing an error, rule c would
|
||||
* return normally. Rule b would not find the required '^' though.
|
||||
* At this point, it gets a mismatched token error and throws an
|
||||
* exception (since LA(1) is not in the viable following token
|
||||
* set). The rule exception handler tries to recover, but finds
|
||||
* the same recovery set and doesn't consume anything. Rule b
|
||||
* exits normally returning to rule a. Now it finds the ']' (and
|
||||
* with the successful match exits errorRecovery mode).
|
||||
*
|
||||
* So, you can see that the parser walks up the call chain looking
|
||||
* for the token that was a member of the recovery set.
|
||||
*
|
||||
* Errors are not generated in errorRecovery mode.
|
||||
*
|
||||
* ANTLR's error recovery mechanism is based upon original ideas:
|
||||
*
|
||||
* "Algorithms + Data Structures = Programs" by Niklaus Wirth
|
||||
*
|
||||
* and
|
||||
*
|
||||
* "A note on error recovery in recursive descent parsers":
|
||||
* http://portal.acm.org/citation.cfm?id=947902.947905
|
||||
*
|
||||
* Later, Josef Grosch had some good ideas:
|
||||
*
|
||||
* "Efficient and Comfortable Error Recovery in Recursive Descent
|
||||
* Parsers":
|
||||
* ftp://www.cocolab.com/products/cocktail/doca4.ps/ell.ps.zip
|
||||
*
|
||||
* Like Grosch I implement context-sensitive FOLLOW sets that are combined
|
||||
* at run-time upon error to avoid overhead during parsing.
|
||||
*/
|
||||
virtual misc::IntervalSet getErrorRecoverySet(Parser *recognizer);
|
||||
|
||||
/// <summary>
|
||||
/// Consume tokens until one matches the given token set. </summary>
|
||||
virtual void consumeUntil(Parser *recognizer, const misc::IntervalSet &set);
|
||||
|
||||
private:
|
||||
std::vector<std::unique_ptr<Token>> _errorSymbols; // Temporarily created token.
|
||||
void InitializeInstanceFields();
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,84 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include "atn/PredictionContext.h"
|
||||
#include "atn/ATNConfig.h"
|
||||
#include "atn/ATNConfigSet.h"
|
||||
#include "Parser.h"
|
||||
#include "misc/Interval.h"
|
||||
#include "dfa/DFA.h"
|
||||
|
||||
#include "DiagnosticErrorListener.h"
|
||||
|
||||
using namespace antlr4;
|
||||
|
||||
DiagnosticErrorListener::DiagnosticErrorListener() : DiagnosticErrorListener(true) {
|
||||
}
|
||||
|
||||
DiagnosticErrorListener::DiagnosticErrorListener(bool exactOnly_) : exactOnly(exactOnly_) {
|
||||
}
|
||||
|
||||
void DiagnosticErrorListener::reportAmbiguity(Parser *recognizer, const dfa::DFA &dfa, size_t startIndex, size_t stopIndex,
|
||||
bool exact, const antlrcpp::BitSet &ambigAlts, atn::ATNConfigSet *configs) {
|
||||
if (exactOnly && !exact) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::string decision = getDecisionDescription(recognizer, dfa);
|
||||
antlrcpp::BitSet conflictingAlts = getConflictingAlts(ambigAlts, configs);
|
||||
std::string text = recognizer->getTokenStream()->getText(misc::Interval(startIndex, stopIndex));
|
||||
std::string message = "reportAmbiguity d=" + decision + ": ambigAlts=" + conflictingAlts.toString() +
|
||||
", input='" + text + "'";
|
||||
|
||||
recognizer->notifyErrorListeners(message);
|
||||
}
|
||||
|
||||
void DiagnosticErrorListener::reportAttemptingFullContext(Parser *recognizer, const dfa::DFA &dfa, size_t startIndex,
|
||||
size_t stopIndex, const antlrcpp::BitSet &/*conflictingAlts*/, atn::ATNConfigSet * /*configs*/) {
|
||||
std::string decision = getDecisionDescription(recognizer, dfa);
|
||||
std::string text = recognizer->getTokenStream()->getText(misc::Interval(startIndex, stopIndex));
|
||||
std::string message = "reportAttemptingFullContext d=" + decision + ", input='" + text + "'";
|
||||
recognizer->notifyErrorListeners(message);
|
||||
}
|
||||
|
||||
void DiagnosticErrorListener::reportContextSensitivity(Parser *recognizer, const dfa::DFA &dfa, size_t startIndex,
|
||||
size_t stopIndex, size_t /*prediction*/, atn::ATNConfigSet * /*configs*/) {
|
||||
std::string decision = getDecisionDescription(recognizer, dfa);
|
||||
std::string text = recognizer->getTokenStream()->getText(misc::Interval(startIndex, stopIndex));
|
||||
std::string message = "reportContextSensitivity d=" + decision + ", input='" + text + "'";
|
||||
recognizer->notifyErrorListeners(message);
|
||||
}
|
||||
|
||||
std::string DiagnosticErrorListener::getDecisionDescription(Parser *recognizer, const dfa::DFA &dfa) {
|
||||
size_t decision = dfa.decision;
|
||||
size_t ruleIndex = (reinterpret_cast<atn::ATNState*>(dfa.atnStartState))->ruleIndex;
|
||||
|
||||
const std::vector<std::string>& ruleNames = recognizer->getRuleNames();
|
||||
if (ruleIndex == INVALID_INDEX || ruleIndex >= ruleNames.size()) {
|
||||
return std::to_string(decision);
|
||||
}
|
||||
|
||||
std::string ruleName = ruleNames[ruleIndex];
|
||||
if (ruleName == "" || ruleName.empty()) {
|
||||
return std::to_string(decision);
|
||||
}
|
||||
|
||||
return std::to_string(decision) + " (" + ruleName + ")";
|
||||
}
|
||||
|
||||
antlrcpp::BitSet DiagnosticErrorListener::getConflictingAlts(const antlrcpp::BitSet &reportedAlts,
|
||||
atn::ATNConfigSet *configs) {
|
||||
if (reportedAlts.count() > 0) { // Not exactly like the original Java code, but this listener is only used
|
||||
// in the TestRig (where it never provides a good alt set), so it's probably ok so.
|
||||
return reportedAlts;
|
||||
}
|
||||
|
||||
antlrcpp::BitSet result;
|
||||
for (auto &config : configs->configs) {
|
||||
result.set(config->alt);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BaseErrorListener.h"
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
/// <summary>
|
||||
/// This implementation of <seealso cref="ANTLRErrorListener"/> can be used to identify
|
||||
/// certain potential correctness and performance problems in grammars. "Reports"
|
||||
/// are made by calling <seealso cref="Parser#notifyErrorListeners"/> with the appropriate
|
||||
/// message.
|
||||
///
|
||||
/// <ul>
|
||||
/// <li><b>Ambiguities</b>: These are cases where more than one path through the
|
||||
/// grammar can match the input.</li>
|
||||
/// <li><b>Weak context sensitivity</b>: These are cases where full-context
|
||||
/// prediction resolved an SLL conflict to a unique alternative which equaled the
|
||||
/// minimum alternative of the SLL conflict.</li>
|
||||
/// <li><b>Strong (forced) context sensitivity</b>: These are cases where the
|
||||
/// full-context prediction resolved an SLL conflict to a unique alternative,
|
||||
/// <em>and</em> the minimum alternative of the SLL conflict was found to not be
|
||||
/// a truly viable alternative. Two-stage parsing cannot be used for inputs where
|
||||
/// this situation occurs.</li>
|
||||
/// </ul>
|
||||
///
|
||||
/// @author Sam Harwell
|
||||
/// </summary>
|
||||
class ANTLR4CPP_PUBLIC DiagnosticErrorListener : public BaseErrorListener {
|
||||
/// <summary>
|
||||
/// When {@code true}, only exactly known ambiguities are reported.
|
||||
/// </summary>
|
||||
protected:
|
||||
const bool exactOnly;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of <seealso cref="DiagnosticErrorListener"/> which only
|
||||
/// reports exact ambiguities.
|
||||
/// </summary>
|
||||
public:
|
||||
DiagnosticErrorListener();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of <seealso cref="DiagnosticErrorListener"/>, specifying
|
||||
/// whether all ambiguities or only exact ambiguities are reported.
|
||||
/// </summary>
|
||||
/// <param name="exactOnly"> {@code true} to report only exact ambiguities, otherwise
|
||||
/// {@code false} to report all ambiguities. </param>
|
||||
DiagnosticErrorListener(bool exactOnly);
|
||||
|
||||
virtual void reportAmbiguity(Parser *recognizer, const dfa::DFA &dfa, size_t startIndex, size_t stopIndex, bool exact,
|
||||
const antlrcpp::BitSet &ambigAlts, atn::ATNConfigSet *configs) override;
|
||||
|
||||
virtual void reportAttemptingFullContext(Parser *recognizer, const dfa::DFA &dfa, size_t startIndex, size_t stopIndex,
|
||||
const antlrcpp::BitSet &conflictingAlts, atn::ATNConfigSet *configs) override;
|
||||
|
||||
virtual void reportContextSensitivity(Parser *recognizer, const dfa::DFA &dfa, size_t startIndex, size_t stopIndex,
|
||||
size_t prediction, atn::ATNConfigSet *configs) override;
|
||||
|
||||
protected:
|
||||
virtual std::string getDecisionDescription(Parser *recognizer, const dfa::DFA &dfa);
|
||||
|
||||
/// <summary>
|
||||
/// Computes the set of conflicting or ambiguous alternatives from a
|
||||
/// configuration set, if that information was not already provided by the
|
||||
/// parser.
|
||||
/// </summary>
|
||||
/// <param name="reportedAlts"> The set of conflicting or ambiguous alternatives, as
|
||||
/// reported by the parser. </param>
|
||||
/// <param name="configs"> The conflicting or ambiguous configuration set. </param>
|
||||
/// <returns> Returns {@code reportedAlts} if it is not {@code null}, otherwise
|
||||
/// returns the set of alternatives represented in {@code configs}. </returns>
|
||||
virtual antlrcpp::BitSet getConflictingAlts(const antlrcpp::BitSet &reportedAlts, atn::ATNConfigSet *configs);
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,64 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include "Exceptions.h"
|
||||
|
||||
using namespace antlr4;
|
||||
|
||||
RuntimeException::RuntimeException(const std::string &msg) : std::exception(), _message(msg) {
|
||||
}
|
||||
|
||||
const char* RuntimeException::what() const noexcept {
|
||||
return _message.c_str();
|
||||
}
|
||||
|
||||
//------------------ IOException ---------------------------------------------------------------------------------------
|
||||
|
||||
IOException::IOException(const std::string &msg) : std::exception(), _message(msg) {
|
||||
}
|
||||
|
||||
const char* IOException::what() const noexcept {
|
||||
return _message.c_str();
|
||||
}
|
||||
|
||||
//------------------ IllegalStateException -----------------------------------------------------------------------------
|
||||
|
||||
IllegalStateException::~IllegalStateException() {
|
||||
}
|
||||
|
||||
//------------------ IllegalArgumentException --------------------------------------------------------------------------
|
||||
|
||||
IllegalArgumentException::~IllegalArgumentException() {
|
||||
}
|
||||
|
||||
//------------------ NullPointerException ------------------------------------------------------------------------------
|
||||
|
||||
NullPointerException::~NullPointerException() {
|
||||
}
|
||||
|
||||
//------------------ IndexOutOfBoundsException -------------------------------------------------------------------------
|
||||
|
||||
IndexOutOfBoundsException::~IndexOutOfBoundsException() {
|
||||
}
|
||||
|
||||
//------------------ UnsupportedOperationException ---------------------------------------------------------------------
|
||||
|
||||
UnsupportedOperationException::~UnsupportedOperationException() {
|
||||
}
|
||||
|
||||
//------------------ EmptyStackException -------------------------------------------------------------------------------
|
||||
|
||||
EmptyStackException::~EmptyStackException() {
|
||||
}
|
||||
|
||||
//------------------ CancellationException -----------------------------------------------------------------------------
|
||||
|
||||
CancellationException::~CancellationException() {
|
||||
}
|
||||
|
||||
//------------------ ParseCancellationException ------------------------------------------------------------------------
|
||||
|
||||
ParseCancellationException::~ParseCancellationException() {
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "antlr4-common.h"
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
// An exception hierarchy modelled loosely after java.lang.* exceptions.
|
||||
class ANTLR4CPP_PUBLIC RuntimeException : public std::exception {
|
||||
private:
|
||||
std::string _message;
|
||||
public:
|
||||
RuntimeException(const std::string &msg = "");
|
||||
|
||||
virtual const char* what() const noexcept override;
|
||||
};
|
||||
|
||||
class ANTLR4CPP_PUBLIC IllegalStateException : public RuntimeException {
|
||||
public:
|
||||
IllegalStateException(const std::string &msg = "") : RuntimeException(msg) {}
|
||||
IllegalStateException(IllegalStateException const&) = default;
|
||||
~IllegalStateException();
|
||||
IllegalStateException& operator=(IllegalStateException const&) = default;
|
||||
};
|
||||
|
||||
class ANTLR4CPP_PUBLIC IllegalArgumentException : public RuntimeException {
|
||||
public:
|
||||
IllegalArgumentException(IllegalArgumentException const&) = default;
|
||||
IllegalArgumentException(const std::string &msg = "") : RuntimeException(msg) {}
|
||||
~IllegalArgumentException();
|
||||
IllegalArgumentException& operator=(IllegalArgumentException const&) = default;
|
||||
};
|
||||
|
||||
class ANTLR4CPP_PUBLIC NullPointerException : public RuntimeException {
|
||||
public:
|
||||
NullPointerException(const std::string &msg = "") : RuntimeException(msg) {}
|
||||
NullPointerException(NullPointerException const&) = default;
|
||||
~NullPointerException();
|
||||
NullPointerException& operator=(NullPointerException const&) = default;
|
||||
};
|
||||
|
||||
class ANTLR4CPP_PUBLIC IndexOutOfBoundsException : public RuntimeException {
|
||||
public:
|
||||
IndexOutOfBoundsException(const std::string &msg = "") : RuntimeException(msg) {}
|
||||
IndexOutOfBoundsException(IndexOutOfBoundsException const&) = default;
|
||||
~IndexOutOfBoundsException();
|
||||
IndexOutOfBoundsException& operator=(IndexOutOfBoundsException const&) = default;
|
||||
};
|
||||
|
||||
class ANTLR4CPP_PUBLIC UnsupportedOperationException : public RuntimeException {
|
||||
public:
|
||||
UnsupportedOperationException(const std::string &msg = "") : RuntimeException(msg) {}
|
||||
UnsupportedOperationException(UnsupportedOperationException const&) = default;
|
||||
~UnsupportedOperationException();
|
||||
UnsupportedOperationException& operator=(UnsupportedOperationException const&) = default;
|
||||
|
||||
};
|
||||
|
||||
class ANTLR4CPP_PUBLIC EmptyStackException : public RuntimeException {
|
||||
public:
|
||||
EmptyStackException(const std::string &msg = "") : RuntimeException(msg) {}
|
||||
EmptyStackException(EmptyStackException const&) = default;
|
||||
~EmptyStackException();
|
||||
EmptyStackException& operator=(EmptyStackException const&) = default;
|
||||
};
|
||||
|
||||
// IOException is not a runtime exception (in the java hierarchy).
|
||||
// Hence we have to duplicate the RuntimeException implementation.
|
||||
class ANTLR4CPP_PUBLIC IOException : public std::exception {
|
||||
private:
|
||||
std::string _message;
|
||||
|
||||
public:
|
||||
IOException(const std::string &msg = "");
|
||||
|
||||
virtual const char* what() const noexcept override;
|
||||
};
|
||||
|
||||
class ANTLR4CPP_PUBLIC CancellationException : public IllegalStateException {
|
||||
public:
|
||||
CancellationException(const std::string &msg = "") : IllegalStateException(msg) {}
|
||||
CancellationException(CancellationException const&) = default;
|
||||
~CancellationException();
|
||||
CancellationException& operator=(CancellationException const&) = default;
|
||||
};
|
||||
|
||||
class ANTLR4CPP_PUBLIC ParseCancellationException : public CancellationException {
|
||||
public:
|
||||
ParseCancellationException(const std::string &msg = "") : CancellationException(msg) {}
|
||||
ParseCancellationException(ParseCancellationException const&) = default;
|
||||
~ParseCancellationException();
|
||||
ParseCancellationException& operator=(ParseCancellationException const&) = default;
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,52 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include "atn/ParserATNSimulator.h"
|
||||
#include "Parser.h"
|
||||
#include "atn/PredicateTransition.h"
|
||||
#include "atn/ATN.h"
|
||||
#include "atn/ATNState.h"
|
||||
#include "support/Casts.h"
|
||||
#include "support/CPPUtils.h"
|
||||
|
||||
#include "FailedPredicateException.h"
|
||||
|
||||
using namespace antlr4;
|
||||
using namespace antlrcpp;
|
||||
|
||||
FailedPredicateException::FailedPredicateException(Parser *recognizer) : FailedPredicateException(recognizer, "", "") {
|
||||
}
|
||||
|
||||
FailedPredicateException::FailedPredicateException(Parser *recognizer, const std::string &predicate): FailedPredicateException(recognizer, predicate, "") {
|
||||
}
|
||||
|
||||
FailedPredicateException::FailedPredicateException(Parser *recognizer, const std::string &predicate, const std::string &message)
|
||||
: RecognitionException(!message.empty() ? message : "failed predicate: " + predicate + "?", recognizer,
|
||||
recognizer->getInputStream(), recognizer->getContext(), recognizer->getCurrentToken()) {
|
||||
|
||||
atn::ATNState *s = recognizer->getInterpreter<atn::ATNSimulator>()->atn.states[recognizer->getState()];
|
||||
const atn::Transition *transition = s->transitions[0].get();
|
||||
if (transition->getTransitionType() == atn::TransitionType::PREDICATE) {
|
||||
_ruleIndex = downCast<const atn::PredicateTransition&>(*transition).getRuleIndex();
|
||||
_predicateIndex = downCast<const atn::PredicateTransition&>(*transition).getPredIndex();
|
||||
} else {
|
||||
_ruleIndex = 0;
|
||||
_predicateIndex = 0;
|
||||
}
|
||||
|
||||
_predicate = predicate;
|
||||
}
|
||||
|
||||
size_t FailedPredicateException::getRuleIndex() {
|
||||
return _ruleIndex;
|
||||
}
|
||||
|
||||
size_t FailedPredicateException::getPredIndex() {
|
||||
return _predicateIndex;
|
||||
}
|
||||
|
||||
std::string FailedPredicateException::getPredicate() {
|
||||
return _predicate;
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RecognitionException.h"
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
/// A semantic predicate failed during validation. Validation of predicates
|
||||
/// occurs when normally parsing the alternative just like matching a token.
|
||||
/// Disambiguating predicate evaluation occurs when we test a predicate during
|
||||
/// prediction.
|
||||
class ANTLR4CPP_PUBLIC FailedPredicateException : public RecognitionException {
|
||||
public:
|
||||
explicit FailedPredicateException(Parser *recognizer);
|
||||
FailedPredicateException(Parser *recognizer, const std::string &predicate);
|
||||
FailedPredicateException(Parser *recognizer, const std::string &predicate, const std::string &message);
|
||||
|
||||
virtual size_t getRuleIndex();
|
||||
virtual size_t getPredIndex();
|
||||
virtual std::string getPredicate();
|
||||
|
||||
private:
|
||||
size_t _ruleIndex;
|
||||
size_t _predicateIndex;
|
||||
std::string _predicate;
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,57 +0,0 @@
|
||||
// Copyright 2012-2022 The ANTLR Project
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
// provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
// and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
// conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
// with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
|
||||
// WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "antlr4-common.h"
|
||||
|
||||
#if ANTLR4CPP_USING_ABSEIL
|
||||
#include "absl/container/flat_hash_map.h"
|
||||
#else
|
||||
#include <unordered_map>
|
||||
#endif
|
||||
|
||||
// By default ANTLRv4 uses containers provided by the C++ standard library. In most deployments this
|
||||
// is fine, however in some using custom containers may be preferred. This header allows that by
|
||||
// optionally supporting some alternative implementations and allowing for more easier patching of
|
||||
// other alternatives.
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
#if ANTLR4CPP_USING_ABSEIL
|
||||
template <typename Key, typename Value,
|
||||
typename Hash = typename absl::flat_hash_map<Key, Value>::hasher,
|
||||
typename Equal = typename absl::flat_hash_map<Key, Value>::key_equal,
|
||||
typename Allocator = typename absl::flat_hash_map<Key, Value>::allocator_type>
|
||||
using FlatHashMap = absl::flat_hash_map<Key, Value, Hash, Equal, Allocator>;
|
||||
#else
|
||||
template <typename Key, typename Value,
|
||||
typename Hash = std::hash<Key>,
|
||||
typename Equal = std::equal_to<Key>,
|
||||
typename Allocator = std::allocator<std::pair<const Key, Value>>>
|
||||
using FlatHashMap = std::unordered_map<Key, Value, Hash, Equal, Allocator>;
|
||||
#endif
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,57 +0,0 @@
|
||||
// Copyright 2012-2022 The ANTLR Project
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
// provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
// and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
// conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
// with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
|
||||
// WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "antlr4-common.h"
|
||||
|
||||
#if ANTLR4CPP_USING_ABSEIL
|
||||
#include "absl/container/flat_hash_set.h"
|
||||
#else
|
||||
#include <unordered_set>
|
||||
#endif
|
||||
|
||||
// By default ANTLRv4 uses containers provided by the C++ standard library. In most deployments this
|
||||
// is fine, however in some using custom containers may be preferred. This header allows that by
|
||||
// optionally supporting some alternative implementations and allowing for more easier patching of
|
||||
// other alternatives.
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
#if ANTLR4CPP_USING_ABSEIL
|
||||
template <typename Key,
|
||||
typename Hash = typename absl::flat_hash_set<Key>::hasher,
|
||||
typename Equal = typename absl::flat_hash_set<Key>::key_equal,
|
||||
typename Allocator = typename absl::flat_hash_set<Key>::allocator_type>
|
||||
using FlatHashSet = absl::flat_hash_set<Key, Hash, Equal, Allocator>;
|
||||
#else
|
||||
template <typename Key,
|
||||
typename Hash = std::hash<Key>,
|
||||
typename Equal = std::equal_to<Key>,
|
||||
typename Allocator = std::allocator<Key>>
|
||||
using FlatHashSet = std::unordered_set<Key, Hash, Equal, Allocator>;
|
||||
#endif
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,18 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include "Parser.h"
|
||||
|
||||
#include "InputMismatchException.h"
|
||||
|
||||
using namespace antlr4;
|
||||
|
||||
InputMismatchException::InputMismatchException(Parser *recognizer)
|
||||
: RecognitionException(recognizer, recognizer->getInputStream(), recognizer->getContext(),
|
||||
recognizer->getCurrentToken()) {
|
||||
}
|
||||
|
||||
InputMismatchException::~InputMismatchException() {
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RecognitionException.h"
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
/// <summary>
|
||||
/// This signifies any kind of mismatched input exceptions such as
|
||||
/// when the current input does not match the expected token.
|
||||
/// </summary>
|
||||
class ANTLR4CPP_PUBLIC InputMismatchException : public RecognitionException {
|
||||
public:
|
||||
InputMismatchException(Parser *recognizer);
|
||||
InputMismatchException(InputMismatchException const&) = default;
|
||||
~InputMismatchException();
|
||||
InputMismatchException& operator=(InputMismatchException const&) = default;
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,12 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include "IntStream.h"
|
||||
|
||||
using namespace antlr4;
|
||||
|
||||
const std::string IntStream::UNKNOWN_SOURCE_NAME = "<unknown>";
|
||||
|
||||
IntStream::~IntStream() = default;
|
||||
@@ -1,218 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "antlr4-common.h"
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
/// <summary>
|
||||
/// A simple stream of symbols whose values are represented as integers. This
|
||||
/// interface provides <em>marked ranges</em> with support for a minimum level
|
||||
/// of buffering necessary to implement arbitrary lookahead during prediction.
|
||||
/// For more information on marked ranges, see <seealso cref="#mark"/>.
|
||||
/// <p/>
|
||||
/// <strong>Initializing Methods:</strong> Some methods in this interface have
|
||||
/// unspecified behavior if no call to an initializing method has occurred after
|
||||
/// the stream was constructed. The following is a list of initializing methods:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li><seealso cref="#LA"/></li>
|
||||
/// <li><seealso cref="#consume"/></li>
|
||||
/// <li><seealso cref="#size"/></li>
|
||||
/// </ul>
|
||||
/// </summary>
|
||||
class ANTLR4CPP_PUBLIC IntStream {
|
||||
public:
|
||||
static constexpr size_t EOF = std::numeric_limits<size_t>::max();
|
||||
|
||||
/// The value returned by <seealso cref="#LA LA()"/> when the end of the stream is
|
||||
/// reached.
|
||||
/// No explicit EOF definition. We got EOF on all platforms.
|
||||
//static const size_t _EOF = std::ios::eofbit;
|
||||
|
||||
/// <summary>
|
||||
/// The value returned by <seealso cref="#getSourceName"/> when the actual name of the
|
||||
/// underlying source is not known.
|
||||
/// </summary>
|
||||
static const std::string UNKNOWN_SOURCE_NAME;
|
||||
|
||||
virtual ~IntStream();
|
||||
|
||||
/// <summary>
|
||||
/// Consumes the current symbol in the stream. This method has the following
|
||||
/// effects:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li><strong>Forward movement:</strong> The value of <seealso cref="#index index()"/>
|
||||
/// before calling this method is less than the value of {@code index()}
|
||||
/// after calling this method.</li>
|
||||
/// <li><strong>Ordered lookahead:</strong> The value of {@code LA(1)} before
|
||||
/// calling this method becomes the value of {@code LA(-1)} after calling
|
||||
/// this method.</li>
|
||||
/// </ul>
|
||||
///
|
||||
/// Note that calling this method does not guarantee that {@code index()} is
|
||||
/// incremented by exactly 1, as that would preclude the ability to implement
|
||||
/// filtering streams (e.g. <seealso cref="CommonTokenStream"/> which distinguishes
|
||||
/// between "on-channel" and "off-channel" tokens).
|
||||
/// </summary>
|
||||
/// <exception cref="IllegalStateException"> if an attempt is made to consume the the
|
||||
/// end of the stream (i.e. if {@code LA(1)==}<seealso cref="#EOF EOF"/> before calling
|
||||
/// {@code consume}). </exception>
|
||||
virtual void consume() = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value of the symbol at offset {@code i} from the current
|
||||
/// position. When {@code i==1}, this method returns the value of the current
|
||||
/// symbol in the stream (which is the next symbol to be consumed). When
|
||||
/// {@code i==-1}, this method returns the value of the previously read
|
||||
/// symbol in the stream. It is not valid to call this method with
|
||||
/// {@code i==0}, but the specific behavior is unspecified because this
|
||||
/// method is frequently called from performance-critical code.
|
||||
/// <p/>
|
||||
/// This method is guaranteed to succeed if any of the following are true:
|
||||
///
|
||||
/// <ul>
|
||||
/// <li>{@code i>0}</li>
|
||||
/// <li>{@code i==-1} and <seealso cref="#index index()"/> returns a value greater
|
||||
/// than the value of {@code index()} after the stream was constructed
|
||||
/// and {@code LA(1)} was called in that order. Specifying the current
|
||||
/// {@code index()} relative to the index after the stream was created
|
||||
/// allows for filtering implementations that do not return every symbol
|
||||
/// from the underlying source. Specifying the call to {@code LA(1)}
|
||||
/// allows for lazily initialized streams.</li>
|
||||
/// <li>{@code LA(i)} refers to a symbol consumed within a marked region
|
||||
/// that has not yet been released.</li>
|
||||
/// </ul>
|
||||
///
|
||||
/// If {@code i} represents a position at or beyond the end of the stream,
|
||||
/// this method returns <seealso cref="#EOF"/>.
|
||||
/// <p/>
|
||||
/// The return value is unspecified if {@code i<0} and fewer than {@code -i}
|
||||
/// calls to <seealso cref="#consume consume()"/> have occurred from the beginning of
|
||||
/// the stream before calling this method.
|
||||
/// </summary>
|
||||
/// <exception cref="UnsupportedOperationException"> if the stream does not support
|
||||
/// retrieving the value of the specified symbol </exception>
|
||||
virtual size_t LA(ssize_t i) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// A mark provides a guarantee that <seealso cref="#seek seek()"/> operations will be
|
||||
/// valid over a "marked range" extending from the index where {@code mark()}
|
||||
/// was called to the current <seealso cref="#index index()"/>. This allows the use of
|
||||
/// streaming input sources by specifying the minimum buffering requirements
|
||||
/// to support arbitrary lookahead during prediction.
|
||||
/// <p/>
|
||||
/// The returned mark is an opaque handle (type {@code int}) which is passed
|
||||
/// to <seealso cref="#release release()"/> when the guarantees provided by the marked
|
||||
/// range are no longer necessary. When calls to
|
||||
/// {@code mark()}/{@code release()} are nested, the marks must be released
|
||||
/// in reverse order of which they were obtained. Since marked regions are
|
||||
/// used during performance-critical sections of prediction, the specific
|
||||
/// behavior of invalid usage is unspecified (i.e. a mark is not released, or
|
||||
/// a mark is released twice, or marks are not released in reverse order from
|
||||
/// which they were created).
|
||||
/// <p/>
|
||||
/// The behavior of this method is unspecified if no call to an
|
||||
/// <seealso cref="IntStream initializing method"/> has occurred after this stream was
|
||||
/// constructed.
|
||||
/// <p/>
|
||||
/// This method does not change the current position in the input stream.
|
||||
/// <p/>
|
||||
/// The following example shows the use of <seealso cref="#mark mark()"/>,
|
||||
/// <seealso cref="#release release(mark)"/>, <seealso cref="#index index()"/>, and
|
||||
/// <seealso cref="#seek seek(index)"/> as part of an operation to safely work within a
|
||||
/// marked region, then restore the stream position to its original value and
|
||||
/// release the mark.
|
||||
/// <pre>
|
||||
/// IntStream stream = ...;
|
||||
/// int index = -1;
|
||||
/// int mark = stream.mark();
|
||||
/// try {
|
||||
/// index = stream.index();
|
||||
/// // perform work here...
|
||||
/// } finally {
|
||||
/// if (index != -1) {
|
||||
/// stream.seek(index);
|
||||
/// }
|
||||
/// stream.release(mark);
|
||||
/// }
|
||||
/// </pre>
|
||||
/// </summary>
|
||||
/// <returns> An opaque marker which should be passed to
|
||||
/// <seealso cref="#release release()"/> when the marked range is no longer required. </returns>
|
||||
virtual ssize_t mark() = 0;
|
||||
|
||||
/// <summary>
|
||||
/// This method releases a marked range created by a call to
|
||||
/// <seealso cref="#mark mark()"/>. Calls to {@code release()} must appear in the
|
||||
/// reverse order of the corresponding calls to {@code mark()}. If a mark is
|
||||
/// released twice, or if marks are not released in reverse order of the
|
||||
/// corresponding calls to {@code mark()}, the behavior is unspecified.
|
||||
/// <p/>
|
||||
/// For more information and an example, see <seealso cref="#mark"/>.
|
||||
/// </summary>
|
||||
/// <param name="marker"> A marker returned by a call to {@code mark()}. </param>
|
||||
/// <seealso cref= #mark </seealso>
|
||||
virtual void release(ssize_t marker) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Return the index into the stream of the input symbol referred to by
|
||||
/// {@code LA(1)}.
|
||||
/// <p/>
|
||||
/// The behavior of this method is unspecified if no call to an
|
||||
/// <seealso cref="IntStream initializing method"/> has occurred after this stream was
|
||||
/// constructed.
|
||||
/// </summary>
|
||||
virtual size_t index() = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Set the input cursor to the position indicated by {@code index}. If the
|
||||
/// specified index lies past the end of the stream, the operation behaves as
|
||||
/// though {@code index} was the index of the EOF symbol. After this method
|
||||
/// returns without throwing an exception, the at least one of the following
|
||||
/// will be true.
|
||||
///
|
||||
/// <ul>
|
||||
/// <li><seealso cref="#index index()"/> will return the index of the first symbol
|
||||
/// appearing at or after the specified {@code index}. Specifically,
|
||||
/// implementations which filter their sources should automatically
|
||||
/// adjust {@code index} forward the minimum amount required for the
|
||||
/// operation to target a non-ignored symbol.</li>
|
||||
/// <li>{@code LA(1)} returns <seealso cref="#EOF"/></li>
|
||||
/// </ul>
|
||||
///
|
||||
/// This operation is guaranteed to not throw an exception if {@code index}
|
||||
/// lies within a marked region. For more information on marked regions, see
|
||||
/// <seealso cref="#mark"/>. The behavior of this method is unspecified if no call to
|
||||
/// an <seealso cref="IntStream initializing method"/> has occurred after this stream
|
||||
/// was constructed.
|
||||
/// </summary>
|
||||
/// <param name="index"> The absolute index to seek to.
|
||||
/// </param>
|
||||
/// <exception cref="IllegalArgumentException"> if {@code index} is less than 0 </exception>
|
||||
/// <exception cref="UnsupportedOperationException"> if the stream does not support
|
||||
/// seeking to the specified index </exception>
|
||||
virtual void seek(size_t index) = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the total number of symbols in the stream, including a single EOF
|
||||
/// symbol.
|
||||
/// </summary>
|
||||
/// <exception cref="UnsupportedOperationException"> if the size of the stream is
|
||||
/// unknown. </exception>
|
||||
virtual size_t size() = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the underlying symbol source. This method returns a
|
||||
/// non-null, non-empty string. If such a name is not known, this method
|
||||
/// returns <seealso cref="#UNKNOWN_SOURCE_NAME"/>.
|
||||
/// </summary>
|
||||
virtual std::string getSourceName() const = 0;
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,19 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include "InterpreterRuleContext.h"
|
||||
|
||||
using namespace antlr4;
|
||||
|
||||
InterpreterRuleContext::InterpreterRuleContext() : ParserRuleContext() {
|
||||
}
|
||||
|
||||
InterpreterRuleContext::InterpreterRuleContext(ParserRuleContext *parent, size_t invokingStateNumber, size_t ruleIndex)
|
||||
: ParserRuleContext(parent, invokingStateNumber), _ruleIndex(ruleIndex) {
|
||||
}
|
||||
|
||||
size_t InterpreterRuleContext::getRuleIndex() const {
|
||||
return _ruleIndex;
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ParserRuleContext.h"
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
/**
|
||||
* This class extends {@link ParserRuleContext} by allowing the value of
|
||||
* {@link #getRuleIndex} to be explicitly set for the context.
|
||||
*
|
||||
* <p>
|
||||
* {@link ParserRuleContext} does not include field storage for the rule index
|
||||
* since the context classes created by the code generator override the
|
||||
* {@link #getRuleIndex} method to return the correct value for that context.
|
||||
* Since the parser interpreter does not use the context classes generated for a
|
||||
* parser, this class (with slightly more memory overhead per node) is used to
|
||||
* provide equivalent functionality.</p>
|
||||
*/
|
||||
class ANTLR4CPP_PUBLIC InterpreterRuleContext : public ParserRuleContext {
|
||||
public:
|
||||
InterpreterRuleContext();
|
||||
|
||||
/**
|
||||
* Constructs a new {@link InterpreterRuleContext} with the specified
|
||||
* parent, invoking state, and rule index.
|
||||
*
|
||||
* @param parent The parent context.
|
||||
* @param invokingStateNumber The invoking state number.
|
||||
* @param ruleIndex The rule index for the current context.
|
||||
*/
|
||||
InterpreterRuleContext(ParserRuleContext *parent, size_t invokingStateNumber, size_t ruleIndex);
|
||||
|
||||
virtual size_t getRuleIndex() const override;
|
||||
|
||||
protected:
|
||||
/** This is the backing field for {@link #getRuleIndex}. */
|
||||
const size_t _ruleIndex = INVALID_INDEX;
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
@@ -1,294 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#include "atn/LexerATNSimulator.h"
|
||||
#include "Exceptions.h"
|
||||
#include "misc/Interval.h"
|
||||
#include "CommonTokenFactory.h"
|
||||
#include "LexerNoViableAltException.h"
|
||||
#include "ANTLRErrorListener.h"
|
||||
#include "support/CPPUtils.h"
|
||||
#include "CommonToken.h"
|
||||
|
||||
#include "Lexer.h"
|
||||
|
||||
#define DEBUG_LEXER 0
|
||||
|
||||
using namespace antlrcpp;
|
||||
using namespace antlr4;
|
||||
|
||||
Lexer::Lexer() : Recognizer() {
|
||||
InitializeInstanceFields();
|
||||
_input = nullptr;
|
||||
}
|
||||
|
||||
Lexer::Lexer(CharStream *input) : Recognizer(), _input(input) {
|
||||
InitializeInstanceFields();
|
||||
}
|
||||
|
||||
void Lexer::reset() {
|
||||
// wack Lexer state variables
|
||||
_input->seek(0); // rewind the input
|
||||
|
||||
_syntaxErrors = 0;
|
||||
token.reset();
|
||||
type = Token::INVALID_TYPE;
|
||||
channel = Token::DEFAULT_CHANNEL;
|
||||
tokenStartCharIndex = INVALID_INDEX;
|
||||
tokenStartCharPositionInLine = 0;
|
||||
tokenStartLine = 0;
|
||||
type = 0;
|
||||
_text = "";
|
||||
|
||||
hitEOF = false;
|
||||
mode = Lexer::DEFAULT_MODE;
|
||||
modeStack.clear();
|
||||
|
||||
getInterpreter<atn::LexerATNSimulator>()->reset();
|
||||
}
|
||||
|
||||
std::unique_ptr<Token> Lexer::nextToken() {
|
||||
// Mark start location in char stream so unbuffered streams are
|
||||
// guaranteed at least have text of current token
|
||||
ssize_t tokenStartMarker = _input->mark();
|
||||
|
||||
auto onExit = finally([this, tokenStartMarker]{
|
||||
// make sure we release marker after match or
|
||||
// unbuffered char stream will keep buffering
|
||||
_input->release(tokenStartMarker);
|
||||
});
|
||||
|
||||
while (true) {
|
||||
outerContinue:
|
||||
if (hitEOF) {
|
||||
emitEOF();
|
||||
return std::move(token);
|
||||
}
|
||||
|
||||
token.reset();
|
||||
channel = Token::DEFAULT_CHANNEL;
|
||||
tokenStartCharIndex = _input->index();
|
||||
tokenStartCharPositionInLine = getInterpreter<atn::LexerATNSimulator>()->getCharPositionInLine();
|
||||
tokenStartLine = getInterpreter<atn::LexerATNSimulator>()->getLine();
|
||||
_text = "";
|
||||
do {
|
||||
type = Token::INVALID_TYPE;
|
||||
size_t ttype;
|
||||
try {
|
||||
ttype = getInterpreter<atn::LexerATNSimulator>()->match(_input, mode);
|
||||
} catch (LexerNoViableAltException &e) {
|
||||
notifyListeners(e); // report error
|
||||
recover(e);
|
||||
ttype = SKIP;
|
||||
}
|
||||
if (_input->LA(1) == EOF) {
|
||||
hitEOF = true;
|
||||
}
|
||||
if (type == Token::INVALID_TYPE) {
|
||||
type = ttype;
|
||||
}
|
||||
if (type == SKIP) {
|
||||
goto outerContinue;
|
||||
}
|
||||
} while (type == MORE);
|
||||
if (token == nullptr) {
|
||||
emit();
|
||||
}
|
||||
return std::move(token);
|
||||
}
|
||||
}
|
||||
|
||||
void Lexer::skip() {
|
||||
type = SKIP;
|
||||
}
|
||||
|
||||
void Lexer::more() {
|
||||
type = MORE;
|
||||
}
|
||||
|
||||
void Lexer::setMode(size_t m) {
|
||||
mode = m;
|
||||
}
|
||||
|
||||
void Lexer::pushMode(size_t m) {
|
||||
#if DEBUG_LEXER == 1
|
||||
std::cout << "pushMode " << m << std::endl;
|
||||
#endif
|
||||
|
||||
modeStack.push_back(mode);
|
||||
setMode(m);
|
||||
}
|
||||
|
||||
size_t Lexer::popMode() {
|
||||
if (modeStack.empty()) {
|
||||
throw EmptyStackException();
|
||||
}
|
||||
#if DEBUG_LEXER == 1
|
||||
std::cout << std::string("popMode back to ") << modeStack.back() << std::endl;
|
||||
#endif
|
||||
|
||||
setMode(modeStack.back());
|
||||
modeStack.pop_back();
|
||||
return mode;
|
||||
}
|
||||
|
||||
|
||||
TokenFactory<CommonToken>* Lexer::getTokenFactory() {
|
||||
return _factory;
|
||||
}
|
||||
|
||||
void Lexer::setInputStream(IntStream *input) {
|
||||
reset();
|
||||
_input = dynamic_cast<CharStream*>(input);
|
||||
}
|
||||
|
||||
std::string Lexer::getSourceName() {
|
||||
return _input->getSourceName();
|
||||
}
|
||||
|
||||
CharStream* Lexer::getInputStream() {
|
||||
return _input;
|
||||
}
|
||||
|
||||
void Lexer::emit(std::unique_ptr<Token> newToken) {
|
||||
token = std::move(newToken);
|
||||
}
|
||||
|
||||
Token* Lexer::emit() {
|
||||
emit(_factory->create({ this, _input }, type, _text, channel,
|
||||
tokenStartCharIndex, getCharIndex() - 1, tokenStartLine, tokenStartCharPositionInLine));
|
||||
return token.get();
|
||||
}
|
||||
|
||||
Token* Lexer::emitEOF() {
|
||||
size_t cpos = getCharPositionInLine();
|
||||
size_t line = getLine();
|
||||
emit(_factory->create({ this, _input }, EOF, "", Token::DEFAULT_CHANNEL, _input->index(), _input->index() - 1, line, cpos));
|
||||
return token.get();
|
||||
}
|
||||
|
||||
size_t Lexer::getLine() const {
|
||||
return getInterpreter<atn::LexerATNSimulator>()->getLine();
|
||||
}
|
||||
|
||||
size_t Lexer::getCharPositionInLine() {
|
||||
return getInterpreter<atn::LexerATNSimulator>()->getCharPositionInLine();
|
||||
}
|
||||
|
||||
void Lexer::setLine(size_t line) {
|
||||
getInterpreter<atn::LexerATNSimulator>()->setLine(line);
|
||||
}
|
||||
|
||||
void Lexer::setCharPositionInLine(size_t charPositionInLine) {
|
||||
getInterpreter<atn::LexerATNSimulator>()->setCharPositionInLine(charPositionInLine);
|
||||
}
|
||||
|
||||
size_t Lexer::getCharIndex() {
|
||||
return _input->index();
|
||||
}
|
||||
|
||||
std::string Lexer::getText() {
|
||||
if (!_text.empty()) {
|
||||
return _text;
|
||||
}
|
||||
return getInterpreter<atn::LexerATNSimulator>()->getText(_input);
|
||||
}
|
||||
|
||||
void Lexer::setText(const std::string &text) {
|
||||
_text = text;
|
||||
}
|
||||
|
||||
std::unique_ptr<Token> Lexer::getToken() {
|
||||
return std::move(token);
|
||||
}
|
||||
|
||||
void Lexer::setToken(std::unique_ptr<Token> newToken) {
|
||||
token = std::move(newToken);
|
||||
}
|
||||
|
||||
void Lexer::setType(size_t ttype) {
|
||||
type = ttype;
|
||||
}
|
||||
|
||||
size_t Lexer::getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
void Lexer::setChannel(size_t newChannel) {
|
||||
channel = newChannel;
|
||||
}
|
||||
|
||||
size_t Lexer::getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
std::vector<std::unique_ptr<Token>> Lexer::getAllTokens() {
|
||||
std::vector<std::unique_ptr<Token>> tokens;
|
||||
std::unique_ptr<Token> t = nextToken();
|
||||
while (t->getType() != EOF) {
|
||||
tokens.push_back(std::move(t));
|
||||
t = nextToken();
|
||||
}
|
||||
return tokens;
|
||||
}
|
||||
|
||||
void Lexer::recover(const LexerNoViableAltException &/*e*/) {
|
||||
if (_input->LA(1) != EOF) {
|
||||
// skip a char and try again
|
||||
getInterpreter<atn::LexerATNSimulator>()->consume(_input);
|
||||
}
|
||||
}
|
||||
|
||||
void Lexer::notifyListeners(const LexerNoViableAltException & /*e*/) {
|
||||
++_syntaxErrors;
|
||||
std::string text = _input->getText(misc::Interval(tokenStartCharIndex, _input->index()));
|
||||
std::string msg = std::string("token recognition error at: '") + getErrorDisplay(text) + std::string("'");
|
||||
|
||||
ProxyErrorListener &listener = getErrorListenerDispatch();
|
||||
listener.syntaxError(this, nullptr, tokenStartLine, tokenStartCharPositionInLine, msg, std::current_exception());
|
||||
}
|
||||
|
||||
std::string Lexer::getErrorDisplay(const std::string &s) {
|
||||
std::stringstream ss;
|
||||
for (auto c : s) {
|
||||
switch (c) {
|
||||
case '\n':
|
||||
ss << "\\n";
|
||||
break;
|
||||
case '\t':
|
||||
ss << "\\t";
|
||||
break;
|
||||
case '\r':
|
||||
ss << "\\r";
|
||||
break;
|
||||
default:
|
||||
ss << c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
void Lexer::recover(RecognitionException * /*re*/) {
|
||||
// TODO: Do we lose character or line position information?
|
||||
_input->consume();
|
||||
}
|
||||
|
||||
size_t Lexer::getNumberOfSyntaxErrors() {
|
||||
return _syntaxErrors;
|
||||
}
|
||||
|
||||
void Lexer::InitializeInstanceFields() {
|
||||
_syntaxErrors = 0;
|
||||
token = nullptr;
|
||||
_factory = CommonTokenFactory::DEFAULT.get();
|
||||
tokenStartCharIndex = INVALID_INDEX;
|
||||
tokenStartLine = 0;
|
||||
tokenStartCharPositionInLine = 0;
|
||||
hitEOF = false;
|
||||
channel = 0;
|
||||
type = 0;
|
||||
mode = Lexer::DEFAULT_MODE;
|
||||
}
|
||||
@@ -1,196 +0,0 @@
|
||||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
* Use of this file is governed by the BSD 3-clause license that
|
||||
* can be found in the LICENSE.txt file in the project root.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Recognizer.h"
|
||||
#include "TokenSource.h"
|
||||
#include "CharStream.h"
|
||||
#include "Token.h"
|
||||
|
||||
namespace antlr4 {
|
||||
|
||||
/// A lexer is recognizer that draws input symbols from a character stream.
|
||||
/// lexer grammars result in a subclass of this object. A Lexer object
|
||||
/// uses simplified match() and error recovery mechanisms in the interest
|
||||
/// of speed.
|
||||
class ANTLR4CPP_PUBLIC Lexer : public Recognizer, public TokenSource {
|
||||
public:
|
||||
static constexpr size_t DEFAULT_MODE = 0;
|
||||
static constexpr size_t MORE = std::numeric_limits<size_t>::max() - 1;
|
||||
static constexpr size_t SKIP = std::numeric_limits<size_t>::max() - 2;
|
||||
|
||||
static constexpr size_t DEFAULT_TOKEN_CHANNEL = Token::DEFAULT_CHANNEL;
|
||||
static constexpr size_t HIDDEN = Token::HIDDEN_CHANNEL;
|
||||
static constexpr size_t MIN_CHAR_VALUE = 0;
|
||||
static constexpr size_t MAX_CHAR_VALUE = 0x10FFFF;
|
||||
|
||||
CharStream *_input; // Pure reference, usually from statically allocated instance.
|
||||
|
||||
protected:
|
||||
/// How to create token objects.
|
||||
TokenFactory<CommonToken> *_factory;
|
||||
|
||||
public:
|
||||
/// The goal of all lexer rules/methods is to create a token object.
|
||||
/// This is an instance variable as multiple rules may collaborate to
|
||||
/// create a single token. nextToken will return this object after
|
||||
/// matching lexer rule(s). If you subclass to allow multiple token
|
||||
/// emissions, then set this to the last token to be matched or
|
||||
/// something nonnull so that the auto token emit mechanism will not
|
||||
/// emit another token.
|
||||
|
||||
// Life cycle of a token is this:
|
||||
// Created by emit() (via the token factory) or by action code, holding ownership of it.
|
||||
// Ownership is handed over to the token stream when calling nextToken().
|
||||
std::unique_ptr<Token> token;
|
||||
|
||||
/// <summary>
|
||||
/// What character index in the stream did the current token start at?
|
||||
/// Needed, for example, to get the text for current token. Set at
|
||||
/// the start of nextToken.
|
||||
/// </summary>
|
||||
size_t tokenStartCharIndex;
|
||||
|
||||
/// <summary>
|
||||
/// The line on which the first character of the token resides </summary>
|
||||
size_t tokenStartLine;
|
||||
|
||||
/// The character position of first character within the line.
|
||||
size_t tokenStartCharPositionInLine;
|
||||
|
||||
/// Once we see EOF on char stream, next token will be EOF.
|
||||
/// If you have DONE : EOF ; then you see DONE EOF.
|
||||
bool hitEOF;
|
||||
|
||||
/// The channel number for the current token.
|
||||
size_t channel;
|
||||
|
||||
/// The token type for the current token.
|
||||
size_t type;
|
||||
|
||||
// Use the vector as a stack.
|
||||
std::vector<size_t> modeStack;
|
||||
size_t mode;
|
||||
|
||||
Lexer();
|
||||
Lexer(CharStream *input);
|
||||
virtual ~Lexer() {}
|
||||
|
||||
virtual void reset();
|
||||
|
||||
/// Return a token from this source; i.e., match a token on the char stream.
|
||||
virtual std::unique_ptr<Token> nextToken() override;
|
||||
|
||||
/// Instruct the lexer to skip creating a token for current lexer rule
|
||||
/// and look for another token. nextToken() knows to keep looking when
|
||||
/// a lexer rule finishes with token set to SKIP_TOKEN. Recall that
|
||||
/// if token == null at end of any token rule, it creates one for you
|
||||
/// and emits it.
|
||||
virtual void skip();
|
||||
virtual void more();
|
||||
virtual void setMode(size_t m);
|
||||
virtual void pushMode(size_t m);
|
||||
virtual size_t popMode();
|
||||
|
||||
template<typename T1>
|
||||
void setTokenFactory(TokenFactory<T1> *factory) {
|
||||
this->_factory = factory;
|
||||
}
|
||||
|
||||
virtual TokenFactory<CommonToken>* getTokenFactory() override;
|
||||
|
||||
/// Set the char stream and reset the lexer
|
||||
virtual void setInputStream(IntStream *input) override;
|
||||
|
||||
virtual std::string getSourceName() override;
|
||||
|
||||
virtual CharStream* getInputStream() override;
|
||||
|
||||
/// By default does not support multiple emits per nextToken invocation
|
||||
/// for efficiency reasons. Subclasses can override this method, nextToken,
|
||||
/// and getToken (to push tokens into a list and pull from that list
|
||||
/// rather than a single variable as this implementation does).
|
||||
virtual void emit(std::unique_ptr<Token> newToken);
|
||||
|
||||
/// The standard method called to automatically emit a token at the
|
||||
/// outermost lexical rule. The token object should point into the
|
||||
/// char buffer start..stop. If there is a text override in 'text',
|
||||
/// use that to set the token's text. Override this method to emit
|
||||
/// custom Token objects or provide a new factory.
|
||||
virtual Token* emit();
|
||||
|
||||
virtual Token* emitEOF();
|
||||
|
||||
virtual size_t getLine() const override;
|
||||
|
||||
virtual size_t getCharPositionInLine() override;
|
||||
|
||||
virtual void setLine(size_t line);
|
||||
|
||||
virtual void setCharPositionInLine(size_t charPositionInLine);
|
||||
|
||||
/// What is the index of the current character of lookahead?
|
||||
virtual size_t getCharIndex();
|
||||
|
||||
/// Return the text matched so far for the current token or any
|
||||
/// text override.
|
||||
virtual std::string getText();
|
||||
|
||||
/// Set the complete text of this token; it wipes any previous
|
||||
/// changes to the text.
|
||||
virtual void setText(const std::string &text);
|
||||
|
||||
/// Override if emitting multiple tokens.
|
||||
virtual std::unique_ptr<Token> getToken();
|
||||
|
||||
virtual void setToken(std::unique_ptr<Token> newToken);
|
||||
|
||||
virtual void setType(size_t ttype);
|
||||
|
||||
virtual size_t getType();
|
||||
|
||||
virtual void setChannel(size_t newChannel);
|
||||
|
||||
virtual size_t getChannel();
|
||||
|
||||
virtual const std::vector<std::string>& getChannelNames() const = 0;
|
||||
|
||||
virtual const std::vector<std::string>& getModeNames() const = 0;
|
||||
|
||||
/// Return a list of all Token objects in input char stream.
|
||||
/// Forces load of all tokens. Does not include EOF token.
|
||||
virtual std::vector<std::unique_ptr<Token>> getAllTokens();
|
||||
|
||||
virtual void recover(const LexerNoViableAltException &e);
|
||||
|
||||
virtual void notifyListeners(const LexerNoViableAltException &e);
|
||||
|
||||
virtual std::string getErrorDisplay(const std::string &s);
|
||||
|
||||
/// Lexers can normally match any char in it's vocabulary after matching
|
||||
/// a token, so do the easy thing and just kill a character and hope
|
||||
/// it all works out. You can instead use the rule invocation stack
|
||||
/// to do sophisticated error recovery if you are in a fragment rule.
|
||||
virtual void recover(RecognitionException *re);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of syntax errors reported during parsing. This value is
|
||||
/// incremented each time <seealso cref="#notifyErrorListeners"/> is called.
|
||||
/// </summary>
|
||||
/// <seealso cref= #notifyListeners </seealso>
|
||||
virtual size_t getNumberOfSyntaxErrors();
|
||||
|
||||
protected:
|
||||
/// You can set the text for the current token to override what is in
|
||||
/// the input char buffer (via setText()).
|
||||
std::string _text;
|
||||
|
||||
private:
|
||||
size_t _syntaxErrors;
|
||||
void InitializeInstanceFields();
|
||||
};
|
||||
|
||||
} // namespace antlr4
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user