README.md 1.33 KB
Newer Older
qanastek's avatar
qanastek committed
1
# CERIcompiler
Dr. Pierre Jourlin's avatar
Dr. Pierre Jourlin committed
2

qanastek's avatar
qanastek committed
3 4 5
A simple compiler.
From : Pascal-like imperative LL(k) langage
To : 64 bit 80x86 assembly langage (AT&T)
Labrak Yanis's avatar
Labrak Yanis committed
6

7
**Download the repository :**
8

qanastek's avatar
qanastek committed
9
> git clone git@framagit.org:jourlin/cericompiler.git
10

qanastek's avatar
qanastek committed
11
**Build the compiler and test it :**
12

qanastek's avatar
qanastek committed
13
> make test
14

15
**Have a look at the output :**
16

17
> gedit test.s
18

19
**Debug the executable :**
20

21 22
> ddd ./test

23
**Commit the new version :**
24

25
> git commit -a -m "What's new..."
26

27
**Send to your framagit :**
28

29
> git push -u origin master
30

31
**Get from your framagit :**
32

33 34
> git pull -u origin master

qanastek's avatar
qanastek committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
**This version Can handle :**

// Program := [DeclarationPart] StatementPart
// DeclarationPart := "[" Identifier {"," Identifier} "]"
// StatementPart := Statement {";" Statement} "."
// Statement := AssignementStatement
// AssignementStatement := Identifier ":=" Expression

// Expression := SimpleExpression [RelationalOperator SimpleExpression]
// SimpleExpression := Term {AdditiveOperator Term}
// Term := Factor {MultiplicativeOperator Factor}
// Factor := Number | Letter | "(" Expression ")"| "!" Factor
// Number := Digit{Digit}
// Identifier := Letter {(Letter|Digit)}

// AdditiveOperator := "+" | "-" | "||"
// MultiplicativeOperator := "*" | "/" | "%" | "&&"
// RelationalOperator := "==" | "!=" | "<" | ">" | "<=" | ">="  
// Digit := "0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"
// Letter := "a"|...|"z"