Skip to content

Commit

Permalink
Merge branch 'master' into error-prone
Browse files Browse the repository at this point in the history
  • Loading branch information
regisd committed Nov 23, 2019
2 parents 41c70f6 + cd6de79 commit e83a9dc
Show file tree
Hide file tree
Showing 2,649 changed files with 568,717 additions and 3,680 deletions.
31 changes: 31 additions & 0 deletions .bazelproject
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
directories:
java
javatests
# Add the directories you want added as source here
# By default, we've added your entire workspace ('.')
cup
docs
jflex
jflex-maven-plugin
jflex-unicode-maven-plugin
scripts
testsuite
third_party

targets:
//java/...
//javatests/...
# Add targets that reach the source code that you want to resolve here
//jflex/examples/...

additional_languages:
# Uncomment any additional languages you want supported
# android
# dart
# go
# python
# scala

test_sources:
javatests
src/test/java
381 changes: 381 additions & 0 deletions .bazelrc

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion .travis.bazelrc → .ci.bazelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import %workspace%/.bazelrc

# This is from Bazel's former travis setup, to avoid blowing up the RAM usage.
startup --host_jvm_args=-Xms2000m
startup --host_jvm_args=-Xmx3000m
test --ram_utilization_factor=10

# This is so we understand failures better
build --verbose_failures
Expand Down
40 changes: 40 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2018 Google LLC.
# SPDX-License-Identifier: Apache-2.0


build_task:
name: Bazel build and test
container:
image: l.gcr.io/google/bazel:1.1.0
bazel_version_script:
- bazel --bazelrc=.ci.bazelrc info --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST release
build_script:
- bazel --bazelrc=.ci.bazelrc build --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST //jflex
build_all_script:
- bazel --bazelrc=.ci.bazelrc build --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST //...
test_script:
- bazel --bazelrc=.ci.bazelrc test --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST //jflex/...
regression_tests_script:
- bazel --bazelrc=.ci.bazelrc test --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST //javatests/jflex/testcase/...
test_all_script:
- bazel --bazelrc=.ci.bazelrc test --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST //...
codestyle_task:
name: Check code style
container:
image: openjdk:8-jdk
check_java_format_script: scripts/test-java-format.sh
check_bzl_format_script: scripts/test-bzl-format.sh
buildtools_cache:
folder: buildtools

steps:
- restore_cache:
keys:
- source-v1-{{ .Branch }}-{{ .Revision }}
- source-v1-{{ .Branch }}-
- source-v1-
- checkout
- git_cache:
key: source-v1-{{ .Branch }}-{{ .Revision }}
paths:
- ".git"
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
**/target
dependency-reduced-pom.xml
bazel-*
buildtools

# Generated by ant
jflex/build
/jflex/build

# IntelliJ
*.iml
*.ipr
*.iws
.idea
.ijwb

# Eclipse project
.project
Expand Down
41 changes: 10 additions & 31 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@ git:
language: java

jdk:
- openjdk9
- openjdk11

matrix:
include:
- name: "🛂 Check Java format"
script: scripts/test-java-format.sh
language: generic
# Travis fails with: # callsort format
# - name: "🛂 Check Java format"
# script: scripts/test-java-format.sh
# language: generic
- name: "🔨 Maven (compile, unit test, uberjar, ubersrcs, site)"
script:
- scripts/test-unit.sh
- scripts/mvn-site.sh
- scripts/mvn-aggregate-srcs.sh
- scripts/preparare-deploy-source-code.sh
after_success: scripts/send-code-coverage.sh
env:
- PUBLISH_SOURCES=true
Expand All @@ -34,33 +36,9 @@ matrix:
- scripts/test-regression.sh
- name: "😎 Examples (mvn, ant, make)"
script: scripts/test-examples.sh
- name: "👴 Examples (mvn, ant, make) — JDK7"
- name: "👴 Examples (mvn, ant, make) — JDK8"
script: scripts/test-examples.sh
jdk: openjdk7
- name: "💚 Bazel (Examples and documentation)"
language: generic
script:
- scripts/mvn-install-fastbuild.sh
- scripts/bazel.sh
# Prerequisites for Bazel
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- curl
- pkg-config
- zip
- g++
- zlib1g-dev
- unzip
- python
before_install:
- mkdir -p tools
- 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
install:
- sudo apt-get install ./tools/bazel-0.17.2.deb
sudo: true
jdk: openjdk8
- name: "📄 Documentation"
language: generic
install: true
Expand Down Expand Up @@ -101,6 +79,7 @@ cache:
timeout: 86400 # 24 hours
directories:
- $HOME/.m2
- $HOME/.ant
# All our Bazel build artifacts
- $HOME/__bazel_output_base__/
# Items fetched from repositories
Expand Down Expand Up @@ -133,4 +112,4 @@ deploy:
- travis
condition:
- $PUBLISH_SOURCES
script: ./scripts/deploy-source-code.sh
script: scripts/deploy-aggregated-sources.sh
33 changes: 22 additions & 11 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,31 @@ JFlex - Copying, Warranty & License
===================================

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

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



Copyright (c) Gerwin Klein, Steve Rowe, Régis Decamps.
Copyright (c) Gerwin Klein, Steve Rowe, Régis Décamps, Google LLC.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* 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.
* 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.


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.
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.
* 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.
* 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.


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

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


## Modules

The top level directory of the JFLex git repository contains:

* **cup** A copy of the CUP runtime
* **cup-maven-plugin** A simple Maven plugin to generate a parser with CUP.
* **docs** the Markdown sources for the user manual
* **jflex** JFlex, the scanner/lexer generator for Java
* **jflex-maven-plugin** the JFlex maven plugin, that helps to integrate JFlex in your project
* **jflex-unicode-plugin** the JFlex unicode maven plugin, used for compiling JFlex
* **testsuite** the regression test suite for JFlex,
* **third_party** third-party librairies used by examples of the [Bazel build system][bazel]


## Usage

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

### Usage with Maven

You need JDK 8 or later.

1. Place grammar files in `src/main/flex/` directory.

2. Extend the project [POM build section][pom-build] with the `maven-jflex-plugin`
Expand All @@ -49,7 +40,7 @@ and the [wiki][wiki].
<plugin>
<groupId>de.jflex</groupId>
<artifactId>jflex-maven-plugin</artifactId>
<version>1.7.0</version>
<version>1.8.0</version>
<executions>
<execution>
<goals>
Expand All @@ -67,6 +58,8 @@ and the [wiki][wiki].

### Usage with ant

You need JDK 8 or later.

1. Define ant task
```xml
<taskdef classname="jflex.anttask.JFlexTask" name="jflex"
Expand All @@ -93,14 +86,16 @@ jflex(

### Usage in CLI

You need JDK 8 or later.

You can also use JFlex directly from the command line:
```
jflex/bin/jflex src/grammar/parser.flex
```

Or:
```
java -jar jflex-full-1.7.0.jar -d output src/grammar/parser.flex
java -jar jflex-full-1.8.0.jar -d output src/grammar/parser.flex
```

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


## Modules

The top level directory of the JFLex git repository contains:

* **cup** A copy of the CUP runtime
* **cup-maven-plugin** A simple Maven plugin to generate a parser with CUP.
* **docs** the Markdown sources for the user manual
* **java** Java sources [WIP, Bazel]
* **javatests** Java sources of test [WIP, Bazel]
* **jflex** JFlex, the scanner/lexer generator for Java
* **jflex-maven-plugin** the JFlex maven plugin, that helps to integrate JFlex in your project
* **jflex-unicode-plugin** the JFlex unicode maven plugin, used for compiling JFlex
* **testsuite** the regression test suite for JFlex,
* **third_party** third-party librairies used by examples of the [Bazel build system][bazel]


## Build from source

You need JDK 8 or later and Maven 3.5.2 or later.

```
./mvnw install
```
Expand Down
Loading

0 comments on commit e83a9dc

Please sign in to comment.