Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ replay_pid*

.idea

target
target

*.o
.run
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ The EeZee programming language is designed to allow us to learn various compiler
The EeZee programming language is a tiny statically typed language with syntax inspired by Swift.
The language has the following features:

* Integer, Struct and 1-Dimensional Array types
* Integer, Float, Struct and 1-Dimensional Array types
* If and While statements
* Functions

The EeZee language specification is [available](https://compilerprogramming.github.io/ez-lang.html).
The EeZee language specification is [available](./docs/ez-lang.rst).
The language is intentionally very simple and is meant to have just enough functionality to experiment with compiler implementation techniques.

## Modules
Expand All @@ -31,6 +31,10 @@ The project is under development and subject to change. At this point in time, w
* [seaofnodes](./seaofnodes/README.md) - WIP compiler that generates Sea of Nodes IR, using SoN backend from [Simple Chapter 21](https://github.com/SeaOfNodes/Simple).
Generates native code for X86-64, AArch64 and RISC-V.

## Documentation

See [docs](./docs)

## How can you contribute?

The project is educational, with a focus on exploring various compiler algorithms and data structures.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ typeName

nominalType
: 'Int'
| 'Float'
| IDENTIFIER ('?')?
;

Expand Down Expand Up @@ -86,7 +87,7 @@ additionExpression
;

multiplicationExpression
: unaryExpression (('*' | '/' ) unaryExpression)*
: unaryExpression (('*' | '/' | '%') unaryExpression)*
;

unaryExpression
Expand Down Expand Up @@ -116,6 +117,7 @@ fieldExpression

primaryExpression
: INTEGER_LITERAL
| FLOAT_LITERAL
| IDENTIFIER
| '(' orExpression ')'
| 'new' typeName initExpression
Expand Down Expand Up @@ -156,7 +158,9 @@ NON_DIGIT
INTEGER_LITERAL
: DEC_LITERAL
;
DEC_LITERAL: DEC_DIGIT (DEC_DIGIT | '_')*;
DEC_LITERAL: DEC_DIGIT+;

FLOAT_LITERAL: DEC_DIGIT+ '.' DEC_DIGIT*;

fragment DEC_DIGIT: [0-9];

Expand Down
19 changes: 19 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Documentation

This folder contains language and compiler design notes for ez-lang.

## Language

- [EeZee Programming Language](ez-lang.rst) - Source language overview, including syntax, types, control flow, expressions, and grammar.

## Intermediate Representations

- [Intermediate Representations](ir-overview.rst) - Overview of the compiler IRs used in the project, including stack-based, register-based, and sea-of-nodes forms.
- [IR Design Instructions](ir-design-instructions.md) - Notes on designing linear IRs, including basic blocks, control flow graphs, and instruction organization.
- [Virtual Registers](ir-virtual-registers.md) - Design discussion for virtual register representation, source variable slots, temporaries, and register identity.

## Data-Flow And SSA

- [Liveness Analysis](liveness.md) - Description of the liveness sets and algorithm used by the optimizing VM.
- [SSA Construction](ssa-construction.md) - Explanation of SSA conversion, dominance-frontier phi placement, and register renaming.
- [SSA Destruction Using Briggs](ssa-destruction-briggs.md) - Explanation of the Briggs SSA destruction algorithm and how phi nodes are lowered to copies.
Loading
Loading