Skip to content

Commit f231e15

Browse files
committed
Merge branch 'master' into error-prone
2 parents 41c70f6 + cd6de79 commit f231e15

File tree

2,649 files changed

+568717
-3680
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,649 files changed

+568717
-3680
lines changed

.bazelproject

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
directories:
2+
java
3+
javatests
4+
# Add the directories you want added as source here
5+
# By default, we've added your entire workspace ('.')
6+
cup
7+
docs
8+
jflex
9+
jflex-maven-plugin
10+
jflex-unicode-maven-plugin
11+
scripts
12+
testsuite
13+
third_party
14+
15+
targets:
16+
//java/...
17+
//javatests/...
18+
# Add targets that reach the source code that you want to resolve here
19+
//jflex/examples/...
20+
21+
additional_languages:
22+
# Uncomment any additional languages you want supported
23+
# android
24+
# dart
25+
# go
26+
# python
27+
# scala
28+
29+
test_sources:
30+
javatests
31+
src/test/java

.bazelrc

Lines changed: 381 additions & 0 deletions
Large diffs are not rendered by default.

.travis.bazelrc renamed to .ci.bazelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import %workspace%/.bazelrc
2+
13
# This is from Bazel's former travis setup, to avoid blowing up the RAM usage.
24
startup --host_jvm_args=-Xms2000m
35
startup --host_jvm_args=-Xmx3000m
4-
test --ram_utilization_factor=10
56

67
# This is so we understand failures better
78
build --verbose_failures

.cirrus.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright 2018 Google LLC.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
5+
build_task:
6+
name: Bazel build and test
7+
container:
8+
image: l.gcr.io/google/bazel:1.1.0
9+
bazel_version_script:
10+
- bazel --bazelrc=.ci.bazelrc info --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST release
11+
build_script:
12+
- bazel --bazelrc=.ci.bazelrc build --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST //jflex
13+
build_all_script:
14+
- bazel --bazelrc=.ci.bazelrc build --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST //...
15+
test_script:
16+
- bazel --bazelrc=.ci.bazelrc test --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST //jflex/...
17+
regression_tests_script:
18+
- bazel --bazelrc=.ci.bazelrc test --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST //javatests/jflex/testcase/...
19+
test_all_script:
20+
- bazel --bazelrc=.ci.bazelrc test --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST //...
21+
codestyle_task:
22+
name: Check code style
23+
container:
24+
image: openjdk:8-jdk
25+
check_java_format_script: scripts/test-java-format.sh
26+
check_bzl_format_script: scripts/test-bzl-format.sh
27+
buildtools_cache:
28+
folder: buildtools
29+
30+
steps:
31+
- restore_cache:
32+
keys:
33+
- source-v1-{{ .Branch }}-{{ .Revision }}
34+
- source-v1-{{ .Branch }}-
35+
- source-v1-
36+
- checkout
37+
- git_cache:
38+
key: source-v1-{{ .Branch }}-{{ .Revision }}
39+
paths:
40+
- ".git"

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@
77
**/target
88
dependency-reduced-pom.xml
99
bazel-*
10+
buildtools
11+
1012
# Generated by ant
11-
jflex/build
13+
/jflex/build
1214

1315
# IntelliJ
1416
*.iml
1517
*.ipr
1618
*.iws
1719
.idea
20+
.ijwb
1821

1922
# Eclipse project
2023
.project

.travis.yml

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,20 @@ git:
1212
language: java
1313

1414
jdk:
15-
- openjdk9
15+
- openjdk11
1616

