在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:javacc/javacc开源软件地址:https://github.com/javacc/javacc开源编程语言:Java 99.1%开源软件介绍:JavaCCJava Compiler Compiler (JavaCC) is the most popular parser generator for use with Java applications. A parser generator is a tool that reads a grammar specification and converts it to a Java program that can recognize matches to the grammar. In 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. All you need to run a JavaCC parser, once generated, is a Java Runtime Environment (JRE). 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.github.io/javacc/. ContentsIntroductionFeatures
ExampleThis 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:
Examples of illegal strings are:
GrammarPARSER_BEGIN(Example)
/** Simple brace matcher. */
public class Example {
/** Main entry point. */
public static void main(String args[]) throws ParseException {
Example parser = new Example(System.in);
parser.Input();
}
}
PARSER_END(Example)
/** Root production. */
void Input() :
{}
{
MatchedBraces() ("\n"|"\r")* <EOF>
}
/** Brace matching production. */
void MatchedBraces() :
{}
{
"{" [ MatchedBraces() ] "}"
} Output$ java Example
{{}}<return> $ java Example
{x<return>
Lexical error at line 1, column 2. Encountered: "x"
TokenMgrError: Lexical error at line 1, column 2. Encountered: "x" (120), after : ""
at ExampleTokenManager.getNextToken(ExampleTokenManager.java:146)
at Example.getToken(Example.java:140)
at Example.MatchedBraces(Example.java:51)
at Example.Input(Example.java:10)
at Example.main(Example.java:6) $ java Example
{}}<return>
ParseException: Encountered "}" at line 1, column 3.
Was expecting one of:
<EOF>
"\n" ...
"\r" ...
at Example.generateParseException(Example.java:184)
at Example.jj_consume_token(Example.java:126)
at Example.Input(Example.java:32)
at Example.main(Example.java:6) Getting StartedFollow the steps here to get started with JavaCC. 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. Download & InstallationJavaCC 7.0.11 is our latest stable release.
All JavaCC releases are available via GitHub and Maven including checksums and cryptographic signatures. For all previous releases, please see stable releases. 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. InstallationTo install JavaCC, navigate to the download directory and type:
Then place the binary Once you have completed installation add the On UNIX based systems, the scripts may not be executable immediately. This can be solved by using the command from the
Building JavaCC from SourceThe 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. Prerequisites for building JavaCC:
This will build the Developing JavaCCMinimal requirements for an IDE are:
IntelliJ IDEAThe IntelliJ IDE supports Maven out of the box and offers a plugin for JavaCC development.
Eclipse IDE
CommunityJavaCC 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 which includes the original authors and Chris Ainsley, Tim Pizney and Francis Andre. SupportDon’t hesitate to ask! Contact the developers and community on the Google user group or email us at JavaCC Support if you need any help. Open an issue if you found a bug in JavaCC. For questions relating to development please join our Slack channel. DocumentationThe documentation of JavaCC is located on the website https://javacc.github.io/javacc/ and in the It includes detailed documentation for JavaCC, JJTree, and JJDoc. ResourcesBooks
Tutorials
Articles
Parsing theory
Powered by JavaCCJavaCC is used in many commercial applications and open source projects. The following list highlights a few notable JavaCC projects that run interesting use cases in production, with links to the relevant grammar specifications.
LicenseJavaCC is an open source project released under the BSD License 2.0. The JavaCC project was originally developed at Sun Microsystems Inc. by Sreeni Viswanadha and Sriram Sankar. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论