Merge branch 'master' into master

This commit is contained in:
Terence Parr 2019-06-23 15:45:10 -07:00 committed by GitHub
commit aa51ef297a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
194 changed files with 4501 additions and 1982 deletions

View File

@ -71,67 +71,67 @@ matrix:
- clang-3.7
- os: osx
compiler: clang
osx_image: xcode9
osx_image: xcode10.1
env:
- TARGET=cpp
- GROUP=LEXER
stage: extended-test
- os: osx
compiler: clang
osx_image: xcode9
osx_image: xcode10.1
env:
- TARGET=cpp
- GROUP=PARSER
stage: extended-test
- os: osx
compiler: clang
osx_image: xcode9
osx_image: xcode10.1
env:
- TARGET=cpp
- GROUP=RECURSION
stage: extended-test
- os: osx
compiler: clang
osx_image: xcode9
osx_image: xcode10.1
env:
- TARGET=swift
- GROUP=LEXER
stage: main-test
- os: osx
compiler: clang
osx_image: xcode9
osx_image: xcode10.1
env:
- TARGET=swift
- GROUP=PARSER
stage: main-test
- os: osx
compiler: clang
osx_image: xcode9
osx_image: xcode10.1
env:
- TARGET=swift
- GROUP=RECURSION
stage: main-test
- os: linux
dist: trusty
dist: xenial
compiler: clang
env:
- TARGET=swift
- GROUP=ALL
stage: extended-test
- os: osx
osx_image: xcode9
osx_image: xcode10.1
env:
- TARGET=dotnet
- GROUP=LEXER
stage: extended-test
- os: osx
osx_image: xcode9
osx_image: xcode10.1
env:
- TARGET=dotnet
- GROUP=PARSER
stage: extended-test
- os: osx
osx_image: xcode9
osx_image: xcode10.1
env:
- TARGET=dotnet
- GROUP=RECURSION
@ -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
@ -202,4 +202,9 @@ before_install:
- f="./.travis/before-install-$TRAVIS_OS_NAME-$TARGET.sh"; ! [ -x "$f" ] || "$f"
script:
- cd runtime-testsuite; travis_wait 40 ../.travis/run-tests-$TARGET.sh
- |
cd runtime-testsuite;
travis_wait 40 ../.travis/run-tests-$TARGET.sh;
rc=$?;
cat target/surefire-reports/*.dumpstream || true;
exit $rc

View File

@ -1,5 +1,7 @@
#!/bin/bash
set -euo pipefail
if [ $GROUP == "LEXER" ]; then
mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dtest=cpp.* test
elif [ $GROUP == "PARSER" ]; then

View File

@ -1,3 +1,5 @@
#!/bin/bash
set -euo pipefail
mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=csharp.* test

View File

@ -1,10 +1,12 @@
#!/bin/bash
set -euo pipefail
# we need to build the runtime before test run, since we used "--no-dependencies"
# when we call dotnet cli for restore and build, in order to speed up
dotnet restore ../runtime/CSharp/runtime/CSharp/Antlr4.Runtime/Antlr4.Runtime.dotnet.csproj
dotnet build -c Release ../runtime/CSharp/runtime/CSharp/Antlr4.Runtime/Antlr4.Runtime.dotnet.csproj
dotnet build -c Release -f netstandard1.3 ../runtime/CSharp/runtime/CSharp/Antlr4.Runtime/Antlr4.Runtime.dotnet.csproj
# call test

View File

@ -1,3 +1,5 @@
#!/bin/bash
set -euo pipefail
mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=go.* test

View File

@ -1,5 +1,7 @@
#!/bin/bash
set -euo pipefail
mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=java.* test
cd ../tool-testsuite
mvn test

View File

@ -1,3 +1,5 @@
#!/bin/bash
set -euo pipefail
mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=node.* test

View File

@ -1,3 +1,9 @@
#!/bin/bash
set -euo pipefail
mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=python2.* test
cd ../runtime/Python2/tests
python run.py

View File

@ -1,3 +1,9 @@
#!/bin/bash
set -euo pipefail
mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=python3.* test
cd ../runtime/Python3/test
python3.6 run.py

View File

@ -6,19 +6,20 @@ set -euo pipefail
# here since environment variables doesn't pass
# across scripts
if [ $TRAVIS_OS_NAME == "linux" ]; then
export SWIFT_VERSION=swift-4.0.2
export SWIFT_HOME=$(pwd)/swift/$SWIFT_VERSION-RELEASE-ubuntu14.04/usr/bin/
export SWIFT_VERSION=swift-4.2.1
export SWIFT_HOME=$(pwd)/swift/$SWIFT_VERSION-RELEASE-ubuntu16.04/usr/bin/
export PATH=$SWIFT_HOME:$PATH
# download swift
mkdir swift
curl https://swift.org/builds/$SWIFT_VERSION-release/ubuntu1404/$SWIFT_VERSION-RELEASE/$SWIFT_VERSION-RELEASE-ubuntu14.04.tar.gz -s | tar xz -C swift &> /dev/null
curl https://swift.org/builds/$SWIFT_VERSION-release/ubuntu1604/$SWIFT_VERSION-RELEASE/$SWIFT_VERSION-RELEASE-ubuntu16.04.tar.gz -s | tar xz -C swift &> /dev/null
fi
if [ -z "${JAVA_HOME-}" ]
then
export JAVA_HOME="$(dirname $(java -XshowSettings:properties -version 2>&1 |
grep 'java\.home' | awk '{ print $3 }'))"
export JAVA_HOME="$(java -XshowSettings:properties -version 2>&1 |
grep 'java\.home' | awk '{ print $3 }')"
echo "export JAVA_HOME=$JAVA_HOME"
fi
# check swift

View File

@ -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.

View File

@ -8,7 +8,7 @@
<parent>
<groupId>org.antlr</groupId>
<artifactId>antlr4-master</artifactId>
<version>4.7.2-SNAPSHOT</version>
<version>4.7.3-SNAPSHOT</version>
</parent>
<artifactId>antlr4-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>

View File

@ -178,11 +178,22 @@ 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/14, scadgek, Sergey Chupov, scadgek@live.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
2018/05/15, johnvanderholt, jan dillingh johnvanderholte@gmail.com
@ -194,3 +205,16 @@ YYYY/MM/DD, github id, Full name, email
2018/07/27, Maksim Novikov, mnovikov.work@gmail.com
2018/08/03, ENDOH takanao, djmchl@gmail.com
2018/10/18, edirgarcia, Edir García Lazo, edirgl@hotmail.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/11/12, vinoski, Steve Vinoski, vinoski@ieee.org
2018/11/14, nxtstep, Adriaan (Arjan) Duz, codewithadriaan[et]gmail[dot]com
2018/11/15, amykyta3, Alex Mykyta, amykyta3@users.noreply.github.com
2018/11/29, hannemann-tamas, Ralf Hannemann-Tamas, ralf.ht@gmail.com
2018/12/20, WalterCouto, Walter Couto, WalterCouto@users.noreply.github.com
2018/12/23, youkaichao, Kaichao You, youkaichao@gmail.com
2019/02/06, ralucado, Cristina Raluca Vijulie, ralucris.v[at]gmail[dot]com
2019/03/13, base698, Justin Thomas, justin.thomas1@gmail.com
2019/03/18, carlodri, Carlo Dri, carlo.dri@gmail.com
2019/05/02, askingalot, Andy Collins, askingalot@gmail.com

View File

@ -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:

View File

@ -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

View File

@ -30,7 +30,7 @@ Let's suppose that your grammar is named `MyGrammar`. The tool will generate for
Now a fully functioning code might look like the following for start rule `StartRule`:
```
```csharp
using Antlr4.Runtime;
using Antlr4.Runtime.Tree;
@ -59,7 +59,7 @@ Let's suppose your MyGrammar grammar comprises 2 rules: "key" and "value".
The antlr4 tool will have generated the following listener (only partial code shown here):
```
```csharp
interface IMyGrammarParserListener : IParseTreeListener {
void EnterKey (MyGrammarParser.KeyContext context);
void ExitKey (MyGrammarParser.KeyContext context);
@ -70,7 +70,7 @@ interface IMyGrammarParserListener : IParseTreeListener {
In order to provide custom behavior, you might want to create the following class:
```
```csharp
class KeyPrinter : MyGrammarBaseListener {
// override default listener behavior
void ExitKey (MyGrammarParser.KeyContext context) {
@ -82,7 +82,7 @@ class KeyPrinter : MyGrammarBaseListener {
In order to execute this listener, you would simply add the following lines to the above code:
```
```csharp
...
IParseTree tree = parser.StartRule() - only repeated here for reference
KeyPrinter printer = new KeyPrinter();

View File

@ -16,10 +16,10 @@ If you are going to integrate ANTLR into your existing build system using mvn, a
1. Download
```
$ cd /usr/local/lib
$ curl -O http://www.antlr.org/download/antlr-4.7.1-complete.jar
$ curl -O https://www.antlr.org/download/antlr-4.7.1-complete.jar
```
Or just download in browser from website:
[http://www.antlr.org/download.html](http://www.antlr.org/download.html)
[https://www.antlr.org/download.html](https://www.antlr.org/download.html)
and put it somewhere rational like `/usr/local/lib`.
2. Add `antlr-4.7.1-complete.jar` to your `CLASSPATH`:
@ -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
@ -39,9 +39,9 @@ $ alias grun='java org.antlr.v4.gui.TestRig'
(*Thanks to Graham Wideman*)
0. Install Java (version 1.6 or higher)
1. Download antlr-4.5.3-complete.jar (or whatever version) from [http://www.antlr.org/download/](http://www.antlr.org/download/)
1. Download antlr-4.7.1-complete.jar (or whatever version) from [https://www.antlr.org/download/](https://www.antlr.org/download/)
Save to your directory for 3rd party Java libraries, say `C:\Javalib`
2. Add `antlr-4.5.3-complete.jar` to CLASSPATH, either:
2. Add `antlr-4.7.1-complete.jar` to CLASSPATH, either:
* Permanently: Using System Properties dialog > Environment variables > Create or append to `CLASSPATH` variable
* Temporarily, at command line:
```
@ -53,6 +53,10 @@ SET CLASSPATH=.;C:\Javalib\antlr-4.7.1-complete.jar;%CLASSPATH%
java org.antlr.v4.Tool %*
```
```
@ECHO OFF
SET TEST_CURRENT_DIR=%CLASSPATH:.;=%
if "%TEST_CURRENT_DIR%" == "%CLASSPATH%" ( SET CLASSPATH=.;%CLASSPATH% )
@ECHO ON
java org.antlr.v4.gui.TestRig %*
```
* Or, use doskey commands:

View File

@ -21,6 +21,8 @@ This documentation is a reference and summarizes grammar syntax and the key sema
<a href="https://vimeo.com/59285751"><img src=images/tertalk.png width=200></a>
For those using Java, here's a great [set of ANTLR in Intellij notes](https://docs.google.com/document/d/1gQ2lsidvN2cDUUsHEkT05L-wGbX5mROB7d70Aaj3R64/edit#heading=h.xr0jj8vcdsgc) by Andreas Stefik.
## Sections
* [Getting Started with ANTLR v4](getting-started.md)

View File

@ -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

View File

@ -117,6 +117,44 @@ This program will work. But it won't be useful unless you do one of the followin
(please note that production code is target specific, so you can't have multi target grammars that include production code)
## How do I create and run a visitor?
```javascript
// test.js
var antlr4 = require('antlr4');
var MyGrammarLexer = require('./QueryLexer').QueryLexer;
var MyGrammarParser = require('./QueryParser').QueryParser;
var MyGrammarListener = require('./QueryListener').QueryListener;
var input = "field = 123 AND items in (1,2,3)"
var chars = new antlr4.InputStream(input);
var lexer = new MyGrammarLexer(chars);
var tokens = new antlr4.CommonTokenStream(lexer);
var parser = new MyGrammarParser(tokens);
parser.buildParseTrees = true;
var tree = parser.query();
class Visitor {
visitChildren(ctx) {
if (!ctx) {
return;
}
if (ctx.children) {
return ctx.children.map(child => {
if (child.children && child.children.length != 0) {
return child.accept(this);
} else {
return child.getText();
}
});
}
}
}
tree.accept(new Visitor());
````
## How do I create and run a custom listener?
Let's suppose your MyGrammar grammar comprises 2 rules: "key" and "value". The antlr4 tool will have generated the following listener:

View File

@ -50,8 +50,8 @@ from MyGrammarLexer import MyGrammarLexer
from MyGrammarParser import MyGrammarParser
def main(argv):
input = FileStream(argv[1])
lexer = MyGrammarLexer(input)
input_stream = FileStream(argv[1])
lexer = MyGrammarLexer(input_stream)
stream = CommonTokenStream(lexer)
parser = MyGrammarParser(stream)
tree = parser.startRule()

View File

@ -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

View File

@ -1,5 +1,12 @@
# ANTLR4 Language Target, Runtime for Swift
## Requirements
ANTLR 4.7.2 requires Swift 4.2. It works on Swift 4.2.1 also.
ANTLR 4.7.1 requires Swift 4.0, and does not work on Swift 4.2. (The status of
Swift 4.1 support is unknown.)
## Performance Note
To use ANTLR4 Swift target in production environment, make sure to turn on compiler optimizations by following [these instructions](https://github.com/apple/swift-package-manager/blob/master/Documentation/Usage.md#build-configurations) if you use SwiftPM to build your project. If you are using Xcode to build your project, it's unlikely you will not use `release` build for production build.

View File

@ -13,7 +13,7 @@
</parent>
<groupId>org.antlr</groupId>
<artifactId>antlr4-master</artifactId>
<version>4.7.2-SNAPSHOT</version>
<version>4.7.3-SNAPSHOT</version>
<packaging>pom</packaging>
<name>ANTLR 4</name>
@ -138,6 +138,8 @@
<filesets>
<fileset>
<directory>runtime/Swift/.build</directory>
</fileset>
<fileset>
<directory>runtime/Swift/Tests/Antlr4Tests/gen</directory>
</fileset>
</filesets>

View File

@ -9,7 +9,7 @@
<parent>
<groupId>org.antlr</groupId>
<artifactId>antlr4-master</artifactId>
<version>4.7.2-SNAPSHOT</version>
<version>4.7.3-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>antlr4-runtime-test-annotations</artifactId>

View File

@ -10,7 +10,7 @@
<parent>
<groupId>org.antlr</groupId>
<artifactId>antlr4-master</artifactId>
<version>4.7.2-SNAPSHOT</version>
<version>4.7.3-SNAPSHOT</version>
</parent>
<artifactId>antlr4-runtime-testsuite</artifactId>
<name>ANTLR 4 Runtime Tests (2nd generation)</name>
@ -26,7 +26,7 @@
<dependency>
<groupId>org.antlr</groupId>
<artifactId>ST4</artifactId>
<version>4.0.8</version>
<version>4.1</version>
<scope>test</scope>
</dependency>
<dependency>
@ -68,7 +68,7 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>8.1.16.v20140903</version>
<version>[9.3.24.v20180605,)</version>
<scope>test</scope>
</dependency>
<dependency>
@ -92,6 +92,11 @@
</resource>
<resource>
<directory>../runtime</directory>
<excludes>
<exclude>**/.build/**</exclude>
<exclude>**/target/**</exclude>
<exclude>Swift/*.xcodeproj/**</exclude>
</excludes>
</resource>
</resources>
<plugins>

View File

@ -9,7 +9,7 @@
<parent>
<groupId>org.antlr</groupId>
<artifactId>antlr4-master</artifactId>
<version>4.7.2-SNAPSHOT</version>
<version>4.7.3-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>antlr4-runtime-test-annotation-processors</artifactId>
@ -18,11 +18,9 @@
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.4.2</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
<groupId>com.github.olivergondza</groupId>
<artifactId>maven-jdk-tools-wrapper</artifactId>
<version>0.1</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>

View File

@ -1,6 +1,6 @@
writeln(s) ::= <<print(<s>)>>
writeln(s) ::= <<print((<s>) ?? "nil")>>
write(s) ::= <<print(<s>, terminator: "")>>
write(s) ::= <<print((<s>) ?? "nil", terminator: "")>>
False() ::= "false"

View File

@ -31,6 +31,8 @@ import java.util.Collections;
import java.util.List;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.fail;
import static junit.framework.TestCase.failNotEquals;
import static org.junit.Assume.assumeFalse;
/** This class represents a single runtime test. It pulls data from
@ -161,14 +163,7 @@ public abstract class BaseRuntimeTest {
descriptor.getInput(),
descriptor.showDiagnosticErrors()
);
if ( delegate instanceof SpecialRuntimeTestAssert ) {
((SpecialRuntimeTestAssert)delegate).assertEqualStrings(descriptor.getErrors(), delegate.getParseErrors());
((SpecialRuntimeTestAssert)delegate).assertEqualStrings(descriptor.getOutput(), found);
}
else {
assertEquals(descriptor.getErrors(), delegate.getParseErrors());
assertEquals(descriptor.getOutput(), found);
}
assertCorrectOutput(descriptor, delegate, found);
}
public void testLexer(RuntimeTestDescriptor descriptor) throws Exception {
@ -202,16 +197,7 @@ public abstract class BaseRuntimeTest {
grammar = grammarST.render();
String found = delegate.execLexer(grammarName+".g4", grammar, grammarName, descriptor.getInput(), descriptor.showDFA());
if ( delegate instanceof SpecialRuntimeTestAssert ) {
((SpecialRuntimeTestAssert)delegate).assertEqualStrings(descriptor.getOutput(), found);
((SpecialRuntimeTestAssert)delegate).assertEqualStrings(descriptor.getANTLRToolErrors(), delegate.getANTLRToolErrors());
((SpecialRuntimeTestAssert)delegate).assertEqualStrings(descriptor.getErrors(), delegate.getParseErrors());
}
else {
assertEquals(descriptor.getOutput(), found);
assertEquals(descriptor.getANTLRToolErrors(), delegate.getANTLRToolErrors());
assertEquals(descriptor.getErrors(), delegate.getParseErrors());
}
assertCorrectOutput(descriptor, delegate, found);
}
/** Write a grammar to tmpdir and run antlr */
@ -313,4 +299,66 @@ public abstract class BaseRuntimeTest {
ioe.printStackTrace(System.err);
}
}
protected static void assertCorrectOutput(RuntimeTestDescriptor descriptor, RuntimeTestSupport delegate, String actualOutput) {
String actualParseErrors = delegate.getParseErrors();
String actualToolErrors = delegate.getANTLRToolErrors();
String expectedOutput = descriptor.getOutput();
String expectedParseErrors = descriptor.getErrors();
String expectedToolErrors = descriptor.getANTLRToolErrors();
if (actualOutput == null) {
actualOutput = "";
}
if (actualParseErrors == null) {
actualParseErrors = "";
}
if (actualToolErrors == null) {
actualToolErrors = "";
}
if (expectedOutput == null) {
expectedOutput = "";
}
if (expectedParseErrors == null) {
expectedParseErrors = "";
}
if (expectedToolErrors == null) {
expectedToolErrors = "";
}
if (actualOutput.equals(expectedOutput) &&
actualParseErrors.equals(expectedParseErrors) &&
actualToolErrors.equals(expectedToolErrors)) {
return;
}
if (actualOutput.equals(expectedOutput)) {
if (actualParseErrors.equals(expectedParseErrors)) {
failNotEquals("[" + descriptor.getTarget() + ":" + descriptor.getTestName() + "] " +
"Parse output and parse errors are as expected, but tool errors are incorrect",
expectedToolErrors, actualToolErrors);
}
else {
fail("[" + descriptor.getTarget() + ":" + descriptor.getTestName() + "] " +
"Parse output is as expected, but errors are not: " +
"expectedParseErrors:<" + expectedParseErrors +
">; actualParseErrors:<" + actualParseErrors +
">; expectedToolErrors:<" + expectedToolErrors +
">; actualToolErrors:<" + actualToolErrors +
">.");
}
}
else {
fail("[" + descriptor.getTarget() + ":" + descriptor.getTestName() + "] " +
"Parse output is incorrect: " +
"expectedOutput:<" + expectedOutput +
">; actualOutput:<" + actualOutput +
">; expectedParseErrors:<" + expectedParseErrors +
">; actualParseErrors:<" + actualParseErrors +
">; expectedToolErrors:<" + expectedToolErrors +
">; actualToolErrors:<" + actualToolErrors +
">.");
}
}
}

