Merge branch 'master' into master
This commit is contained in:
commit
61d8aea398
|
@ -185,7 +185,7 @@ matrix:
|
|||
sources:
|
||||
- deadsnakes # source required so it finds the package definition below
|
||||
packages:
|
||||
- python3.5
|
||||
- python3.6
|
||||
stage: main-test
|
||||
- os: linux
|
||||
dist: trusty
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# ANTLR v4
|
||||
|
||||
[![Build Travis-CI Status](https://travis-ci.org/antlr/antlr4.png?branch=master)](https://travis-ci.org/antlr/antlr4) [![Build AppVeyor Status](https://ci.appveyor.com/api/projects/status/5acpbx1pg7bhgh8v/branch/master?svg=true)](https://ci.appveyor.com/project/parrt/antlr4) [![Java 7+](https://img.shields.io/badge/java-7+-4c7e9f.svg)](http://java.oracle.com) [![License](https://img.shields.io/badge/license-BSD-blue.svg)](https://raw.githubusercontent.com/antlr/antlr4/master/LICENSE.txt)
|
||||
[![Build Travis-CI Status](https://travis-ci.org/antlr/antlr4.svg?branch=master)](https://travis-ci.org/antlr/antlr4) [![Build AppVeyor Status](https://ci.appveyor.com/api/projects/status/5acpbx1pg7bhgh8v/branch/master?svg=true)](https://ci.appveyor.com/project/parrt/antlr4) [![Java 7+](https://img.shields.io/badge/java-7+-4c7e9f.svg)](http://java.oracle.com) [![License](https://img.shields.io/badge/license-BSD-blue.svg)](https://raw.githubusercontent.com/antlr/antlr4/master/LICENSE.txt)
|
||||
|
||||
**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 parse trees and also generates a listener interface (or visitor) that makes it easy to respond to the recognition of phrases of interest.
|
||||
|
||||
|
|
|
@ -178,12 +178,20 @@ YYYY/MM/DD, github id, Full name, email
|
|||
2017/12/01, DavidMoraisFerreira, David Morais Ferreira, david.moraisferreira@gmail.com
|
||||
2017/12/01, SebastianLng, Sebastian Lang, sebastian.lang@outlook.com
|
||||
2017/12/03, oranoran, Oran Epelbaum, oran / epelbaum me
|
||||
2017/12/12, janlinde, Jan Lindemann, jan@janware.com
|
||||
2017/12/13, enessoylu, Enes Soylu, enessoylutr@gmail.com
|
||||
2017/12/20, kbsletten, Kyle Sletten, kbsletten@gmail.com
|
||||
2017/12/27, jkmar, Jakub Marciniszyn, marciniszyn.jk@gmail.com
|
||||
2018/03/08, dannoc, Daniel Clifford, danno@google.com
|
||||
2018/03/10, uvguy, kangjoni76@gmail.com
|
||||
2018/01/06, kasbah, Kaspar Emanuel, kaspar@monostable.co.uk
|
||||
2018/01/15, xgcssch, Sönke Schau, xgcssch@users.noreply.github.com
|
||||
2018/02/08, razfriman, Raz Friman, raz@razfriman.com
|
||||
2018/02/11, io7m, Mark Raynsford, code@io7m.com
|
||||
2018/04/24, solussd, Joe Smith, joe@uwcreations.com
|
||||
2018/15/05, johnvanderholt, jan dillingh johnvanderholte@gmail.com
|
||||
2018/06/16, EternalPhane, Zongyuan Zuo, eternalphane@gmail.com
|
||||
2018/06/27, wu-sheng, Wu Sheng, wu.sheng@foxmail.com
|
||||
2018/02/25, chaseoxide, Marcus Ong, taccs97[at]gmail[dot]com
|
||||
2018/05/15, johnvanderholt, jan dillingh johnvanderholte@gmail.com
|
||||
2018/06/16, EternalPhane, Zongyuan Zuo, eternalphane@gmail.com
|
||||
|
@ -194,5 +202,6 @@ YYYY/MM/DD, github id, Full name, email
|
|||
2018/06/16, EternalPhane, Zongyuan Zuo, eternalphane@gmail.com
|
||||
2018/07/03, jgoppert, James Goppert, james.goppert@gmail.com
|
||||
2018/07/27, Maksim Novikov, mnovikov.work@gmail.com
|
||||
2018/07/31 Lucas Henrqiue, lucashenrique580@gmail.com
|
||||
2018/08/03, ENDOH takanao, djmchl@gmail.com
|
||||
2018/10/29, chrisaycock, Christopher Aycock, chris[at]chrisaycock[dot]com
|
||||
2018/10/29, chrisaycock, Christopher Aycock, chris[at]chrisaycock[dot]com
|
|
@ -42,9 +42,9 @@ In order to perform the tests on all target languages, you need to have the foll
|
|||
* `mono` (e.g., `brew install mono`) on non-Windows boxes (on Windows it uses the Microsoft .net stack). Also must [`xbuild` the runtime](https://github.com/antlr/antlr4/blob/master/doc/releasing-antlr.md) before tests will run; see below
|
||||
* `nodejs`
|
||||
* Python 2.7
|
||||
* Python 3.5
|
||||
* Python 3.6
|
||||
* Go
|
||||
* Swift 3 (via XCode 8.x) tested currently only osx
|
||||
* Swift 4 (via XCode 10.x) tested currently only osx
|
||||
* clang (for C++ target)
|
||||
*
|
||||
To **install into local repository** `~/.m2/repository/org/antlr`, do this:
|
||||
|
|
|
@ -28,16 +28,7 @@ Checking out files: 100% (1427/1427), done.
|
|||
# Compile
|
||||
|
||||
```bash
|
||||
$ cd /tmp
|
||||
$ git clone git@github.com:antlr/antlr4.git
|
||||
Cloning into 'antlr4'...
|
||||
remote: Counting objects: 59858, done.
|
||||
remote: Compressing objects: 100% (57/57), done.
|
||||
remote: Total 59858 (delta 28), reused 9 (delta 9), pack-reused 59786
|
||||
Receiving objects: 100% (59858/59858), 31.10 MiB | 819.00 KiB/s, done.
|
||||
Resolving deltas: 100% (31898/31898), done.
|
||||
Checking connectivity... done.
|
||||
$ cd antlr4
|
||||
$ cd /tmp/antlr4
|
||||
$ export MAVEN_OPTS="-Xmx1G" # don't forget this on linux
|
||||
$ mvn clean # must be separate, not part of install/compile
|
||||
$ mvn -DskipTests install
|
||||
|
|
|
@ -31,7 +31,7 @@ It's also a good idea to put this in your `.bash_profile` or whatever your start
|
|||
3. Create aliases for the ANTLR Tool, and `TestRig`.
|
||||
```
|
||||
$ alias antlr4='java -Xmx500M -cp "/usr/local/lib/antlr-4.7.1-complete.jar:$CLASSPATH" org.antlr.v4.Tool'
|
||||
$ alias grun='java org.antlr.v4.gui.TestRig'
|
||||
$ alias grun='java -Xmx500M -cp "/usr/local/lib/antlr-4.7.1-complete.jar:$CLASSPATH" org.antlr.v4.gui.TestRig'
|
||||
```
|
||||
|
||||
### WINDOWS
|
||||
|
|
|
@ -16,7 +16,7 @@ Also, I have prepared a [video](https://youtu.be/eW4WFgRtFeY) that will help you
|
|||
|
||||
### Eclipse
|
||||
|
||||
Edgar Espina has created an [eclipse plugin for ANTLR v4](https://youtu.be/eW4WFgRtFeY). Features: Advanced Syntax Highlighting, Automatic Code Generation (on save), Manual Code Generation (through External Tools menu), Code Formatter (Ctrl+Shift+F), Syntax Diagrams, Advanced Rule Navigation between files (F3), Quick fixes.
|
||||
Edgar Espina has created an [eclipse plugin for ANTLR v4](https://marketplace.eclipse.org/content/antlr-ide). Features: Advanced Syntax Highlighting, Automatic Code Generation (on save), Manual Code Generation (through External Tools menu), Code Formatter (Ctrl+Shift+F), Syntax Diagrams, Advanced Rule Navigation between files (F3), Quick fixes.
|
||||
|
||||
### NetBeans
|
||||
|
||||
|
@ -241,4 +241,4 @@ mvn install
|
|||
mvn exec:java -Dexec.mainClass=org.abcd.examples.ArrayInit.ArrayInit
|
||||
{1,2,3}
|
||||
^D
|
||||
```
|
||||
```
|
||||
|
|
|
@ -150,13 +150,13 @@ Uploaded: https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antl
|
|||
The maven deploy lifecycle phased deploys the artifacts and the poms for the ANTLR project to the [sonatype remote staging server](https://oss.sonatype.org/content/repositories/snapshots/).
|
||||
|
||||
```bash
|
||||
mvn deploy -DskipTests
|
||||
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`; mvn deploy -DskipTests
|
||||
```
|
||||
|
||||
With JDK 1.7 (not 6 or 8), do this:
|
||||
|
||||
```bash
|
||||
mvn release:prepare -Darguments="-DskipTests"
|
||||
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`; mvn release:prepare -Darguments="-DskipTests"
|
||||
```
|
||||
|
||||
Hm...per https://github.com/keybase/keybase-issues/issues/1712 we need this to make gpg work:
|
||||
|
@ -175,6 +175,12 @@ alias jar='/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/bin/j
|
|||
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
|
||||
```
|
||||
|
||||
But I think just this on front of mvn works:
|
||||
|
||||
```
|
||||
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`; mvn ...
|
||||
```
|
||||
|
||||
You should see 0x33 in generated .class files after 0xCAFEBABE; see [Java SE 7 = 51 (0x33 hex)](https://en.wikipedia.org/wiki/Java_class_file):
|
||||
|
||||
```bash
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>ST4</artifactId>
|
||||
<version>4.0.8</version>
|
||||
<version>4.1-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -66,10 +66,10 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
<version>8.1.16.v20140903</version>
|
||||
<scope>test</scope>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
<version>[9.3.24.v20180605,)</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish</groupId>
|
||||
|
|
|
@ -514,7 +514,10 @@ public abstract class BasePythonTest implements RuntimeTestSupport {
|
|||
}
|
||||
|
||||
private String locateTool(String tool) {
|
||||
String[] roots = { "/opt/local/bin", "/usr/bin/", "/usr/local/bin/" };
|
||||
String[] roots = {
|
||||
"/opt/local/bin", "/usr/bin/", "/usr/local/bin/",
|
||||
"/Users/"+System.getProperty("user.name")+"/anaconda3/bin/"
|
||||
};
|
||||
for(String root : roots) {
|
||||
if(new File(root + tool).exists()) {
|
||||
return root+tool;
|
||||
|
|
|
@ -19,8 +19,8 @@ public class BasePython3Test extends BasePythonTest {
|
|||
|
||||
@Override
|
||||
protected String getPythonExecutable() {
|
||||
return "python3.5";
|
||||
} // force 3.5
|
||||
return "python3.6";
|
||||
} // force 3.6
|
||||
|
||||
@Override
|
||||
protected void writeLexerTestFile(String lexerName, boolean showDFA) {
|
||||
|
|
|
@ -103,10 +103,14 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHE
|
|||
# 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 APPLE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
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++11 -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))
|
||||
|
@ -128,6 +132,59 @@ 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/antlr4 CACHE STRING
|
||||
"Installation directory for cmake files." FORCE )
|
||||
endif(NOT ANTLR4_CMAKE_DIR)
|
||||
|
||||
set(version_config ${PROJECT_BINARY_DIR}/antlr4-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}
|
||||
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}
|
||||
PATH_VARS
|
||||
ANTLR4_INCLUDE_DIR
|
||||
ANTLR4_LIB_DIR )
|
||||
|
||||
write_basic_package_version_file(
|
||||
${version_config}
|
||||
VERSION ${ANTLR_VERSION}
|
||||
COMPATIBILITY SameMajorVersion )
|
||||
|
||||
install(EXPORT ${targets_export_name}
|
||||
DESTINATION ${ANTLR4_CMAKE_DIR} )
|
||||
|
||||
install(FILES ${project_runtime_config}
|
||||
${project_generator_config}
|
||||
${version_config}
|
||||
DESTINATION ${ANTLR4_CMAKE_DIR} )
|
||||
|
||||
endif(ANTLR4_INSTALL)
|
||||
|
||||
if(EXISTS LICENSE.txt)
|
||||
install(FILES LICENSE.txt
|
||||
DESTINATION "share/doc/libantlr4")
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
{
|
||||
// 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": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"variables": [
|
||||
{
|
||||
"name": "ANTLR4_INSTALL",
|
||||
"value": "1"
|
||||
}
|
||||
],
|
||||
"buildCommandArgs": "-v",
|
||||
"ctestCommandArgs": ""
|
||||
},
|
||||
{
|
||||
"name": "x86-Release",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"inheritEnvironments": [ "msvc_x86" ],
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"variables": [
|
||||
{
|
||||
"name": "ANTLR4_INSTALL",
|
||||
"value": "1"
|
||||
}
|
||||
],
|
||||
"buildCommandArgs": "-v",
|
||||
"ctestCommandArgs": ""
|
||||
},
|
||||
{
|
||||
"name": "x64-Debug",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"variables": [
|
||||
{
|
||||
"name": "ANTLR4_INSTALL",
|
||||
"value": "1"
|
||||
}
|
||||
],
|
||||
"buildCommandArgs": "-v",
|
||||
"ctestCommandArgs": ""
|
||||
},
|
||||
{
|
||||
"name": "x64-Release",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "RelWithDebInfo",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
|
||||
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"variables": [
|
||||
{
|
||||
"name": "ANTLR4_INSTALL",
|
||||
"value": "1"
|
||||
}
|
||||
],
|
||||
"buildCommandArgs": "-v",
|
||||
"ctestCommandArgs": ""
|
||||
}
|
||||
]
|
||||
}
|
|
@ -25,7 +25,7 @@ The C++ target has been the work of the following people:
|
|||
|
||||
## Project Status
|
||||
|
||||
* Building on OS X, Windows, and Linux
|
||||
* Building on OS X, Windows, Android and Linux
|
||||
* No errors and warnings
|
||||
* Library linking
|
||||
* Some unit tests in the OSX project, for important base classes with almost 100% code coverage.
|
||||
|
@ -41,12 +41,19 @@ Include the antlr4-runtime.h umbrella header in your target application to get e
|
|||
|
||||
If you are compiling with cmake, the minimum version required is cmake 2.8.
|
||||
|
||||
#### Compiling on Windows
|
||||
#### Compiling on Windows with Visual Studio prior to 2017
|
||||
Simply open the VS solution (VS 2013+) and build it.
|
||||
|
||||
#### Compiling on Windows with Visual Studio VS2017
|
||||
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 OSX
|
||||
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
|
||||
|
@ -57,3 +64,10 @@ Either open the included XCode project and build that or use the cmake compilati
|
|||
If you don't want to build the demo then simply run cmake without 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)
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,136 @@
|
|||
# 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 option to the ANTLR4 generator can be passed in the `ANTLR4_GENERATED_OPTIONS` variable
|
||||
|
||||
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.7.1-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)
|
||||
|
||||
```
|
||||
|
|
@ -0,0 +1,181 @@
|
|||
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()
|
|
@ -0,0 +1,10 @@
|
|||
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(${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake)
|
||||
|
||||
check_required_components(antlr)
|
|
@ -250,7 +250,7 @@
|
|||
37D727A21867AF1E007B6D10 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0920;
|
||||
LastUpgradeCheck = 1010;
|
||||
ORGANIZATIONNAME = "ANTLR4 Project";
|
||||
TargetAttributes = {
|
||||
27C66A661C9591280021E494 = {
|
||||
|
@ -419,12 +419,14 @@
|
|||
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;
|
||||
|
@ -479,12 +481,14 @@
|
|||
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;
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<?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,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0920"
|
||||
LastUpgradeVersion = "1010"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -26,9 +26,8 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
codeCoverageEnabled = "YES">
|
||||
codeCoverageEnabled = "YES"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
|
@ -57,7 +56,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0920"
|
||||
LastUpgradeVersion = "1010"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -10,7 +10,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
|
@ -31,7 +30,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
|
|
@ -102,9 +102,11 @@ set_target_properties(antlr4_static
|
|||
COMPILE_FLAGS "${disabled_compile_warnings} ${extra_static_compile_flags}")
|
||||
|
||||
install(TARGETS antlr4_shared
|
||||
DESTINATION lib)
|
||||
DESTINATION lib
|
||||
EXPORT antlr4-targets)
|
||||
install(TARGETS antlr4_static
|
||||
ARCHIVE DESTINATION lib)
|
||||
DESTINATION lib
|
||||
EXPORT antlr4-targets)
|
||||
|
||||
install(DIRECTORY "${PROJECT_SOURCE_DIR}/runtime/src/"
|
||||
DESTINATION "include/antlr4-runtime"
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{A9762991-1B57-4DCE-90C0-EE42B96947BE}</ProjectGuid>
|
||||
<ProjectGuid>{229A61DC-1207-4E4E-88B0-F4CB7205672D}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>antlr4cpp</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
@ -223,7 +223,7 @@
|
|||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src/tree;src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
|
@ -305,7 +305,7 @@
|
|||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src/tree;src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
|
|
|
@ -230,7 +230,7 @@
|
|||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
|
@ -317,7 +317,7 @@
|
|||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>ANTLR4CPP_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeaderFile>
|
||||
</PrecompiledHeaderFile>
|
||||
|
|
|
@ -0,0 +1,652 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" 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.16299.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>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug DLL|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Static|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Static|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v141</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-2015\$(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-2015\$(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-2015\$(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-2015\$(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-2015\$(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-2015\$(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-2015\$(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-2015\$(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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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\AbstractPredicateTransition.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\ATNSerializer.cpp" />
|
||||
<ClCompile Include="src\atn\ATNSimulator.cpp" />
|
||||
<ClCompile Include="src\atn\ATNState.cpp" />
|
||||
<ClCompile Include="src\atn\AtomTransition.cpp" />
|
||||
<ClCompile Include="src\atn\BasicBlockStartState.cpp" />
|
||||
<ClCompile Include="src\atn\BasicState.cpp" />
|
||||
<ClCompile Include="src\atn\BlockEndState.cpp" />
|
||||
<ClCompile Include="src\atn\BlockStartState.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\EmptyPredictionContext.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\LoopEndState.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\PlusBlockStartState.cpp" />
|
||||
<ClCompile Include="src\atn\PlusLoopbackState.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\PredictionMode.cpp" />
|
||||
<ClCompile Include="src\atn\ProfilingATNSimulator.cpp" />
|
||||
<ClCompile Include="src\atn\RangeTransition.cpp" />
|
||||
<ClCompile Include="src\atn\RuleStartState.cpp" />
|
||||
<ClCompile Include="src\atn\RuleStopState.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\StarBlockStartState.cpp" />
|
||||
<ClCompile Include="src\atn\StarLoopbackState.cpp" />
|
||||
<ClCompile Include="src\atn\StarLoopEntryState.cpp" />
|
||||
<ClCompile Include="src\atn\TokensStartState.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\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\guid.cpp" />
|
||||
<ClCompile Include="src\support\StringUtils.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\ErrorNode.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\TerminalNode.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\antlr4-runtime.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\AbstractPredicateTransition.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\ATNSerializer.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\ConfigLookup.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\EmptyPredictionContext.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\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\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\misc\TestRig.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\CPPUtils.h" />
|
||||
<ClInclude Include="src\support\Declarations.h" />
|
||||
<ClInclude Include="src\support\guid.h" />
|
||||
<ClInclude Include="src\support\StringUtils.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\RuleNode.h" />
|
||||
<ClInclude Include="src\tree\SyntaxTree.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>
|
|
@ -0,0 +1,990 @@
|
|||
<?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>
|
||||
</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\EmptyPredictionContext.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\AbstractPredicateTransition.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\ATNSerializer.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\atn\ConfigLookup.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\misc\TestRig.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\support\guid.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\RuleNode.h">
|
||||
<Filter>Header Files\tree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\tree\SyntaxTree.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\antlr4-runtime.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\support\Any.h">
|
||||
<Filter>Source Files\support</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>
|
||||
</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\AbstractPredicateTransition.cpp">
|
||||
<Filter>Source Files\atn</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\ATNSerializer.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\BasicBlockStartState.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\BasicState.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\BlockEndState.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\DecisionState.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\EmptyPredictionContext.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\LoopEndState.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\PlusBlockStartState.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\PlusLoopbackState.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\RuleStartState.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\RuleStopState.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\StarBlockStartState.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\StarLoopbackState.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\StarLoopEntryState.cpp">
|
||||
<Filter>Source Files\atn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\atn\TokensStartState.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\support\guid.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\BlockStartState.cpp">
|
||||
<Filter>Source Files\atn</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\ErrorNode.cpp">
|
||||
<Filter>Source Files\tree</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\TerminalNode.cpp">
|
||||
<Filter>Source Files\tree</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\tree\pattern\Chunk.cpp">
|
||||
<Filter>Source Files\tree\pattern</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -2226,7 +2226,7 @@
|
|||
37D727A21867AF1E007B6D10 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0910;
|
||||
LastUpgradeCheck = 1010;
|
||||
ORGANIZATIONNAME = ANTLR;
|
||||
TargetAttributes = {
|
||||
270C67EF1CDB4F1E00116E17 = {
|
||||
|
@ -2847,11 +2847,13 @@
|
|||
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_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
|
@ -2904,11 +2906,13 @@
|
|||
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_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<?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,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0910"
|
||||
LastUpgradeVersion = "1010"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -26,7 +26,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
|
@ -37,7 +36,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0920"
|
||||
LastUpgradeVersion = "1010"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -26,7 +26,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
|
@ -37,7 +36,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0920"
|
||||
LastUpgradeVersion = "1010"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -26,7 +26,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
|
@ -37,7 +36,6 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
/* 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.
|
||||
*/
|
||||
|
@ -11,12 +11,18 @@ using namespace antlr4;
|
|||
|
||||
NoViableAltException::NoViableAltException(Parser *recognizer)
|
||||
: NoViableAltException(recognizer, recognizer->getTokenStream(), recognizer->getCurrentToken(),
|
||||
recognizer->getCurrentToken(), nullptr, recognizer->getContext()) {
|
||||
recognizer->getCurrentToken(), nullptr, recognizer->getContext(), false) {
|
||||
}
|
||||
|
||||
NoViableAltException::NoViableAltException(Parser *recognizer, TokenStream *input,Token *startToken,
|
||||
Token *offendingToken, atn::ATNConfigSet *deadEndConfigs, ParserRuleContext *ctx)
|
||||
: RecognitionException("No viable alternative", recognizer, input, ctx, offendingToken), _deadEndConfigs(deadEndConfigs), _startToken(startToken) {
|
||||
Token *offendingToken, atn::ATNConfigSet *deadEndConfigs, ParserRuleContext *ctx, bool deleteConfigs)
|
||||
: RecognitionException("No viable alternative", recognizer, input, ctx, offendingToken),
|
||||
_deadEndConfigs(deadEndConfigs), _startToken(startToken), _deleteConfigs(deleteConfigs) {
|
||||
}
|
||||
|
||||
NoViableAltException::~NoViableAltException() {
|
||||
if (_deleteConfigs)
|
||||
delete _deadEndConfigs;
|
||||
}
|
||||
|
||||
Token* NoViableAltException::getStartToken() const {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
/* 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.
|
||||
*/
|
||||
|
@ -19,8 +19,9 @@ namespace antlr4 {
|
|||
public:
|
||||
NoViableAltException(Parser *recognizer); // LL(1) error
|
||||
NoViableAltException(Parser *recognizer, TokenStream *input,Token *startToken,
|
||||
Token *offendingToken, atn::ATNConfigSet *deadEndConfigs, ParserRuleContext *ctx);
|
||||
|
||||
Token *offendingToken, atn::ATNConfigSet *deadEndConfigs, ParserRuleContext *ctx, bool deleteConfigs);
|
||||
~NoViableAltException();
|
||||
|
||||
virtual Token* getStartToken() const;
|
||||
virtual atn::ATNConfigSet* getDeadEndConfigs() const;
|
||||
|
||||
|
@ -28,6 +29,9 @@ namespace antlr4 {
|
|||
/// Which configurations did we try at input.index() that couldn't match input.LT(1)?
|
||||
atn::ATNConfigSet* _deadEndConfigs;
|
||||
|
||||
// Flag that indicates if we own the dead end config set and have to delete it on destruction.
|
||||
bool _deleteConfigs;
|
||||
|
||||
/// The token object at the start index; the input stream might
|
||||
/// not be buffering tokens so get a reference to it. (At the
|
||||
/// time the error occurred, of course the stream needs to keep a
|
||||
|
|
|
@ -272,7 +272,7 @@ namespace antlr4 {
|
|||
/// <seealso cref="#_ctx"/> get the current context.
|
||||
virtual void enterRule(ParserRuleContext *localctx, size_t state, size_t ruleIndex);
|
||||
|
||||
virtual void exitRule();
|
||||
void exitRule();
|
||||
|
||||
virtual void enterOuterAlt(ParserRuleContext *localctx, size_t altNum);
|
||||
|
||||
|
|
|
@ -78,7 +78,12 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
class ANTLR4CPP_PUBLIC std::exception; // Needed for VS 2015.
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
// clang-cl should escape this to prevent [ignored-attributes].
|
||||
namespace std {
|
||||
class ANTLR4CPP_PUBLIC exception; // Prevents warning C4275 from MSVC.
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
typedef std::u32string UTF32String;
|
||||
|
|
|
@ -53,7 +53,7 @@ ParserATNSimulator::ParserATNSimulator(const ATN &atn, std::vector<dfa::DFA> &de
|
|||
|
||||
ParserATNSimulator::ParserATNSimulator(Parser *parser, const ATN &atn, std::vector<dfa::DFA> &decisionToDFA,
|
||||
PredictionContextCache &sharedContextCache)
|
||||
: ATNSimulator(atn, sharedContextCache), parser(parser), decisionToDFA(decisionToDFA) {
|
||||
: ATNSimulator(atn, sharedContextCache), decisionToDFA(decisionToDFA), parser(parser) {
|
||||
InitializeInstanceFields();
|
||||
}
|
||||
|
||||
|
@ -176,7 +176,7 @@ size_t ParserATNSimulator::execATN(dfa::DFA &dfa, dfa::DFAState *s0, TokenStream
|
|||
// ATN states in SLL implies LL will also get nowhere.
|
||||
// If conflict in states that dip out, choose min since we
|
||||
// will get error no matter what.
|
||||
NoViableAltException e = noViableAlt(input, outerContext, previousD->configs.get(), startIndex);
|
||||
NoViableAltException e = noViableAlt(input, outerContext, previousD->configs.get(), startIndex, false);
|
||||
input->seek(startIndex);
|
||||
size_t alt = getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(previousD->configs.get(), outerContext);
|
||||
if (alt != ATN::INVALID_ALT_NUMBER) {
|
||||
|
@ -236,7 +236,7 @@ size_t ParserATNSimulator::execATN(dfa::DFA &dfa, dfa::DFAState *s0, TokenStream
|
|||
BitSet alts = evalSemanticContext(D->predicates, outerContext, true);
|
||||
switch (alts.count()) {
|
||||
case 0:
|
||||
throw noViableAlt(input, outerContext, D->configs.get(), startIndex);
|
||||
throw noViableAlt(input, outerContext, D->configs.get(), startIndex, false);
|
||||
|
||||
case 1:
|
||||
return alts.nextSetBit(0);
|
||||
|
@ -351,7 +351,7 @@ size_t ParserATNSimulator::execATNWithFullContext(dfa::DFA &dfa, dfa::DFAState *
|
|||
// ATN states in SLL implies LL will also get nowhere.
|
||||
// If conflict in states that dip out, choose min since we
|
||||
// will get error no matter what.
|
||||
NoViableAltException e = noViableAlt(input, outerContext, previous, startIndex);
|
||||
NoViableAltException e = noViableAlt(input, outerContext, previous, startIndex, previous != s0);
|
||||
input->seek(startIndex);
|
||||
size_t alt = getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(previous, outerContext);
|
||||
if (alt != ATN::INVALID_ALT_NUMBER) {
|
||||
|
@ -893,15 +893,6 @@ void ParserATNSimulator::closure_(Ref<ATNConfig> const& config, ATNConfigSet *co
|
|||
bool continueCollecting = !is<ActionTransition*>(t) && collectPredicates;
|
||||
Ref<ATNConfig> c = getEpsilonTarget(config, t, continueCollecting, depth == 0, fullCtx, treatEofAsEpsilon);
|
||||
if (c != nullptr) {
|
||||
if (!t->isEpsilon()) {
|
||||
// avoid infinite recursion for EOF* and EOF+
|
||||
if (closureBusy.count(c) == 0) {
|
||||
closureBusy.insert(c);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
int newDepth = depth;
|
||||
if (is<RuleStopState*>(config->state)) {
|
||||
assert(!fullCtx);
|
||||
|
@ -926,6 +917,16 @@ void ParserATNSimulator::closure_(Ref<ATNConfig> const& config, ATNConfigSet *co
|
|||
}
|
||||
|
||||
c->reachesIntoOuterContext++;
|
||||
|
||||
if (!t->isEpsilon()) {
|
||||
// avoid infinite recursion for EOF* and EOF+
|
||||
if (closureBusy.count(c) == 0) {
|
||||
closureBusy.insert(c);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
configs->dipsIntoOuterContext = true; // TO_DO: can remove? only care when we add to set per middle of this method
|
||||
assert(newDepth > INT_MIN);
|
||||
|
||||
|
@ -934,7 +935,16 @@ void ParserATNSimulator::closure_(Ref<ATNConfig> const& config, ATNConfigSet *co
|
|||
std::cout << "dips into outer ctx: " << c << std::endl;
|
||||
#endif
|
||||
|
||||
} else if (is<RuleTransition*>(t)) {
|
||||
} else if (!t->isEpsilon()) {
|
||||
// avoid infinite recursion for EOF* and EOF+
|
||||
if (closureBusy.count(c) == 0) {
|
||||
closureBusy.insert(c);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (is<RuleTransition*>(t)) {
|
||||
// latch when newDepth goes negative - once we step out of the entry context we can't return
|
||||
if (newDepth >= 0) {
|
||||
newDepth++;
|
||||
|
@ -1219,8 +1229,8 @@ void ParserATNSimulator::dumpDeadEndConfigs(NoViableAltException &nvae) {
|
|||
}
|
||||
|
||||
NoViableAltException ParserATNSimulator::noViableAlt(TokenStream *input, ParserRuleContext *outerContext,
|
||||
ATNConfigSet *configs, size_t startIndex) {
|
||||
return NoViableAltException(parser, input, input->get(startIndex), input->LT(1), configs, outerContext);
|
||||
ATNConfigSet *configs, size_t startIndex, bool deleteConfigs) {
|
||||
return NoViableAltException(parser, input, input->get(startIndex), input->LT(1), configs, outerContext, deleteConfigs);
|
||||
}
|
||||
|
||||
size_t ParserATNSimulator::getUniqueAlt(ATNConfigSet *configs) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
|
||||
/* 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.
|
||||
*/
|
||||
|
@ -836,7 +836,7 @@ namespace atn {
|
|||
virtual antlrcpp::BitSet getConflictingAltsOrUniqueAlt(ATNConfigSet *configs);
|
||||
|
||||
virtual NoViableAltException noViableAlt(TokenStream *input, ParserRuleContext *outerContext,
|
||||
ATNConfigSet *configs, size_t startIndex);
|
||||
ATNConfigSet *configs, size_t startIndex, bool deleteConfigs);
|
||||
|
||||
static size_t getUniqueAlt(ATNConfigSet *configs);
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace atn {
|
|||
class ANTLR4CPP_PUBLIC TokensStartState final : public DecisionState {
|
||||
|
||||
public:
|
||||
virtual size_t getStateType();
|
||||
virtual size_t getStateType() override;
|
||||
};
|
||||
|
||||
} // namespace atn
|
||||
|
|
|
@ -50,6 +50,9 @@ namespace antlrcpp {
|
|||
break;
|
||||
}
|
||||
// else fall through
|
||||
#if __has_cpp_attribute(clang::fallthrough)
|
||||
[[clang::fallthrough]];
|
||||
#endif
|
||||
|
||||
default:
|
||||
result += c;
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace pattern {
|
|||
/// are returned in the form {@code label:tag}, and unlabeled tags are
|
||||
/// returned as just the tag name.
|
||||
/// </summary>
|
||||
virtual std::string toString();
|
||||
virtual std::string toString() override;
|
||||
|
||||
private:
|
||||
/// This is the backing field for <seealso cref="#getTag"/>.
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace pattern {
|
|||
/// The implementation for <seealso cref="TextChunk"/> returns the result of
|
||||
/// <seealso cref="#getText()"/> in single quotes.
|
||||
/// </summary>
|
||||
virtual std::string toString();
|
||||
virtual std::string toString() override;
|
||||
};
|
||||
|
||||
} // namespace pattern
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"antlr4",
|
||||
"grammar"
|
||||
],
|
||||
"license": "BSD",
|
||||
"license": "BSD-3-Clause",
|
||||
"bugs": {
|
||||
"url": "https://github.com/antlr/antlr4/issues"
|
||||
},
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from antlr4.Token import Token
|
||||
from antlr4.InputStream import InputStream
|
||||
from antlr4.FileStream import FileStream
|
||||
from antlr4.StdinStream import StdinStream
|
||||
from antlr4.BufferedTokenStream import TokenStream
|
||||
from antlr4.CommonTokenStream import CommonTokenStream
|
||||
from antlr4.Lexer import Lexer
|
||||
|
@ -17,4 +18,4 @@ from antlr4.tree.Tree import ParseTreeListener, ParseTreeVisitor, ParseTreeWalke
|
|||
from antlr4.error.Errors import RecognitionException, IllegalStateException, NoViableAltException
|
||||
from antlr4.error.ErrorStrategy import BailErrorStrategy
|
||||
from antlr4.error.DiagnosticErrorListener import DiagnosticErrorListener
|
||||
from antlr4.Utils import str_list
|
||||
from antlr4.Utils import str_list
|
||||
|
|
|
@ -2,18 +2,17 @@
|
|||
/// 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.
|
||||
///
|
||||
|
||||
///
|
||||
/// Vacuum all input from a _java.io.Reader_/_java.io.InputStream_ and then treat it
|
||||
/// like a `char[]` buffer. Can also pass in a _String_ or
|
||||
/// `char[]` to use.
|
||||
///
|
||||
/// If you need encoding, pass in stream/reader with correct encoding.
|
||||
///
|
||||
|
||||
///
|
||||
public class ANTLRInputStream: CharStream {
|
||||
public static let READ_BUFFER_SIZE: Int = 1024
|
||||
public static let INITIAL_BUFFER_SIZE: Int = 1024
|
||||
|
||||
///
|
||||
///
|
||||
/// The data being scanned
|
||||
///
|
||||
internal var data: [Character]
|
||||
|
@ -24,9 +23,9 @@ public class ANTLRInputStream: CharStream {
|
|||
internal var n: Int
|
||||
|
||||
///
|
||||
/// 0..n-1 index into string of next char
|
||||
/// 0...n-1 index into string of next char
|
||||
///
|
||||
internal var p: Int = 0
|
||||
internal var p = 0
|
||||
|
||||
///
|
||||
/// What is name or source of this char stream?
|
||||
|
@ -62,7 +61,7 @@ public class ANTLRInputStream: CharStream {
|
|||
if p >= n {
|
||||
assert(LA(1) == ANTLRInputStream.EOF, "Expected: LA(1)==IntStream.EOF")
|
||||
|
||||
throw ANTLRError.illegalState(msg: "annot consume EOF")
|
||||
throw ANTLRError.illegalState(msg: "cannot consume EOF")
|
||||
|
||||
}
|
||||
|
||||
|
@ -99,7 +98,7 @@ public class ANTLRInputStream: CharStream {
|
|||
}
|
||||
|
||||
///
|
||||
/// Return the current input symbol index 0..n where n indicates the
|
||||
/// 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).
|
||||
///
|
||||
|
@ -136,29 +135,21 @@ public class ANTLRInputStream: CharStream {
|
|||
// seek forward, consume until p hits index or n (whichever comes first)
|
||||
index = min(index, n)
|
||||
while p < index {
|
||||
try consume()
|
||||
try consume()
|
||||
}
|
||||
}
|
||||
|
||||
public func getText(_ interval: Interval) -> String {
|
||||
let start: Int = interval.a
|
||||
var stop: Int = interval.b
|
||||
if stop >= n {
|
||||
stop = n - 1
|
||||
}
|
||||
let count = stop - start + 1;
|
||||
let start = interval.a
|
||||
if start >= n {
|
||||
return ""
|
||||
}
|
||||
|
||||
return String(data[start ..< (start + count)])
|
||||
let stop = min(n, interval.b + 1)
|
||||
return String(data[start ..< stop])
|
||||
}
|
||||
|
||||
public func getSourceName() -> String {
|
||||
guard let name = name , !name.isEmpty else {
|
||||
return ANTLRInputStream.UNKNOWN_SOURCE_NAME
|
||||
}
|
||||
return name
|
||||
return name ?? ANTLRInputStream.UNKNOWN_SOURCE_NAME
|
||||
}
|
||||
|
||||
public func toString() -> String {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
/// channel, such as _org.antlr.v4.runtime.Token#DEFAULT_CHANNEL_ or
|
||||
/// _org.antlr.v4.runtime.Token#HIDDEN_CHANNEL_, use a filtering token stream such a
|
||||
/// _org.antlr.v4.runtime.CommonTokenStream_.
|
||||
///
|
||||
///
|
||||
|
||||
public class BufferedTokenStream: TokenStream {
|
||||
///
|
||||
|
@ -30,8 +30,7 @@ public class BufferedTokenStream: TokenStream {
|
|||
/// considered a complete view of the input once _#fetchedEOF_ is set
|
||||
/// to `true`.
|
||||
///
|
||||
internal var tokens: Array<Token> = Array<Token>()
|
||||
// Array<Token>(100
|
||||
internal var tokens = [Token]()
|
||||
|
||||
///
|
||||
/// The index into _#tokens_ of the current token (next token to
|
||||
|
@ -44,7 +43,7 @@ public class BufferedTokenStream: TokenStream {
|
|||
/// see the documentation of _org.antlr.v4.runtime.IntStream_ for a description of
|
||||
/// Initializing Methods.
|
||||
///
|
||||
internal var p: Int = -1
|
||||
internal var p = -1
|
||||
|
||||
///
|
||||
/// Indicates whether the _org.antlr.v4.runtime.Token#EOF_ token has been fetched from
|
||||
|
@ -58,10 +57,10 @@ public class BufferedTokenStream: TokenStream {
|
|||
/// * _#fetch_: The check to prevent adding multiple EOF symbols into
|
||||
/// _#tokens_ is trivial with this field.
|
||||
///
|
||||
internal var fetchedEOF: Bool = false
|
||||
internal var fetchedEOF = false
|
||||
|
||||
|
||||
public init(_ tokenSource: TokenSource) {
|
||||
|
||||
self.tokenSource = tokenSource
|
||||
}
|
||||
|
||||
|
@ -135,10 +134,10 @@ public class BufferedTokenStream: TokenStream {
|
|||
@discardableResult
|
||||
internal func sync(_ i: Int) throws -> Bool {
|
||||
assert(i >= 0, "Expected: i>=0")
|
||||
let n: Int = i - tokens.count + 1 // how many more elements we need?
|
||||
let n = i - tokens.count + 1 // how many more elements we need?
|
||||
//print("sync("+i+") needs "+n);
|
||||
if n > 0 {
|
||||
let fetched: Int = try fetch(n)
|
||||
let fetched = try fetch(n)
|
||||
return fetched >= n
|
||||
}
|
||||
|
||||
|
@ -156,12 +155,12 @@ public class BufferedTokenStream: TokenStream {
|
|||
}
|
||||
|
||||
for i in 0..<n {
|
||||
let t: Token = try tokenSource.nextToken()
|
||||
if t is WritableToken {
|
||||
(t as! WritableToken).setTokenIndex(tokens.count)
|
||||
let t = try tokenSource.nextToken()
|
||||
if let wt = t as? WritableToken {
|
||||
wt.setTokenIndex(tokens.count)
|
||||
}
|
||||
|
||||
tokens.append(t) //add
|
||||
tokens.append(t)
|
||||
if t.getType() == BufferedTokenStream.EOF {
|
||||
fetchedEOF = true
|
||||
return i + 1
|
||||
|
@ -173,14 +172,13 @@ public class BufferedTokenStream: TokenStream {
|
|||
|
||||
public func get(_ i: Int) throws -> Token {
|
||||
if i < 0 || i >= tokens.count {
|
||||
let index = tokens.count - 1
|
||||
throw ANTLRError.indexOutOfBounds(msg: "token index \(i) out of range 0..\(index)")
|
||||
throw ANTLRError.indexOutOfBounds(msg: "token index \(i) out of range 0 ..< \(tokens.count)")
|
||||
}
|
||||
return tokens[i]
|
||||
}
|
||||
|
||||
///
|
||||
/// Get all tokens from start..stop inclusively
|
||||
/// Get all tokens from start...stop inclusively
|
||||
///
|
||||
public func get(_ start: Int,_ stop: Int) throws -> Array<Token>? {
|
||||
var stop = stop
|
||||
|
@ -188,12 +186,12 @@ public class BufferedTokenStream: TokenStream {
|
|||
return nil
|
||||
}
|
||||
try lazyInit()
|
||||
var subset: Array<Token> = Array<Token>()
|
||||
var subset = [Token]()
|
||||
if stop >= tokens.count {
|
||||
stop = tokens.count - 1
|
||||
}
|
||||
for i in start...stop {
|
||||
let t: Token = tokens[i]
|
||||
let t = tokens[i]
|
||||
if t.getType() == BufferedTokenStream.EOF {
|
||||
break
|
||||
}
|
||||
|
@ -223,14 +221,13 @@ public class BufferedTokenStream: TokenStream {
|
|||
return try LB(-k)
|
||||
}
|
||||
|
||||
let i: Int = p + k - 1
|
||||
let i = p + k - 1
|
||||
try sync(i)
|
||||
if i >= tokens.count {
|
||||
// return EOF token
|
||||
// EOF must be last token
|
||||
return tokens[tokens.count - 1]
|
||||
return tokens.last!
|
||||
}
|
||||
// if ( i>range ) range = i;
|
||||
return tokens[i]
|
||||
}
|
||||
|
||||
|
@ -289,7 +286,7 @@ public class BufferedTokenStream: TokenStream {
|
|||
try lazyInit()
|
||||
if start < 0 || start >= tokens.count ||
|
||||
stop < 0 || stop >= tokens.count {
|
||||
throw ANTLRError.indexOutOfBounds(msg: "start \(start) or stop \(stop) not in 0...\(tokens.count - 1)")
|
||||
throw ANTLRError.indexOutOfBounds(msg: "start \(start) or stop \(stop) not in 0 ..< \(tokens.count)")
|
||||
|
||||
}
|
||||
if start > stop {
|
||||
|
@ -330,7 +327,7 @@ public class BufferedTokenStream: TokenStream {
|
|||
return size() - 1
|
||||
}
|
||||
|
||||
var token: Token = tokens[i]
|
||||
var token = tokens[i]
|
||||
while token.getChannel() != channel {
|
||||
if token.getType() == BufferedTokenStream.EOF {
|
||||
return i
|
||||
|
@ -363,7 +360,7 @@ public class BufferedTokenStream: TokenStream {
|
|||
}
|
||||
|
||||
while i >= 0 {
|
||||
let token: Token = tokens[i]
|
||||
let token = tokens[i]
|
||||
if token.getType() == BufferedTokenStream.EOF || token.getChannel() == channel {
|
||||
return i
|
||||
}
|
||||
|
@ -379,45 +376,35 @@ public class BufferedTokenStream: TokenStream {
|
|||
/// 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.
|
||||
///
|
||||
public func getHiddenTokensToRight(_ tokenIndex: Int, _ channel: Int) throws -> Array<Token>? {
|
||||
public func getHiddenTokensToRight(_ tokenIndex: Int, _ channel: Int = -1) throws -> [Token]? {
|
||||
try lazyInit()
|
||||
if tokenIndex < 0 || tokenIndex >= tokens.count {
|
||||
throw ANTLRError.indexOutOfBounds(msg: "\(tokenIndex) not in 0..\(tokens.count - 1)")
|
||||
|
||||
throw ANTLRError.indexOutOfBounds(msg: "\(tokenIndex) not in 0 ..< \(tokens.count)")
|
||||
}
|
||||
|
||||
let nextOnChannel: Int =
|
||||
try nextTokenOnChannel(tokenIndex + 1, Lexer.DEFAULT_TOKEN_CHANNEL)
|
||||
var to: Int
|
||||
let from: Int = tokenIndex + 1
|
||||
let nextOnChannel = try nextTokenOnChannel(tokenIndex + 1, Lexer.DEFAULT_TOKEN_CHANNEL)
|
||||
let from = tokenIndex + 1
|
||||
let to: Int
|
||||
// if none onchannel to right, nextOnChannel=-1 so set to = last token
|
||||
if nextOnChannel == -1 {
|
||||
to = size() - 1
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
to = nextOnChannel
|
||||
}
|
||||
|
||||
return filterForChannel(from, to, channel)
|
||||
}
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
public func getHiddenTokensToRight(_ tokenIndex: Int) throws -> Array<Token>? {
|
||||
return try getHiddenTokensToRight(tokenIndex, -1)
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
public func getHiddenTokensToLeft(_ tokenIndex: Int, _ channel: Int) throws -> Array<Token>? {
|
||||
public func getHiddenTokensToLeft(_ tokenIndex: Int, _ channel: Int = -1) throws -> [Token]? {
|
||||
try lazyInit()
|
||||
if tokenIndex < 0 || tokenIndex >= tokens.count {
|
||||
throw ANTLRError.indexOutOfBounds(msg: "\(tokenIndex) not in 0..\(tokens.count - 1)")
|
||||
throw ANTLRError.indexOutOfBounds(msg: "\(tokenIndex) not in 0 ..< \(tokens.count)")
|
||||
}
|
||||
|
||||
if tokenIndex == 0 {
|
||||
|
@ -425,26 +412,16 @@ public class BufferedTokenStream: TokenStream {
|
|||
return nil
|
||||
}
|
||||
|
||||
let prevOnChannel: Int =
|
||||
try previousTokenOnChannel(tokenIndex - 1, Lexer.DEFAULT_TOKEN_CHANNEL)
|
||||
let prevOnChannel = try previousTokenOnChannel(tokenIndex - 1, Lexer.DEFAULT_TOKEN_CHANNEL)
|
||||
if prevOnChannel == tokenIndex - 1 {
|
||||
return nil
|
||||
}
|
||||
// if none onchannel to left, prevOnChannel=-1 then from=0
|
||||
let from: Int = prevOnChannel + 1
|
||||
let to: Int = tokenIndex - 1
|
||||
|
||||
let from = prevOnChannel + 1
|
||||
let to = tokenIndex - 1
|
||||
return filterForChannel(from, to, channel)
|
||||
}
|
||||
|
||||
///
|
||||
/// 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.
|
||||
///
|
||||
public func getHiddenTokensToLeft(_ tokenIndex: Int) throws -> [Token]? {
|
||||
return try getHiddenTokensToLeft(tokenIndex, -1)
|
||||
}
|
||||
|
||||
internal func filterForChannel(_ from: Int, _ to: Int, _ channel: Int) -> [Token]? {
|
||||
var hidden = [Token]()
|
||||
for t in tokens[from...to] {
|
||||
|
@ -478,17 +455,13 @@ public class BufferedTokenStream: TokenStream {
|
|||
|
||||
public func getText(_ interval: Interval) throws -> String {
|
||||
let start = interval.a
|
||||
var stop = interval.b
|
||||
if start < 0 || stop < 0 {
|
||||
if start < 0 {
|
||||
return ""
|
||||
}
|
||||
try fill()
|
||||
if stop >= tokens.count {
|
||||
stop = tokens.count - 1
|
||||
}
|
||||
|
||||
let stop = min(tokens.count, interval.b + 1)
|
||||
var buf = ""
|
||||
for t in tokens[start...stop] {
|
||||
for t in tokens[start ..< stop] {
|
||||
if t.getType() == BufferedTokenStream.EOF {
|
||||
break
|
||||
}
|
||||
|
|
|
@ -79,10 +79,10 @@ public class ListTokenSource: TokenSource {
|
|||
else if let eofToken = eofToken {
|
||||
return eofToken.getCharPositionInLine()
|
||||
}
|
||||
else if tokens.count > 0 {
|
||||
else if !tokens.isEmpty {
|
||||
// have to calculate the result from the line/column of the previous
|
||||
// token, along with the text of the token.
|
||||
let lastToken = tokens[tokens.count - 1]
|
||||
let lastToken = tokens.last!
|
||||
|
||||
if let tokenText = lastToken.getText() {
|
||||
if let lastNewLine = tokenText.lastIndex(of: "\n") {
|
||||
|
@ -93,10 +93,11 @@ public class ListTokenSource: TokenSource {
|
|||
lastToken.getStopIndex() -
|
||||
lastToken.getStartIndex() + 1)
|
||||
}
|
||||
|
||||
// only reach this if tokens is empty, meaning EOF occurs at the first
|
||||
// position in the input
|
||||
return 0
|
||||
else {
|
||||
// only reach this if tokens is empty, meaning EOF occurs at the first
|
||||
// position in the input
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
public func nextToken() -> Token {
|
||||
|
@ -130,33 +131,32 @@ public class ListTokenSource: TokenSource {
|
|||
public func getLine() -> Int {
|
||||
if i < tokens.count {
|
||||
return tokens[i].getLine()
|
||||
} else {
|
||||
if let eofToken = eofToken {
|
||||
return eofToken.getLine()
|
||||
} else {
|
||||
if tokens.count > 0 {
|
||||
// have to calculate the result from the line/column of the previous
|
||||
// token, along with the text of the token.
|
||||
let lastToken = tokens[tokens.count - 1]
|
||||
var line = lastToken.getLine()
|
||||
}
|
||||
else if let eofToken = eofToken {
|
||||
return eofToken.getLine()
|
||||
}
|
||||
else if !tokens.isEmpty {
|
||||
// have to calculate the result from the line/column of the previous
|
||||
// token, along with the text of the token.
|
||||
let lastToken = tokens.last!
|
||||
var line = lastToken.getLine()
|
||||
|
||||
if let tokenText = lastToken.getText() {
|
||||
for c in tokenText {
|
||||
if c == "\n" {
|
||||
line += 1
|
||||
}
|
||||
}
|
||||
if let tokenText = lastToken.getText() {
|
||||
for c in tokenText {
|
||||
if c == "\n" {
|
||||
line += 1
|
||||
}
|
||||
|
||||
// if no text is available, assume the token did not contain any newline characters.
|
||||
return line
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// only reach this if tokens is empty, meaning EOF occurs at the first
|
||||
// position in the input
|
||||
return 1
|
||||
// if no text is available, assume the token did not contain any newline characters.
|
||||
return line
|
||||
}
|
||||
else {
|
||||
// only reach this if tokens is empty, meaning EOF occurs at the first
|
||||
// position in the input
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
public func getInputStream() -> CharStream? {
|
||||
|
@ -166,8 +166,8 @@ public class ListTokenSource: TokenSource {
|
|||
else if let eofToken = eofToken {
|
||||
return eofToken.getInputStream()
|
||||
}
|
||||
else if tokens.count > 0 {
|
||||
return tokens[tokens.count - 1].getInputStream()
|
||||
else if !tokens.isEmpty {
|
||||
return tokens.last!.getInputStream()
|
||||
}
|
||||
|
||||
// no input stream information is available
|
||||
|
|
|
@ -8,7 +8,21 @@
|
|||
|
||||
import Foundation
|
||||
|
||||
///
|
||||
///
|
||||
/// This field maps from the serialized ATN string to the deserialized _org.antlr.v4.runtime.atn.ATN_ with
|
||||
/// bypass alternatives.
|
||||
///
|
||||
/// - SeeAlso: `ATNDeserializationOptions.generateRuleBypassTransitions`
|
||||
///
|
||||
private var bypassAltsAtnCache = [String: ATN]()
|
||||
|
||||
///
|
||||
/// mutex for bypassAltsAtnCache updates
|
||||
///
|
||||
private let bypassAltsAtnCacheMutex = Mutex()
|
||||
|
||||
|
||||
///
|
||||
/// This is all the parsing support code essentially; most of it is error recovery stuff.
|
||||
///
|
||||
open class Parser: Recognizer<ParserATNSimulator> {
|
||||
|
@ -58,25 +72,6 @@ open class Parser: Recognizer<ParserATNSimulator> {
|
|||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// mutex for bypassAltsAtnCache updates
|
||||
///
|
||||
private let bypassAltsAtnCacheMutex = Mutex()
|
||||
|
||||
///
|
||||
/// mutex for decisionToDFA updates
|
||||
///
|
||||
private let decisionToDFAMutex = Mutex()
|
||||
|
||||
///
|
||||
/// This field maps from the serialized ATN string to the deserialized _org.antlr.v4.runtime.atn.ATN_ with
|
||||
/// bypass alternatives.
|
||||
///
|
||||
/// - SeeAlso: org.antlr.v4.runtime.atn.ATNDeserializationOptions#isGenerateRuleBypassTransitions()
|
||||
///
|
||||
private let bypassAltsAtnCache: HashMap<String, ATN> = HashMap<String, ATN>()
|
||||
|
||||
|
||||
///
|
||||
/// The error handling strategy for the parser. The default value is a new
|
||||
/// instance of _org.antlr.v4.runtime.DefaultErrorStrategy_.
|
||||
|
@ -417,23 +412,21 @@ open class Parser: Recognizer<ParserATNSimulator> {
|
|||
///
|
||||
/// The ATN with bypass alternatives is expensive to create so we create it
|
||||
/// lazily.
|
||||
///
|
||||
/// - Throws: _ANTLRError.unsupportedOperation_ if the current parser does not
|
||||
/// implement the _#getSerializedATN()_ method.
|
||||
///
|
||||
///
|
||||
public func getATNWithBypassAlts() -> ATN {
|
||||
let serializedAtn = getSerializedATN()
|
||||
|
||||
var result = bypassAltsAtnCache[serializedAtn]
|
||||
bypassAltsAtnCacheMutex.synchronized { [unowned self] in
|
||||
if result == nil {
|
||||
let deserializationOptions = ATNDeserializationOptions()
|
||||
try! deserializationOptions.setGenerateRuleBypassTransitions(true)
|
||||
result = try! ATNDeserializer(deserializationOptions).deserialize(Array(serializedAtn))
|
||||
self.bypassAltsAtnCache[serializedAtn] = result!
|
||||
return bypassAltsAtnCacheMutex.synchronized {
|
||||
if let cachedResult = bypassAltsAtnCache[serializedAtn] {
|
||||
return cachedResult
|
||||
}
|
||||
|
||||
var opts = ATNDeserializationOptions()
|
||||
opts.generateRuleBypassTransitions = true
|
||||
let result = try! ATNDeserializer(opts).deserialize(Array(serializedAtn))
|
||||
bypassAltsAtnCache[serializedAtn] = result
|
||||
return result
|
||||
}
|
||||
return result!
|
||||
}
|
||||
|
||||
///
|
||||
|
@ -965,18 +958,13 @@ open class Parser: Recognizer<ParserATNSimulator> {
|
|||
|
||||
/// For debugging and other purposes.
|
||||
public func getDFAStrings() -> [String] {
|
||||
var s = [String]()
|
||||
guard let _interp = _interp else {
|
||||
return s
|
||||
guard let _interp = _interp else {
|
||||
return []
|
||||
}
|
||||
decisionToDFAMutex.synchronized { [unowned self] in
|
||||
for d in 0..<_interp.decisionToDFA.count {
|
||||
let dfa = _interp.decisionToDFA[d]
|
||||
s.append(dfa.toString(self.getVocabulary()))
|
||||
}
|
||||
|
||||
let vocab = getVocabulary()
|
||||
return _interp.decisionToDFA.map {
|
||||
$0.toString(vocab)
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
/// For debugging and other purposes.
|
||||
|
@ -984,19 +972,16 @@ open class Parser: Recognizer<ParserATNSimulator> {
|
|||
guard let _interp = _interp else {
|
||||
return
|
||||
}
|
||||
decisionToDFAMutex.synchronized { [unowned self] in
|
||||
var seenOne = false
|
||||
|
||||
for dfa in _interp.decisionToDFA {
|
||||
if !dfa.states.isEmpty {
|
||||
if seenOne {
|
||||
print("")
|
||||
}
|
||||
print("Decision \(dfa.decision):")
|
||||
|
||||
print(dfa.toString(self.getVocabulary()), terminator: "")
|
||||
seenOne = true
|
||||
var seenOne = false
|
||||
let vocab = getVocabulary()
|
||||
for dfa in _interp.decisionToDFA {
|
||||
if !dfa.states.isEmpty {
|
||||
if seenOne {
|
||||
print("")
|
||||
}
|
||||
print("Decision \(dfa.decision):")
|
||||
print(dfa.toString(vocab), terminator: "")
|
||||
seenOne = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,22 +12,22 @@ public class UnbufferedTokenStream: TokenStream {
|
|||
/// we keep adding to buffer. Otherwise, _#consume consume()_ resets so
|
||||
/// we start filling at index 0 again.
|
||||
///
|
||||
internal var tokens: [Token]
|
||||
internal var tokens = [Token]()
|
||||
|
||||
///
|
||||
/// The number of tokens currently in _#tokens tokens_.
|
||||
/// The number of tokens currently in `self.tokens`.
|
||||
///
|
||||
/// This is not the buffer capacity, that's `tokens.length`.
|
||||
/// This is not the buffer capacity, that's `self.tokens.count`.
|
||||
///
|
||||
internal var n: Int
|
||||
internal var n = 0
|
||||
|
||||
///
|
||||
/// 0..n-1 index into _#tokens tokens_ of next token.
|
||||
/// `0...n-1` index into `self.tokens` of next token.
|
||||
///
|
||||
/// The `LT(1)` token is `tokens[p]`. If `p == n`, we are
|
||||
/// out of buffered tokens.
|
||||
///
|
||||
internal var p: Int = 0
|
||||
internal var p = 0
|
||||
|
||||
///
|
||||
/// Count up with _#mark mark()_ and down with
|
||||
|
@ -35,7 +35,7 @@ public class UnbufferedTokenStream: TokenStream {
|
|||
/// `numMarkers` reaches 0 and we reset the buffer. Copy
|
||||
/// `tokens[p]..tokens[n-1]` to `tokens[0]..tokens[(n-1)-p]`.
|
||||
///
|
||||
internal var numMarkers: Int = 0
|
||||
internal var numMarkers = 0
|
||||
|
||||
///
|
||||
/// This is the `LT(-1)` token for the current position.
|
||||
|
@ -56,24 +56,18 @@ public class UnbufferedTokenStream: TokenStream {
|
|||
/// This value is used to set the token indexes if the stream provides tokens
|
||||
/// that implement _org.antlr.v4.runtime.WritableToken_.
|
||||
///
|
||||
internal var currentTokenIndex: Int = 0
|
||||
internal var currentTokenIndex = 0
|
||||
|
||||
public convenience init(_ tokenSource: TokenSource) throws {
|
||||
try self.init(tokenSource, 256)
|
||||
}
|
||||
//TODO: bufferSize don't be use
|
||||
public init(_ tokenSource: TokenSource, _ bufferSize: Int) throws {
|
||||
|
||||
public init(_ tokenSource: TokenSource) throws {
|
||||
self.tokenSource = tokenSource
|
||||
//tokens = [Token](count: bufferSize, repeatedValue: Token) ;
|
||||
tokens = [Token]()
|
||||
n = 0
|
||||
try fill(1) // prime the pump
|
||||
}
|
||||
|
||||
|
||||
public func get(_ i: Int) throws -> Token {
|
||||
// get absolute index
|
||||
let bufferStartIndex: Int = getBufferStartIndex()
|
||||
let bufferStartIndex = getBufferStartIndex()
|
||||
if i < bufferStartIndex || i >= bufferStartIndex + n {
|
||||
throw ANTLRError.indexOutOfBounds(msg: "get(\(i)) outside buffer: \(bufferStartIndex)..\(bufferStartIndex + n)")
|
||||
}
|
||||
|
@ -103,7 +97,7 @@ public class UnbufferedTokenStream: TokenStream {
|
|||
|
||||
|
||||
public func LA(_ i: Int) throws -> Int {
|
||||
return try LT(i)!.getType()
|
||||
return try LT(i)!.getType()
|
||||
}
|
||||
|
||||
|
||||
|
@ -184,8 +178,8 @@ public class UnbufferedTokenStream: TokenStream {
|
|||
//tokens = Arrays.copyOf(tokens, tokens.length * 2);
|
||||
}
|
||||
|
||||
if t is WritableToken {
|
||||
(t as! WritableToken).setTokenIndex(getBufferStartIndex() + n)
|
||||
if let wt = t as? WritableToken {
|
||||
wt.setTokenIndex(getBufferStartIndex() + n)
|
||||
}
|
||||
|
||||
tokens[n] = t
|
||||
|
@ -205,14 +199,14 @@ public class UnbufferedTokenStream: TokenStream {
|
|||
lastTokenBufferStart = lastToken
|
||||
}
|
||||
|
||||
let mark: Int = -numMarkers - 1
|
||||
let mark = -numMarkers - 1
|
||||
numMarkers += 1
|
||||
return mark
|
||||
}
|
||||
|
||||
|
||||
public func release(_ marker: Int) throws {
|
||||
let expectedMark: Int = -numMarkers
|
||||
let expectedMark = -numMarkers
|
||||
if marker != expectedMark {
|
||||
throw ANTLRError.illegalState(msg: "release() called with an invalid marker.")
|
||||
}
|
||||
|
@ -224,7 +218,6 @@ public class UnbufferedTokenStream: TokenStream {
|
|||
// Copy tokens[p]..tokens[n-1] to tokens[0]..tokens[(n-1)-p], reset ptrs
|
||||
// p is last valid token; move nothing if p==n as we have no valid char
|
||||
tokens = Array(tokens[p ... n - 1])
|
||||
//System.arraycopy(tokens, p, tokens, 0, n - p); // shift n-p tokens from p to 0
|
||||
n = n - p
|
||||
p = 0
|
||||
}
|
||||
|
@ -251,16 +244,14 @@ public class UnbufferedTokenStream: TokenStream {
|
|||
index = min(index, getBufferStartIndex() + n - 1)
|
||||
}
|
||||
|
||||
let bufferStartIndex: Int = getBufferStartIndex()
|
||||
let i: Int = index - bufferStartIndex
|
||||
let bufferStartIndex = getBufferStartIndex()
|
||||
let i = index - bufferStartIndex
|
||||
if i < 0 {
|
||||
throw ANTLRError.illegalState(msg: "cannot seek to negative index \(index)")
|
||||
|
||||
} else {
|
||||
if i >= n {
|
||||
throw ANTLRError.unsupportedOperation(msg: "seek to index outside buffer: \(index) not in \(bufferStartIndex)..\(bufferStartIndex + n)")
|
||||
|
||||
}
|
||||
}
|
||||
else if i >= n {
|
||||
throw ANTLRError.unsupportedOperation(msg: "seek to index outside buffer: \(index) not in \(bufferStartIndex)..<\(bufferStartIndex + n)")
|
||||
}
|
||||
|
||||
p = i
|
||||
|
@ -290,7 +281,7 @@ public class UnbufferedTokenStream: TokenStream {
|
|||
let start = interval.a
|
||||
let stop = interval.b
|
||||
if start < bufferStartIndex || stop > bufferStopIndex {
|
||||
throw ANTLRError.unsupportedOperation(msg: "interval \(interval) not in token buffer window: \(bufferStartIndex)..bufferStopIndex)")
|
||||
throw ANTLRError.unsupportedOperation(msg: "interval \(interval) not in token buffer window: \(bufferStartIndex)...\(bufferStopIndex)")
|
||||
}
|
||||
|
||||
let a = start - bufferStartIndex
|
||||
|
|
|
@ -40,8 +40,7 @@ public class ATN {
|
|||
///
|
||||
/// For lexer ATNs, this maps the rule index to the resulting token type.
|
||||
/// For parser ATNs, this maps the rule index to the generated bypass token
|
||||
/// type if the
|
||||
/// _org.antlr.v4.runtime.atn.ATNDeserializationOptions#isGenerateRuleBypassTransitions_
|
||||
/// type if the `ATNDeserializationOptions.generateRuleBypassTransitions`
|
||||
/// deserialization option was specified; otherwise, this is `null`.
|
||||
///
|
||||
public final var ruleToTokenType: [Int]!
|
||||
|
|
|
@ -303,7 +303,7 @@ public class ATNConfigSet: Hashable, CustomStringConvertible {
|
|||
|
||||
public final func getConflictingAltSubsets() -> [BitSet] {
|
||||
let length = configs.count
|
||||
let configToAlts = HashMap<Int, BitSet>(count: length)
|
||||
var configToAlts = [Int: BitSet]()
|
||||
|
||||
for i in 0..<length {
|
||||
let hash = configHash(configs[i].state.stateNumber, configs[i].context)
|
||||
|
@ -318,12 +318,12 @@ public class ATNConfigSet: Hashable, CustomStringConvertible {
|
|||
try! alts.set(configs[i].alt)
|
||||
}
|
||||
|
||||
return configToAlts.values
|
||||
return Array(configToAlts.values)
|
||||
}
|
||||
|
||||
public final func getStateToAltMap() -> HashMap<ATNState, BitSet> {
|
||||
public final func getStateToAltMap() -> [ATNState: BitSet] {
|
||||
let length = configs.count
|
||||
let m = HashMap<ATNState, BitSet>(count: length)
|
||||
var m = [ATNState: BitSet]()
|
||||
|
||||
for i in 0..<length {
|
||||
var alts: BitSet
|
||||
|
@ -412,7 +412,7 @@ public class ATNConfigSet: Hashable, CustomStringConvertible {
|
|||
public final func applyPrecedenceFilter(_ mergeCache: inout DoubleKeyMap<PredictionContext, PredictionContext, PredictionContext>?,_ parser: Parser,_ _outerContext: ParserRuleContext!) throws -> ATNConfigSet {
|
||||
|
||||
let configSet = ATNConfigSet(fullCtx)
|
||||
let statesFromAlt1 = HashMap<Int, PredictionContext>(count: configs.count)
|
||||
var statesFromAlt1 = [Int: PredictionContext]()
|
||||
for config in configs {
|
||||
// handle alt 1 first
|
||||
if config.alt != 1 {
|
||||
|
|
|
@ -4,73 +4,7 @@
|
|||
/// can be found in the LICENSE.txt file in the project root.
|
||||
///
|
||||
|
||||
|
||||
|
||||
///
|
||||
///
|
||||
/// - Sam Harwell
|
||||
///
|
||||
|
||||
public class ATNDeserializationOptions {
|
||||
|
||||
static let defaultOptions: ATNDeserializationOptions = {
|
||||
|
||||
let defaultOptions = ATNDeserializationOptions()
|
||||
defaultOptions.makeReadOnly()
|
||||
return defaultOptions
|
||||
|
||||
}()
|
||||
|
||||
|
||||
private var readOnly: Bool = false
|
||||
private var verifyATN: Bool
|
||||
private var generateRuleBypassTransitions: Bool
|
||||
|
||||
public init() {
|
||||
self.verifyATN = true
|
||||
self.generateRuleBypassTransitions = false
|
||||
}
|
||||
|
||||
public init(_ options: ATNDeserializationOptions) {
|
||||
self.verifyATN = options.verifyATN
|
||||
self.generateRuleBypassTransitions = options.generateRuleBypassTransitions
|
||||
}
|
||||
|
||||
|
||||
public static func getDefaultOptions() -> ATNDeserializationOptions {
|
||||
return defaultOptions
|
||||
}
|
||||
|
||||
public final func isReadOnly() -> Bool {
|
||||
return readOnly
|
||||
}
|
||||
|
||||
public final func makeReadOnly() {
|
||||
readOnly = true
|
||||
}
|
||||
|
||||
public final func isVerifyATN() -> Bool {
|
||||
return verifyATN
|
||||
}
|
||||
|
||||
public final func setVerifyATN(_ verifyATN: Bool) throws {
|
||||
try throwIfReadOnly()
|
||||
self.verifyATN = verifyATN
|
||||
}
|
||||
|
||||
public final func isGenerateRuleBypassTransitions() -> Bool {
|
||||
return generateRuleBypassTransitions
|
||||
}
|
||||
|
||||
public final func setGenerateRuleBypassTransitions(_ generateRuleBypassTransitions: Bool) throws {
|
||||
try throwIfReadOnly()
|
||||
self.generateRuleBypassTransitions = generateRuleBypassTransitions
|
||||
}
|
||||
|
||||
internal func throwIfReadOnly() throws {
|
||||
if isReadOnly() {
|
||||
throw ANTLRError.illegalState(msg: "This object is readonly")
|
||||
|
||||
}
|
||||
}
|
||||
public struct ATNDeserializationOptions {
|
||||
public var verifyATN = true
|
||||
public var generateRuleBypassTransitions = false
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ public class ATNDeserializer {
|
|||
private let deserializationOptions: ATNDeserializationOptions
|
||||
|
||||
public init(_ deserializationOptions: ATNDeserializationOptions? = nil) {
|
||||
self.deserializationOptions = deserializationOptions ?? ATNDeserializationOptions.getDefaultOptions()
|
||||
self.deserializationOptions = deserializationOptions ?? ATNDeserializationOptions()
|
||||
}
|
||||
|
||||
///
|
||||
|
@ -667,13 +667,13 @@ public class ATNDeserializer {
|
|||
|
||||
private func finalizeATN(_ atn: ATN) throws {
|
||||
markPrecedenceDecisions(atn)
|
||||
if deserializationOptions.isVerifyATN() {
|
||||
if deserializationOptions.verifyATN {
|
||||
try verifyATN(atn)
|
||||
}
|
||||
if deserializationOptions.isGenerateRuleBypassTransitions() && atn.grammarType == ATNType.parser {
|
||||
if deserializationOptions.generateRuleBypassTransitions && atn.grammarType == ATNType.parser {
|
||||
try generateRuleBypassTransitions(atn)
|
||||
|
||||
if deserializationOptions.isVerifyATN() {
|
||||
if deserializationOptions.verifyATN {
|
||||
// reverify after modification
|
||||
try verifyATN(atn)
|
||||
}
|
||||
|
|
|
@ -75,11 +75,10 @@ open class ATNSimulator {
|
|||
open func getCachedContext(_ context: PredictionContext) -> PredictionContext {
|
||||
//TODO: synced (sharedContextCache!)
|
||||
//synced (sharedContextCache!) {
|
||||
let visited = HashMap<PredictionContext, PredictionContext>()
|
||||
|
||||
var visited = [PredictionContext: PredictionContext]()
|
||||
return PredictionContext.getCachedContext(context,
|
||||
sharedContextCache,
|
||||
visited)
|
||||
&visited)
|
||||
}
|
||||
|
||||
public static func edgeFactory(_ atn: ATN,
|
||||
|
|
|
@ -711,7 +711,7 @@ open class LexerATNSimulator: ATNSimulator {
|
|||
|
||||
return dfaStatesMutex.synchronized {
|
||||
if let existing = dfa.states[proposed] {
|
||||
return existing!
|
||||
return existing
|
||||
}
|
||||
|
||||
let newState = proposed
|
||||
|
|
|
@ -19,10 +19,9 @@ public enum LookupDictionaryType: Int {
|
|||
}
|
||||
|
||||
public struct LookupDictionary {
|
||||
private var type: LookupDictionaryType
|
||||
// private var cache: HashMap<Int, [ATNConfig]> = HashMap<Int, [ATNConfig]>()
|
||||
//
|
||||
private var cache: HashMap<Int, ATNConfig> = HashMap<Int, ATNConfig>()
|
||||
private let type: LookupDictionaryType
|
||||
private var cache = [Int: ATNConfig]()
|
||||
|
||||
public init(type: LookupDictionaryType = LookupDictionaryType.lookup) {
|
||||
self.type = type
|
||||
}
|
||||
|
@ -48,82 +47,41 @@ public struct LookupDictionary {
|
|||
return true
|
||||
}
|
||||
|
||||
|
||||
let same: Bool =
|
||||
lhs.state.stateNumber == rhs.state.stateNumber &&
|
||||
return
|
||||
lhs.state.stateNumber == rhs.state.stateNumber &&
|
||||
lhs.alt == rhs.alt &&
|
||||
lhs.semanticContext == rhs.semanticContext
|
||||
|
||||
return same
|
||||
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
//Ordered
|
||||
return lhs == rhs
|
||||
}
|
||||
}
|
||||
|
||||
// public mutating func getOrAdd(config: ATNConfig) -> ATNConfig {
|
||||
//
|
||||
// let h = hash(config)
|
||||
//
|
||||
// if let configList = cache[h] {
|
||||
// let length = configList.count
|
||||
// for i in 0..<length {
|
||||
// if equal(configList[i], config) {
|
||||
// return configList[i]
|
||||
// }
|
||||
// }
|
||||
// cache[h]!.append(config)
|
||||
// } else {
|
||||
// cache[h] = [config]
|
||||
// }
|
||||
//
|
||||
// return config
|
||||
//
|
||||
// }
|
||||
public mutating func getOrAdd(_ config: ATNConfig) -> ATNConfig {
|
||||
|
||||
let h = hash(config)
|
||||
|
||||
if let configList = cache[h] {
|
||||
return configList
|
||||
} else {
|
||||
cache[h] = config
|
||||
}
|
||||
|
||||
return config
|
||||
public mutating func getOrAdd(_ config: ATNConfig) -> ATNConfig {
|
||||
let h = hash(config)
|
||||
|
||||
if let configList = cache[h] {
|
||||
return configList
|
||||
}
|
||||
else {
|
||||
cache[h] = config
|
||||
}
|
||||
|
||||
return config
|
||||
}
|
||||
|
||||
public var isEmpty: Bool {
|
||||
return cache.isEmpty
|
||||
}
|
||||
|
||||
// public func contains(config: ATNConfig) -> Bool {
|
||||
//
|
||||
// let h = hash(config)
|
||||
// if let configList = cache[h] {
|
||||
// for c in configList {
|
||||
// if equal(c, config) {
|
||||
// return true
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return false
|
||||
//
|
||||
// }
|
||||
public func contains(_ config: ATNConfig) -> Bool {
|
||||
|
||||
let h = hash(config)
|
||||
if let _ = cache[h] {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
|
||||
return cache[h] != nil
|
||||
}
|
||||
|
||||
public mutating func removeAll() {
|
||||
cache.clear()
|
||||
cache.removeAll()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -255,7 +255,7 @@ open class ParserATNSimulator: ATNSimulator {
|
|||
|
||||
public final var decisionToDFA: [DFA]
|
||||
|
||||
///
|
||||
///
|
||||
/// SLL, LL, or LL + exact ambig detection?
|
||||
///
|
||||
|
||||
|
@ -2013,7 +2013,7 @@ open class ParserATNSimulator: ATNSimulator {
|
|||
|
||||
return dfaStatesMutex.synchronized {
|
||||
if let existing = dfa.states[D] {
|
||||
return existing!
|
||||
return existing
|
||||
}
|
||||
|
||||
D.stateNumber = dfa.states.count
|
||||
|
|
|
@ -580,71 +580,67 @@ public class PredictionContext: Hashable, CustomStringConvertible {
|
|||
public static func getCachedContext(
|
||||
_ context: PredictionContext,
|
||||
_ contextCache: PredictionContextCache,
|
||||
_ visited: HashMap<PredictionContext, PredictionContext>) -> PredictionContext {
|
||||
if context.isEmpty() {
|
||||
_ visited: inout [PredictionContext: PredictionContext]) -> PredictionContext {
|
||||
if context.isEmpty() {
|
||||
return context
|
||||
}
|
||||
|
||||
if let visitedContext = visited[context] {
|
||||
return visitedContext
|
||||
}
|
||||
|
||||
if let cachedContext = contextCache.get(context) {
|
||||
visited[context] = cachedContext
|
||||
return cachedContext
|
||||
}
|
||||
|
||||
var changed = false
|
||||
var parents = [PredictionContext?](repeating: nil, count: context.size())
|
||||
let length = parents.count
|
||||
for i in 0..<length {
|
||||
if context.getParent(i) == nil {
|
||||
return context
|
||||
}
|
||||
|
||||
var existing = visited[context]
|
||||
if existing != nil {
|
||||
return existing!
|
||||
}
|
||||
let parent = getCachedContext(context.getParent(i)!, contextCache, &visited)
|
||||
if changed || parent !== context.getParent(i) {
|
||||
if !changed {
|
||||
parents = [PredictionContext?](repeating: nil, count: context.size())
|
||||
|
||||
existing = contextCache.get(context)
|
||||
if existing != nil {
|
||||
visited[context] = existing!
|
||||
return existing!
|
||||
}
|
||||
|
||||
var changed = false
|
||||
var parents = [PredictionContext?](repeating: nil, count: context.size())
|
||||
let length = parents.count
|
||||
for i in 0..<length {
|
||||
//added by janyou
|
||||
if context.getParent(i) == nil {
|
||||
return context
|
||||
}
|
||||
|
||||
let parent = getCachedContext(context.getParent(i)!, contextCache, visited)
|
||||
//modified by janyou != !==
|
||||
if changed || parent !== context.getParent(i) {
|
||||
if !changed {
|
||||
parents = [PredictionContext?](repeating: nil, count: context.size())
|
||||
|
||||
for j in 0..<context.size() {
|
||||
parents[j] = context.getParent(j)
|
||||
}
|
||||
|
||||
changed = true
|
||||
for j in 0..<context.size() {
|
||||
parents[j] = context.getParent(j)
|
||||
}
|
||||
|
||||
parents[i] = parent
|
||||
changed = true
|
||||
}
|
||||
}
|
||||
|
||||
if !changed {
|
||||
contextCache.add(context)
|
||||
visited[context] = context
|
||||
return context
|
||||
parents[i] = parent
|
||||
}
|
||||
}
|
||||
|
||||
let updated: PredictionContext
|
||||
if parents.isEmpty {
|
||||
updated = EMPTY
|
||||
}
|
||||
else if parents.count == 1 {
|
||||
updated = SingletonPredictionContext.create(parents[0], context.getReturnState(0))
|
||||
}
|
||||
else {
|
||||
let arrayPredictionContext = context as! ArrayPredictionContext
|
||||
updated = ArrayPredictionContext(parents, arrayPredictionContext.returnStates)
|
||||
}
|
||||
if !changed {
|
||||
contextCache.add(context)
|
||||
visited[context] = context
|
||||
return context
|
||||
}
|
||||
|
||||
contextCache.add(updated)
|
||||
visited[updated] = updated
|
||||
visited[context] = updated
|
||||
let updated: PredictionContext
|
||||
if parents.isEmpty {
|
||||
updated = EMPTY
|
||||
}
|
||||
else if parents.count == 1 {
|
||||
updated = SingletonPredictionContext.create(parents[0], context.getReturnState(0))
|
||||
}
|
||||
else {
|
||||
let arrayPredictionContext = context as! ArrayPredictionContext
|
||||
updated = ArrayPredictionContext(parents, arrayPredictionContext.returnStates)
|
||||
}
|
||||
|
||||
return updated
|
||||
contextCache.add(updated)
|
||||
visited[updated] = updated
|
||||
visited[context] = updated
|
||||
|
||||
return updated
|
||||
}
|
||||
|
||||
|
||||
|
@ -652,14 +648,14 @@ public class PredictionContext: Hashable, CustomStringConvertible {
|
|||
// ter's recursive version of Sam's getAllNodes()
|
||||
public static func getAllContextNodes(_ context: PredictionContext) -> [PredictionContext] {
|
||||
var nodes = [PredictionContext]()
|
||||
let visited = HashMap<PredictionContext, PredictionContext>()
|
||||
getAllContextNodes_(context, &nodes, visited)
|
||||
var visited = [PredictionContext: PredictionContext]()
|
||||
getAllContextNodes_(context, &nodes, &visited)
|
||||
return nodes
|
||||
}
|
||||
|
||||
public static func getAllContextNodes_(_ context: PredictionContext?,
|
||||
_ nodes: inout [PredictionContext],
|
||||
_ visited: HashMap<PredictionContext, PredictionContext>) {
|
||||
private static func getAllContextNodes_(_ context: PredictionContext?,
|
||||
_ nodes: inout [PredictionContext],
|
||||
_ visited: inout [PredictionContext: PredictionContext]) {
|
||||
guard let context = context, visited[context] == nil else {
|
||||
return
|
||||
}
|
||||
|
@ -667,7 +663,7 @@ public class PredictionContext: Hashable, CustomStringConvertible {
|
|||
nodes.append(context)
|
||||
let length = context.size()
|
||||
for i in 0..<length {
|
||||
getAllContextNodes_(context.getParent(i), &nodes, visited)
|
||||
getAllContextNodes_(context.getParent(i), &nodes, &visited)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@
|
|||
///
|
||||
|
||||
public final class PredictionContextCache {
|
||||
//internal final var
|
||||
var cache: HashMap<PredictionContext, PredictionContext> =
|
||||
HashMap<PredictionContext, PredictionContext>()
|
||||
private var cache = [PredictionContext: PredictionContext]()
|
||||
|
||||
public init() {
|
||||
}
|
||||
///
|
||||
|
||||
///
|
||||
/// Add a context to the cache and return it. If the context already exists,
|
||||
/// return that one instead and do not add a new context to the cache.
|
||||
/// Protect shared cache from unsafe thread access.
|
||||
|
@ -27,10 +27,9 @@ public final class PredictionContextCache {
|
|||
if ctx === PredictionContext.EMPTY {
|
||||
return PredictionContext.EMPTY
|
||||
}
|
||||
let existing: PredictionContext? = cache[ctx]
|
||||
if existing != nil {
|
||||
if let existing = cache[ctx] {
|
||||
// print(name+" reuses "+existing);
|
||||
return existing!
|
||||
return existing
|
||||
}
|
||||
cache[ctx] = ctx
|
||||
return ctx
|
||||
|
|
|
@ -493,7 +493,7 @@ public enum PredictionMode {
|
|||
/// map[c._org.antlr.v4.runtime.atn.ATNConfig#state state_] U= c._org.antlr.v4.runtime.atn.ATNConfig#alt alt_
|
||||
///
|
||||
///
|
||||
public static func getStateToAltMap(_ configs: ATNConfigSet) -> HashMap<ATNState, BitSet> {
|
||||
public static func getStateToAltMap(_ configs: ATNConfigSet) -> [ATNState: BitSet] {
|
||||
return configs.getStateToAltMap()
|
||||
}
|
||||
|
||||
|
|
|
@ -7,20 +7,17 @@
|
|||
|
||||
public class DFA: CustomStringConvertible {
|
||||
///
|
||||
/// A set of all DFA states. Use _java.util.Map_ so we can get old state back
|
||||
/// (_java.util.Set_ only allows you to see if it's there).
|
||||
/// A set of all DFA states.
|
||||
///
|
||||
public var states = [DFAState: DFAState]()
|
||||
|
||||
public final var states: HashMap<DFAState, DFAState?> = HashMap<DFAState, DFAState?>()
|
||||
|
||||
public /*volatile*/ var s0: DFAState?
|
||||
public var s0: DFAState?
|
||||
|
||||
public final var decision: Int
|
||||
|
||||
///
|
||||
/// From which ATN state did we create this DFA?
|
||||
///
|
||||
|
||||
///
|
||||
public let atnStartState: DecisionState
|
||||
|
||||
///
|
||||
|
|
|
@ -11,34 +11,36 @@
|
|||
/// This nested hash table saves creating a single key each time we access
|
||||
/// map; avoids mem creation.
|
||||
///
|
||||
public struct DoubleKeyMap<Key1:Hashable, Key2:Hashable, Value> {
|
||||
private var data: HashMap<Key1, HashMap<Key2, Value>> = HashMap<Key1, HashMap<Key2, Value>>()
|
||||
public struct DoubleKeyMap<Key1: Hashable, Key2: Hashable, Value> {
|
||||
private var data = [Key1: [Key2: Value]]()
|
||||
|
||||
@discardableResult
|
||||
public mutating func put(_ k1: Key1, _ k2: Key2, _ v: Value) -> Value? {
|
||||
|
||||
var data2 = data[k1]
|
||||
var prev: Value? = nil
|
||||
if data2 == nil {
|
||||
data2 = HashMap<Key2, Value>()
|
||||
|
||||
} else {
|
||||
prev = data2![k2]
|
||||
let prev: Value?
|
||||
if var data2 = data[k1] {
|
||||
prev = data2[k2]
|
||||
data2[k2] = v
|
||||
data[k1] = data2
|
||||
}
|
||||
else {
|
||||
prev = nil
|
||||
let data2 = [
|
||||
k2: v
|
||||
]
|
||||
data[k1] = data2
|
||||
}
|
||||
data2![k2] = v
|
||||
data[k1] = data2
|
||||
return prev
|
||||
}
|
||||
|
||||
public func get(_ k1: Key1, _ k2: Key2) -> Value? {
|
||||
|
||||
public func get(_ k1: Key1, _ k2: Key2) -> Value? {
|
||||
if let data2 = data[k1] {
|
||||
return data2[k2]
|
||||
}
|
||||
return nil
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
public func get(_ k1: Key1) -> HashMap<Key2, Value>? {
|
||||
public func get(_ k1: Key1) -> [Key2: Value]? {
|
||||
return data[k1]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,475 +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.
|
||||
///
|
||||
|
||||
final class Entry<K: Hashable,V>: CustomStringConvertible {
|
||||
final var key: K
|
||||
final var value: V
|
||||
final var next: Entry<K,V>!
|
||||
final var hash: Int
|
||||
|
||||
///
|
||||
/// Creates new entry.
|
||||
///
|
||||
init(_ h: Int, _ k: K, _ v: V, _ n: Entry<K,V>!) {
|
||||
value = v
|
||||
next = n
|
||||
key = k
|
||||
hash = h
|
||||
}
|
||||
|
||||
final func getKey() -> K {
|
||||
return key
|
||||
}
|
||||
|
||||
final func getValue() -> V {
|
||||
return value
|
||||
}
|
||||
|
||||
final func setValue(_ newValue: V) -> V {
|
||||
let oldValue: V = value
|
||||
value = newValue
|
||||
return oldValue
|
||||
}
|
||||
|
||||
final var hashValue: Int {
|
||||
return key.hashValue
|
||||
}
|
||||
|
||||
var description: String { return "\(getKey())=\(getValue())" }
|
||||
|
||||
}
|
||||
func == <K, V: Equatable>(lhs: Entry<K,V>, rhs: Entry<K,V>) -> Bool {
|
||||
if lhs === rhs {
|
||||
return true
|
||||
}
|
||||
if lhs.key == rhs.key {
|
||||
if lhs.value == rhs.value {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
func == <K, V: Equatable>(lhs: Entry<K,V?>, rhs: Entry<K,V?>) -> Bool {
|
||||
if lhs === rhs {
|
||||
return true
|
||||
}
|
||||
if lhs.key == rhs.key {
|
||||
if lhs.value == nil && rhs.value == nil {
|
||||
return true
|
||||
} else if lhs.value != nil && rhs.value != nil && lhs.value! == rhs.value! {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
|
||||
public final class HashMap<K: Hashable,V>: Sequence
|
||||
{
|
||||
|
||||
///
|
||||
/// The default initial capacity - MUST be a power of two.
|
||||
///
|
||||
private let DEFAULT_INITIAL_CAPACITY: Int = 16
|
||||
|
||||
///
|
||||
/// The maximum capacity, used if a higher value is implicitly specified
|
||||
/// by either of the constructors with arguments.
|
||||
/// MUST be a power of two <= 1<<30.
|
||||
///
|
||||
private let MAXIMUM_CAPACITY: Int = 1 << 30
|
||||
|
||||
///
|
||||
/// The load factor used when none specified in constructor.
|
||||
///
|
||||
private let DEFAULT_LOAD_FACTOR: Float = 0.75
|
||||
|
||||
///
|
||||
/// The table, resized as necessary. Length MUST Always be a power of two.
|
||||
///
|
||||
var table: [Entry<K,V>?]
|
||||
|
||||
///
|
||||
/// The number of key-value mappings contained in this map.
|
||||
///
|
||||
var size: Int = 0
|
||||
|
||||
///
|
||||
/// The next size value at which to resize (capacity * load factor).
|
||||
/// -
|
||||
///
|
||||
var threshold: Int = 0
|
||||
|
||||
///
|
||||
/// The load factor for the hash table.
|
||||
///
|
||||
/// -
|
||||
///
|
||||
var loadFactor: Float = 0
|
||||
|
||||
///
|
||||
/// The number of times this HashMap has been structurally modified
|
||||
/// Structural modifications are those that change the number of mappings in
|
||||
/// the HashMap or otherwise modify its internal structure (e.g.,
|
||||
/// rehash). This field is used to make iterators on Collection-views of
|
||||
/// the HashMap fail-fast. (See ConcurrentModificationException).
|
||||
///
|
||||
var modCount: Int = 0
|
||||
|
||||
public init(count: Int) {
|
||||
var initialCapacity = count
|
||||
if (count < 0)
|
||||
{
|
||||
initialCapacity = DEFAULT_INITIAL_CAPACITY
|
||||
}
|
||||
else if (count > MAXIMUM_CAPACITY)
|
||||
{
|
||||
initialCapacity = MAXIMUM_CAPACITY
|
||||
} else {
|
||||
// Find a power of 2 >= initialCapacity
|
||||
initialCapacity = 1
|
||||
while initialCapacity < count
|
||||
{
|
||||
initialCapacity <<= 1
|
||||
}
|
||||
}
|
||||
|
||||
self.loadFactor = DEFAULT_LOAD_FACTOR
|
||||
threshold = Int(Float(initialCapacity) * loadFactor)
|
||||
table = [Entry<K,V>?](repeating: nil, count: initialCapacity)
|
||||
}
|
||||
public init() {
|
||||
self.loadFactor = DEFAULT_LOAD_FACTOR
|
||||
threshold = Int(Float(DEFAULT_INITIAL_CAPACITY) * DEFAULT_LOAD_FACTOR)
|
||||
table = [Entry<K,V>?](repeating: nil, count: DEFAULT_INITIAL_CAPACITY)
|
||||
}
|
||||
|
||||
static func hash(_ h: Int) -> Int {
|
||||
var h = h
|
||||
// This function ensures that hashCodes that differ only by
|
||||
// constant multiples at each bit position have a bounded
|
||||
// number of collisions (approximately 8 at default load factor).
|
||||
h ^= (h >>> 20) ^ (h >>> 12)
|
||||
return h ^ (h >>> 7) ^ (h >>> 4)
|
||||
}
|
||||
|
||||
///
|
||||
/// Returns index for hash code h.
|
||||
///
|
||||
static func indexFor(_ h: Int, _ length: Int) -> Int {
|
||||
return h & (length-1)
|
||||
}
|
||||
|
||||
///
|
||||
/// Returns <tt>true</tt> if this map contains no key-value mappings.
|
||||
///
|
||||
/// - returns: <tt>true</tt> if this map contains no key-value mappings
|
||||
///
|
||||
public final var isEmpty: Bool {
|
||||
return size == 0
|
||||
}
|
||||
public final subscript(key: K) -> V? {
|
||||
get {
|
||||
return get(key)
|
||||
}
|
||||
set {
|
||||
if newValue == nil {
|
||||
remove(key)
|
||||
}else{
|
||||
put(key,newValue!)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final var count: Int {
|
||||
return size
|
||||
}
|
||||
///
|
||||
/// Returns the value to which the specified key is mapped,
|
||||
/// or `null` if this map contains no mapping for the key.
|
||||
///
|
||||
/// More formally, if this map contains a mapping from a key
|
||||
/// `k` to a value `v` such that `(key==null ? k==null :
|
||||
/// key.equals(k))`, then this method returns `v`; otherwise
|
||||
/// it returns `null`. (There can be at most one such mapping.)
|
||||
///
|
||||
/// A return value of `null` does not necessarily
|
||||
/// indicate that the map contains no mapping for the key; it's also
|
||||
/// possible that the map explicitly maps the key to `null`.
|
||||
/// The _#containsKey containsKey_ operation may be used to
|
||||
/// distinguish these two cases.
|
||||
///
|
||||
/// - seealso: #put(Object, Object)
|
||||
///
|
||||
public final func get(_ key: K) -> V? {
|
||||
let hash: Int = HashMap.hash(key.hashValue)
|
||||
var e = table[HashMap.indexFor(hash, table.count)]
|
||||
while let eWrap = e {
|
||||
if eWrap.hash == hash && eWrap.key == key
|
||||
{
|
||||
return eWrap.value
|
||||
}
|
||||
e = eWrap.next
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
///
|
||||
/// Returns <tt>true</tt> if this map contains a mapping for the
|
||||
/// specified key.
|
||||
///
|
||||
/// - parameter key: The key whose presence in this map is to be tested
|
||||
/// - returns: <tt>true</tt> if this map contains a mapping for the specified
|
||||
/// key.
|
||||
///
|
||||
public final func containsKey(_ key: K) -> Bool {
|
||||
return getEntry(key) != nil
|
||||
}
|
||||
|
||||
///
|
||||
/// Returns the entry associated with the specified key in the
|
||||
/// HashMap. Returns null if the HashMap contains no mapping
|
||||
/// for the key.
|
||||
///
|
||||
final func getEntry(_ key: K) -> Entry<K,V>! {
|
||||
let hash: Int = HashMap.hash(key.hashValue)
|
||||
var e = table[HashMap.indexFor(hash, table.count)]
|
||||
while let eWrap = e {
|
||||
if eWrap.hash == hash && eWrap.key == key
|
||||
{
|
||||
return eWrap
|
||||
}
|
||||
e = eWrap.next
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Associates the specified value with the specified key in this map.
|
||||
/// If the map previously contained a mapping for the key, the old
|
||||
/// value is replaced.
|
||||
///
|
||||
/// - parameter key: key with which the specified value is to be associated
|
||||
/// - parameter value: value to be associated with the specified key
|
||||
/// - returns: the previous value associated with <tt>key</tt>, or
|
||||
/// <tt>null</tt> if there was no mapping for <tt>key</tt>.
|
||||
/// (A <tt>null</tt> return can also indicate that the map
|
||||
/// previously associated <tt>null</tt> with <tt>key</tt>.)
|
||||
///
|
||||
@discardableResult
|
||||
public final func put(_ key: K, _ value: V) -> V? {
|
||||
|
||||
let hash: Int = HashMap.hash(key.hashValue)
|
||||
let i: Int = HashMap.indexFor(hash, table.count)
|
||||
var e = table[i]
|
||||
while let eWrap = e {
|
||||
if eWrap.hash == hash && eWrap.key == key {
|
||||
let oldValue = eWrap.value
|
||||
eWrap.value = value
|
||||
return oldValue
|
||||
}
|
||||
e = eWrap.next
|
||||
}
|
||||
|
||||
|
||||
modCount += 1
|
||||
addEntry(hash, key, value, i)
|
||||
return nil
|
||||
}
|
||||
|
||||
///
|
||||
/// Adds a new entry with the specified key, value and hash code to
|
||||
/// the specified bucket. It is the responsibility of this
|
||||
/// method to resize the table if appropriate.
|
||||
///
|
||||
/// Subclass overrides this to alter the behavior of put method.
|
||||
///
|
||||
final func addEntry(_ hash: Int, _ key: K, _ value: V, _ bucketIndex: Int) {
|
||||
let e = table[bucketIndex]
|
||||
table[bucketIndex] = Entry<K,V>(hash, key, value, e)
|
||||
let oldSize = size
|
||||
size += 1
|
||||
if oldSize >= threshold {
|
||||
resize(2 * table.count)
|
||||
}
|
||||
}
|
||||
///
|
||||
/// Rehashes the contents of this map into a new array with a
|
||||
/// larger capacity. This method is called automatically when the
|
||||
/// number of keys in this map reaches its threshold.
|
||||
///
|
||||
/// If current capacity is MAXIMUM_CAPACITY, this method does not
|
||||
/// resize the map, but sets threshold to Integer.MAX_VALUE.
|
||||
/// This has the effect of preventing future calls.
|
||||
///
|
||||
/// - parameter newCapacity: the new capacity, MUST be a power of two;
|
||||
/// must be greater than current capacity unless current
|
||||
/// capacity is MAXIMUM_CAPACITY (in which case value
|
||||
/// is irrelevant).
|
||||
///
|
||||
final func resize(_ newCapacity: Int) {
|
||||
let oldCapacity: Int = table.count
|
||||
if oldCapacity == MAXIMUM_CAPACITY {
|
||||
threshold = Int.max
|
||||
return
|
||||
}
|
||||
|
||||
var newTable = [Entry<K,V>?](repeating: nil, count: newCapacity)
|
||||
transfer(&newTable)
|
||||
table = newTable
|
||||
threshold = Int(Float(newCapacity) * loadFactor)
|
||||
}
|
||||
|
||||
///
|
||||
/// Transfers all entries from current table to newTable.
|
||||
///
|
||||
final func transfer(_ newTable: inout [Entry<K,V>?]) {
|
||||
|
||||
let newCapacity: Int = newTable.count
|
||||
let length = table.count
|
||||
for j in 0..<length {
|
||||
if let e = table[j] {
|
||||
table[j] = nil
|
||||
var eOption: Entry<K,V>? = e
|
||||
while let e = eOption {
|
||||
let next = e.next
|
||||
let i: Int = HashMap.indexFor(e.hash, newCapacity)
|
||||
e.next = newTable[i]
|
||||
newTable[i] = e
|
||||
eOption = next
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
///
|
||||
/// Removes all of the mappings from this map.
|
||||
/// The map will be empty after this call returns.
|
||||
///
|
||||
public final func clear() {
|
||||
modCount += 1
|
||||
let length = table.count
|
||||
for i in 0..<length {
|
||||
table[i] = nil
|
||||
}
|
||||
size = 0
|
||||
}
|
||||
@discardableResult
|
||||
public func remove(_ key: K) -> V? {
|
||||
if let e = removeEntryForKey(key) {
|
||||
return e.value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
final func removeEntryForKey(_ key: K) -> Entry<K,V>? {
|
||||
let hash: Int = HashMap.hash(Int(key.hashValue))
|
||||
let i = Int(HashMap.indexFor(hash, Int(table.count)))
|
||||
var prev = table[i]
|
||||
var e = prev
|
||||
|
||||
while let eWrap = e {
|
||||
let next = eWrap.next
|
||||
var _: AnyObject
|
||||
if eWrap.hash == hash && eWrap.key == key{
|
||||
modCount += 1
|
||||
size -= 1
|
||||
if prev === eWrap
|
||||
{table[i] = next}
|
||||
else
|
||||
{prev?.next = next}
|
||||
return eWrap
|
||||
}
|
||||
prev = eWrap
|
||||
e = next
|
||||
}
|
||||
|
||||
return e
|
||||
}
|
||||
|
||||
public final var values: [V]{
|
||||
var valueList: [V] = [V]()
|
||||
let length = table.count
|
||||
for j in 0..<length {
|
||||
if let e = table[j] {
|
||||
valueList.append(e.value)
|
||||
var eOption: Entry<K,V>? = e
|
||||
while let e = eOption {
|
||||
let next = e.next
|
||||
eOption = next
|
||||
if let eOption = eOption {
|
||||
valueList.append(eOption.value)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return valueList
|
||||
}
|
||||
|
||||
public final var keys: [K]{
|
||||
var keyList: [K] = [K]()
|
||||
let length = table.count
|
||||
for j in 0..<length {
|
||||
if let e = table[j] {
|
||||
keyList.append(e.key)
|
||||
var eOption: Entry<K,V>? = e
|
||||
while let e = eOption {
|
||||
let next = e.next
|
||||
eOption = next
|
||||
if let eOption = eOption {
|
||||
keyList.append(eOption.key )
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return keyList
|
||||
}
|
||||
|
||||
|
||||
public func makeIterator() -> AnyIterator<(K,V)> {
|
||||
var _next: Entry<K,V>? // next entry to return
|
||||
let expectedModCount: Int = modCount // For fast-fail
|
||||
var index: Int = 0 // current slot
|
||||
//var current: HashMapEntry<K,V> // current entry
|
||||
if size > 0{ // advance to first entry
|
||||
|
||||
while index < table.count && _next == nil
|
||||
{
|
||||
_next = table[index]
|
||||
index += 1
|
||||
}
|
||||
}
|
||||
|
||||
return AnyIterator {
|
||||
if self.modCount != expectedModCount
|
||||
{
|
||||
fatalError("\(#function) ConcurrentModificationException")
|
||||
}
|
||||
if let e = _next {
|
||||
_next = e.next
|
||||
if _next == nil{
|
||||
while index < self.table.count && _next == nil
|
||||
{
|
||||
_next = self.table[index]
|
||||
index += 1
|
||||
}
|
||||
}
|
||||
//current = e
|
||||
return (e.getKey(),e.getValue())
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -26,7 +26,7 @@
|
|||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>ST4</artifactId>
|
||||
<version>4.0.8</version>
|
||||
<version>4.1-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -510,6 +510,7 @@ LeftRecursiveRuleFunction(currentRule, args, code, locals, ruleCtx, altLabelCtxs
|
|||
size_t parentState = getState();
|
||||
<parser.name>::<currentRule.ctxType> *_localctx = _tracker.createInstance\<<currentRule.ctxType>\>(_ctx, parentState<currentRule.args: {a | , <a.name>}>);
|
||||
<parser.name>::<currentRule.ctxType> *previousContext = _localctx;
|
||||
(void)previousContext; // Silence compiler, in case the context is not used by generated code.
|
||||
size_t startState = <currentRule.startState>;
|
||||
enterRecursionRule(_localctx, <currentRule.startState>, <parser.name>::Rule<currentRule.name; format = "cap">, precedence);
|
||||
|
||||
|
@ -542,7 +543,7 @@ public:
|
|||
<if (ctorAttrs)><struct.name>(antlr4::ParserRuleContext *parent, size_t invokingState);<endif>
|
||||
<struct.name>(antlr4::ParserRuleContext *parent, size_t invokingState<ctorAttrs: {a | , <a>}>);
|
||||
<if (struct.provideCopyFrom)> <! don't need copy unless we have subclasses !>
|
||||
<struct.name>() : antlr4::ParserRuleContext() { }
|
||||
<struct.name>() = default;
|
||||
void copyFrom(<struct.name> *context);
|
||||
using antlr4::ParserRuleContext::copyFrom;
|
||||
<endif>
|
||||
|
|
Loading…
Reference in New Issue