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
|
.\" bock.1 -- describe the use of BOCK
.\" Written by Charles Briscoe-Smith; refer to the file LEGAL for details.
.TH BOCK 1 "19 Jul 1998"
.SH NAME
bock \- bootstrap-only compiler for a subset of Java(tm)
.SH SYNOPSIS
.B bock
.RB [ -s
.IR start-class ]
.RB [ -o
.IR output-file ]
.IR java-file \&...
.SH DESCRIPTION
.B BOCK
reads all the
.IR java-file s
specified on its command line, parses them as source code in a
language which is a subset of the Java(tm) language, and writes
an equivalent C program as output.
.PP
Please note that
.B BOCK
is
.B not
meant as a production compiler. It is a throw-away first-attempt
compiler. The second attempt,
.BR Jackal ,
will be written after
.B BOCK
is capable of compiling a reasonable subset of Java(tm) programs.
.B Jackal
will be written in the Java(tm) subset which
.B BOCK
can compile, resulting in a Java(tm) system which can be bootstrapped
entirely from a C-only environment.
.PP
.B BOCK
is a somewhat user-unfriendly command; it does not include the standard
library automatically, and it does not compile its C output into
native code automatically.
For a command which does these things, see
.BR jcomp (1).
.SH OPTIONS
.IP -s
Specifies the name of the class whose
.B main()
function should be called when the program is run.
If not specified,
.I Test
is used.
.IP -o
Specifies which file to write generated C to. If not specified,
.B BOCK
writes compiled code to its standard output.
.SH FILES
.B BOCK
does not use any external files other than those specified on its
command line.
.PP
There is a subset of the Java standard library in
.IR /usr/share/bock/lib/* .
No extra files are needed to implement the library's native methods.
.\" You will also need to copy
.\" .I /usr/share/bock/native.c
.\" to a directory where cpp can find it when compiling BOCK's output.
.SH "SEE ALSO"
The forthcoming
.B Jackal
compiler for the Java(tm) language.
.PP
.BR jcomp (1),
.IR /usr/doc/bock/* .
.SH DIAGNOSTICS
If
.B BOCK
detects an error or a construct it cannot compile, it writes a
message to its standard error output and terminates with a non-zero exit
code. There are many errors which
.B BOCK
does not detect.
.SH BUGS
.B BOCK
does not implement the Java(tm) language as specified.
The differences are mostly commented throughout the code. The most
significant differences from Java(tm) 1.0 are:
.IP \(bu
Very little error checking
.IP \(bu
No floating point support
.IP \(bu
No multithreading or synchronisation
.IP \(bu
No labeled statements (and thus no break or continue with label)
.IP \(bu
Et cetera; see
.I /usr/doc/bock/BUGS
for more
.PP
Because this compiler is only intended for bootstrapping a real,
self-hosted Java(tm) compiler system, I don't intend to remedy these
deficiencies.
.B BOCK
does not claim to be a standards-compliant Java(tm)
compiler.
.SH AUTHOR
.B BOCK
was written by Charles Briscoe-Smith. I own the copyright to this
program and its accompanying documentation. Please see the file
/usr/doc/bock/copyright for more information.
.PP
"Java", "Sun" and "Sun Microsystems" are trademarks or registered
trademarks of Sun Microsystems, Inc. This program was written with
reference to Gosling, Joy and Steele's "The Java Language Specification",
but without reference to Sun's JDK or any other Sun Microsystems code.
.PP
This compiler may infringe on patents owned by Sun Microsystems or others,
and it is certainly based on Sun copyrighted material (namely, the LALR(1)
grammar from "The Java Language Specification"). According to the licence
notice in the front of "The Java Language Specification", I am licenced
to use such of Sun's intellectual property as is necessary to practice
the Java(tm) language specification, provided that any implementation is
fully compliant with the specification. I therefore make this request
to Sun's legal department: please do not sue me for failing to make
.B BOCK
fully compliant. It's only a (not so) quick hack.
|