View File

@ -1,14 +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.
*/
package org.antlr.v4.test.runtime;
/** This interface acts like a tag on a Base*Test class that wants
* to use its own assertEquals() instead of jUnit's.
*/
public interface SpecialRuntimeTestAssert {
void assertEqualStrings(String expected, String actual);
}

View File

@ -56,7 +56,7 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
public class BaseCSharpTest implements RuntimeTestSupport /*, SpecialRuntimeTestAssert*/ {
public class BaseCSharpTest implements RuntimeTestSupport {
public static final String newline = System.getProperty("line.separator");
public static final String pathSep = System.getProperty("path.separator");

View File

@ -639,7 +639,7 @@ public class ParserErrorsDescriptors {
@Override
public boolean ignore(String targetName) {
return !"Java".equals(targetName);
return !"Java".equals(targetName) && !"Swift".equals(targetName);
}
}
}

View File

@ -113,7 +113,7 @@ public class PerformanceDescriptors {
@Override
public boolean ignore(String targetName) {
return !Arrays.asList("Java", "CSharp", "Python2", "Python3", "Node", "Cpp").contains(targetName);
return !Arrays.asList("Java", "CSharp", "Python2", "Python3", "Node", "Cpp", "Swift").contains(targetName);
}
}
@ -199,7 +199,7 @@ public class PerformanceDescriptors {
@Override
public boolean ignore(String targetName) {
// passes, but still too slow in Python and JavaScript
return !Arrays.asList("Java", "CSharp", "Cpp").contains(targetName);
return !Arrays.asList("Java", "CSharp", "Cpp", "Swift").contains(targetName);
}
}

View File

@ -291,7 +291,7 @@ public class SemPredEvalParserDescriptors {
@Override
public boolean ignore(String targetName) {
return !"Java".equals(targetName);
return !"Java".equals(targetName) && !"Swift".equals(targetName);
}
}

View File

@ -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;

View File

@ -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) {

View File

@ -279,7 +279,6 @@ public class BaseSwiftTest implements RuntimeTestSupport {
" }\n" +
"}\n" +
"\n" +
"do {\n" +
"let args = CommandLine.arguments\n" +
"let input = try ANTLRFileStream(args[1])\n" +
"let lex = <lexerName>(input)\n" +
@ -289,12 +288,7 @@ public class BaseSwiftTest implements RuntimeTestSupport {
"<profile>\n" +
"let tree = try parser.<parserStartRuleName>()\n" +
"<if(profile)>print(profiler.getDecisionInfo().description)<endif>\n" +
"try ParseTreeWalker.DEFAULT.walk(TreeShapeListener(), tree)\n" +
"}catch ANTLRException.recognition(let e ) {\n" +
" print(\"error occur\\(e)\")\n" +
"}catch {\n" +
" print(\"error occur\")\n" +
"}\n"
"try ParseTreeWalker.DEFAULT.walk(TreeShapeListener(), tree)\n"
);
ST createParserST = new ST(" let parser = try <parserName>(tokens)\n");
if (debug) {
@ -329,13 +323,7 @@ public class BaseSwiftTest implements RuntimeTestSupport {
"let lex = <lexerName>(input)\n" +
"let tokens = CommonTokenStream(lex)\n" +
"do {\n" +
" try tokens.fill()\n" +
"} catch ANTLRException.recognition(let e ) {\n" +
" print(\"error occur\\(e)\")\n" +
"} catch {\n" +
" print(\"error occur\")\n" +
"}\n" +
"try tokens.fill()\n" +
"for t in tokens.getTokens() {\n" +
" print(t)\n" +

View File

@ -43,7 +43,7 @@ See the docs and the book to learn about writing lexer and parser grammars.
### Step 4: Generate the C# code
This can be done either from the cmd line, or by adding a custom pre-build command in your project.
At minimal, the cmd line should look as follows: ``java -jar antlr4-4.7.1.jar -Dlanguage=CSharp grammar.g4``
At minimal, the cmd line should look as follows: ``java -jar antlr4-4.7.2.jar -Dlanguage=CSharp grammar.g4``
This will generate the files, which you can then integrate in your project.
This is just a quick start. The tool has many useful options to control generation, please refer to its documentation.

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Company>The ANTLR Organization</Company>
<Version>4.7.1.1</Version>
<Version>4.7.2</Version>
<NeutralLanguage>en-US</NeutralLanguage>
<TargetFrameworks>netstandard1.3;net35</TargetFrameworks>
<NoWarn>$(NoWarn);CS1591;CS1574;CS1580</NoWarn>

View File

@ -1622,12 +1622,6 @@ namespace Antlr4.Runtime.Atn
depth == 0, fullCtx, treatEofAsEpsilon);
if (c != null)
{
if (!t.IsEpsilon && !closureBusy.Add(c))
{
// avoid infinite recursion for EOF* and EOF+
continue;
}
int newDepth = depth;
if (config.state is RuleStopState)
{
@ -1637,12 +1631,6 @@ namespace Antlr4.Runtime.Atn
// come in handy and we avoid evaluating context dependent
// preds if this is > 0.
if (!closureBusy.Add(c))
{
// avoid infinite recursion for right-recursive rules
continue;
}
if (thisDfa != null && thisDfa.IsPrecedenceDfa)
{
int outermostPrecedenceReturn = ((EpsilonTransition)t).OutermostPrecedenceReturn;
@ -1653,12 +1641,26 @@ namespace Antlr4.Runtime.Atn
}
c.reachesIntoOuterContext++;
if (!closureBusy.Add(c))
{
// avoid infinite recursion for right-recursive rules
continue;
}
configs.dipsIntoOuterContext = true; // TODO: can remove? only care when we add to set per middle of this method
newDepth--;
if (debug)
ConsoleWriteLine("dips into outer ctx: " + c);
}
else if (t is RuleTransition)
else
{
if (!t.IsEpsilon && !closureBusy.Add(c))
{
// avoid infinite recursion for EOF* and EOF+
continue;
}
if (t is RuleTransition)
{
// latch when newDepth goes negative - once we step out of the entry context we can't return
if (newDepth >= 0)
@ -1666,6 +1668,7 @@ namespace Antlr4.Runtime.Atn
newDepth++;
}
}
}
ClosureCheckingStopState(c, configs, closureBusy, continueCollecting,
fullCtx, newDepth, treatEofAsEpsilon);

View File

@ -352,7 +352,7 @@ namespace Antlr4.Runtime.Atn
for (int p = 0; p < parents.Length; p++)
{
PredictionContext parent = parents[p];
if (!uniqueParents.ContainsKey(parent))
if (parent!=null && !uniqueParents.ContainsKey(parent))
{ // don't replace
uniqueParents.Put(parent, parent);
}
@ -360,7 +360,9 @@ namespace Antlr4.Runtime.Atn
for (int p = 0; p < parents.Length; p++)
{
parents[p] = uniqueParents.Get(parents[p]);
PredictionContext parent = parents[p];
if (parent!=null)
parents[p] = uniqueParents.Get(parent);
}
}

View File

@ -42,8 +42,8 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.7.1")]
[assembly: AssemblyVersion("4.7.2")]
#if !COMPACT
[assembly: AssemblyFileVersion("4.7.1")]
[assembly: AssemblyInformationalVersion("4.7.1")]
[assembly: AssemblyFileVersion("4.7.2")]
[assembly: AssemblyInformationalVersion("4.7.2")]
#endif

View File

@ -612,7 +612,6 @@ namespace Antlr4.Runtime
}
// throw exception unless disjoint or identical
bool disjoint = prevRop.lastIndex < rop.index || prevRop.index > rop.lastIndex;
bool same = prevRop.index == rop.index && prevRop.lastIndex == rop.lastIndex;
// Delete special case of replace (text==null):
// D.i-j.u D.x-y.v | boundaries overlap combine to max(min)..max(right)
if (prevRop.text == null && rop.text == null && !disjoint)
@ -628,7 +627,7 @@ namespace Antlr4.Runtime
}
else
{
if (!disjoint && !same)
if (!disjoint)
{
throw new ArgumentException("replace op boundaries of " + rop + " overlap with previous " + prevRop);
}

View File

@ -20,6 +20,8 @@ if(NOT WITH_DEMO)
endif(NOT WITH_DEMO)
option(WITH_LIBCXX "Building with clang++ and libc++(in Linux). To enable with: -DWITH_LIBCXX=On" On)
option(WITH_STATIC_CRT "(Visual C++) Enable to statically link CRT, which avoids requiring users to install the redistribution package.
To disable with: -DWITH_STATIC_CRT=Off" On)
project(LIBANTLR4)
@ -47,11 +49,11 @@ endif()
file(STRINGS "VERSION" ANTLR_VERSION)
if (WITH_DEMO)
if(WITH_DEMO)
# Java is not necessary if building without demos.
find_package(Java COMPONENTS Runtime REQUIRED)
if (NOT ANTLR_JAR_LOCATION)
if(NOT ANTLR_JAR_LOCATION)
message(FATAL_ERROR "Missing antlr4.jar location. You can specify it's path using: -DANTLR_JAR_LOCATION=<path>")
else()
get_filename_component(ANTLR_NAME ${ANTLR_JAR_LOCATION} NAME_WE)
@ -63,7 +65,7 @@ if (WITH_DEMO)
endif()
endif(WITH_DEMO)
if (MSVC_VERSION)
if(MSVC_VERSION)
set(MY_CXX_WARNING_FLAGS " /W4")
else()
set(MY_CXX_WARNING_FLAGS " -Wall -pedantic -W")
@ -82,7 +84,7 @@ else()
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_WARNING_FLAGS}")
if (MSVC_VERSION)
if(MSVC_VERSION)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MP ${MY_CXX_WARNING_FLAGS}")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /O1 /Oi /Ob2 /Gy /MP /DNDEBUG ${MY_CXX_WARNING_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2 /Oi /Ob2 /Gy /MP /DNDEBUG ${MY_CXX_WARNING_FLGAS}")
@ -95,38 +97,95 @@ else()
endif()
# Compiler-specific C++11 activation.
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel")
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel")
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
# Just g++-5.0 and greater contain <codecvt> header. (test in ubuntu)
if (NOT (GCC_VERSION VERSION_GREATER 5.0 OR GCC_VERSION VERSION_EQUAL 5.0))
if(NOT (GCC_VERSION VERSION_GREATER 5.0 OR GCC_VERSION VERSION_EQUAL 5.0))
message(FATAL_ERROR "${PROJECT_NAME} requires g++ 5.0 or greater.")
endif ()
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND ANDROID)
# Need -Os cflag and cxxflags here to work with exception handling on armeabi.
# see https://github.com/android-ndk/ndk/issues/573
# and without -stdlib=libc++ cxxflags
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_SYSTEM_NAME MATCHES "Linux")
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))
if(NOT (CLANG_VERSION VERSION_GREATER 4.2.1 OR CLANG_VERSION VERSION_EQUAL 4.2.1))
message(FATAL_ERROR "${PROJECT_NAME} requires clang 4.2.1 or greater.")
endif ()
endif()
# You can use libc++ to compile this project when g++ is NOT greater than or equal to 5.0.
if (WITH_LIBCXX)
if(WITH_LIBCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
elseif ( MSVC_VERSION GREATER 1800 OR MSVC_VERSION EQUAL 1800 )
elseif(MSVC_VERSION GREATER 1800 OR MSVC_VERSION EQUAL 1800)
# Visual Studio 2012+ supports c++11 features
else ()
message(FATAL_ERROR "Your C++ compiler does not support C++11.")
endif ()
endif()
add_subdirectory(runtime)
if (WITH_DEMO)
if(WITH_DEMO)
add_subdirectory(demo)
endif(WITH_DEMO)
if( EXISTS LICENSE.txt)
# 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")
elseif(EXISTS ../../LICENSE.txt)

View File

@ -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": ""
}
]
}

