> Oolong permits to generate easily a ClassFile. One of my questions is:
> will all the Oolong programs generate valid class files. Or is it
> possible to have a valid Oolong program which will generate an invalid
> class file.
Without actually trying, I'd expect that Oolong would make it difficult or
impossible to create structurally invalid classfiles (e.g. all the constant
pool references would be valid). However it's easy enough to create classfiles
that fail the deeper analysis in "verification" -- for instance methods that:
declare too few locals.
return the wrong type
call a method the wrong type parameters
...etc..
E.g:
--------------
.class public super TestX
.super java/lang/Object
.method public <init> ()V
.limit stack 1
.limit locals 1
aload_0
invokespecial java/lang/Object/<init> ()V
return
.end method
.method public static main ([Ljava/lang/String;)V
.limit stack 2
.limit locals 1
getstatic java/lang/System/out Ljava/io/PrintStream;
bipush 33
invokevirtual java/io/PrintStream/println (Ljava/lang/String;)V
return
.end method
--------------
which creates a classfile that fails verification because it's calling a method
with the wrong type parameter on the stack.
> In the same idea, what is the algorithm used by oolong to check that the
> oolong program is valid. Is it only a syntactic check or will it also
> check the semantic of the instructions inside the program ?
The semantic validity of the programs is *your* affair -- if you want a
compiler
that looks after that for you then use java ;-)
> Where (aside the book of Engel) can I find more information
> (explanations) about Oolong and how it operates ?
> Is there an official site for oolong users ?
I don't know of any. (The book itself recommends this newsgroup ;-)
> What are the advantages of using Oolong rather than using some libraries
> like BCEL ?
Oolong is a (low-level) file-based programming language that generates
classfiles. BCEL is a library for bytecode analysis and manipulation. To
drive Oolong you use a text editor, to drive BCEL you write Java code. Which
do you want to do ?
-- chris