• Home
Name
Date
Size
#Lines
LOC

..--

ASCII_CharStream.javaD03-May-202410.3 KiB389310

ASTExpr.javaD03-May-202410.8 KiB331220

ASTFactor.javaD03-May-20241.5 KiB5620

ASTFunAppl.javaD03-May-20247 KiB253162

ASTFunDecl.javaD03-May-202413.1 KiB444294

ASTIdent.javaD03-May-20243.9 KiB14685

ASTIfExpr.javaD03-May-20245.3 KiB190115

ASTInteger.javaD03-May-20242.4 KiB9741

ASTLetExpr.javaD03-May-20245.3 KiB191107

ASTProgram.javaD03-May-202411.7 KiB339217

ASTTerm.javaD03-May-20241.5 KiB5620

EnvEntry.javaD03-May-2024995 306

Environment.javaD03-May-20244.9 KiB210124

Function.javaD03-May-20242.8 KiB8348

JJTMiniParserState.javaD03-May-20243.8 KiB14181

Mini.bnfD03-May-2024716 7659

Mini.jjD03-May-202412.7 KiB577544

Mini.jjtD03-May-20245 KiB311278

MiniC.javaD03-May-20245.8 KiB186133

MiniParser$JJCallsD03-May-2024363

MiniParser.javaD03-May-202430 KiB1,1491,062

MiniParserConstants.javaD03-May-20242.1 KiB10379

MiniParserTokenManager.javaD03-May-202421.5 KiB785748

MiniParserTreeConstants.javaD03-May-20241.4 KiB5128

Node.javaD03-May-20241.8 KiB5310

ParseException.javaD03-May-20247 KiB212112

READMED03-May-20241.6 KiB5533

SimpleNode.javaD03-May-20242.7 KiB9952

Token.javaD03-May-20243.4 KiB10020

TokenMgrError.javaD03-May-20244.9 KiB15273

Variable.javaD03-May-20242.2 KiB6836

fac.miniD03-May-2024139 118

fib.miniD03-May-2024172 129

max.miniD03-May-2024357 2218

README

1            Mini-Mini tutorial
2            ------------------
3
4Mini is a very simple (semi-functional) language that I wrote to test
5the generic package of BCEL.
6
7    http://commons.apache.org/bcel/
8
9Mini uses the JavaCC parser generator which comes precompiled from
10
11    http://www.webgain.com/products/java_cc/
12
13After  setting the  CLASSPATH to  the  directory  just above the  Mini
14directory, e.g.
15
16    % cd Mini
17    % setenv CLASSPATH $CLASSPATH:.:..
18
19try the following:
20
21    % java Mini.MiniC max.mini
22
23This produces a Java class file (max.class) which you can execute with
24
25    % java max
26
27Enter a number (4, eg.)  and you will be asked to enter 4 numbers. The
28program will then tell you the biggest of them.
29
30Alternatively you can  produce a  Java  file (max.java) which  will be
31translated automatically to a .class file.
32
33    % java Mini.MiniC -java max.mini
34
35There are three    examples programs  (max.mini,  fac.mini,  fib.mini)
36provided  which  demonstrate the language  syntax  and should be quite
37easy to understand.
38
39
40The compiler is not  that well documented, I'm  afraid, but  if you've
41ever seen a compiler before, you should be able to understand what I'm
42doing. The  part that  produces  the  byte code   is contained  in the
43byte_code() method  that  all AST   nodes implement.  Take  a  look at
44MiniC.java at line 85 and follow the recursive byte_code() calls.
45
46It's also useful to use  the listclass program provided with BCEL
47to examine the generated class. For example
48
49    % java listclass max.class
50
51
52Send bug reports and suggestions to
53
54    m.dahm@gmx.de (Markus Dahm)
55