Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
parrt authored Dec 17, 2018
2 parents 9321b6b + b3f00ca commit 96890a3
Show file tree
Hide file tree
Showing 78 changed files with 626 additions and 523 deletions.
27 changes: 16 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 2 additions & 0 deletions .travis/run-tests-cpp.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions .travis/run-tests-csharp.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

set -euo pipefail

mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=csharp.* test
4 changes: 3 additions & 1 deletion .travis/run-tests-dotnet.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 2 additions & 0 deletions .travis/run-tests-go.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

set -euo pipefail

mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=go.* test
2 changes: 2 additions & 0 deletions .travis/run-tests-java.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -euo pipefail

mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=java.* test
cd ../tool-testsuite
mvn test
2 changes: 2 additions & 0 deletions .travis/run-tests-javascript.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

set -euo pipefail

mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=node.* test
2 changes: 2 additions & 0 deletions .travis/run-tests-python2.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

set -euo pipefail

mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=python2.* test
2 changes: 2 additions & 0 deletions .travis/run-tests-python3.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

set -euo pipefail

mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=python3.* test
11 changes: 6 additions & 5 deletions .travis/run-tests-swift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion contributors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ YYYY/MM/DD, github id, Full name, email
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
Expand All @@ -202,6 +203,10 @@ YYYY/MM/DD, github id, Full name, email
2018/06/16, EternalPhane, Zongyuan Zuo, eternalphane@gmail.com
2018/07/03, jgoppert, James Goppert, james.goppert@gmail.com
2018/07/27, Maksim Novikov, mnovikov.work@gmail.com
2018/07/31 Lucas Henrqiue, lucashenrique580@gmail.com
2018/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
12 changes: 8 additions & 4 deletions doc/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand All @@ -39,9 +39,9 @@ $ alias grun='java -Xmx500M -cp "/usr/local/lib/antlr-4.7.1-complete.jar:$CLASSP
(*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:
```
Expand All @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions doc/swift-target.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@
<filesets>
<fileset>
<directory>runtime/Swift/.build</directory>
</fileset>
<fileset>
<directory>runtime/Swift/Tests/Antlr4Tests/gen</directory>
</fileset>
</filesets>
Expand Down
7 changes: 6 additions & 1 deletion runtime-testsuite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<dependency>
<groupId>org.antlr</groupId>
<artifactId>ST4</artifactId>
<version>4.1-SNAPSHOT</version>
<version>4.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -92,6 +92,11 @@
</resource>
<resource>
<directory>../runtime</directory>
<excludes>
<exclude>**/.build/**</exclude>
<exclude>**/target/**</exclude>
<exclude>Swift/*.xcodeproj/**</exclude>
</excludes>
</resource>
</resources>
<plugins>
Expand Down
8 changes: 3 additions & 5 deletions runtime-testsuite/processors/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
Loading

0 comments on commit 96890a3

Please sign in to comment.