aboutsummaryrefslogtreecommitdiff
path: root/examples/Mini/README
diff options
context:
space:
mode:
authorJason van Zyl <jvanzyl@apache.org>2001-10-29 19:59:54 +0000
committerJason van Zyl <jvanzyl@apache.org>2001-10-29 19:59:54 +0000
commit96ac0670cf9944d4912ab25ec885a4bea651443d (patch)
tree485cb3c3d889d1e3db129b44e60f6714924314c7 /examples/Mini/README
parent32e0972903c55452f01defb3322dc0ce9ef0dd58 (diff)
downloadapache-commons-bcel-96ac0670cf9944d4912ab25ec885a4bea651443d.tar.gz
Initial revision
git-svn-id: https://svn.apache.org/repos/asf/jakarta/bcel/trunk@152690 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'examples/Mini/README')
-rw-r--r--examples/Mini/README54
1 files changed, 54 insertions, 0 deletions
diff --git a/examples/Mini/README b/examples/Mini/README
new file mode 100644
index 00000000..8d0ebe7c
--- /dev/null
+++ b/examples/Mini/README
@@ -0,0 +1,54 @@
+ Mini-Mini tutorial
+ ------------------
+
+Mini is a very simple (semi-functional) language that I wrote to test
+the generic package of BCEL.
+
+ http://jakarta.apache.org/bcel/
+
+Mini uses the JavaCC parser generator which comes precompiled from
+
+ http://www.webgain.com/products/java_cc/
+
+After setting the CLASSPATH to the directory just above the Mini
+directory, e.g.
+
+ % cd Mini
+ % setenv CLASSPATH $CLASSPATH:.:..
+
+try the following:
+
+ % java Mini.MiniC max.mini
+
+This produces a Java class file (max.class) which you can execute with
+
+ % java max
+
+Enter a number (4, eg.) and you will be asked to enter 4 numbers. The
+program will then tell you the biggest of them.
+
+Alternatively you can produce a Java file (max.java) which will be
+translated automatically to a .class file.
+
+ % java Mini.MiniC -java max.mini
+
+There are three examples programs (max.mini, fac.mini, fib.mini)
+provided which demonstrate the language syntax and should be quite
+easy to understand.
+
+
+The compiler is not that well documented, I'm afraid, but if you've
+ever seen a compiler before, you should be able to understand what I'm
+doing. The part that produces the byte code is contained in the
+byte_code() method that all AST nodes implement. Take a look at
+MiniC.java at line 85 and follow the recursive byte_code() calls.
+
+It's also useful to use the listclass program provided with BCEL
+to examine the generated class. For example
+
+ % java listclass max.class
+
+
+Send bug reports and suggestions to
+
+ markus.dahm@berlin.de (Markus Dahm)