зеркало из https://github.com/mozilla/pjs.git
d2eb2e3974 | ||
---|---|---|
.. | ||
build/java | ||
macbuild | ||
src/java | ||
test | ||
readme |
readme
J S C R E A D M E F I L E Jeff Dyer, Mountain View Compiler Company Dec-15-2000 OVERVIEW JSC (JavaScript Compiler) is a stand-alone front-end implementation of the JS2 language specification. Its purpose is to demonstrate how JS2 programs are statically prepared for execution by a JS2 interpreter. Its output is a psuedo intermediate language suitable for reading by human beings. BUILDING JSC Before you start make sure you have a current version of the Java SDK installed on your system. If it is correctly installed, you can type 'javac' at the command-line and see something like: Usage: javac <options> <source files> followed by a bunch of other documentation text. NOTE: I've only tried to build on NT40 using Java2 1.3.0_01. You may get different results in different environments. Go to the directory ./build/java, and run your favorite make utility, such as: make If all goes well, the sanity test will run and you will see something like ../../test/sanity.js: 0 errors [120 msec] --> completion( 0, okay, null ) on the last line of the console output. To run more extensive tests, use the build command: make test There are also build targets for each of the components (input, lexer, parser, semantics, and generator) of the compiler. Thus, a useful idiom is to give 'make' two targets, the component you just modified followed by the sanity test target like this: make parser sanity To automatically rebuild the parser and run the sanity test. What's missing is any kind of dependency rules, so using the root target always rebuilds everything. This, for the sake of keeping it simple. RUNNING JSC From the ./build/java directory, use the following command: java -classpath classes Main program.js where 'program.js' is the name of the file to compile. JSC will produce a new file given the name of the original source file with the suffix '.jsil' appended to it. Errors are written to a file with the suffix '.err' appended to it. STATUS OF JSC Dec-1-2000 ---------- Signficant portions of the type system, compile-time constant evaluator, and name management systems are working. Missing are semantics for using, import, export, and unit parsing. More tests are also needed. ISSUES * Intermediate form of references, classes, and interfaces. CHANGES Dec-15-2000 ----------- Removed dependency on sun.tools packages. Dec-1-2000 ---------- * Original checkin to mozilla.org. * Updated readme. * NPL copyright notice added to all source files. Nov-30-2000 ----------- * Folded definition evaluation into constant evaluation since annotated definitions cannot be evaluated until the constant attribute values have been computed. Now there is a BlockEvaluator and a ConstantEvaluator. * Added an error handler to the constant evaluator. * Simplified the type system. Nov-16-2000 ----------- * Original release.