📄 features.html
字号:
<HTML><!--Copyright 漏 2002 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,California 95054, U.S.A. All rights reserved. Sun Microsystems, Inc. hasintellectual property rights relating to technology embodied in the productthat is described in this document. In particular, and without limitation,these intellectual property rights may include one or more of the U.S.patents listed at http://www.sun.com/patents and one or more additionalpatents or pending patent applications in the U.S. and in other countries.U.S. Government Rights - Commercial software. Government users are subjectto the Sun Microsystems, Inc. standard license agreement and applicableprovisions of the FAR and its supplements. Use is subject to license terms.Sun, Sun Microsystems, the Sun logo and Java are trademarks or registeredtrademarks of Sun Microsystems, Inc. in the U.S. and other countries. Thisproduct is covered and controlled by U.S. Export Control laws and may besubject to the export or import laws in other countries. Nuclear, missile,chemical biological weapons or nuclear maritime end uses or end users, whetherdirect or indirect, are strictly prohibited. Export or reexport to countriessubject to U.S. embargo or to entities identified on U.S. export exclusionlists, including, but not limited to, the denied persons and speciallydesignated nationals lists is strictly prohibited.--><HEAD> <title>JavaCC Features</title><!-- Changed by: Michael Van De Vanter, 14-Jan-2003 --></HEAD><BODY bgcolor="#FFFFFF" ><H1>JavaCC [tm]: Features</H1>JavaCC [tm] is a Java parser generator written in the Java programming language. It produces pureJava code. Both JavaCC and the parsers generated by JavaCC have beenrun on a variety of Java platforms. JavaCC comes with a bunch ofgrammars including Java 1.0.2, Java 1.1, and Java 2 as well as a coupleof HTML grammars.<P>Specific features of JavaCC are listed below:<UL><LI>TOP-DOWN: JavaCC generates top-down (recursive descent) parsers asopposed to bottom-up parsers generated by YACC-like tools. Thisallows the use of more general grammars (although left-recursion isdisallowed). Top-down parsers have a bunch of other advantages(besides more general grammars) such as being easier to debug,having the ability to parse to any non-terminal in the grammar, and also having theability to pass values (attributes) both up and down the parsetree during parsing.<P><LI>LARGE USER COMMUNITY: JavaCC is by far the most popular parsergenerator used with Java applications. We've had over hundreds ofthousands of downloads and estimate serious users in the many thousands(maybe even tens of thousands). Our <a href="mailinglist.html">mailinglist</a> and newsgroups together have a few thousand participants.<P><LI>LEXICAL AND GRAMMAR SPECIFICATIONS IN ONE FILE: The lexicalspecifications such as regular expressions, strings, etc. and thegrammar specifications (the BNF) are both written together in the samefile. It makes grammars easier to read (since it is possible to useregular expressions inline in the grammar specification) and alsoeasier to maintain.<P><LI>TREE BUILDING PREPROCESSOR: JavaCC comes with JJTree, an extremelypowerful tree building preprocessor.<P><LI>EXTREMELY CUSTOMIZABLE: JavaCC offers many different options tocustomize its behavior and the behavior of the generated parsers.Examples of such options are the kinds of Unicode processing toperform on the input stream, the number of tokens of ambiguitychecking to perform, etc. etc.<P><LI>CERTIFIED TO BE 100% PURE JAVA: JavaCC runs on all Java compliantplatforms Version 1.1 or later. It has been used on countless differentmachines with no special porting effort - a testimonial to the"Write Once, Run Everywhere" aspect of the Java [tm] programming language.<P><LI>DOCUMENT GENERATION: JavaCC includes a tool called JJDoc thatconverts grammar files to documentation files (optionally in html).<P><LI>MANY MANY EXAMPLES: The JavaCC release includes a wide range ofexamples including Java and HTML grammars. The examples, along withtheir documentation, are a great way to get acquainted with JavaCC.<P><LI>INTERNATIONALIZED: The lexical analyzer of JavaCC can handle fullUnicode input, and lexical specifications may also include anyUnicode character. This facilitates descriptions of language elementssuch as Java identifiers that allow certain Unicode characters (that arenot ASCII), but not others.<P><LI>SYNTACTIC AND SEMANTIC LOOKAHEAD SPECIFICATIONS: By default, JavaCCgenerates an LL(1) parser. However, there may be portions of the grammarthat are not LL(1). JavaCC offers the capabilities of syntactic andsemantic lookahead to resolve shift-shift ambiguities locally at thesepoints. For example, the parser is LL(k) only at such points, but remains LL(1)everywhere else for better performance. Shift-reduce and reduce-reduceconflicts are not an issue for top-down parsers.<P><LI>PERMITS EXTENDED BNF SPECIFICATIONS: JavaCC allows extended BNFspecifications - such as <code>(A)*</code>, <code>(A)+</code>, etc. - within the lexical andthe grammar specifications. Extended BNF relieves the need forleft-recursion to some extent. In fact, extended BNF is often easierto read as in <code>A ::= y(x)*</code> versus <code>A ::= Ax|y</code>.<P><LI>LEXICAL STATES AND LEXICAL ACTIONS: JavaCC offers <I>lex</I>-like lexicalstate and lexical action capabilities. Specific aspects in JavaCCthat are superior to other tools are the first class status it offersconcepts such as TOKEN, MORE, SKIP, state changes, etc. This allowscleaner specifications as well as better error and warning messagesfrom JavaCC.<P><LI>CASE-INSENSITIVE LEXICAL ANALYSIS: Lexical specifications can definetokens not to be case sensitive either at the global level for theentire lexical specification, or on an individual lexical specificationbasis.<P><LI>EXTENSIVE DEBUGGING CAPABILITIES: Using options DEBUG_PARSER,DEBUG_LOOKAHEAD, and DEBUG_TOKEN_MANAGER, one can get in-depth analysisof the parsing and the token processing steps.<P><LI>SPECIAL TOKENS: Tokens that are defined as special tokens in thelexical specification are ignored during parsing, but these tokensare available for processing by the tools. A useful application ofthis is in the processing of comments.<P><LI>VERY GOOD ERROR REPORTING: JavaCC error reporting is among the best inparser generators. JavaCC generated parsers are able to clearly pointout the location of parse errors with complete diagnostic information.<P></UL></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -