This commit is contained in:
Vu Tuan Minh
2025-04-30 12:54:49 +02:00
parent 44a1d9918f
commit 23059a87b8
2 changed files with 47 additions and 9 deletions

View File

@@ -1,17 +1,55 @@
# TP2 PDS - VSL+
Ce projet VSCode contient tout le nécessaire pour commencer à programmer le compilateur.
Vous pouvez forker ce dépôt, mais devez impérativement garder votre dépôt privé.
Ce fichier `README.md` doit être complété au fur et à mesure de votre avancement.
func::=Func(String,)
Réalisé par Thibaut ROCHAS et Tuan Minh VU
#### Program
```
Program ::= Program(Function+)
```
#### Function
```
Function ::= Function(Type, String, Var*, Instruction)
| Prototype(Type, String, Var*)
```
#### Var
```
Var ::= Var(String)
```
#### Declaration
```
Declaration ::= Declaration(Type, String+)
```
#### Instruction
```
Instruction ::= Assign(String, Expression)
| Return(Expression)
| Bloc(Instruction+)
| BlocWithDecl(DeclarationList, Instruction+)
| VoidFunctionCall(String, Expression*)
| IfThen(Expression, Instruction)
| IfThenElse(Expression, Instruction, Instruction)
| While(Expression, Instruction)
| Read(Var+)
| Print(ExpressionOuText+)
```
#### Expression
```
ExpressionOuText ::= Expression
| Text(String)
Expression ::= Binop(Op, Expression, Expression)
| Const(Int)
| Var(String)
| Call(String, Expression*)
| Paren(Expression)
```
#### Autres
```
Op ::= PLUS | MINUS | TIMES | DIV | MOD
Type ::= INT | VOID
```
## Etat
## Compatibilité

BIN
a.out

Binary file not shown.