From 7bb1564c7bb1f7f1e42412e8a93ebf8732e137bf Mon Sep 17 00:00:00 2001 From: mmazas Date: Tue, 11 Feb 2025 17:38:06 +0100 Subject: [PATCH] Structure, readme. Signed-off-by: mmazas --- .github/workflows/maven.yml | 4 +- LICENSE | 4 +- README.md | 337 +++++++++++++----- pom.xml | 37 +- rulesets/java/maven-pmd-plugin-default.xml | 4 +- tests/cpp/TestTokenManagerUsesParser/pom.xml | 4 +- tests/cpp/TestTokenManagerUsesParser2/pom.xml | 4 +- tests/cpp/build.xml | 4 +- tests/cpp/exceptions/build.xml | 4 +- tests/cpp/exceptions/pom.xml | 4 +- tests/cpp/imports/build.xml | 4 +- tests/cpp/imports/pom.xml | 4 +- tests/cpp/javaFileGeneration/build.xml | 4 +- tests/cpp/javaFileGeneration/pom.xml | 4 +- tests/cpp/javaFiles/build.xml | 4 +- tests/cpp/javaFiles/pom.xml | 4 +- tests/cpp/javacodeLA/build.xml | 4 +- tests/cpp/javacodeLA/pom.xml | 4 +- tests/cpp/lineNumbers/build.xml | 4 +- tests/cpp/lineNumbers/pom.xml | 4 +- tests/cpp/lom/build.xml | 4 +- tests/cpp/lom/pom.xml | 4 +- tests/cpp/newToken/build.xml | 4 +- tests/cpp/newToken/pom.xml | 4 +- tests/cpp/pom.xml | 4 +- tests/java/exceptions/pom.xml | 4 +- tests/java/pom.xml | 4 +- tests/pom.xml | 4 +- 28 files changed, 310 insertions(+), 168 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index ff408b6a..5dd7b06f 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,8 +1,8 @@ # This workflow will build a Java project with Maven # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven # -# Copyright (c) 2020-2024, Sreeni Viswanadha . -# Copyright (c) 2024, Marc Mazas . +# Copyright (c) 2020-2025, Sreeni Viswanadha . +# Copyright (c) 2024-2025, Marc Mazas . # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/LICENSE b/LICENSE index 54dcded3..6a307f9e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,8 +1,8 @@ BSD 3-Clause License Copyright (c) 2020-2021, javacc -Copyright (c) 2020-2024, Sreeni Viswanadha . -Copyright (c) 2024, Marc Mazas . +Copyright (c) 2020-2025, Sreeni Viswanadha . +Copyright (c) 2024-2025, Marc Mazas . All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.md b/README.md index 441f9787..5364140c 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,7 @@ - +# JavaCC -# JavaCC - -[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.javacc.core/javacc/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.javacc.core/javacc) -[![Javadocs](https://www.javadoc.io/badge/org.javacc.core/javacc.svg)](https://www.javadoc.io/doc/org.javacc.core/javacc) +[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org/javacc/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org/javacc) +[![Javadocs](https://www.javadoc.io/badge/org/javacc.svg)](https://www.javadoc.io/doc/org/javacc) Java Compiler Compiler (JavaCC) is the most popular parser generator for use with Java applications. @@ -20,27 +13,62 @@ All you need to run a JavaCC parser, once generated, is a Java Runtime Environme This README is meant as a brief overview of the core features and how to set things up to get yourself started with JavaCC. For a fully detailed documentation, please see [https://javacc.org/](https://javacc.org/). -## Contents +## Contents - [Introduction](#introduction) - * [Features](#features) - * [Example](#example) - * [Tutorials](docs/tutorials/index.md) - * [FAQ](docs/faq.md) + * [Features](#features) + * [An example](#an-example) + * [Tutorials](docs/tutorials/index.md) + * [FAQ](docs/faq.md) - [Getting Started](#getting-started) - * [Download & Installation](#download) - * [Building JavaCC from Source](#building-from-source) - * [Developing JavaCC](#developing) + * [From the command line](#use-javacc-from-the-command-line) + * [Within an IDE](#use-javacc-within-an-ide) + * [Rebuilding JavaCC](#rebuilding-javacc) - [Community](#community) - * [Support](#support) - * [Documentation](#documentation) - * [Resources](#resources) - * [Powered by JavaCC](#powered-by) + * [Support](#support) + * [Documentation](#documentation) + * [Resources](#resources) + * [Powered by JavaCC](#powered-by-javacc) - [License](#license) -## Introduction +## Introduction + +### Features + +* JavaCC generates top-down ([recursive descent](https://en.wikipedia.org/wiki/Recursive_descent_parser)) parsers as opposed to bottom-up parsers generated by [YACC](https://en.wikipedia.org/wiki/Yacc)-like tools. This allows the use of more general grammars, although [left-recursion](https://en.wikipedia.org/wiki/Left_recursion) is disallowed. Top-down parsers have a number of other advantages (besides more general grammars) such as being easier to debug, having the ability to parse to any [non-terminal](https://en.wikipedia.org/wiki/Terminal_and_nonterminal_symbols) in the grammar, and also having the ability to pass values (attributes) both up and down the parse tree during parsing. + +* By default, JavaCC generates an `LL(1)` parser. However, there may be portions of grammar that are not `LL(1)`. JavaCC offers the capabilities of syntactic and semantic lookahead to resolve shift-shift ambiguities locally at these points. For example, the parser is `LL(k)` only at such points, but remains `LL(1)` everywhere else for better performance. Shift-reduce and reduce-reduce conflicts are not an issue for top-down parsers. + +* JavaCC generates parsers that are 100% pure Java, so there is no runtime dependency on JavaCC and no special porting effort required to run on different machine platforms. + +* JavaCC allows [extended BNF](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) specifications - such as `(A)*`, `(A)+` etc - within the lexical and the grammar specifications. Extended BNF relieves the need for left-recursion to some extent. In fact, extended BNF is often easier to read as in `A ::= y(x)*` versus `A ::= Ax|y`. + +* The lexical specifications (such as regular expressions, strings) and the grammar specifications (the BNF) are both written together in the same file. It makes grammars easier to read since it is possible to use regular expressions inline in the grammar specification, and also easier to maintain. + +* The [lexical analyzer](https://en.wikipedia.org/wiki/Lexical_analysis) of JavaCC can handle full Unicode input, and lexical specifications may also include any Unicode character. This facilitates descriptions of language elements such as Java identifiers that allow certain Unicode characters (that are not ASCII), but not others. + +* JavaCC offers [Lex](https://en.wikipedia.org/wiki/Lex_(software))-like lexical state and lexical action capabilities. Specific aspects in JavaCC that are superior to other tools are the first class status it offers concepts such as `TOKEN`, `MORE`, `SKIP` and state changes. This allows cleaner specifications as well as better error and warning messages from JavaCC. + +* Tokens that are defined as *special tokens* in the lexical specification are ignored during parsing, but these tokens are available for processing by the tools. A useful application of this is in the processing of comments. + +* Lexical specifications can define tokens not to be case-sensitive either at the global level for the entire lexical specification, or on an individual lexical specification basis. + +* JavaCC comes with JJTree, an extremely powerful tree building pre-processor. + +* JavaCC also includes JJDoc, a tool that converts grammar files to documentation files, optionally in HTML. + +* JavaCC offers many options to customize its behavior and the behavior of the generated parsers. Examples of such options are the kinds of Unicode processing to perform on the input stream, the number of tokens of ambiguity checking to perform etc. + +* JavaCC error reporting is among the best in parser generators. JavaCC generated parsers are able to clearly point out the location of parse errors with complete diagnostic information. + +* Using options `DEBUG_PARSER`, `DEBUG_LOOKAHEAD`, and `DEBUG_TOKEN_MANAGER`, users can get in-depth analysis of the parsing and the token processing steps. + +* The JavaCC release includes a wide range of examples including Java and HTML grammars. The examples, along with their documentation, are a great way to get acquainted with JavaCC. + + +## Introduction -### Features +### Features * JavaCC generates top-down ([recursive descent](https://en.wikipedia.org/wiki/Recursive_descent_parser)) parsers as opposed to bottom-up parsers generated by [YACC](https://en.wikipedia.org/wiki/Yacc)-like tools. This allows the use of more general grammars, although [left-recursion](https://en.wikipedia.org/wiki/Left_recursion) is disallowed. Top-down parsers have a number of other advantages (besides more general grammars) such as being easier to debug, having the ability to parse to any [non-terminal](https://en.wikipedia.org/wiki/Terminal_and_nonterminal_symbols) in the grammar, and also having the ability to pass values (attributes) both up and down the parse tree during parsing. @@ -73,19 +101,20 @@ This README is meant as a brief overview of the core features and how to set thi * The JavaCC release includes a wide range of examples including Java and HTML grammars. The examples, along with their documentation, are a great way to get acquainted with JavaCC. -### Example +### An example -This example recognizes matching braces followed by zero or more line terminators and then an end of file. +The following JavaCC grammar example recognizes matching braces followed by zero or more line terminators and then an end of file. Examples of legal strings in this grammar are: -`{}`, `{{{{{}}}}}` // ... etc +`{}`, `{% raw %}{{{{{}}}}}{% endraw %}` // ... etc Examples of illegal strings are: -`{}{}`, `}{}}`, `{ }`, `{x}` // ... etc +`{}{}`, `}{}}`, `{ }`, `{x}` // ... etc + +##### Its grammar -#### Grammar ```java PARSER_BEGIN(Example) @@ -117,12 +146,17 @@ void MatchedBraces() : } ``` -#### Output +##### Some executions and outputs + +###### {{}} gives no error + ```java $ java Example {{}} ``` +###### {x gives a Lexical error + ```java $ java Example {x @@ -135,6 +169,8 @@ TokenMgrError: Lexical error at line 1, column 2. Encountered: "x" (120), after at Example.main(Example.java:6) ``` +###### {}} gives a ParseException + ```java $ java Example {}} @@ -149,73 +185,94 @@ Was expecting one of: at Example.main(Example.java:6) ``` -## Getting Started +## Versions -Follow the steps here to get started with JavaCC. +The RECOMMENDED version is version **8**: it separates the parser (the core) from the generators (for the different languages); development and maintenance effort will be mainly on this version. +This version lies on different Git repositories / java & maven projects / jars: +- the umbrella [javacc-8](https://github.com/javacc/javacc-8) +- the [core](https://github.com/javacc/javacc-8-core) +- the generators: + - [java](https://github.com/javacc/javacc-8-java) + - [C++](https://github.com/javacc/javacc-8-cpp) + - [C#](https://github.com/javacc/javacc-8-csharp) -This guide will walk you through locally building the project, running an existing example, and setup to start developing and testing your own JavaCC application. +The previous versions (4, 5, 6, 7) are widely spread; effort to migrate to version 8 should be minimum. +Their last version lies on a single Git repository / java & maven project / jar: +- [javacc](https://github.com/javacc/javacc) -### Download & Installation +Differences between v8 versus v7: very small at the grammar level, more important at the generated sources level: +- the javacc/jjtree grammar part is the same +- most of javacc/jjtree options should be the same, but some may be removed and others appear in v8 +- the java grammar part should be nearly the same (may be some java 7 & java 8 features will appear in v8 and not in v7); in the future java 11..17..21.. features would appear only in v8) +- the C++ / C# grammar parts may be somewhat different +- some generated files are not much different, others are -JavaCC 7.0.9 is our latest stable release. +If you read this README.md, you should be under the v8 code. -* JavaCC 7.0.9 - ([Source (zip)](https://github.com/javacc/javacc/archive/javacc-7.0.9.zip), [Source (tar.gz)](https://github.com/javacc/javacc/archive/javacc-7.0.9.tar.gz), [Binaries](https://repo1.maven.org/maven2/net/java/dev/javacc/javacc/7.0.9/javacc-7.0.9.jar), [Javadocs](https://repo1.maven.org/maven2/net/java/dev/javacc/javacc/7.0.9/javacc-7.0.9-javadoc.jar), [Release Notes](docs/release-notes.md#javacc-7.0.9)) +## Getting Started -All JavaCC releases are available via [GitHub](https://github.com/javacc/javacc/releases) and [Maven](https://mvnrepository.com/artifact/net.java.dev.javacc/javacc) including checksums and cryptographic signatures. +You can use JavaCC either from the command line or through an IDE. -For all previous releases, please see [stable releases](docs/downloads.md). +### Use JavaCC from the command line -The GitHub 8.0 branch contains the next generation of JavaCC that splits the frontend -- the JavaCC parser -- from the backends -- the code generator targeted for Java, C++ &and C# --. Status of JavaCC is experimental and not production ready. +#### Download -#### Installation +Download the latest stable release (at least the binaries and the sources) in a so called download directory: -To install JavaCC, navigate to the download directory and type: +##### Version 8 -``` -$ unzip javacc-7.0.9.zip -or -$ tar xvf javacc-7.0.9.tar.gz -``` +Download the core and the generator(s) you are going to use: -Then place the binary `javacc-7.0.9.jar` in a new `target/` folder, and rename to `javacc.jar`. +* JavaCC Core 8.0.1 - [Binaries](https://repo1.maven.org/maven2/org/javacc/core/8.0.1/core-8.0.1.jar), [Source (zip)](https://github.com/javacc/javacc-8-core/archive/core-8.0.1.zip), [Source (tar.gz)](https://github.com/javacc/javacc-8-core/archive/core-8.0.1.tar.gz), [Javadocs](https://repo1.maven.org/maven2/org/javacc/core/8.0.1/core-8.0.1-javadoc.jar) -Once you have completed installation add the `scripts/` directory in the JavaCC installation to your `PATH`. The JavaCC, JJTree, and JJDoc invocation scripts/executables reside in this directory. +* JavaCC C++ 8.0.1 - [Binaries](https://repo1.maven.org/maven2/org/javacc/generator/cpp/8.0.1/cpp-8.0.1.jar), [Source (zip)](https://github.com/javacc/javacc-8-cpp/archive/cpp-8.0.1.zip), [Source (tar.gz)](https://github.com/javacc/javacc-8-cpp/archive/cpp-8.0.1.tar.gz), [Javadocs](https://repo1.maven.org/maven2/org/javacc/generator/cpp/8.0.1/cpp-8.0.1-javadoc.jar) -On UNIX based systems, the scripts may not be executable immediately. This can be solved by using the command from the `javacc-7.0.9/` directory: +* JavaCC C# 8.0.1 - [Binaries](https://repo1.maven.org/maven2/org/javacc/generator/csharp/8.0.1/csharp-8.0.1.jar), [Source (zip)](https://github.com/javacc/javacc-8-csharp/archive/csharp-8.0.1.zip), [Source (tar.gz)](https://github.com/javacc/javacc-8-csharp/archive/csharp-8.0.1.tar.gz), [Javadocs](https://repo1.maven.org/maven2/org/javacc/generator/csharp/8.0.1/csharp-8.0.1-javadoc.jar) -``` -chmod +x scripts/javacc -``` +* JavaCC Java 8.0.1 - [Binaries](https://repo1.maven.org/maven2/org/javacc/generator/java/8.0.1/java-8.0.1.jar), [Source (zip)](https://github.com/javacc/javacc-8-java/archive/java-8.0.1.zip), [Source (tar.gz)](https://github.com/javacc/javacc-8-java/archive/java-8.0.1.tar.gz), [Javadocs](https://repo1.maven.org/maven2/org/javacc/generator/java/8.0.1/java-8.0.1-javadoc.jar) -### Building JavaCC from Source +All JavaCC v8 *releases* are available via [GitHub](https://github.com/javacc/javacc-8/releases) and [Maven](https://mvnrepository.com/artifact/org/javacc) including checksums and cryptographic signatures. -The source contain the JavaCC, JJTree and JJDoc sources, launcher scripts, example grammars and documentation. It also contains a bootstrap version of JavaCC needed to build JavaCC. +##### Version 7 -Prerequisites for building JavaCC: +* JavaCC 7.0.13 - [Binaries](https://repo1.maven.org/maven2/net/java/dev/javacc/javacc/7.0.13/javacc-7.0.13.jar), [Source (zip)](https://github.com/javacc/javacc/archive/javacc-7.0.13.zip), [Source (tar.gz)](https://github.com/javacc/javacc/archive/javacc-7.0.13.tar.gz), [Javadocs](https://repo1.maven.org/maven2/net/java/dev/javacc/javacc/7.0.13/javacc-7.0.13-javadoc.jar), [Release Notes](docs/release-notes.md) -* Git -* Ant (we require version 1.5.3 or above - you can get ant from [http://ant.apache.org](http://ant.apache.org)) -* Maven -* Java 8 (Java 9 and 10 are not yet supported) +All JavaCC v7 releases are available via [GitHub](https://github.com/javacc/javacc/releases) and [Maven](https://mvnrepository.com/artifact/net.java.dev.javacc/javacc) including checksums and cryptographic signatures. -``` -$ git clone https://github.com/javacc/javacc.git -$ cd javacc -$ ant -``` +For all previous releases, please see [stable releases](docs/downloads.md). -This will build the `javacc.jar` file in the `target/` directory +#### Install +##### Version 8 -### Developing JavaCC +*To be written*. Help welcomed! - -Minimal requirements for an IDE are: -* Support for Java -* Support for Maven with Java +##### Version 7 +Once you have downloaded the files, navigate to the download directory and unzip the sources file(s), this creating a so called JavaCC installation directory: + +`$ unzip javacc-7.0.13.zip` +or +`$ tar xvf javacc-7.0.13.tar.gz` + +Then create a new `target` directory under the installation directory, and copy or move the binary file `javacc-7.0.13.jar` under this `target` directory, and copy or rename it to `javacc.jar`. + +Then add the `scripts/` directory under the JavaCC installation directory to your `PATH`. The JavaCC, JJTree, and JJDoc invocation scripts/executables reside in this directory. + +On UNIX based systems, the scripts may not be executable immediately. This can be solved by using the command from the `javacc-7.0.13/` directory: +`chmod +x scripts/javacc` + +#### Write your grammar and generate your parser + +You can then create and edit a grammar file with your favorite text editor. + +Then use the appropriate script for generating your parser from your grammar. + +### Use JavaCC within an IDE + +Minimal requirements for an IDE are: +* Support for Java, C++ or C# +* Support for Maven or Gradle #### IntelliJ IDEA @@ -233,21 +290,69 @@ Check out our [Setting up IntelliJ](https://ci.apache.org/projects/flink/flink-d * Eclipse download: [https://www.eclipse.org/ide/](https://www.eclipse.org/ide/) * Eclipse JavaCC Plugin: [https://marketplace.eclipse.org/content/javacc-eclipse-plug](https://marketplace.eclipse.org/content/javacc-eclipse-plug) - -## Community +### Rebuilding JavaCC + +*To be verified / completed*. Help welcomed! + +#### From the source installation directory + +The source installation directory contains the JavaCC, JJTree and JJDoc sources, launcher scripts, example grammars and documentation, and also a bootstrap version of JavaCC needed to build JavaCC. + +Prerequisites for building JavaCC with this method: + +* Ant (we require version 1.5.3 or above - you can get ant from [http://ant.apache.org](http://ant.apache.org)) +* Maven +* Java 8 (Java 9 and 10 are not yet supported) + +Use the ant build script: + +``` +$ cd javacc +$ ant +``` + +This will build the `javacc.jar` file in the `target/` directory + +#### After cloning the JavaCC GitHub repository + +This is the preferred method for contributing to JavaCC. + +Prerequisites for building JavaCC with this method: + +* Git +* Ant (we require version 1.5.3 or above - you can get ant from [http://ant.apache.org](http://ant.apache.org)) +* Maven +* Java 8 (Java 9 and 10 are not yet supported) + +Just clone the repository and then use the ant build script: + +``` +$ git clone https://github.com/javacc/javacc.git +$ cd javacc +$ ant +``` + +This will build the `javacc.jar` file in the `target/` directory + +## Community JavaCC is by far the most popular parser generator used with Java applications with an estimated user base of over 1,000 users and more than 100,000 downloads to date. It is maintained by the [developer community](https://github.com/javacc/javacc/graphs/contributors) which includes the original authors and [Chris Ainsley](https://github.com/ainslec), [Tim Pizney](https://github.com/timp) and [Francis Andre](https://github.com/zosrothko). -### Support +### Support + +Open an issue if you found a bug in JavaCC. + +If you use version 7, open it [here](https://github.com/javacc/javacc/issues); +if you use version 8 and you do not know to which part it is related (the core or a generator), open it [here](https://github.com/javacc/javacc-8/issues); if you are sure of the project it is related to, open it in the issues section of the project. Don’t hesitate to ask! Contact the developers and community on the [Google user group](https://groups.google.com/forum/#!forum/javacc-users) or email us at [JavaCC Support](mailto:support@javacc.org) if you need any help. -[Open an issue](https://github.com/javacc/javacc/issues) if you found a bug in JavaCC. - For questions relating to development please join our [Slack channel](https://javacc.slack.com/). -### Documentation +### Documentation -The documentation of JavaCC is located on the website [https://javacc.org](https://javacc.org) and in the `docs/` directory of the source code on [Github](https://github.com/javacc/javacc). +The documentation of JavaCC is located on the website [https://javacc.github.io/javacc/](https://javacc.github.io/javacc/) and in the `docs/` directory of the source code on [GitHub javacc](https://github.com/javacc/javacc) or [GitHub javacc-8](https://github.com/javacc/javacc-8). It includes [detailed documentation](docs/documentation/index.md) for JavaCC, JJTree, and JJDoc. -### Resources +### Resources -#### Books +##### Books * Dos Reis, Anthony J., Compiler Construction Using Java, JavaCC, and Yacc., Wiley-Blackwell 2012. ISBN 0-4709495-9-7 ([book](https://www.amazon.co.uk/Compiler-Construction-Using-Java-JavaCC/dp/0470949597), [pdf](https://doc.lagout.org/programmation/Java/Compiler%20Construction%20using%20Java%2C%20JavaCC%2C%20and%20YACC%20%5BReis%202011-12-20%5D.pdf)). * Copeland, Tom, Generating Parsers with JavaCC., Centennial Books, 2007. ISBN 0-9762214-3-8 ([book](https://www.amazon.com/Generating-Parsers-JavaCC-Easy-Use/dp/0976221438)). -#### Tutorials +##### Tutorials * JavaCC [tutorials](docs/tutorials/index.md). * [Introduction to JavaCC](https://www.engr.mun.ca/~theo/JavaCC-Tutorial/javacc-tutorial.pdf) by Theodore S. Norvell. * [Incorporating language processing into Java applications: a JavaCC tutorial](https://ieeexplore.ieee.org/document/1309649) by Viswanathan Kodaganallur. -#### Articles +##### Articles * [Looking for lex and yacc for Java? You don't know Jack](https://www.javaworld.com/article/2077315/looking-for-lex-and-yacc-for-java--you-don-t-know-jack.html) by Chuck Mcmanis. * [Build your own languages with JavaCC](https://www.javaworld.com/article/2076269/build-your-own-languages-with-javacc.html) by Oliver Enseling. * [Writing an Interpreter Using JavaCC](https://anandsekar.github.io/writing-an-interpretter-using-javacc/) by Anand Rajasekar. * [Building a lexical analyzer with JavaCC](http://kiwwito.com/build-a-lexical-analyzer-with-javacc/) by Keyvan Akbary. -#### Parsing theory +##### Parsing theory * Alfred V. Aho, Monica S. Lam, Ravi Sethi and Jeffrey D. Ullman, Compilers: Principles, Techniques, and Tools, 2nd Edition, Addison-Wesley, 2006, ISBN 0-3211314-3-6 ([book](https://www.amazon.co.uk/Compilers-Principles-Techniques-Tools-2nd/dp/0321131436), [pdf](https://github.com/germanoa/compiladores/blob/master/doc/ebook/Compilers%20Principles%2C%20Techniques%2C%20and%20Tools%20-%202nd%20Edition%20-%20Alfred%20V.%20Aho.pdf)). * Charles N. Fischer and Richard J. Leblanc, Jr., Crafting a Compiler with C., Pearson, 1991. ISBN 0-8053216-6-7 ([book](https://www.amazon.co.uk/Crafting-Compiler-Charles-N-Fischer/dp/0805321667)). -### Powered by JavaCC +### Powered by JavaCC JavaCC is used in many commercial applications and open source projects. @@ -324,13 +475,13 @@ User | Use Case [Apache Calcite](https://calcite.apache.org/) | Parsing SQL statements | [Parser.jj](https://github.com/apache/calcite/blob/master/core/src/main/codegen/templates/Parser.jj) [Apache Camel](https://camel.apache.org/) | Parsing stored SQL templates | [sspt.jj](https://github.com/apache/camel/blob/master/components/camel-sql/src/main/java/org/apache/camel/component/sql/stored/template/grammar/sspt.jj) [Apache Jena](https://jena.apache.org/) | Parsing queries written in SPARQL, ARQ, SSE, Turtle and JSON | [sparql_10](https://github.com/apache/jena/blob/master/jena-arq/Grammar/Final/sparql_10-final.jj), [sparql_11](https://github.com/apache/jena/blob/master/jena-arq/Grammar/Final/sparql_11-final.jj), [arq.jj](https://github.com/apache/jena/blob/master/jena-arq/Grammar/arq.jj), [sse.jj](https://github.com/apache/jena/blob/master/jena-arq/Grammar/sse/sse.jj), [turtle.jj](https://github.com/apache/jena/blob/master/jena-arq/Grammar/turtle.jj), [json.jj](https://github.com/apache/jena/blob/master/jena-arq/Grammar/JSON/json.jj) -[Apache Lucene](https://lucene.apache.org/) | Parsing search queries | [QueryParser.jj](https://github.com/apache/lucene-solr/blob/master/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParser.jj) +[Apache Lucene](https://lucene.apache.org/) | Parsing search queries | [QueryParser.jj](https://github.com/apache/lucene/blob/main/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParser.jj) [Apache Tomcat](https://tomcat.apache.org/) | Parsing Expression Language (EL) and JSON | [ELParser.jjt](https://github.com/apache/tomcat/blob/master/java/org/apache/el/parser/ELParser.jjt), [JSONParser.jj](https://github.com/apache/tomcat/blob/master/java/org/apache/tomcat/util/json/JSONParser.jj) [Apache Zookeeper](https://zookeeper.apache.org/) | Optimising serialisation/deserialisation of Hadoop I/O records | [rcc.jj](https://github.com/apache/zookeeper/blob/master/zookeeper-jute/src/main/java/org/apache/jute/compiler/generated/rcc.jj) [Java Parser](https://javaparser.org/) | Parsing Java language files | [java.jj](https://github.com/javaparser/javaparser/blob/master/javaparser-core/src/main/javacc/java.jj) -## License +## License JavaCC is an open source project released under the [BSD License 2.0](LICENSE). The JavaCC project was originally developed at Sun Microsystems Inc. by [Sreeni Viswanadha](https://github.com/kaikalur) and [Sriram Sankar](https://twitter.com/sankarsearch). @@ -348,6 +499,6 @@ JavaCC is an open source project released under the [BSD License 2.0](LICENSE). --- -[Top](#top) +[Top](#javacc)
diff --git a/pom.xml b/pom.xml index 8819ffcb..dc3cff7b 100644 --- a/pom.xml +++ b/pom.xml @@ -1,7 +1,7 @@ + @@ -404,7 +405,7 @@ THE POSSIBILITY OF SUCH DAMAGE. - + org.apache.maven.plugins @@ -486,13 +487,6 @@ THE POSSIBILITY OF SUCH DAMAGE. 2.7 --> - - com.github.maven-nar - nar-maven-plugin - 3.10.1 - - - org.javacc.plugin javacc-maven-plugin @@ -559,6 +553,14 @@ THE POSSIBILITY OF SUCH DAMAGE. + + + generate-tc + + generate-jdk-toolchains-xml + + @@ -588,18 +590,6 @@ THE POSSIBILITY OF SUCH DAMAGE. exec-maven-plugin - - com.github.maven-nar - nar-maven-plugin - - - - 3 - - - - - org.apache.maven.plugins maven-surefire-plugin @@ -630,6 +620,7 @@ THE POSSIBILITY OF SUCH DAMAGE. + org.javacc.plugin javacc-maven-plugin diff --git a/rulesets/java/maven-pmd-plugin-default.xml b/rulesets/java/maven-pmd-plugin-default.xml index 9403cc25..3fcb24d2 100644 --- a/rulesets/java/maven-pmd-plugin-default.xml +++ b/rulesets/java/maven-pmd-plugin-default.xml @@ -1,7 +1,7 @@