-
Notifications
You must be signed in to change notification settings - Fork 0
/
features.html
173 lines (171 loc) · 12 KB
/
features.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<!DOCTYPE html>
<html>
<head>
<link rel='shortcut icon' href='favicon.ico' type='image/x-icon'/ >
<title>JavaCC Features</title>
<link rel="stylesheet" href="common-styles.css">
<link rel="stylesheet" href="feature-styles.css">
<script src="jquery-1.11.3.min.js"></script>
<script src="open-divs.js"></script>
</head>
<body>
<!--template-->
<div id="alldropdowns">
<div id="logo-container">
<a href="https://javacc.org"><img id="logo" src="https://javacc.org/new-javacc-logo.png"></a>
</div>
<div class="dropdown">
<button onclick="window.location = 'https://javacc.org/download';" class="dropbtn"><div class="drpdntext">DOWNLOAD</div></button>
</div>
<div class="dropdown">
<button onclick="window.location = 'https://javacc.org/doc';" class="dropbtn"><div class="drpdntext">DOCUMENTATION</div></button>
</div>
<div class="dropdown">
<button onclick="window.location = 'https://javacc.org/contact';" class="dropbtn"><div class="drpdntext">CONTACT</div></button>
</div>
</div>
<script src="expand-picture.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-81345115-1', 'auto');
ga('send', 'pageview');
</script>
<br><br><br><br>
<!--end-->
<h1>Features</h1>
<div id="intro">JavaCC™ is a Java parser generator written in the Java programming language. It produces pure Java code. Both JavaCC and the parsers generated by JavaCC have been run on a variety of Java platforms. JavaCC comes with a bunch of grammars including Java 1.0.2, Java 1.1, and Java 2 as well as a couple of HTML grammars.<br><br>Click on any feature of JavaCC to learn more:</div>
<ul>
<li>
<div>
<a onclick="toggleDiv(1);"><span style="font-weight: bold;"><div class="arrow">▶</div> Top-Down</span></a>
</div>
<div class="feat-info">
JavaCC generates top-down (recursive descent) parsers as opposed to bottom-up parsers generated by YACC-like tools. This allows the use of more general grammars (although left-recursion is disallowed). 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 the ability to pass values (attributes) both up and down the parse tree during parsing.
</div>
</li>
<li>
<div>
<a onclick="toggleDiv(2);"><span style="font-weight: bold;"><div class="arrow">▶</div> Large User Community</span></a>
</div>
<div class="feat-info">
JavaCC is by far the most popular parser generator used with Java applications. We've had over hundreds of thousands of downloads and estimate serious users in the many thousands (maybe even tens of thousands). Our <a>mailing list</a> and newsgroups together have a few thousand participants.
</div>
</li>
<li>
<div>
<a onclick="toggleDiv(3);"><span style="font-weight: bold;"><div class="arrow">▶</div> Lexical and Grammar Specifications in One File</span></a>
</div>
<div class="feat-info">
The lexical specifications such as regular expressions, strings, etc. 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.
</div>
</li>
<li>
<div>
<a onclick="toggleDiv(4);"><span style="font-weight: bold;"><div class="arrow">▶</div> Tree Building Preprocessor</span></a>
</div>
<div class="feat-info">
JavaCC comes with JJTree, an extremely powerful tree building preprocessor.
</div>
</li>
<li>
<div>
<a onclick="toggleDiv(5);"><span style="font-weight: bold;"><div class="arrow">▶</div> Extremely Customizable</span></a>
</div>
<div class="feat-info">
JavaCC offers many different 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. etc.
</div>
</li>
<li>
<div>
<a onclick="toggleDiv(6);"><span style="font-weight: bold;"><div class="arrow">▶</div> Certified to be Pure 100% Java</span></a>
</div>
<div class="feat-info">
JavaCC runs on all Java compliant platforms Version 1.1 or later. It has been used on countless different machines with no special porting effort - a testimonial to the "Write Once, Run Everywhere" aspect of the Java™ programming language.
</div>
</li>
<li>
<div>
<a onclick="toggleDiv(7);"><span style="font-weight: bold;"><div class="arrow">▶</div> Document Generation</span></a>
</div>
<div class="feat-info">
JavaCC includes a tool called JJDoc that converts grammar files to documentation files (optionally in html).
</div>
</li>
<li>
<div>
<a onclick="toggleDiv(8);"><span style="font-weight: bold;"><div class="arrow">▶</div> Many Many Examples</span></a>
</div>
<div class="feat-info">
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.
</div>
</li>
<li>
<div>
<a onclick="toggleDiv(9);"><span style="font-weight: bold;"><div class="arrow">▶</div> Internationalized</span></a>
</div>
<div class="feat-info">
The lexical analyzer 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.
</div>
</li>
<li>
<div>
<a onclick="toggleDiv(10);"><span style="font-weight: bold;"><div class="arrow">▶</div> Syntactic and Semantic Lookahead Specifications</span></a>
</div>
<div class="feat-info">
By default, JavaCC generates an LL(1) parser. However, there may be portions of the 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.
</div>
</li>
<li>
<div>
<a onclick="toggleDiv(11);"><span style="font-weight: bold;"><div class="arrow">▶</div> Permits Extended BNF Specifications</span></a>
</div>
<div class="feat-info">
JavaCC allows extended BNF 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.
</div>
</li>
<li>
<div>
<a onclick="toggleDiv(12);"><span style="font-weight: bold;"><div class="arrow">▶</div> Lexical States and Lexical Actions</span></a>
</div>
<div class="feat-info">
JavaCC offers <i>lex</i>-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, state changes, etc. This allows cleaner specifications as well as better error and warning messages from JavaCC.
</div>
</li>
<li>
<div>
<a onclick="toggleDiv(13);"><span style="font-weight: bold;"><div class="arrow">▶</div> Case-Insensitive Lexical Analysis</span></a>
</div>
<div class="feat-info">
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.
</div>
</li>
<li>
<div>
<a onclick="toggleDiv(14);"><span style="font-weight: bold;"><div class="arrow">▶</div> Extensive Debugging Capabilities</span></a>
</div>
<div class="feat-info">
Using options DEBUG_PARSER, DEBUG_LOOKAHEAD, and DEBUG_TOKEN_MANAGER, one can get in-depth analysis of the parsing and the token processing steps.
</div>
</li>
<li>
<div>
<a onclick="toggleDiv(15);"><span style="font-weight: bold;"><div class="arrow">▶</div> Special Tokens</span></a>
</div>
<div class="feat-info">
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.
</div>
</li>
<li>
<div>
<a onclick="toggleDiv(16);"><span style="font-weight: bold;"><div class="arrow">▶</div> Very Good Error Reporting</span></a>
</div>
<div class="feat-info">
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.
</div>
</li>
</ul>
</body>
</html>