1717
matrix:
1818
include:
19-
- name: "🛂 Check Java format"
20-
script: scripts/test-java-format.sh
21-
language: generic
19+
# Travis fails with: # callsort format
20+
# - name: "🛂 Check Java format"
21+
# script: scripts/test-java-format.sh
22+
# language: generic
2223
- name: "🔨 Maven (compile, unit test, uberjar, ubersrcs, site)"
2324
script:
2425
- scripts/test-unit.sh
2526
- scripts/mvn-site.sh
2627
- scripts/mvn-aggregate-srcs.sh
28+
- scripts/preparare-deploy-source-code.sh
2729
after_success: scripts/send-code-coverage.sh
2830
env:
2931
- PUBLISH_SOURCES=true
@@ -34,33 +36,9 @@ matrix:
3436
- scripts/test-regression.sh
3537
- name: "😎 Examples (mvn, ant, make)"
3638
script: scripts/test-examples.sh
37-
- name: "👴 Examples (mvn, ant, make) — JDK7"
39+
- name: "👴 Examples (mvn, ant, make) — JDK8"
3840
script: scripts/test-examples.sh
39-
jdk: openjdk7
40-
- name: "💚 Bazel (Examples and documentation)"
41-
language: generic
42-
script:
43-
- scripts/mvn-install-fastbuild.sh
44-
- scripts/bazel.sh
45-
# Prerequisites for Bazel
46-
addons:
47-
apt:
48-
sources:
49-
- ubuntu-toolchain-r-test
50-
packages:
51-
- curl
52-
- pkg-config
53-
- zip
54-
- g++
55-
- zlib1g-dev
56-
- unzip
57-
- python
58-
before_install:
59-
- mkdir -p tools
60-
- curl -L https://github.com/bazelbuild/bazel/releases/download/0.17.2/bazel_0.17.2-linux-x86_64.deb -o tools/bazel-0.17.2.deb
61-
install:
62-
- sudo apt-get install ./tools/bazel-0.17.2.deb
63-
sudo: true
41+
jdk: openjdk8
6442
- name: "📄 Documentation"
6543
language: generic
6644
install: true
@@ -101,6 +79,7 @@ cache:
10179
timeout: 86400 # 24 hours
10280
directories:
10381
- $HOME/.m2
82+
- $HOME/.ant
10483
# All our Bazel build artifacts
10584
- $HOME/__bazel_output_base__/
10685
# Items fetched from repositories
@@ -133,4 +112,4 @@ deploy:
133112
- travis
134113
condition:
135114
- $PUBLISH_SOURCES
136-
script: ./scripts/deploy-source-code.sh
115+
script: scripts/deploy-aggregated-sources.sh

LICENSE.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,31 @@ JFlex - Copying, Warranty & License
22
===================================
33

44
JFlex is free software, since version 1.5 published under the terms of this
5-
3-clause BSD-style license.
5+
[3-clause BSD-style license](https://opensource.org/licenses/BSD-3-Clause).
66

77
There is absolutely NO WARRANTY for JFlex, its code and its documentation.
88

99

10-
11-
Copyright (c) Gerwin Klein, Steve Rowe, Régis Decamps.
10+
Copyright (c) Gerwin Klein, Steve Rowe, Régis Décamps, Google LLC.
1211
All rights reserved.
1312

14-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
15-
16-
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
17-
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
18-
* Neither the names of the authors nor the names of JFlex contributors may be used to endorse or promote products derived from this software without specific prior written permission.
19-
20-
21-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13+
Redistribution and use in source and binary forms, with or without modification, are permitted
14+
provided that the following conditions are met:
15+
16+
* Redistributions of source code must retain the above copyright notice, this list of conditions
17+
and the following disclaimer.
18+
* Redistributions in binary form must reproduce the above copyright notice, this list of
19+
conditions and the following disclaimer in the documentation and/or other materials provided
20+
with the distribution.
21+
* Neither the names of the authors nor the names of JFlex contributors may be used to endorse
22+
or promote products derived from this software without specific prior written permission.
23+
24+
25+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
26+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
27+
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
28+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
31+
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
32+
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<a href="https://travis-ci.org/jflex-de/jflex">
22
<img alt="Build status" src="https://travis-ci.org/jflex-de/jflex.svg?branch=master" height="20">
33
</a>
4+
<a href="https://cirrus-ci.com/github/jflex-de/jflex/master">
5+
<img alt="Bazel build status" src="https://api.cirrus-ci.com/github/jflex-de/jflex.svg" height="20">
6+
</a>
47
<a href="https://search.maven.org/artifact/de.jflex/jflex/">
58
<img alt="Maven central" src="https://img.shields.io/maven-central/v/de.jflex/jflex.svg" height="20">
69
</a>
@@ -12,34 +15,22 @@
1215
JFlex takes as input a specification with a set of regular expressions and corresponding actions.
1316
It generates Java source of a lexer that reads input, matches the input against the regular
1417
expressions in the spec file, and runs the corresponding action if a regular expression
15-
matched. Lexers usually are the first front-end step in compilers, matching keywords, comments,
18+
matched. Lexers usually are the first front-end step in compilers, matching keywords, comments,
1619
operators, etc, and generating an input token stream for parsers.
1720

1821
JFlex lexers are based on deterministic finite automata (DFAs).
1922
They are fast, without expensive backtracking.
2023

2124

22-
## Modules
23-
24-
The top level directory of the JFLex git repository contains:
25-
26-
* **cup** A copy of the CUP runtime
27-
* **cup-maven-plugin** A simple Maven plugin to generate a parser with CUP.
28-
* **docs** the Markdown sources for the user manual
29-
* **jflex** JFlex, the scanner/lexer generator for Java
30-
* **jflex-maven-plugin** the JFlex maven plugin, that helps to integrate JFlex in your project
31-
* **jflex-unicode-plugin** the JFlex unicode maven plugin, used for compiling JFlex
32-
* **testsuite** the regression test suite for JFlex,
33-
* **third_party** third-party librairies used by examples of the [Bazel build system][bazel]
34-
35-
3625
## Usage
3726

3827
For documentation and more information see the [JFlex documentation][jflex-doc]
3928
and the [wiki][wiki].
4029

4130
### Usage with Maven
4231

32+
You need JDK 8 or later.
33+
4334
1. Place grammar files in `src/main/flex/` directory.
4435

4536
2. Extend the project [POM build section][pom-build] with the `maven-jflex-plugin`
@@ -49,7 +40,7 @@ and the [wiki][wiki].
4940
<plugin>
5041
<groupId>de.jflex</groupId>
5142
<artifactId>jflex-maven-plugin</artifactId>
52-
<version>1.7.0</version>
43+
<version>1.8.0</version>
5344
<executions>
5445
<execution>
5546
<goals>
@@ -67,6 +58,8 @@ and the [wiki][wiki].
6758

6859
### Usage with ant
6960

61+
You need JDK 8 or later.
62+
7063
1. Define ant task
7164
```xml
7265
<taskdef classname="jflex.anttask.JFlexTask" name="jflex"
@@ -93,14 +86,16 @@ jflex(
9386

9487
### Usage in CLI
9588

89+
You need JDK 8 or later.
90+
9691
You can also use JFlex directly from the command line:
9792
```
9893
jflex/bin/jflex src/grammar/parser.flex
9994
```
10095

10196
Or:
10297
```
103-
java -jar jflex-full-1.7.0.jar -d output src/grammar/parser.flex
98+
java -jar jflex-full-1.8.0.jar -d output src/grammar/parser.flex
10499
```
105100

106101
### Other build tools
@@ -113,8 +108,26 @@ See [Build tool plugins](https://github.com/jflex-de/jflex/wiki/Build-tool-integ
113108
Have a look at the sample project: [simple][example-simple] and other [examples].
114109

115110

111+
## Modules
112+
113+
The top level directory of the JFLex git repository contains:
114+
115+
* **cup** A copy of the CUP runtime
116+
* **cup-maven-plugin** A simple Maven plugin to generate a parser with CUP.
117+
* **docs** the Markdown sources for the user manual
118+
* **java** Java sources [WIP, Bazel]
119+
* **javatests** Java sources of test [WIP, Bazel]
120+
* **jflex** JFlex, the scanner/lexer generator for Java
121+
* **jflex-maven-plugin** the JFlex maven plugin, that helps to integrate JFlex in your project
122+
* **jflex-unicode-plugin** the JFlex unicode maven plugin, used for compiling JFlex
123+
* **testsuite** the regression test suite for JFlex,
124+
* **third_party** third-party librairies used by examples of the [Bazel build system][bazel]
125+
126+
116127
## Build from source
117128

129+
You need JDK 8 or later and Maven 3.5.2 or later.
130+
118131
```
119132
./mvnw install
120133
```

0 commit comments

Comments
 (0)