-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEBNF Grammar for Mini-Java.html
600 lines (525 loc) · 23.6 KB
/
EBNF Grammar for Mini-Java.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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>EBNF Grammar for Mini-Java</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<!-- style elements -->
<style type="text/css">
body {margin-left: 10%; margin-right:10% } /* looks nicer with bigger margins */
pre {font-family: monospace; } /* some browsers forget */
a:link {text-decoration: none; color:black} /* for unvisited links */
a:visited {text-decoration: none; color:black} /* for visited links */
a:active {text-decoration: none; color:black} /* when link is clicked */
.quote {border-color: blue; border: none; padding: 1em; background-color: #FFFFCC; color: black; margin-left: 10%; margin-right: 10% }
.new {color: darkblue; font-weight: bold; font-style: italic }
.hilite {background-color: yellow}
.key {color: black; font-family: monospace; font-weight: bold}
.meta {color: red; font-style: italic; font-size: larger}
</style>
</head>
<body>
<h1>EBNF Grammar for Mini-Java</h1>
<p>
<!-- width = 117 15 6?? -->
<table>
<!-- Goal -->
<tbody>
<tr>
<td valign="baseline" align="right"><a name="prod1">Goal</a></td>
<td valign="baseline" align="center"><span class="meta">=</span></td>
<td valign="baseline" align="left">
<a href="#MainClass">MainClass</a><span class="meta">,</span>
<span class="meta">{</span> <a href="#prod3">ClassDeclaration</a> <span class="meta">},</span>
<a href="#EOF">EOF</a><span class="meta">;</span>
</td>
</tr>
<tr style="height:15"><td></td></tr> <!-- for inter-row spacing -->
</tbody>
<!-- MainClass -->
<tbody>
<tr>
<td valign="baseline" align="right"><a name="MainClass">MainClass</a></td>
<td valign="baseline" align="center"><span class="meta">=</span></td>
<!-- class Identifier { public static void main ( String [ ] Identifier ) { Statement } } -->
<td valign="baseline" align="left">
<span class="key">"class"</span><span class="meta">,</span>
<a href="#Identifier">Identifier</a><span class="meta">,</span>
<span class="key">"{"</span><span class="meta">,</span>
<span class="key">"public"</span><span class="meta">,</span>
<span class="key">"static"</span><span class="meta">,</span>
<span class="key">"void"</span><span class="meta">,</span>
<span class="key">"main"</span><span class="meta">,</span>
<span class="key">"("</span><span class="meta">,</span>
<span class="key">"String"</span><span class="meta">,</span>
<span class="key">"["</span><span class="meta">,</span>
<span class="key">"]"</span><span class="meta">,</span>
<a href="#Identifier">Identifier</a><span class="meta">,</span>
<span class="key">")"</span><span class="meta">,</span>
<span class="key">"{"</span><span class="meta">,</span>
<a href="#Statement">Statement</a><span class="meta">,</span>
<span class="key">"}"</span><span class="meta">,</span>
<span class="key">"}"</span><span class="meta">;</span>
</td>
</tr>
<tr style="height:15"><td></td></tr> <!-- for inter-row spacing -->
</tbody>
<!-- ClassDeclaration -->
<tbody>
<tr>
<td valign="baseline" align="right"><a name="ClassDeclaration">ClassDeclaration</a></td>
<td valign="baseline" align="center"><span class="meta">=</span></td>
<!-- class Identifier (/ extends Identifer /) { (: VarDeclaration :) (: MethodDeclaration :) } -->
<td valign="baseline" align="left">
<span class="key">"class"</span><span class="meta">,</span>
<a href="#Identifier">Identifier</a>
<span class="meta">[</span>
<span class="key">"extends"</span><span class="meta">,</span>
<a href="#Identifier">Identifier</a>
<span class="meta">]</span>
<span class="key">"{"</span>
<span class="meta">{</span> <a href="#VarDeclaration">VarDeclaration</a> <span class="meta">}</span>
<span class="meta">{</span> <a href="#MethodDeclaration">MethodDeclaration</a>
<span class="meta">}</span>
<span class="key">"}"</span>
</td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span></td>
<!-- record Identifier () {} -->
<td valign="baseline" align="left">
<span class="key">"record"</span><span class="meta">,</span>
<a href="#Identifier">Identifier</a><span class="meta">,</span>
<span class="key">"("</span>
<span class="meta">[</span>
<a href="#Type">Type</a><span class="meta">,</span>
<a href="#Identifier">Identifier</a>
<span class="meta">{</span>
<span class="key">","</span><span class="meta">,</span>
<a href="#Type">Type</a><span class="meta">,</span>
<a href="#Identifier">Identifier</a> <span class="meta">}</span>
<span class="meta">]</span>
<span class="key">")"</span><span class="meta">,</span>
<span class="key">"{"</span><span class="meta">,</span>
<span class="key">"}"</span>
</td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">;</span></td>
<td valign="baseline" align="left"></td>
</tr>
<tr style="height:15"><td></td></tr> <!-- for inter-row spacing -->
</tbody>
<!-- VarDeclaration -->
<tbody>
<tr>
<td valign="baseline" align="right"><a name="VarDeclaration">VarDeclaration</a></td>
<td valign="baseline" align="center"><span class="meta">=</span></td>
<td valign="baseline" align="left">
<a href="#Type">Type</a><span class="meta">,</span>
<a href="#Identifier">Identifier</a><span class="meta">,</span>
<span class="key">";"</span>
<span class="meta">;</span>
</td></tr>
<tr style="height:15"><td></td></tr> <!-- inter-row spacing -->
</tbody>
<!-- MethodDeclaration -->
<tbody>
<tr>
<td valign="baseline" align="right"><a name="MethodDeclaration">MethodDeclaration</a></td>
<td valign="baseline" align="center"><span class="meta">=</span></td>
<td valign="baseline" align="left">
<span class="key">"public"</span><span class="meta">,</span>
<a href="#Type">Type</a><span class="meta">,</span>
<a href="#Identifier">Identifier</a><span class="meta">,</span>
<span class="key">"("</span>
<span class="meta">[</span>
<a href="#Type">Type</a><span class="meta">,</span>
<a href="#Identifier">Identifier</a>
<span class="meta">{</span>
<span class="key">","</span><span class="meta">,</span>
<a href="#Type">Type</a><span class="meta">,</span>
<a href="#Identifier">Identifier</a> <span class="meta">}</span>
<span class="meta">]</span>
<span class="key">")"</span><span class="meta">,</span>
<span class="key">"{"</span>
<span class="meta">{</span><a href="#VarDeclaration">VarDeclaration</a> <span class="meta">}</span>
<span class="meta">{</span><a href="#Statement">Statement</a><span class="meta">}</span>
<span class="key">"return"</span><span class="meta">,</span>
<a href="#Expression">Expression</a><span class="meta">,</span>
<span class="key">";"</span><span class="meta">,</span>
<span class="key">"}"</span><span class="meta">;</span>
</td>
</tr>
<tr style="height:15"><td></td></tr> <!-- inter-row spacing -->
</tbody>
<!-- Type -->
<tbody>
<tr>
<td valign="baseline" align="right"><a name="Type">Type</a></td>
<td valign="baseline" align="center"><span class="meta">=</span></td>
<td valign="baseline" align="left">
<span class="key">"int"</span><span class="meta">,</span>
<span class="key">"["</span><span class="meta">,</span>
<span class="key">"]"</span>
</td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span></td>
<td valign="baseline" align="left"><span class="key">"boolean"</span></td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span></td>
<td valign="baseline" align="left"><span class="key">"int"</span></td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span></td>
<td valign="baseline" align="left"><a href="#Identifier">Identifier</a></td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">;</span></td>
<td valign="baseline" align="left"></td>
</tr>
<tr style="height:15"><td></td></tr> <!-- inter-row spacing -->
</tbody>
<!-- Statement -->
<tbody>
<tr>
<td valign="baseline" align="right"><a name="Statement">Statement</a></td>
<td valign="baseline" align="center"><span class="meta">=</span></td>
<td valign="baseline" align="left">
<span class="key">"{"</span>
<span class="meta">{</span><a href="#Statement">Statement</a><span class="meta">}</span>
<span class="key">"}"
</span></td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span></td>
<td valign="baseline" align="left">
<span class="key">"if"</span><span class="meta">,</span>
<span class="key">"("</span><span class="meta">,</span>
<a href="#Expression">Expression</a><span class="meta">,</span>
<span class="key">")"</span><span class="meta">,</span>
<a href="#Statement">Statement</a><span class="meta">,</span>
<span class="key">"else"</span><span class="meta">,</span>
<a href="#Statement">Statement</a>
</td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span></td>
<td valign="baseline" align="left">
<span class="key">"while"</span><span class="meta">,</span>
<span class="key">"("</span><span class="meta">,</span>
<a href="#Expression">Expression</a><span class="meta">,</span>
<span class="key">")"</span><span class="meta">,</span>
<a href="#Statement">Statement</a>
</td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span></td>
<td valign="baseline" align="left">
<span class="key">"System" "." "out" "." "println"</span><span class="meta">,</span>
<span class="key">"("</span> <span class="meta">,</span>
<a href="#Expression">Expression</a><span class="meta">,</span>
<span class="key">")"</span><span class="meta">,</span>
<span class="key">";"</span>
</td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span></td>
<td valign="baseline" align="left">
<a href="#Identifier">Identifier</a><span class="meta">,</span>
<span class="key">"="</span><span class="meta">,</span>
<a href="#Expression">Expression</a><span class="meta">,</span>
<span class="key">";"</span>
</td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span></td>
<td valign="baseline" align="left">
<a href="#Identifier">Identifier</a><span class="meta">,</span>
<span class="key">"["</span><span class="meta">,</span>
<a href="#Expression">Expression</a><span class="meta">,</span>
<span class="key">"]"</span><span class="meta">,</span>
<span class="key">"="</span><span class="meta">,</span>
<a href="#Expression">Expression</a><span class="meta">,</span>
<span class="key">";"</span>
</td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">;</span></td>
<td valign="baseline" align="left"></td>
</tr>
<tr style="height:15"><td></td></tr> <!-- inter-row spacing -->
</tbody>
<!-- Expression -->
<tbody>
<!-- Expression ::= Expression ( "&&" | "<" | "+" | "-" | "*" ) Expression -->
<tr>
<td valign="baseline" align="right"><a name="Expression">Expression</a></td>
<td valign="baseline" align="center"><span class="meta">=</span></td>
<td valign="baseline" align="left">
<a href="#Expression">Expression</a>
<span class="meta">(</span> "&&" | "<" | "+" | "-" | "*" <span class="meta">)</span>
<a href="#Expression">Expression</a>
</td>
</tr>
<!-- Expression ::= Expression "." Identifier { Expression , Expression } ) " -->
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span></td>
<td valign="baseline" align="left">
<a href="#Expression">Expression</a> <span class="meta">,</span>
<span class="key">"."</span> <span class="meta">,</span>
<a href="#Identifier">Identifier</a> <span class="meta">,</span>
<span class="key">"("</span> <span class="meta">,</span>
<span class="meta">[</span> <a href="#Expression">Expression</a> <span class="meta">{</span>
<span class="key">","</span> <span class="meta">,</span>
<a href="#Expression">Expression</a> <span class="meta">}</span>
<span class="meta">]</span> <span class="meta">,</span>
<span class="key">")"</span>
</td>
</tr>
<!-- Expression ::= Expression "[" Expression "]" -->
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span></td>
<td valign="baseline" align="left">
<a href="#Expression">Expression</a><span class="meta">,</span>
<span class="key">"["</span><span class="meta">,</span>
<a href="#Expression">Expression</a><span class="meta">,</span>
<span class="key">"]"</span>
</td></tr>
<!-- Expression ::= Expression "." "length" -->
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span></td>
<td valign="baseline" align="left">
<a href="#Expression">Expression</a><span class="meta">,</span>
<span class="key">"."</span><span class="meta">,</span>
<span class="key">"length"</span>
</td></tr>
<!-- Expression ::= "new" "int" "[" Expression "]" -->
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span></td>
<td valign="baseline" align="left">
<span class="key">"new"</span><span class="meta">,</span>
<span class="key">"int"</span><span class="meta">,</span>
<span class="key">"["</span><span class="meta">,</span>
<a href="#Expression">Expression</a><span class="meta">,</span>
<span class="key">"]"</span>
</td>
</tr>
<!-- Expression ::= "new" Identifer "(" ")" -->
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span></td>
<td valign="baseline" align="left">
<span class="key">"new"</span> <span class="meta">,</span>
<a href="#Identifier">Identifier</a> <span class="meta">,</span>
<span class="key">"("</span> <span class="meta">,</span>
<span class="meta">[</span> <a href="#Expression">Expression</a> <span class="meta">{</span>
<span class="key">","</span> <span class="meta">,</span>
<a href="#Expression">Expression</a> <span class="meta">}</span>
<span class="meta">]</span> <span class="meta">,</span>
<span class="key">")"</span>
</td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span></td>
<td valign="baseline" align="left">
<span class="key">"!"</span><span class="meta">,</span>
<a href="#Expression">Expression</a>
</td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span></td>
<td valign="baseline" align="left">
<a href="#IntegerLiteral">IntegerLiteral</a>
</td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span> </td>
<td valign="baseline" align="left"><span class="key">"true"</span></td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span> </td>
<td valign="baseline" align="left"><span class="key">"false"</span></td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span></td>
<td valign="baseline" align="left"><a href="#Identifier">Identifier</a></td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span></td>
<td valign="baseline" align="left"><span class="key">"this"</span></td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">|</span></td>
<td valign="baseline" align="left">
<span class="key">"("</span><span class="meta">,</span>
<a href="#Expression">Expression</a><span class="meta">,</span>
<span class="key">")"</span>
</td>
</tr>
<tr>
<td valign="baseline" align="right"></td>
<td valign="baseline" align="center"><span class="meta">;</span></td>
<td valign="baseline" align="left"></td>
</tr>
<tr style="height:15"><td></td></tr> <!-- inter-row spacing -->
</tbody>
<!-- Identifier -->
<tbody>
<tr>
<td valign="baseline" align="right"><a name="Identifier">Identifier</a></td>
<td valign="baseline" align="center"><span class="meta">is</span></td>
<td valign="baseline" align="left">
one or more letters, digits, and underscores, starting with a letter
</td>
</tr>
</tbody>
<!-- IntegerLiteral -->
<tbody>
<tr>
<td valign="baseline" align="right"><a name="IntegerLiteral">IntegerLiteral</a></td>
<td valign="baseline" align="center"><span class="meta">is</span></td>
<td valign="baseline" align="left">
one or more decimal digits [see Java spec for largest]
</td>
</tr>
</tbody>
<!-- EOF -->
<tbody>
<tr>
<td valign="baseline" align="right"><a name="EOF">EOF</a></td>
<td valign="baseline" align="center"><span class="meta">is</span></td>
<td valign="baseline" align="left">
a distinguished token returned by the scanner at end-of-file
</td>
</tr>
</tbody>
</table>
</p><p>
There is a problem of consistency with Java concerning array access and array creation.
They are both expressions.
In Java <code>new int [5][4]</code> is 2D array creation and not array access
as in MiniJava <code>(new int [5])[4]</code>.
</p><h2>EBNF</h2>
<a href="http://www.cl.cam.ac.uk/~mgk25/iso-14977.pdf">ISO/IEC 14977: 1996(E)</a>
<ul>
<li>Terminal symbols are quoted
</li><li><span class="meta">[</span> and <span class="meta">]</span> indicate optional symbols
</li><li><span class="meta">{</span> and <span class="meta">}</span> indicate repetition
</li><li><span class="meta">(</span> and <span class="meta">)</span> group items together;
the other brackets do too
</li></ul>
<h2>MiniJava Character Set</h2>
Any sequence of bytes is potential input to the MiniJava compiler.
The MiniJava compiler should interpret the input as a text file of
<a href="https://en.wikipedia.org/wiki/ISO/IEC_8859-1">Latin-1 characters</a>.
This fixes the meaning of every 8-bit byte
as a single character (unlike UTF-8)--not necessarly a printable character.
The syntax of a MiniJava program actually requires only a subset of
<a href="http://en.wikipedia.org/wiki/ASCII">US-ASCII characters</a>
(which is a subset of <a href="https://en.wikipedia.org/wiki/ISO/IEC_8859-1">Latin-1</a>).
This is different than Java which handle multiple character sets as input.
<p>
No Java/Python unicode escapes <code>\uXXXX</code> are used in MiniJava,
but are easy to include using a JavaCC options: <code>JAVA_UNICODE_ESCAPE=true</code>.
</p><p>
Line terminators are LF, CF, or CF followed by LF.
In addition to the line terminators,
white space is SP, HT, or the FF characters.
(In Java the input can end with the US-ASCII SUB character,
also known as "control-Z".)
</p><h2>Java Comments</h2>
Comments are <tt>//</tt> to end of line and <tt>/* ... */</tt>, just
as in Java. The <tt>/* ... */</tt> comments do <em>not</em> nest in Java.
For example,
<pre>/*
One commment
/* Nested comment */
Bad things will happen
*/
</pre>
The second <tt>/*</tt> will be ignored (it is in a comment), and
the first <tt>*/</tt> will terminate the comment.
Now, "bad things will happen" as the remaining text is not a comment.
<p>
Appel, 2nd edition, page 484, describes comments in MiniJava as being nestable.
This is an interesting exercise for the scanner, but is not correct.
</p><p>
Any
<a href="https://en.wikipedia.org/wiki/ISO/IEC_8859-1">Latin-1</a>
character is legal in a Java comment.
</p><h2>Programming Meaning</h2>
Mini Java is supposed to be a subset of Java.
If the input is not a legal (lexically, syntactically, and semantically correct) Java 20 program, then
it is not a legal Mini Java program.
<pre>javac -encoding ISO-8859-1 ClassFile.java
</pre>
A Mini Java program behaves exactly like the Java program.
<p></p>
<p>
The following program is not legal in Java:
</p><pre>class Main {
void m() {
int goto = 3; // 'goto' is a reserved word in Java
}
}
</pre>
it should not be legal in Mini-Java.
<p></p>
<p>
A Mini-Java program with uninitilized variables ought to
be illegal just as in Java.
A Mini-java program with unreachable statements ought to
be illegal just as in Java.
However, it is not possible to write a Mini-Java program
with an unreachable statement.
</p><h2>Java Keywords</h2>
Many Java keywords are not used in MiniJava.
Consult the Java language specification for details.
Java now has contextual keywords.
<h2>Relaxations from Java</h2>
In order to simplify the programming project, we make the
following simplifications:
<ul>
<li>No unicode escapes.
</li><li>No byte, short, or long type.
</li><li>No char or String type.
</li><li>No floating-point types (float, double)
</li><li>No literal <tt>null</tt>.
</li><li>No test for primitive equality, or equality of references.
</li><li>Five or fewer formal arguments in methods.
</li><li>No methods are overriden.
</li><li>No methods are overloaded.
</li></ul>
(However, you may include these features, if you wish.)
<p>
A minimal Mini-Java compiler must, however, include the following features:
</p><ul>
<li>Subclass and subclass polymorphism.
</li><li>Inherited fields and methods.
</li></ul>
<br>
</body></html>