{"id":13485598,"url":"https://javacc.github.io/javacc/","last_synced_at":"2025-03-27T19:31:29.154Z","repository":{"id":37789836,"uuid":"63746988","full_name":"javacc/javacc","owner":"javacc","description":"JavaCC - a parser generator for building parsers from grammars. It can generate code in Java, C++ and C#.","archived":false,"fork":false,"pushed_at":"2025-02-26T07:30:52.000Z","size":7846,"stargazers_count":1219,"open_issues_count":42,"forks_count":251,"subscribers_count":39,"default_branch":"master","last_synced_at":"2025-03-25T23:01:42.485Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://javacc.org","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/javacc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-20T03:23:59.000Z","updated_at":"2025-03-24T16:05:13.000Z","dependencies_parsed_at":"2023-02-18T22:45:58.225Z","dependency_job_id":"94086ad8-fb48-4b45-a019-223396929d97","html_url":"https://github.com/javacc/javacc","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javacc%2Fjavacc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javacc%2Fjavacc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javacc%2Fjavacc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javacc%2Fjavacc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javacc","download_url":"https://codeload.github.com/javacc/javacc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245910809,"owners_count":20692505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T18:00:27.562Z","updated_at":"2025-03-27T19:31:29.135Z","avatar_url":"https://github.com/javacc.png","language":"Java","funding_links":[],"categories":["Projects","项目"],"sub_categories":["Compiler-compiler","编译器-编译器"],"readme":"# JavaCC\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.java.dev.javacc/javacc/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.java.dev.javacc/javacc)\n[![Javadocs](https://www.javadoc.io/badge/net.java.dev.javacc/javacc.svg)](https://www.javadoc.io/doc/net.java.dev.javacc/javacc)\n\nJava Compiler Compiler (JavaCC) is the most popular parser generator for use with Java applications.\n\nA parser generator is a tool that reads a grammar specification and converts it to a Java program that can recognize matches to the grammar.\n\nIn addition to the parser generator itself, JavaCC provides other standard capabilities related to parser generation such as tree building (via a tool called JJTree included with JavaCC), actions and debugging.\n\nAll you need to run a JavaCC parser, once generated, is a Java Runtime Environment (JRE).\n\nThis 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.github.io/javacc/](https://javacc.github.io/javacc/).\n\n## Contents\n\n- [Introduction](#introduction)\n    * [Features](#features)\n    * [An example](#an-example)\n    * [Tutorials](docs/tutorials/index.md)\n    * [FAQ](docs/faq.md)\n- [Getting Started](#getting-started)\n    * [From the command line](#use-javacc-from-the-command-line)\n    * [Within an IDE](#use-javacc-within-an-ide)\n    * [Rebuilding JavaCC](#rebuilding-javacc)\n- [Community](#community)\n    * [Support](#support)\n    * [Documentation](#documentation)\n    * [Resources](#resources)\n    * [Powered by JavaCC](#powered-by-javacc)\n- [License](#license)\n\n## Introduction\n\n### Features\n\n* 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.\n\n* 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.\n\n* 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.\n\n* 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`.\n\n* 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.\n\n* 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.\n\n* 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.\n\n* 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.\n\n* 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.\n\n* JavaCC comes with JJTree, an extremely powerful tree building pre-processor.\n\n* JavaCC also includes JJDoc, a tool that converts grammar files to documentation files, optionally in HTML.\n\n* 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.\n\n* 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.\n\n* Using options `DEBUG_PARSER`, `DEBUG_LOOKAHEAD`, and `DEBUG_TOKEN_MANAGER`, users can get in-depth analysis of the parsing and the token processing steps.\n\n* 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.\n\n\n### An example\n\nThe following JavaCC grammar example recognizes matching braces followed by zero or more line terminators and then an end of file.\n\nExamples of legal strings in this grammar are:\n\n`{}`, `{% raw %}{{{{{}}}}}{% endraw %}` // ... etc\n\nExamples of illegal strings are:\n\n`\u0026#123;\u0026#125;\u0026#123;\u0026#125;`, `\u0026#125;\u0026#123;\u0026#125;\u0026#125;`, `\u0026#123; \u0026#125;`, `\u0026#123;x\u0026#125;` // ... etc\n\n##### Its grammar\n\n```java\nPARSER_BEGIN(Example)\n\n/** Simple brace matcher. */\npublic class Example {\n\n  /** Main entry point. */\n  public static void main(String args[]) throws ParseException {\n    Example parser = new Example(System.in);\n    parser.Input();\n  }\n\n}\n\nPARSER_END(Example)\n\n/** Root production. */\nvoid Input() :\n{}\n{\n  MatchedBraces() (\"\\n\"|\"\\r\")* \u003cEOF\u003e\n}\n\n/** Brace matching production. */\nvoid MatchedBraces() :\n{}\n{\n  \"{\" [ MatchedBraces() ] \"}\"\n}\n```\n\n##### Some executions and outputs\n\n###### {{}} gives no error\n\n```java\n$ java Example\n{{}}\u003creturn\u003e\n```\n\n###### {x gives a Lexical error\n\n```java\n$ java Example\n{x\u003creturn\u003e\nLexical error at line 1, column 2.  Encountered: \"x\"\nTokenMgrError: Lexical error at line 1, column 2.  Encountered: \"x\" (120), after : \"\"\n        at ExampleTokenManager.getNextToken(ExampleTokenManager.java:146)\n        at Example.getToken(Example.java:140)\n        at Example.MatchedBraces(Example.java:51)\n        at Example.Input(Example.java:10)\n        at Example.main(Example.java:6)\n```\n\n###### {}} gives a ParseException\n\n```java\n$ java Example\n{}}\u003creturn\u003e\nParseException: Encountered \"}\" at line 1, column 3.\nWas expecting one of:\n    \u003cEOF\u003e\n    \"\\n\" ...\n    \"\\r\" ...\n        at Example.generateParseException(Example.java:184)\n        at Example.jj_consume_token(Example.java:126)\n        at Example.Input(Example.java:32)\n        at Example.main(Example.java:6)\n```\n\n## Versions\n\nThe 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.  \nThis version lies on different Git repositories / java \u0026 maven projects / jars:\n- the umbrella [javacc-8](https://github.com/javacc/javacc-8)\n- the [core](https://github.com/javacc/javacc-8-core)\n- the generators:\n    - [java](https://github.com/javacc/javacc-8-java)\n    - [C++](https://github.com/javacc/javacc-8-cpp)\n    - [C#](https://github.com/javacc/javacc-8-csharp)\n\nThe previous versions (4, 5, 6, 7) are widely spread; effort to migrate to version 8 should be minimum.  \nTheir last version lies on a single Git repository / java \u0026 maven project / jar:\n- [javacc](https://github.com/javacc/javacc)\n\nDifferences between v8 versus v7: very small at the grammar level, more important at the generated sources level:\n- the javacc/jjtree grammar part is the same\n- most of javacc/jjtree options should be the same, but some may be removed and others appear in v8\n- the java grammar part should be nearly the same (may be some java 7 \u0026 java 8 features will appear in v8 and not in v7); in the future java 11..17..21.. features would appear only in v8)\n- the C++ / C# grammar parts may be somewhat different\n- some generated files are not much different, others are\n\nIf you read this README.md, you should be under the v7 code.\n\n## Getting Started\n\nYou can use JavaCC either from the command line or through an IDE.\n\n### Use JavaCC from the command line\n\n#### Download\n\nDownload the latest stable release (at least the binaries and the sources) in a so called download directory:\n\n##### Version 8\n\nDownload the core and the generator(s) you are going to use:\n\n* 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)\n\n* 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)\n\n* 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)\n\n* 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)\n\nAll 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.\n\n##### Version 7\n\n* 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)\n\nAll 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.\n\nFor all previous releases, please see [stable releases](docs/downloads.md).\n\n#### Install\n\n##### Version 8\n\n*To be written*. Help welcomed!\n\n##### Version 7\n\nOnce you have downloaded the files, navigate to the download directory and unzip the sources file(s), this creating a so called JavaCC installation directory:\n\n`$ unzip javacc-7.0.13.zip`  \nor  \n`$ tar xvf javacc-7.0.13.tar.gz`\n\nThen 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`.\n\nThen add the `scripts/` directory under the JavaCC installation directory to your `PATH`. The JavaCC, JJTree, and JJDoc invocation scripts/executables reside in this directory.\n\nOn 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:\n`chmod +x scripts/javacc`\n\n#### Write your grammar and generate your parser\n\nYou can then create and edit a grammar file with your favorite text editor.\n\nThen use the appropriate script for generating your parser from your grammar.\n\n### Use JavaCC within an IDE\n\nMinimal requirements for an IDE are:\n* Support for Java, C++ or C#\n* Support for Maven or Gradle\n\n#### IntelliJ IDEA\n\nThe IntelliJ IDE supports Maven out of the box and offers a plugin for JavaCC development.\n\n* IntelliJ download: [https://www.jetbrains.com/idea/](https://www.jetbrains.com/idea/)\n* IntelliJ JavaCC Plugin: [https://plugins.jetbrains.com/plugin/11431-javacc/](https://plugins.jetbrains.com/plugin/11431-javacc/)\n\n\u003c!---\nCheck out our [Setting up IntelliJ](https://ci.apache.org/projects/flink/flink-docs-master/flinkDev/ide_setup.html#intellij-idea) guide for details.\n--\u003e\n\n#### Eclipse IDE\n\n* Eclipse download: [https://www.eclipse.org/ide/](https://www.eclipse.org/ide/)\n* Eclipse JavaCC Plugin: [https://marketplace.eclipse.org/content/javacc-eclipse-plug](https://marketplace.eclipse.org/content/javacc-eclipse-plug)\n\n#### Maven\n\nAdd the following plugin to your `pom.xml` file, under the build plugins, or under one or more profiles.\n\n##### Version 8\n\n(You must use the javacc-maven-plugin from the JavaCC organization.)  \nAdapt the versions, the execution(s) (goals `javacc` and/or `jjtree-javacc`) and the `codeGenerator` setting for the generator (`java`, `cpp`, `csharp`). Also add the configuration settings you want to override.\n\n```\n          \u003cplugin\u003e\n              \u003cgroupId\u003eorg.javacc.plugin\u003c/groupId\u003e\n              \u003cartifactId\u003ejavacc-maven-plugin\u003c/artifactId\u003e\n              \u003cversion\u003e3.0.3\u003c/version\u003e\n              \u003cexecutions\u003e\n                  \u003cexecution\u003e\n                      \u003cid\u003ejavacc\u003c/id\u003e\n                      \u003cphase\u003egenerate-sources\u003c/phase\u003e\n                      \u003cgoals\u003e\n                          \u003cgoal\u003ejjtree-javacc\u003c/goal\u003e\n                      \u003c/goals\u003e\n                      \u003cconfiguration\u003e\n                          \u003ccodeGenerator\u003ejava\u003c/codeGenerator\u003e\n                      \u003c/configuration\u003e\n                  \u003c/execution\u003e\n              \u003c/executions\u003e\n              \u003cdependencies\u003e\n                  \u003cdependency\u003e\n                      \u003cgroupId\u003eorg.javacc.generator\u003c/groupId\u003e\n                        \u003cartifactId\u003ejava\u003c/artifactId\u003e\n                        \u003cversion\u003e8.0.1\u003c/version\u003e\n                    \u003c/dependency\u003e\n                    \u003cdependency\u003e\n                        \u003cgroupId\u003eorg.javacc\u003c/groupId\u003e\n                        \u003cartifactId\u003ecore\u003c/artifactId\u003e\n                        \u003cversion\u003e8.0.1\u003c/version\u003e\n                    \u003c/dependency\u003e\n                \u003c/dependencies\u003e\n            \u003c/plugin\u003e\n```\n\n##### Version 7\n\n(You can use the [javacc-maven-plugin](https://www.mojohaus.org/javacc-maven-plugin/) from MojoHaus or te [javacc-maven-plugin](https://github.com/javacc/javacc-maven-plugin) from the JavaCC organization.)  \n\nSame as above, with a single different dependency, and without the `codeGenerator` setting.\n\n```\n\u003cdependency\u003e\n    \u003cgroupId\u003enet.java.dev.javacc\u003c/groupId\u003e\n    \u003cartifactId\u003ejavacc\u003c/artifactId\u003e\n    \u003cversion\u003e7.0.13\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n#### Gradle\n\n##### Version 8\n\n*To be tested / written*. Help welcomed!\n\n##### Version 7\n\nAdd the following to your `build.gradle` file.\n\n```\nrepositories {\n    mavenLocal()\n    maven {\n        url = 'https://mvnrepository.com/artifact/net.java.dev.javacc/javacc'\n    }\n}\n\ndependencies {\n    compile group: 'net.java.dev.javacc', name: 'javacc', version: '7.0.13'\n}\n```\n\n### Rebuilding JavaCC \n\n*To be verified / completed*. Help welcomed!\n\n#### From the source installation directory\n\nThe 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.\n\nPrerequisites for building JavaCC with this method:\n\n* Ant (we require version 1.5.3 or above - you can get ant from [http://ant.apache.org](http://ant.apache.org))\n* Maven\n* Java 8 (Java 9 and 10 are not yet supported)\n\nUse the ant build script:\n\n```\n$ cd javacc\n$ ant\n```\n\nThis will build the `javacc.jar` file in the `target/` directory\n\n#### After cloning the JavaCC GitHub repository\n\nThis is the preferred method for contributing to JavaCC.\n\nPrerequisites for building JavaCC with this method:\n\n* Git\n* Ant (we require version 1.5.3 or above - you can get ant from [http://ant.apache.org](http://ant.apache.org))\n* Maven\n* Java 8 (Java 9 and 10 are not yet supported)\n\nJust clone the repository and then use the ant build script:\n\n```\n$ git clone https://github.com/javacc/javacc.git\n$ cd javacc\n$ ant\n```\n\nThis will build the `javacc.jar` file in the `target/` directory\n\n## Community\n\nJavaCC 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.\n\nIt 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).\n\n### Support\n\nOpen an issue if you found a bug in JavaCC.\n\nIf you use version 7, open it [here](https://github.com/javacc/javacc/issues);  \nif 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.\n\nDon’t hesitate to ask!\n\nContact 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.\n\nFor questions relating to development please join our [Slack channel](https://javacc.slack.com/).\n\n### Documentation\n\nThe 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).\n\nIt includes [detailed documentation](docs/documentation/index.md) for JavaCC, JJTree, and JJDoc.\n\n### Resources\n\n##### Books\n\n* 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://spada.uns.ac.id/pluginfile.php/265072/mod_resource/content/1/Compiler%20Construction%20using%20Java%2C%20JavaCC%2C%20and%20YACC%20%5BReis%202011-12-20%5D.pdf)).\n* 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)).\n\n##### Tutorials\n\n* JavaCC [tutorials](docs/tutorials/index.md).\n* [Introduction to JavaCC](https://www.engr.mun.ca/~theo/JavaCC-Tutorial/javacc-tutorial.pdf) by Theodore S. Norvell.\n* [Incorporating language processing into Java applications: a JavaCC tutorial](https://ieeexplore.ieee.org/document/1309649) by Viswanathan Kodaganallur.\n\n##### Articles\n\n* [Looking for lex and yacc for Java? You don't know Jack](https://www.infoworld.com/article/2170636/looking-for-lex-and-yacc-for-java-you-don-t-know-jack.html) by Chuck Mcmanis.\n* [Build your own languages with JavaCC](https://www.infoworld.com/article/2162779/build-your-own-languages-with-javacc.html) by Oliver Enseling.\n* [Writing an Interpreter Using JavaCC](https://anandsekar.github.io/writing-an-interpretter-using-javacc/) by Anand Rajasekar.\n* [Building a lexical analyzer with JavaCC](http://kiwwito.com/build-a-lexical-analyzer-with-javacc/) by Keyvan Akbary.\n\n##### Parsing theory\n\n* 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)).\n* 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)).\n\n### Powered by JavaCC\n\nJavaCC is used in many commercial applications and open source projects.\n\nThe following list highlights a few notable JavaCC projects that run interesting use cases in production, with links to the relevant grammar specifications.\n\nUser                                                 | Use Case                                                       | Grammar File(s)\n:--------------------------------------------------- |:-------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------:\n[Apache ActiveMQ](https://activemq.apache.org/)      | Parsing JMS selector statements                                | [SelectorParser.jj](https://github.com/apache/activemq/blob/master/activemq-client/src/main/grammar/SelectorParser.jj), [HyphenatedParser.jj](https://github.com/apache/activemq-artemis/blob/master/artemis-selector/src/main/javacc/HyphenatedParser.jj)\n[Apache Avro](https://avro.apache.org/)              | Parsing higher-level languages into Avro Schema                | [idl.jj](https://github.com/apache/avro/blob/master/lang/java/compiler/src/main/javacc/org/apache/avro/compiler/idl/idl.jj)\n[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)\n[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)\n[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/main/jena-arq/Grammar/Turtle/turtle.jj), [json.jj](https://github.com/apache/jena/blob/master/jena-arq/Grammar/JSON/json.jj)\n[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)\n[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/main/java/org/apache/tomcat/util/json/JSONParser.jjt)\n[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)\n[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)\n\n\u003c!---\n## Contributing\n\nThis is an active open-source project. We are always open to people who want to use the system or contribute to it.\nContact us if you are looking for implementation tasks that fit your skills.\nThis article describes [how to contribute to Apache Flink](https://flink.apache.org/contributing/how-to-contribute.html).\n\nhttps://blog.scottlowe.org/2015/01/27/using-fork-branch-git-workflow/\n\n--\u003e\n\n## License\n\nJavaCC 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).\n\n\u003cbr\u003e\n\n---\n\n[Top](#javacc)\n\n\u003cbr\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/javacc.github.io%2Fjavacc%2F","html_url":"https://awesome.ecosyste.ms/projects/javacc.github.io%2Fjavacc%2F","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/javacc.github.io%2Fjavacc%2F/lists"}