diff --git a/README.html b/README.html index 4ece1a49..d91ae8c9 100644 --- a/README.html +++ b/README.html @@ -17,7 +17,7 @@ Getting Started with LuaJ -James Roseborough, Ian Farmer, Version 1.9.50 +James Roseborough, Ian Farmer, Version 1.9.53
Copyright © 2007-2009 Luaj.org. @@ -42,7 +42,7 @@ Freely available under the terms of the
-This is a development release for a planned luaj 2.0. The most recent stable release is 1.0.1 +This is a development release for a planned luaj 2.0. The most recent stable release is 1.0.2 @@ -54,7 +54,7 @@ This is a development release for a planned luaj 2.0. The most recent stable re From the main distribution directory line type:
- java -cp lib/luaj-jse-1.9.50.jar lua examples/lua/hello.lua + java -cp lib/luaj-jse-1.9.53.jar lua examples/lua/hello.lua
@@ -99,7 +99,7 @@ A simple example may be found in
-You must include the library lib/luaj-jse-1.9.50.jar in your class path. +You must include the library lib/luaj-jse-1.9.53.jar in your class path.
-You must include the library lib/luaj-jme-1.9.50.jar in your midlet jar. +You must include the library lib/luaj-jme-1.9.53.jar in your midlet jar. They can be obfuscated if desired.
-You must include the library lib/luaj-jse-1.9.50.jar in your class path. +You must include the library lib/luaj-jse-1.9.53.jar in your class path.
A working example may be found in @@ -171,6 +171,47 @@ A working example may be found in examples/jse/ScriptEngineSample.java +
+A code generator that compiles lua to java bytecode base on the +bcel library is now included. + +
+To use it at runtime, the tool "lua" has an option "-j" to compile into java bytecode. + +
+ java -cp luaj-jse-1.9.53.jar;lib/bcel-5.2.jar lua -j examples/lua/hello.lua ++ +
+To compile lua files into Java in advance, the tool "luajc" is provided: + +
+ cp examples/lua/hello.lua . + java -cp luaj-jse-1.9.53.jar;lib/bcel-5.2.jar luajc hello.lua + ls -l hello.class ++ +You should see a class file of 906 bytes or so. A version of the bcel +library must be in your class path for code generation to work. +The ant script contains a target for fetching bcel v 5.2: + +
+ ant bcel-lib ++ +
+Files compiled into java in this way can be run via Java class loading, without the bcel libraries +(generated class files must be in your class path): + +
+ java -cp luaj-jse-1.9.53.jar;. lua -l hello ++ +The current bytecode generator produces a separate class file for each prototype, +and generated class files do not work properly with module() or setfenv(). +
See a longer sample in src/test/res/swingapp.lua for details, or try running it using:
- java -cp lib/luaj-jse-1.9.50.jar lua src/test/res/swingapp.lua + java -cp lib/luaj-jse-1.9.53.jar lua src/test/res/swingapp.lua
@@ -317,7 +358,7 @@ These tests are used for to produce code coverage statistics using build-coverag
|