Skip to content

Commit 386f131

Browse files
committed
Adding README
1 parent fb170cf commit 386f131

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,22 @@
1-
# fjava
1+
# Functional Java Compiler
2+
3+
© Kai Chen
4+
5+
## Overview
6+
7+
**FJavaC** (Functional Java Compiler) is a compiler (for x86) written in OCaml for an extended version of Java with functional features such as *higher-order functions* and *nested function compositions*. The major components include a *front-end* (a lexer and parser), the *intermediate representation* (IR), the *functional intermediate representation* (FIR), and a *back-end* (code-generator, register allocator ...). The full compiler is too huge to be covered here. In this repo, we only present parts we found of most interest.
8+
9+
------
10+
11+
## Components of Interest
12+
* Front-end: [Lexer](./fj_ast_lex.mll), [Parser](./fj_ast_parse.mly).
13+
* Intermediate Representation (IR): [IR](./fj_ir.ml), [Abstract Syntax Tree (ast)](./fj_ir_ast.ml), [Expressions](./fj_ir_exp.ml).
14+
* Functional Intermediate Representation (FIR): [Continuation Passing Style (CPS) Conversion](./fj_fir_ir.ml), [Closure Conversion](./fj_fir_closure.ml).
15+
* Back-end: [Assembly Code Generation](./x86_codegen.ml), [Liveness Analysis](./ra_live.ml), [Register Allocation](./ra_main.ml).
16+
* Optimization: [Abstract Syntax Tree (ast) Optimization](./fj_ast_opt.ml), [Dead Code Elimination](./fj_fir_dead.ml), [Inlining/Constant Folding](./fj_fir_inline.ml).
17+
18+
------
19+
20+
## Examples
21+
* A demonstration of the usage of higher-order functions: [HigherOrder1.java](./HigherOrder1.java).
22+
* The assembly dump for HigherOrder1.java generated by our fjavac: [HigherOrder1.s](./HigherOrder1.s).

0 commit comments

Comments
 (0)