• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..20-Sep-2019-

ASCII_CharStream.javaH A D20-Sep-201910.8 KiB389310

ASTExpr.javaH A D20-Sep-201911.3 KiB331220

ASTFactor.javaH A D13-Sep-20191.6 KiB5520

ASTFunAppl.javaH A D13-Sep-20197.4 KiB252162

ASTFunDecl.javaH A D20-Sep-201913.9 KiB444295

ASTIdent.javaH A D13-Sep-20194.1 KiB14585

ASTIfExpr.javaH A D20-Sep-20195.5 KiB189115

ASTInteger.javaH A D13-Sep-20192.6 KiB9641

ASTLetExpr.javaH A D20-Sep-20195.6 KiB191108

ASTProgram.javaH A D20-Sep-201912.1 KiB338217

ASTTerm.javaH A D13-Sep-20191.6 KiB5520

EnvEntry.javaH A D13-Sep-2019985 296

Environment.javaH A D20-Sep-20195.2 KiB209124

Function.javaH A D20-Sep-20192.9 KiB8248

JJTMiniParserState.javaH A D13-Sep-20193.9 KiB14181

Mini.bnfH A D13-Sep-2019791 7659

Mini.jjH A D13-Sep-201913.3 KiB577544

Mini.jjtH A D13-Sep-20195.3 KiB311278

MiniC.javaH A D20-Sep-20196.1 KiB186133

MiniParser.javaH A D13-Sep-201931.4 KiB1,1491,062

MiniParserConstants.javaH A D13-Sep-20192.2 KiB10379

MiniParserTokenManager.javaH A D20-Sep-201922.5 KiB785748

MiniParserTreeConstants.javaH A D13-Sep-20191.4 KiB5128

Node.javaH A D20-Sep-20191.8 KiB5310

ParseException.javaH A D20-Sep-20197.3 KiB212112

READMEH A D13-Sep-20191.6 KiB5533

SimpleNode.javaH A D20-Sep-20192.8 KiB9852

Token.javaH A D13-Sep-20193.5 KiB10020

TokenMgrError.javaH A D20-Sep-20195.1 KiB15273

Variable.javaH A D13-Sep-20192.3 KiB6736

fac.miniH A D13-Sep-2019149 118

fib.miniH A D13-Sep-2019183 129

max.miniH A D13-Sep-2019378 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    https://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