View File

@ -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)

View File

@ -1 +1 @@
4.7.1
4.7.2

View File

@ -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.2-complete.jar)
# generate lexer
antlr4_generate(
antlrcpptest_lexer
${CMAKE_CURRENT_SOURCE_DIR}/TLexer.g4
LEXER
FALSE
FALSE
"antlrcpptest"
)
# generate parser
antlr4_generate(
antlrcpptest_parser
${CMAKE_CURRENT_SOURCE_DIR}/TParser.g4
PARSER
FALSE
TRUE
"antlrcpptest"
"${ANTLR4_TOKEN_FILES_antlrcpptest_lexer}"
"${ANTLR4_TOKEN_DIRECTORY_antlrcpptest_lexer}"
)
# add directories for generated include files
include_directories( ${PROJECT_BINARY_DIR} ${ANTLR4_INCLUDE_DIR} ${ANTLR4_INCLUDE_DIR_antlrcpptest_lexer} ${ANTLR4_INCLUDE_DIR_antlrcpptest_parser} )
# add generated source files
add_executable( Parsertest main.cpp ${ANTLR4_SRC_FILES_antlrcpptest_lexer} ${ANTLR4_SRC_FILES_antlrcpptest_parser} )
# add required runtime library
add_dependencies( Parsertest antlr4_shared )
target_link_libraries( Parsertest PRIVATE
antlr4_shared)
```

View File

@ -1,223 +1,148 @@
# -*- mode:cmake -*-
#
# This Cmake file is for those using a superbuild Cmake Pattern, it
# will download the tools and build locally
#
# use 2the antlr4cpp_process_grammar to support multiple grammars in the
# same project
#
# - Getting quicky started with Antlr4cpp
#
# Here is how you can use this external project to create the antlr4cpp
# demo to start your project off.
#
# create your project source folder somewhere. e.g. ~/srcfolder/
# + make a subfolder cmake
# + Copy this file to srcfolder/cmake
# + cut below and use it to create srcfolder/CMakeLists.txt,
# + from https://github.com/DanMcLaughlin/antlr4/tree/master/runtime/Cpp/demo Copy main.cpp, TLexer.g4 and TParser.g4 to ./srcfolder/
#
# next make a build folder e.g. ~/buildfolder/
# from the buildfolder, run cmake ~/srcfolder; make
#
###############################################################
# # minimum required CMAKE version
# CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12.2 FATAL_ERROR)
#
# LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )
#
# # compiler must be 11 or 14
# SET (CMAKE_CXX_STANDARD 11)
#
# # set variable pointing to the antlr tool that supports C++
# set(ANTLR4CPP_JAR_LOCATION /home/user/antlr4-4.5.4-SNAPSHOT.jar)
# # add external build for antlrcpp
# include( ExternalAntlr4Cpp )
# # add antrl4cpp artifacts to project environment
# include_directories( ${ANTLR4CPP_INCLUDE_DIRS} )
# link_directories( ${ANTLR4CPP_LIBS} )
# message(STATUS "Found antlr4cpp libs: ${ANTLR4CPP_LIBS} and includes: ${ANTLR4CPP_INCLUDE_DIRS} ")
#
# # Call macro to add lexer and grammar to your build dependencies.
# antlr4cpp_process_grammar(demo antlrcpptest
# ${CMAKE_CURRENT_SOURCE_DIR}/TLexer.g4
# ${CMAKE_CURRENT_SOURCE_DIR}/TParser.g4)
# # include generated files in project environment
# include_directories(${antlr4cpp_include_dirs_antlrcpptest})
#
# # add generated grammar to demo binary target
# add_executable(demo main.cpp ${antlr4cpp_src_files_antlrcpptest})
# add_dependencies(demo antlr4cpp antlr4cpp_generation_antlrcpptest)
# target_link_libraries(demo antlr4-runtime)
#
###############################################################
cmake_minimum_required(VERSION 3.7)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12.2)
PROJECT(antlr4cpp_fetcher CXX)
INCLUDE(ExternalProject)
FIND_PACKAGE(Git REQUIRED)
include(ExternalProject)
# only JRE required
FIND_PACKAGE(Java COMPONENTS Runtime REQUIRED)
############ Download and Generate runtime #################
set(ANTLR4CPP_EXTERNAL_ROOT ${CMAKE_BINARY_DIR}/externals/antlr4cpp)
# external repository
# GIT_REPOSITORY https://github.com/antlr/antlr4.git
set(ANTLR4CPP_EXTERNAL_REPO "https://github.com/antlr/antlr4.git")
set(ANTLR4CPP_EXTERNAL_TAG "4.7.1")
if(NOT EXISTS "${ANTLR4CPP_JAR_LOCATION}")
message(FATAL_ERROR "Unable to find antlr tool. ANTLR4CPP_JAR_LOCATION:${ANTLR4CPP_JAR_LOCATION}")
set(ANTLR4_ROOT ${CMAKE_CURRENT_BINARY_DIR}/antlr4_runtime/src/antlr4_runtime)
set(ANTLR4_INCLUDE_DIRS ${ANTLR4_ROOT}/runtime/Cpp/runtime/src)
set(ANTLR4_GIT_REPOSITORY https://github.com/antlr/antlr4.git)
if(NOT DEFINED ANTLR4_TAG)
# Set to branch name to keep library updated at the cost of needing to rebuild after 'clean'
# Set to commit hash to keep the build stable and does not need to rebuild after 'clean'
set(ANTLR4_TAG master)
endif()
# default path for source files
if (NOT ANTLR4CPP_GENERATED_SRC_DIR)
set(ANTLR4CPP_GENERATED_SRC_DIR ${CMAKE_BINARY_DIR}/antlr4cpp_generated_src)
if(${CMAKE_GENERATOR} MATCHES "Visual Studio.*")
set(ANTLR4_OUTPUT_DIR ${ANTLR4_ROOT}/runtime/Cpp/dist/$(Configuration))
elseif(${CMAKE_GENERATOR} MATCHES "Xcode.*")
set(ANTLR4_OUTPUT_DIR ${ANTLR4_ROOT}/runtime/Cpp/dist/$(CONFIGURATION))
else()
set(ANTLR4_OUTPUT_DIR ${ANTLR4_ROOT}/runtime/Cpp/dist)
endif()
# !TODO! This should probably check with Cmake Find first?
# set(ANTLR4CPP_JAR_LOCATION ${ANTLR4CPP_EXTERNAL_ROOT}/${ANTLR4CPP_JAR_NAME})
#
# !TODO! Ensure Antlr tool available - copy from internet
#
# # !TODO! this shold be calculated based on the tags
# if (NOT ANTLR4CPP_JAR_NAME)
# # default location to find antlr Java binary
# set(ANTLR4CPP_JAR_NAME antlr4-4.5.4-SNAPSHOT.jar)
# endif()
#
# if(NOT EXISTS "${ANTLR4CPP_JAR_LOCATION}")
# # download Java tool if not installed
# ExternalProject_ADD(
# #--External-project-name------
# antlrtool
# #--Core-directories-----------
# PREFIX ${ANTLR4CPP_EXTERNAL_ROOT}
# #--Download step--------------
# DOWNLOAD_DIR ${ANTLR4CPP_EXTERNAL_ROOT}
# DOWNLOAD_COMMAND ""
# # URL http://www.antlr.org/download/${ANTLR4CPP_JAR_NAME}
# # antlr4-4.5.4-SNAPSHOT.jar
# # GIT_TAG v4.5.4
# TIMEOUT 10
# LOG_DOWNLOAD ON
# #--Update step----------
# # UPDATE_COMMAND ${GIT_EXECUTABLE} pull
# #--Patch step----------
# # PATCH_COMMAND sh -c "cp <SOURCE_DIR>/scripts/CMakeLists.txt <SOURCE_DIR>"
# #--Configure step-------------
# CMAKE_ARGS ""
# CONFIGURE_COMMAND ""
# LOG_CONFIGURE ON
# #--Build step-----------------
# BUILD_COMMAND ""
# LOG_BUILD ON
# #--Install step---------------
# INSTALL_COMMAND ""
# )
# # Verify Antlr Available
# if(NOT EXISTS "${ANTLR4CPP_JAR_LOCATION}")
# message(FATAL_ERROR "Unable to find ANTLR4CPP_JAR_LOCATION:${ANTLR4CPP_JAR_LOCATION} -> ${ANTLR4CPP_JAR_NAME} not in ${ANTLR4CPP_DIR} ")
# endif()
# endif()
# download runtime environment
ExternalProject_ADD(
#--External-project-name------
antlr4cpp
#--Depend-on-antrl-tool-----------
# DEPENDS antlrtool
#--Core-directories-----------
PREFIX ${ANTLR4CPP_EXTERNAL_ROOT}
#--Download step--------------
GIT_REPOSITORY ${ANTLR4CPP_EXTERNAL_REPO}
# GIT_TAG ${ANTLR4CPP_EXTERNAL_TAG}
TIMEOUT 10
LOG_DOWNLOAD ON
#--Update step----------
UPDATE_COMMAND ${GIT_EXECUTABLE} pull
#--Patch step----------
# PATCH_COMMAND sh -c "cp <SOURCE_DIR>/scripts/CMakeLists.txt <SOURCE_DIR>"
#--Configure step-------------
CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release -DANTLR4CPP_JAR_LOCATION=${ANTLR4CPP_JAR_LOCATION} -DBUILD_SHARED_LIBS=ON -BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_SOURCE_DIR:PATH=<SOURCE_DIR>/runtime/Cpp <SOURCE_DIR>/runtime/Cpp
LOG_CONFIGURE ON
#--Build step-----------------
# BUILD_COMMAND ${CMAKE_MAKE_PROGRAM}
LOG_BUILD ON
#--Install step---------------
# INSTALL_COMMAND ""
# INSTALL_DIR ${CMAKE_BINARY_DIR}/
#--Install step---------------
# INSTALL_COMMAND ""
)
ExternalProject_Get_Property(antlr4cpp INSTALL_DIR)
list(APPEND ANTLR4CPP_INCLUDE_DIRS ${INSTALL_DIR}/include/antlr4-runtime)
foreach(src_path misc atn dfa tree support)
list(APPEND ANTLR4CPP_INCLUDE_DIRS ${INSTALL_DIR}/include/antlr4-runtime/${src_path})
endforeach(src_path)
set(ANTLR4CPP_LIBS "${INSTALL_DIR}/lib")
# antlr4_shared ${INSTALL_DIR}/lib/libantlr4-runtime.so
# antlr4_static ${INSTALL_DIR}/lib/libantlr4-runtime.a
############ Generate runtime #################
# macro to add dependencies to target
#
# Param 1 project name
# Param 1 namespace (postfix for dependencies)
# Param 2 Lexer file (full path)
# Param 3 Parser File (full path)
#
# output
#
# antlr4cpp_src_files_{namespace} - src files for add_executable
# antlr4cpp_include_dirs_{namespace} - include dir for generated headers
# antlr4cpp_generation_{namespace} - for add_dependencies tracking
macro(antlr4cpp_process_grammar
antlr4cpp_project
antlr4cpp_project_namespace
antlr4cpp_grammar_lexer
antlr4cpp_grammar_parser)
if(EXISTS "${ANTLR4CPP_JAR_LOCATION}")
message(STATUS "Found antlr tool: ${ANTLR4CPP_JAR_LOCATION}")
if(MSVC)
set(ANTLR4_STATIC_LIBRARIES
${ANTLR4_OUTPUT_DIR}/antlr4-runtime-static.lib)
set(ANTLR4_SHARED_LIBRARIES
${ANTLR4_OUTPUT_DIR}/antlr4-runtime.lib)
set(ANTLR4_RUNTIME_LIBRARIES
${ANTLR4_OUTPUT_DIR}/antlr4-runtime.dll)
else()
set(ANTLR4_STATIC_LIBRARIES
${ANTLR4_OUTPUT_DIR}/libantlr4-runtime.a)
if(MINGW)
set(ANTLR4_SHARED_LIBRARIES
${ANTLR4_OUTPUT_DIR}/libantlr4-runtime.dll.a)
set(ANTLR4_RUNTIME_LIBRARIES
${ANTLR4_OUTPUT_DIR}/libantlr4-runtime.dll)
elseif(CYGWIN)
set(ANTLR4_SHARED_LIBRARIES
${ANTLR4_OUTPUT_DIR}/libantlr4-runtime.dll.a)
set(ANTLR4_RUNTIME_LIBRARIES
${ANTLR4_OUTPUT_DIR}/cygantlr4-runtime-4.7.2.dll)
elseif(APPLE)
set(ANTLR4_RUNTIME_LIBRARIES
${ANTLR4_OUTPUT_DIR}/libantlr4-runtime.dylib)
else()
message(FATAL_ERROR "Unable to find antlr tool. ANTLR4CPP_JAR_LOCATION:${ANTLR4CPP_JAR_LOCATION}")
set(ANTLR4_RUNTIME_LIBRARIES
${ANTLR4_OUTPUT_DIR}/libantlr4-runtime.so)
endif()
endif()
add_custom_target("antlr4cpp_generation_${antlr4cpp_project_namespace}"
COMMAND
${CMAKE_COMMAND} -E make_directory ${ANTLR4CPP_GENERATED_SRC_DIR}
COMMAND
"${Java_JAVA_EXECUTABLE}" -jar "${ANTLR4CPP_JAR_LOCATION}" -Werror -Dlanguage=Cpp -listener -visitor -o "${ANTLR4CPP_GENERATED_SRC_DIR}/${antlr4cpp_project_namespace}" -package ${antlr4cpp_project_namespace} "${antlr4cpp_grammar_lexer}" "${antlr4cpp_grammar_parser}"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
DEPENDS "${antlr4cpp_grammar_lexer}" "${antlr4cpp_grammar_parser}"
)
if(${CMAKE_GENERATOR} MATCHES ".* Makefiles")
# This avoids
# 'warning: jobserver unavailable: using -j1. Add '+' to parent make rule.'
set(ANTLR4_BUILD_COMMAND $(MAKE))
elseif(${CMAKE_GENERATOR} MATCHES "Visual Studio.*")
set(ANTLR4_BUILD_COMMAND
${CMAKE_COMMAND}
--build .
--config $(Configuration)
--target)
elseif(${CMAKE_GENERATOR} MATCHES "Xcode.*")
set(ANTLR4_BUILD_COMMAND
${CMAKE_COMMAND}
--build .
--config $(CONFIGURATION)
--target)
else()
set(ANTLR4_BUILD_COMMAND
${CMAKE_COMMAND}
--build .
--target)
endif()
# Find all the input files
FILE(GLOB generated_files ${ANTLR4CPP_GENERATED_SRC_DIR}/${antlr4cpp_project_namespace}/*.cpp)
if(NOT DEFINED ANTLR4_WITH_STATIC_CRT)
set(ANTLR4_WITH_STATIC_CRT ON)
endif()
# export generated cpp files into list
foreach(generated_file ${generated_files})
list(APPEND antlr4cpp_src_files_${antlr4cpp_project_namespace} ${generated_file})
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set_source_files_properties(
${generated_file}
PROPERTIES
COMPILE_FLAGS -Wno-overloaded-virtual
)
endif ()
endforeach(generated_file)
message(STATUS "Antlr4Cpp ${antlr4cpp_project_namespace} Generated: ${generated_files}")
if(ANTLR4_ZIP_REPOSITORY)
ExternalProject_Add(
antlr4_runtime
PREFIX antlr4_runtime
URL ${ANTLR4_ZIP_REPOSITORY}
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}
BUILD_COMMAND ""
BUILD_IN_SOURCE 1
SOURCE_DIR ${ANTLR4_ROOT}
SOURCE_SUBDIR runtime/Cpp
CMAKE_CACHE_ARGS
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DWITH_STATIC_CRT:BOOL=${ANTLR4_WITH_STATIC_CRT}
INSTALL_COMMAND ""
EXCLUDE_FROM_ALL 1)
else()
ExternalProject_Add(
antlr4_runtime
PREFIX antlr4_runtime
GIT_REPOSITORY ${ANTLR4_GIT_REPOSITORY}
GIT_TAG ${ANTLR4_TAG}
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}
BUILD_COMMAND ""
BUILD_IN_SOURCE 1
SOURCE_DIR ${ANTLR4_ROOT}
SOURCE_SUBDIR runtime/Cpp
CMAKE_CACHE_ARGS
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DWITH_STATIC_CRT:BOOL=${ANTLR4_WITH_STATIC_CRT}
INSTALL_COMMAND ""
EXCLUDE_FROM_ALL 1)
endif()
# export generated include directory
set(antlr4cpp_include_dirs_${antlr4cpp_project_namespace} ${ANTLR4CPP_GENERATED_SRC_DIR}/${antlr4cpp_project_namespace})
message(STATUS "Antlr4Cpp ${antlr4cpp_project_namespace} include: ${ANTLR4CPP_GENERATED_SRC_DIR}/${antlr4cpp_project_namespace}")
# Seperate build step as rarely people want both
ExternalProject_Add_Step(
antlr4_runtime
build_static
COMMAND ${ANTLR4_BUILD_COMMAND} antlr4_static
# Depend on target instead of step (a custom command)
# to avoid running dependent steps concurrently
DEPENDS antlr4_runtime
BYPRODUCTS ${ANTLR4_STATIC_LIBRARIES}
EXCLUDE_FROM_MAIN 1
WORKING_DIRECTORY ${ANTLR4_ROOT})
ExternalProject_Add_StepTargets(antlr4_runtime build_static)
endmacro()
add_library(antlr4_static STATIC IMPORTED)
add_dependencies(antlr4_static antlr4_runtime-build_static)
set_target_properties(antlr4_static PROPERTIES
IMPORTED_LOCATION ${ANTLR4_STATIC_LIBRARIES})
ExternalProject_Add_Step(
antlr4_runtime
build_shared
COMMAND ${ANTLR4_BUILD_COMMAND} antlr4_shared
# Depend on target instead of step (a custom command)
# to avoid running dependent steps concurrently
DEPENDS antlr4_runtime
BYPRODUCTS ${ANTLR4_SHARED_LIBRARIES} ${ANTLR4_RUNTIME_LIBRARIES}
EXCLUDE_FROM_MAIN 1
WORKING_DIRECTORY ${ANTLR4_ROOT})
ExternalProject_Add_StepTargets(antlr4_runtime build_shared)
add_library(antlr4_shared SHARED IMPORTED)
add_dependencies(antlr4_shared antlr4_runtime-build_shared)
set_target_properties(antlr4_shared PROPERTIES
IMPORTED_LOCATION ${ANTLR4_RUNTIME_LIBRARIES})
if(ANTLR4_SHARED_LIBRARIES)
set_target_properties(antlr4_shared PROPERTIES
IMPORTED_IMPLIB ${ANTLR4_SHARED_LIBRARIES})
endif()

View File

@ -0,0 +1,124 @@
find_package(Java QUIET COMPONENTS Runtime)
if(NOT ANTLR_EXECUTABLE)
find_program(ANTLR_EXECUTABLE
NAMES antlr.jar antlr4.jar antlr-4.jar antlr-4.7.2-complete.jar)
endif()
if(ANTLR_EXECUTABLE AND Java_JAVA_EXECUTABLE)
execute_process(
COMMAND ${Java_JAVA_EXECUTABLE} -jar ${ANTLR_EXECUTABLE}
OUTPUT_VARIABLE ANTLR_COMMAND_OUTPUT
ERROR_VARIABLE ANTLR_COMMAND_ERROR
RESULT_VARIABLE ANTLR_COMMAND_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(ANTLR_COMMAND_RESULT EQUAL 0)
string(REGEX MATCH "Version [0-9]+(\\.[0-9])*" ANTLR_VERSION ${ANTLR_COMMAND_OUTPUT})
string(REPLACE "Version " "" ANTLR_VERSION ${ANTLR_VERSION})
else()
message(
SEND_ERROR
"Command '${Java_JAVA_EXECUTABLE} -jar ${ANTLR_EXECUTABLE}' "
"failed with the output '${ANTLR_COMMAND_ERROR}'")
endif()
macro(ANTLR_TARGET Name InputFile)
set(ANTLR_OPTIONS LEXER PARSER LISTENER VISITOR)
set(ANTLR_ONE_VALUE_ARGS PACKAGE OUTPUT_DIRECTORY DEPENDS_ANTLR)
set(ANTLR_MULTI_VALUE_ARGS COMPILE_FLAGS DEPENDS)
cmake_parse_arguments(ANTLR_TARGET
"${ANTLR_OPTIONS}"
"${ANTLR_ONE_VALUE_ARGS}"
"${ANTLR_MULTI_VALUE_ARGS}"
${ARGN})
set(ANTLR_${Name}_INPUT ${InputFile})
get_filename_component(ANTLR_INPUT ${InputFile} NAME_WE)
if(ANTLR_TARGET_OUTPUT_DIRECTORY)
set(ANTLR_${Name}_OUTPUT_DIR ${ANTLR_TARGET_OUTPUT_DIRECTORY})
else()
set(ANTLR_${Name}_OUTPUT_DIR
${CMAKE_CURRENT_BINARY_DIR}/antlr4cpp_generated_src/${ANTLR_INPUT})
endif()
unset(ANTLR_${Name}_CXX_OUTPUTS)
if((ANTLR_TARGET_LEXER AND NOT ANTLR_TARGET_PARSER) OR
(ANTLR_TARGET_PARSER AND NOT ANTLR_TARGET_LEXER))
list(APPEND ANTLR_${Name}_CXX_OUTPUTS
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}.h
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}.cpp)
set(ANTLR_${Name}_OUTPUTS
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}.interp
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}.tokens)
else()
list(APPEND ANTLR_${Name}_CXX_OUTPUTS
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Lexer.h
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Lexer.cpp
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Parser.h
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Parser.cpp)
list(APPEND ANTLR_${Name}_OUTPUTS
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Lexer.interp
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Lexer.tokens)
endif()
if(ANTLR_TARGET_LISTENER)
list(APPEND ANTLR_${Name}_CXX_OUTPUTS
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}BaseListener.h
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}BaseListener.cpp
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Listener.h
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Listener.cpp)
list(APPEND ANTLR_TARGET_COMPILE_FLAGS -listener)
endif()
if(ANTLR_TARGET_VISITOR)
list(APPEND ANTLR_${Name}_CXX_OUTPUTS
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}BaseVisitor.h
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}BaseVisitor.cpp
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Visitor.h
${ANTLR_${Name}_OUTPUT_DIR}/${ANTLR_INPUT}Visitor.cpp)
list(APPEND ANTLR_TARGET_COMPILE_FLAGS -visitor)
endif()
if(ANTLR_TARGET_PACKAGE)
list(APPEND ANTLR_TARGET_COMPILE_FLAGS -package ${ANTLR_TARGET_PACKAGE})
endif()
list(APPEND ANTLR_${Name}_OUTPUTS ${ANTLR_${Name}_CXX_OUTPUTS})
if(ANTLR_TARGET_DEPENDS_ANTLR)
if(ANTLR_${ANTLR_TARGET_DEPENDS_ANTLR}_INPUT)
list(APPEND ANTLR_TARGET_DEPENDS
${ANTLR_${ANTLR_TARGET_DEPENDS_ANTLR}_INPUT})
list(APPEND ANTLR_TARGET_DEPENDS
${ANTLR_${ANTLR_TARGET_DEPENDS_ANTLR}_OUTPUTS})
else()
message(SEND_ERROR
"ANTLR target '${ANTLR_TARGET_DEPENDS_ANTLR}' not found")
endif()
endif()
add_custom_command(
OUTPUT ${ANTLR_${Name}_OUTPUTS}
COMMAND ${Java_JAVA_EXECUTABLE} -jar ${ANTLR_EXECUTABLE}
${InputFile}
-o ${ANTLR_${Name}_OUTPUT_DIR}
-no-listener
-Dlanguage=Cpp
${ANTLR_TARGET_COMPILE_FLAGS}
DEPENDS ${InputFile}
${ANTLR_TARGET_DEPENDS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Building ${Name} with ANTLR ${ANTLR_VERSION}")
endmacro(ANTLR_TARGET)
endif(ANTLR_EXECUTABLE AND Java_JAVA_EXECUTABLE)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
ANTLR
REQUIRED_VARS ANTLR_EXECUTABLE Java_JAVA_EXECUTABLE
VERSION_VAR ANTLR_VERSION)

154
runtime/Cpp/cmake/README.md Normal file
View File

@ -0,0 +1,154 @@
## Getting started with Antlr4Cpp
Here is how you can use this external project to create the antlr4cpp demo to start your project off.
1. Create your project source folder somewhere. e.g. ~/srcfolder/
1. Make a subfolder cmake
2. Copy the files in this folder to srcfolder/cmake
3. Cut below and use it to create srcfolder/CMakeLists.txt
4. Copy main.cpp, TLexer.g4 and TParser.g4 to ./srcfolder/ from [here](https://github.com/antlr/antlr4/tree/master/runtime/Cpp/demo)
2. Make a build folder e.g. ~/buildfolder/
3. From the buildfolder, run `cmake ~/srcfolder; make`
```cmake
# minimum required CMAKE version
CMAKE_MINIMUM_REQUIRED(VERSION 3.7 FATAL_ERROR)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# compiler must be 11 or 14
set(CMAKE_CXX_STANDARD 11)
# required if linking to static library
add_definitions(-DANTLR4CPP_STATIC)
# using /MD flag for antlr4_runtime (for Visual C++ compilers only)
set(ANTLR4_WITH_STATIC_CRT OFF)
# add external build for antlrcpp
include(ExternalAntlr4Cpp)
# add antrl4cpp artifacts to project environment
include_directories(${ANTLR4_INCLUDE_DIRS})
# set variable pointing to the antlr tool that supports C++
# this is not required if the jar file can be found under PATH environment
set(ANTLR_EXECUTABLE /home/user/antlr-4.7.2-complete.jar)
# add macros to generate ANTLR Cpp code from grammar
find_package(ANTLR REQUIRED)
# Call macro to add lexer and grammar to your build dependencies.
antlr_target(SampleGrammarLexer TLexer.g4 LEXER
PACKAGE antlrcpptest)
antlr_target(SampleGrammarParser TParser.g4 PARSER
PACKAGE antlrcpptest
DEPENDS_ANTLR SampleGrammarLexer)
# include generated files in project environment
include_directories(${ANTLR_SampleGrammarLexer_OUTPUT_DIR})
include_directories(${ANTLR_SampleGrammarParser_OUTPUT_DIR})
# add generated grammar to demo binary target
add_executable(demo main.cpp
${ANTLR_SampleGrammarLexer_CXX_OUTPUTS}
${ANTLR_SampleGrammarParser_CXX_OUTPUTS})
target_link_libraries(demo antlr4_static)
```
## Documentation for FindANTLR
The module defines the following variables:
```
ANTLR_FOUND - true is ANTLR jar executable is found
ANTLR_EXECUTABLE - the path to the ANTLR jar executable
ANTLR_VERSION - the version of ANTLR
```
If ANTLR is found, the module will provide the macros:
```
ANTLR_TARGET(<name> <input>
[PACKAGE namespace]
[OUTPUT_DIRECTORY dir]
[DEPENDS_ANTLR <target>]
[COMPILE_FLAGS [args...]]
[DEPENDS [depends...]]
[LEXER]
[PARSER]
[LISTENER]
[VISITOR])
```
which creates a custom command to generate C++ files from `<input>`. Running the macro defines the following variables:
```
ANTLR_${name}_INPUT - the ANTLR input used for the macro
ANTLR_${name}_OUTPUTS - the outputs generated by ANTLR
ANTLR_${name}_CXX_OUTPUTS - the C++ outputs generated by ANTLR
ANTLR_${name}_OUTPUT_DIR - the output directory for ANTLR
```
The options are:
* `PACKAGE` - defines a namespace for the generated C++ files
* `OUTPUT_DIRECTORY` - the output directory for the generated files. By default it uses `${CMAKE_CURRENT_BINARY_DIR}`
* `DEPENDS_ANTLR` - the dependent target generated from antlr_target for the current call
* `COMPILE_FLAGS` - additional compile flags for ANTLR tool
* `DEPENDS` - specify the files on which the command depends. It works the same way `DEPENDS` in [`add_custom_command()`](https://cmake.org/cmake/help/v3.11/command/add_custom_command.html)
* `LEXER` - specify that the input file is a lexer grammar
* `PARSER` - specify that the input file is a parser grammar
* `LISTENER` - tell ANTLR tool to generate a parse tree listener
* `VISITOR` - tell ANTLR tool to generate a parse tree visitor
### Examples
To generate C++ files from an ANTLR input file T.g4, which defines both lexer and parser grammar one may call:
```cmake
find_package(ANTLR REQUIRED)
antlr_target(Sample T.g4)
```
Note that this command will do nothing unless the outputs of `Sample`, i.e. `ANTLR_Sample_CXX_OUTPUTS` gets used by some target.
## Documentation for ExternalAntlr4Cpp
Including ExternalAntlr4Cpp will add `antlr4_static` and `antlr4_shared` as an optional target. It will also define the following variables:
```
ANTLR4_INCLUDE_DIRS - the include directory that should be included when compiling C++ source file
ANTLR4_STATIC_LIBRARIES - path to antlr4 static library
ANTLR4_SHARED_LIBRARIES - path to antlr4 shared library
ANTLR4_RUNTIME_LIBRARIES - path to antlr4 shared runtime library (such as DLL, DYLIB and SO file)
ANTLR4_TAG - branch/tag used for building antlr4 library
```
`ANTLR4_TAG` is set to master branch by default to keep antlr4 updated. However, it will be required to rebuild after every `clean` is called. Set `ANTLR4_TAG` to a desired commit hash value to avoid rebuilding after every `clean` and keep the build stable, at the cost of not automatically update to latest commit.
The ANTLR C++ runtime source is downloaded from GitHub by default. However, users may specify `ANTLR4_ZIP_REPOSITORY` to list the zip file from [ANTLR downloads](http://www.antlr.org/download.html) (under *C++ Target*). This variable can list a zip file included in the project directory; this is useful for maintaining a canonical source for each new build.
Visual C++ compiler users may want to additionally define `ANTLR4_WITH_STATIC_CRT` before including the file. Set `ANTLR4_WITH_STATIC_CRT` to true if ANTLR4 C++ runtime library should be compiled with `/MT` flag, otherwise will be compiled with `/MD` flag. This variable has a default value of `OFF`. Changing `ANTLR4_WITH_STATIC_CRT` after building the library may require reinitialization of CMake or `clean` for the library to get rebuilt.
### Examples
To build and link ANTLR4 static library to a target one may call:
```cmake
include(ExternalAntlr4Cpp)
include_directories(${ANTLR4_INCLUDE_DIRS})
add_executable(output main.cpp)
target_link_libraries(output antlr4_static)
```
It may also be a good idea to copy the runtime libraries (DLL, DYLIB or SO file) to the executable for it to run properly after build. i.e. To build and link antlr4 shared library to a target one may call:
```cmake
include(ExternalAntlr4Cpp)
include_directories(${ANTLR4_INCLUDE_DIRS})
add_executable(output main.cpp)
target_link_libraries(output antlr4_shared)
add_custom_command(TARGET output
POST_BUILD
COMMAND ${CMAKE_COMMAND}
-E copy ${ANTLR4_RUNTIME_LIBRARIES} .
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
```

View File

@ -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()

View File

@ -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)

View File

@ -12,13 +12,13 @@ set(antlr4-demo-GENERATED_SRC
${PROJECT_SOURCE_DIR}/demo/generated/TParserVisitor.cpp
)
foreach( src_file ${antlr4-demo-GENERATED_SRC} )
foreach(src_file ${antlr4-demo-GENERATED_SRC})
set_source_files_properties(
${src_file}
PROPERTIES
GENERATED TRUE
)
endforeach( src_file ${antlr4-demo-GENERATED_SRC} )
endforeach(src_file ${antlr4-demo-GENERATED_SRC})
add_custom_target(GenerateParser DEPENDS ${antlr4-demo-GENERATED_SRC})
add_custom_command(OUTPUT ${antlr4-demo-GENERATED_SRC}
@ -46,26 +46,26 @@ set(antlr4-demo_SRC
${antlr4-demo-GENERATED_SRC}
)
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set (flags_1 "-Wno-overloaded-virtual")
else()
set (flags_1 "-MP /wd4251")
endif()
foreach( src_file ${antlr4-demo_SRC} )
foreach(src_file ${antlr4-demo_SRC})
set_source_files_properties(
${src_file}
PROPERTIES
COMPILE_FLAGS "${COMPILE_FLAGS} ${flags_1}"
)
endforeach( src_file ${antlr4-demo_SRC} )
endforeach(src_file ${antlr4-demo_SRC})
add_executable(antlr4-demo
${antlr4-demo_SRC}
)
#add_precompiled_header(antlr4-demo ${PROJECT_SOURCE_DIR}/runtime/src/antlrcpp-Prefix.h)
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
target_compile_options(antlr4-demo PRIVATE "/MT$<$<CONFIG:Debug>:d>")
endif()

View File

@ -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;

View File

@ -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>

View File

@ -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"

View File

@ -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"

View File

@ -6,7 +6,7 @@
:: Download the ANLTR jar and place it in the same folder as this script (or adjust the LOCATION var accordingly).
set LOCATION=antlr-4.7.1-complete.jar
set LOCATION=antlr-4.7.2-complete.jar
java -jar %LOCATION% -Dlanguage=Cpp -listener -visitor -o generated/ -package antlrcpptest TLexer.g4 TParser.g4
::java -jar %LOCATION% -Dlanguage=Cpp -listener -visitor -o generated/ -package antlrcpptest -XdbgST TLexer.g4 TParser.g4
::java -jar %LOCATION% -Dlanguage=Java -listener -visitor -o generated/ -package antlrcpptest TLexer.g4 TParser.g4

View File

@ -44,14 +44,14 @@ elseif(APPLE)
target_link_libraries(antlr4_static ${COREFOUNDATION_LIBRARY})
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(disabled_compile_warnings "/wd4251")
else()
set(disabled_compile_warnings "-Wno-overloaded-virtual")
endif ()
endif()
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(disabled_compile_warnings "${disabled_compile_warnings} -Wno-dollar-in-identifier-extension -Wno-four-char-constants")
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel")
set(disabled_compile_warnings "${disabled_compile_warnings} -Wno-multichar")
@ -59,21 +59,26 @@ endif()
set(extra_share_compile_flags "")
set(extra_static_compile_flags "")
if (WIN32)
if(WIN32)
set(extra_share_compile_flags "-DANTLR4CPP_EXPORTS")
set(extra_static_compile_flags "-DANTLR4CPP_STATIC")
endif(WIN32)
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
target_compile_options(antlr4_shared PRIVATE "/MD$<$<CONFIG:Debug>:d>")
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
if(WITH_STATIC_CRT)
target_compile_options(antlr4_shared PRIVATE "/MT$<$<CONFIG:Debug>:d>")
target_compile_options(antlr4_static PRIVATE "/MT$<$<CONFIG:Debug>:d>")
else()
target_compile_options(antlr4_shared PRIVATE "/MD$<$<CONFIG:Debug>:d>")
target_compile_options(antlr4_static PRIVATE "/MD$<$<CONFIG:Debug>:d>")
endif()
endif()
set(static_lib_suffix "")
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(static_lib_suffix "-static")
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(extra_share_compile_flags "-DANTLR4CPP_EXPORTS -MP /wd4251")
set(extra_static_compile_flags "-DANTLR4CPP_STATIC -MP")
endif()
@ -97,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"

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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;

View File

@ -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>

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -272,7 +272,7 @@ ssize_t BufferedTokenStream::previousTokenOnChannel(size_t i, size_t channel) {
}
if (i == 0)
break;
return -1;
i--;
}
return i;

View File

@ -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 {

View File

@ -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,7 +19,8 @@ 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

View File

@ -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);

View File

@ -7,7 +7,7 @@
using namespace antlr4;
const std::string RuntimeMetaData::VERSION = "4.7.1";
const std::string RuntimeMetaData::VERSION = "4.7.2";
std::string RuntimeMetaData::getRuntimeVersion() {
return VERSION;

View File

@ -348,7 +348,6 @@ std::unordered_map<size_t, TokenStreamRewriter::RewriteOperation*> TokenStreamRe
}
// throw exception unless disjoint or identical
bool disjoint = prevRop->lastIndex < rop->index || prevRop->index > rop->lastIndex;
bool same = prevRop->index == rop->index && prevRop->lastIndex == rop->lastIndex;
// Delete special case of replace (text==null):
// D.i-j.u D.x-y.v | boundaries overlap combine to max(min)..max(right)
if (prevRop->text.empty() && rop->text.empty() && !disjoint) {
@ -358,7 +357,7 @@ std::unordered_map<size_t, TokenStreamRewriter::RewriteOperation*> TokenStreamRe
rop->lastIndex = std::max(prevRop->lastIndex, rop->lastIndex);
std::cout << "new rop " << rop << std::endl;
}
else if (!disjoint && !same) {
else if (!disjoint) {
throw IllegalArgumentException("replace op boundaries of " + rop->toString() +
" overlap with previous " + prevRop->toString());
}

View File

@ -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;

View File

@ -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) {
@ -698,27 +698,22 @@ std::vector<Ref<SemanticContext>> ParserATNSimulator::getPredsForAmbigAlts(const
}
std::vector<dfa::DFAState::PredPrediction *> ParserATNSimulator::getPredicatePredictions(const antlrcpp::BitSet &ambigAlts,
std::vector<Ref<SemanticContext>> altToPred) {
std::vector<dfa::DFAState::PredPrediction*> pairs;
bool containsPredicate = false;
for (size_t i = 1; i < altToPred.size(); i++) {
Ref<SemanticContext> pred = altToPred[i];
std::vector<Ref<SemanticContext>> const& altToPred) {
bool containsPredicate = std::find_if(altToPred.begin(), altToPred.end(), [](Ref<SemanticContext> const context) {
return context != SemanticContext::NONE;
}) != altToPred.end();
if (!containsPredicate)
return {};
// unpredicted is indicated by SemanticContext.NONE
assert(pred != nullptr);
std::vector<dfa::DFAState::PredPrediction*> pairs;
for (size_t i = 1; i < altToPred.size(); ++i) {
Ref<SemanticContext> const& pred = altToPred[i];
assert(pred != nullptr); // unpredicted is indicated by SemanticContext.NONE
if (ambigAlts.test(i)) {
pairs.push_back(new dfa::DFAState::PredPrediction(pred, (int)i)); /* mem-check: managed by the DFAState it will be assigned to after return */
}
if (pred != SemanticContext::NONE) {
containsPredicate = true;
}
}
if (!containsPredicate) {
pairs.clear();
}
return pairs;
}
@ -893,15 +888,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 +912,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 +930,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 +1224,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) {

View File

@ -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.
*/
@ -652,7 +652,7 @@ namespace atn {
ATNConfigSet *configs, size_t nalts);
virtual std::vector<dfa::DFAState::PredPrediction*> getPredicatePredictions(const antlrcpp::BitSet &ambigAlts,
std::vector<Ref<SemanticContext>> altToPred);
std::vector<Ref<SemanticContext>> const& altToPred);
/**
* This method is used to improve the localization of error messages by
@ -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);

View File

@ -278,7 +278,7 @@ Ref<PredictionContext> PredictionContext::mergeArrays(const Ref<ArrayPredictionC
// same payload (stack tops are equal), must yield merged singleton
size_t payload = a->returnStates[i];
// $+$ = $
bool both$ = payload == EMPTY_RETURN_STATE && a_parent && b_parent;
bool both$ = payload == EMPTY_RETURN_STATE && !a_parent && !b_parent;
bool ax_ax = (a_parent && b_parent) && *a_parent == *b_parent; // ax+ax -> ax
if (both$ || ax_ax) {
mergedParents[k] = a_parent; // choose left

View File

@ -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

View File

@ -46,21 +46,21 @@ struct ANTLR4CPP_PUBLIC Any
template<class U>
bool is() const {
typedef StorageType<U> T;
auto derived = dynamic_cast<Derived<T> *>(_ptr);
auto derived = getDerived<U>(false);
return derived != nullptr;
}
template<class U>
StorageType<U>& as() {
typedef StorageType<U> T;
auto derived = getDerived<U>(true);
auto derived = dynamic_cast<Derived<T>*>(_ptr);
return derived->value;
}
if (!derived)
throw std::bad_cast();
template<class U>
const StorageType<U>& as() const {
auto derived = getDerived<U>(true);
return derived->value;
}
@ -70,6 +70,11 @@ struct ANTLR4CPP_PUBLIC Any
return as<StorageType<U>>();
}
template<class U>
operator const U() const {
return as<const StorageType<U>>();
}
Any& operator = (const Any& a) {
if (_ptr == a._ptr)
return *this;
@ -137,6 +142,18 @@ private:
return nullptr;
}
template<class U>
Derived<StorageType<U>>* getDerived(bool checkCast) const {
typedef StorageType<U> T;
auto derived = dynamic_cast<Derived<T>*>(_ptr);
if (checkCast && !derived)
throw std::bad_cast();
return derived;
}
Base *_ptr;
};

View File

@ -9,7 +9,7 @@
namespace antlrcpp {
class ANTLR4CPP_PUBLIC BitSet : public std::bitset<1024> {
class ANTLR4CPP_PUBLIC BitSet : public std::bitset<2048> {
public:
size_t nextSetBit(size_t pos) const {
for (size_t i = pos; i < size(); i++){

View File

@ -50,6 +50,11 @@ namespace antlrcpp {
break;
}
// else fall through
#ifndef _MSC_VER
#if __has_cpp_attribute(clang::fallthrough)
[[clang::fallthrough]];
#endif
#endif
default:
result += c;

View File

@ -29,6 +29,7 @@ namespace tree {
template<typename V>
class ANTLR4CPP_PUBLIC ParseTreeProperty {
public:
virtual ~ParseTreeProperty() {}
virtual V get(ParseTree *node) {
return _annotations[node];
}

View File

@ -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"/>.

View File

@ -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

View File

@ -49,7 +49,7 @@ var tokenTypeMapCache = make(map[string]int)
var ruleIndexMapCache = make(map[string]int)
func (b *BaseRecognizer) checkVersion(toolVersion string) {
runtimeVersion := "4.7.1"
runtimeVersion := "4.7.2"
if runtimeVersion != toolVersion {
fmt.Println("ANTLR runtime and generated code versions disagree: " + runtimeVersion + "!=" + toolVersion)
}

View File

@ -9,7 +9,7 @@
<parent>
<groupId>org.antlr</groupId>
<artifactId>antlr4-master</artifactId>
<version>4.7.2-SNAPSHOT</version>
<version>4.7.3-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>antlr4-runtime</artifactId>

View File

@ -203,8 +203,8 @@ public abstract class CodePointCharStream implements CharStream {
/** Return the UTF-16 encoded string for the given interval */
@Override
public String getText(Interval interval) {
int startIdx = Math.min(interval.a, size - 1);
int len = Math.min(interval.b - interval.a + 1, size);
int startIdx = Math.min(interval.a, size);
int len = Math.min(interval.b - interval.a + 1, size - startIdx);
// We know there are no surrogates in this
// array, since otherwise we would be given a
@ -258,8 +258,8 @@ public abstract class CodePointCharStream implements CharStream {
/** Return the UTF-16 encoded string for the given interval */
@Override
public String getText(Interval interval) {
int startIdx = Math.min(interval.a, size - 1);
int len = Math.min(interval.b - interval.a + 1, size);
int startIdx = Math.min(interval.a, size);
int len = Math.min(interval.b - interval.a + 1, size - startIdx);
// Note that we pass the int[] code points to the String constructor --
// this is supported, and the constructor will convert to UTF-16 internally.

View File

@ -67,7 +67,7 @@ public class RuntimeMetaData {
* omitted.</li>
* </ul>
*/
public static final String VERSION = "4.7.1";
public static final String VERSION = "4.7.2";
/**
* Gets the currently executing version of the ANTLR 4 runtime library.

View File

@ -21,7 +21,7 @@ Recognizer.ruleIndexMapCache = {};
Recognizer.prototype.checkVersion = function(toolVersion) {
var runtimeVersion = "4.7.1";
var runtimeVersion = "4.7.2";
if (runtimeVersion!==toolVersion) {
console.log("ANTLR runtime and generated code versions disagree: "+runtimeVersion+"!="+toolVersion);
}

View File

@ -1272,10 +1272,6 @@ ParserATNSimulator.prototype.closure_ = function(config, configs, closureBusy, c
var continueCollecting = collectPredicates && !(t instanceof ActionTransition);
var c = this.getEpsilonTarget(config, t, continueCollecting, depth === 0, fullCtx, treatEofAsEpsilon);
if (c!==null) {
if (!t.isEpsilon && closureBusy.add(c)!==c){
// avoid infinite recursion for EOF* and EOF+
continue;
}
var newDepth = depth;
if ( config.state instanceof RuleStopState) {
// target fell off end of rule; mark resulting c as having dipped into outer context
@ -1283,12 +1279,6 @@ ParserATNSimulator.prototype.closure_ = function(config, configs, closureBusy, c
// track how far we dip into outer context. Might
// come in handy and we avoid evaluating context dependent
// preds if this is > 0.
if (closureBusy.add(c)!==c) {
// avoid infinite recursion for right-recursive rules
continue;
}
if (this._dfa !== null && this._dfa.precedenceDfa) {
if (t.outermostPrecedenceReturn === this._dfa.atnStartState.ruleIndex) {
c.precedenceFilterSuppressed = true;
@ -1296,17 +1286,27 @@ ParserATNSimulator.prototype.closure_ = function(config, configs, closureBusy, c
}
c.reachesIntoOuterContext += 1;
if (closureBusy.add(c)!==c) {
// avoid infinite recursion for right-recursive rules
continue;
}
configs.dipsIntoOuterContext = true; // TODO: can remove? only care when we add to set per middle of this method
newDepth -= 1;
if (this.debug) {
console.log("dips into outer ctx: " + c);
}
} else if (t instanceof RuleTransition) {
} else {
if (!t.isEpsilon && closureBusy.add(c)!==c){
// avoid infinite recursion for EOF* and EOF+
continue;
}
if (t instanceof RuleTransition) {
// latch when newDepth goes negative - once we step out of the entry context we can't return
if (newDepth >= 0) {
newDepth += 1;
}
}
}
this.closureCheckingStopState(c, configs, closureBusy, continueCollecting, fullCtx, newDepth, treatEofAsEpsilon);
}
}

View File

@ -1,6 +1,6 @@
{
"name": "antlr4",
"version": "4.7.1",
"version": "4.7.2",
"description": "JavaScript runtime for ANTLR4",
"main": "src/antlr4/index.js",
"repository": "antlr/antlr4.git",
@ -11,7 +11,7 @@
"antlr4",
"grammar"
],
"license": "BSD",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/antlr/antlr4/issues"
},

View File

@ -2,12 +2,12 @@ from setuptools import setup
setup(
name='antlr4-python2-runtime',
version='4.7.1',
version='4.7.2',
url='http://www.antlr.org',
license='BSD',
packages=['antlr4', 'antlr4.atn', 'antlr4.dfa', 'antlr4.tree', 'antlr4.error', 'antlr4.xpath'],
package_dir={'': 'src'},
author='Eric Vergnaud, Terence Parr, Sam Harwell',
author_email='eric.vergnaud@wanadoo.fr',
description='ANTLR 4.7.1 runtime for Python 2.7.12'
description='ANTLR 4.7.2 runtime for Python 2.7.12'
)

View File

@ -269,36 +269,32 @@ class BufferedTokenStream(TokenStream):
def getSourceName(self):
return self.tokenSource.getSourceName()
def getText(self, interval=None):
def getText(self, start=None, stop=None):
"""
Get the text of all tokens in this buffer.
:param interval:
:type interval: antlr4.IntervalSet.Interval
:return: string
"""
self.lazyInit()
self.fill()
if interval is None:
interval = (0, len(self.tokens)-1)
start = interval[0]
if isinstance(start, Token):
start = start.tokenIndex
stop = interval[1]
elif start is None:
start = 0
if isinstance(stop, Token):
stop = stop.tokenIndex
if start is None or stop is None or start<0 or stop<0:
return ""
if stop >= len(self.tokens):
stop = len(self.tokens)-1
elif stop is None or stop >= len(self.tokens):
stop = len(self.tokens) - 1
if start < 0 or stop < 0 or stop<start:
return u""
with StringIO() as buf:
for i in range(start, stop+1):
for i in xrange(start, stop+1):
t = self.tokens[i]
if t.type==Token.EOF:
break
buf.write(t.text)
return buf.getvalue()
def fill(self):
"""
Get all tokens from lexer until EOF

View File

@ -24,12 +24,6 @@ class Interval(object):
def __iter__(self):
return iter(self.range)
def __getitem__(self, idx):
if idx == 0:
return self.start
elif idx == 1:
return self.stop
raise IndexError('Interval index out or range [{}]'.format(idx))
class IntervalSet(object):

View File

@ -30,7 +30,7 @@ class Recognizer(object):
return major, minor
def checkVersion(self, toolVersion):
runtimeVersion = "4.7.1"
runtimeVersion = "4.7.2"
rvmajor, rvminor = self.extractVersion(runtimeVersion)
tvmajor, tvminor = self.extractVersion(toolVersion)
if rvmajor!=tvmajor or rvminor!=tvminor:

View File

@ -88,6 +88,7 @@ class TokenStreamRewriter(object):
def delete(self, program_name, from_idx, to_idx):
if isinstance(from_idx, Token):
self.replace(program_name, from_idx.tokenIndex, to_idx.tokenIndex, "")
else:
self.replace(program_name, from_idx, to_idx, "")
def lastRewriteTokenIndex(self, program_name=DEFAULT_PROGRAM_NAME):
@ -100,25 +101,22 @@ class TokenStreamRewriter(object):
return self.programs.setdefault(program_name, [])
def getDefaultText(self):
return self.getText(self.DEFAULT_PROGRAM_NAME, Interval(0, len(self.tokens.tokens)))
return self.getText(self.DEFAULT_PROGRAM_NAME, 0, len(self.tokens.tokens) - 1)
def getText(self, program_name, interval):
def getText(self, program_name, start, stop):
"""
:type interval: Interval.Interval
:param program_name:
:param interval:
:return:
:return: the text in tokens[start, stop](closed interval)
"""
rewrites = self.programs.get(program_name)
start = interval.start
stop = interval.stop
# ensure start/end are in range
if stop > len(self.tokens.tokens) - 1: stop = len(self.tokens.tokens) - 1
if start < 0: start = 0
if stop > len(self.tokens.tokens) - 1:
stop = len(self.tokens.tokens) - 1
if start < 0:
start = 0
# if no instructions to execute
if not rewrites: return self.tokens.getText(interval)
if not rewrites: return self.tokens.getText(start, stop)
buf = StringIO()
indexToOp = self._reduceToSingleOperationPerIndex(rewrites)
i = start
@ -159,13 +157,12 @@ class TokenStreamRewriter(object):
rewrites[prevRop.instructionIndex] = None
continue
isDisjoint = any((prevRop.last_index < rop.index, prevRop.index > rop.last_index))
isSame = all((prevRop.index == rop.index, prevRop.last_index == rop.last_index))
if all((prevRop.text is None, rop.text is None, not isDisjoint)):
rewrites[prevRop.instructionIndex] = None
rop.index = min(prevRop.index, rop.index)
rop.last_index = min(prevRop.last_index, rop.last_index)
print('New rop {}'.format(rop))
elif not all((isDisjoint, isSame)):
elif (not(isDisjoint)):
raise ValueError("replace op boundaries of {} overlap with previous {}".format(rop, prevRop))
# Walk inserts before
@ -173,13 +170,13 @@ class TokenStreamRewriter(object):
if any((iop is None, not isinstance(iop, TokenStreamRewriter.InsertBeforeOp))):
continue
prevInserts = [op for op in rewrites[:i] if isinstance(op, TokenStreamRewriter.InsertBeforeOp)]
for i, prevIop in enumerate(prevInserts):
for prev_index, prevIop in enumerate(prevInserts):
if prevIop.index == iop.index and type(prevIop) is TokenStreamRewriter.InsertBeforeOp:
iop.text += prevIop.text
rewrites[i] = None
rewrites[prev_index] = None
elif prevIop.index == iop.index and type(prevIop) is TokenStreamRewriter.InsertAfterOp:
iop.text = prevIop.text + iop.text
rewrites[i] = None
rewrites[prev_index] = None
# look for replaces where iop.index is in range; error
prevReplaces = [op for op in rewrites[:i] if type(op) is TokenStreamRewriter.ReplaceOp]
for rop in prevReplaces:

View File

@ -1145,11 +1145,6 @@ class ParserATNSimulator(ATNSimulator):
continueCollecting = collectPredicates and not isinstance(t, ActionTransition)
c = self.getEpsilonTarget(config, t, continueCollecting, depth == 0, fullCtx, treatEofAsEpsilon)
if c is not None:
if not t.isEpsilon:
if c in closureBusy:
# avoid infinite recursion for EOF* and EOF+
continue
closureBusy.add(c)
newDepth = depth
if isinstance( config.state, RuleStopState):
# target fell off end of rule; mark resulting c as having dipped into outer context
@ -1158,20 +1153,25 @@ class ParserATNSimulator(ATNSimulator):
# come in handy and we avoid evaluating context dependent
# preds if this is > 0.
if c in closureBusy:
# avoid infinite recursion for right-recursive rules
continue
closureBusy.add(c)
if self._dfa is not None and self._dfa.precedenceDfa:
if t.outermostPrecedenceReturn == self._dfa.atnStartState.ruleIndex:
c.precedenceFilterSuppressed = True
c.reachesIntoOuterContext += 1
if c in closureBusy:
# avoid infinite recursion for right-recursive rules
continue
closureBusy.add(c)
configs.dipsIntoOuterContext = True # TODO: can remove? only care when we add to set per middle of this method
newDepth -= 1
if ParserATNSimulator.debug:
print("dips into outer ctx: " + str(c))
elif isinstance(t, RuleTransition):
else:
if not t.isEpsilon:
if c in closureBusy:
# avoid infinite recursion for EOF* and EOF+
continue
closureBusy.add(c)
if isinstance(t, RuleTransition):
# latch when newDepth goes negative - once we step out of the entry context we can't return
if newDepth >= 0:
newDepth += 1
@ -1603,17 +1603,15 @@ class ParserATNSimulator(ATNSimulator):
def reportAttemptingFullContext(self, dfa, conflictingAlts, configs, startIndex, stopIndex):
if ParserATNSimulator.debug or ParserATNSimulator.retry_debug:
interval = range(startIndex, stopIndex + 1)
print("reportAttemptingFullContext decision=" + str(dfa.decision) + ":" + str(configs) +
", input=" + self.parser.getTokenStream().getText(interval))
", input=" + self.parser.getTokenStream().getText(startIndex, stopIndex + 1))
if self.parser is not None:
self.parser.getErrorListenerDispatch().reportAttemptingFullContext(self.parser, dfa, startIndex, stopIndex, conflictingAlts, configs)
def reportContextSensitivity(self, dfa, prediction, configs, startIndex, stopIndex):
if ParserATNSimulator.debug or ParserATNSimulator.retry_debug:
interval = range(startIndex, stopIndex + 1)
print("reportContextSensitivity decision=" + str(dfa.decision) + ":" + str(configs) +
", input=" + self.parser.getTokenStream().getText(interval))
", input=" + self.parser.getTokenStream().getText(startIndex, stopIndex + 1))
if self.parser is not None:
self.parser.getErrorListenerDispatch().reportContextSensitivity(self.parser, dfa, startIndex, stopIndex, prediction, configs)
@ -1637,9 +1635,8 @@ class ParserATNSimulator(ATNSimulator):
# }
# i++;
# }
interval = range(startIndex, stopIndex + 1)
print("reportAmbiguity " + str(ambigAlts) + ":" + str(configs) +
", input=" + self.parser.getTokenStream().getText(interval))
", input=" + self.parser.getTokenStream().getText(startIndex, stopIndex + 1))
if self.parser is not None:
self.parser.getErrorListenerDispatch().reportAmbiguity(self.parser, dfa, startIndex, stopIndex, exact, ambigAlts, configs)

View File

@ -45,7 +45,7 @@ class DiagnosticErrorListener(ErrorListener):
buf.write(u": ambigAlts=")
buf.write(str_set(self.getConflictingAlts(ambigAlts, configs)))
buf.write(u", input='")
buf.write(recognizer.getTokenStream().getText((startIndex, stopIndex)))
buf.write(recognizer.getTokenStream().getText(startIndex, stopIndex))
buf.write(u"'")
recognizer.notifyErrorListeners(buf.getvalue())
@ -56,7 +56,7 @@ class DiagnosticErrorListener(ErrorListener):
buf.write(u"reportAttemptingFullContext d=")
buf.write(self.getDecisionDescription(recognizer, dfa))
buf.write(u", input='")
buf.write(recognizer.getTokenStream().getText((startIndex, stopIndex)))
buf.write(recognizer.getTokenStream().getText(startIndex, stopIndex))
buf.write(u"'")
recognizer.notifyErrorListeners(buf.getvalue())
@ -66,7 +66,7 @@ class DiagnosticErrorListener(ErrorListener):
buf.write(u"reportContextSensitivity d=")
buf.write(self.getDecisionDescription(recognizer, dfa))
buf.write(u", input='")
buf.write(recognizer.getTokenStream().getText((startIndex, stopIndex)))
buf.write(recognizer.getTokenStream().getText(startIndex, stopIndex))
buf.write(u"'")
recognizer.notifyErrorListeners(buf.getvalue())

Some files were not shown because too many files have changed in this diff Show More