This commit is contained in:
Mylloon 2023-10-24 21:58:58 +02:00
parent 885f2e0790
commit 397dade946
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -22,18 +22,18 @@
%left let1
%left FUN
/* %left FUN */
%left STRING
%left INT CID CHAR WHILE
%left INT CID CHAR /* WHILE */
%left ID
%right REF DO
%left LET MATCH IF FOR
/* %right REF DO */
/* %left LET MATCH IF FOR */
%right ARROW
%right SEMICOLON
%left DOT
%left ASSIGN
%left LBRACE
%left BACKSLASH
/* %left BACKSLASH */
%left EXCLA COLON
@ -44,7 +44,7 @@
%left PLUS MINUS
%left SLASH STAR
%left ref1
/* %left ref1 */
%left fun1
%left app1
@ -291,11 +291,9 @@ simple_expression:
TypeAnnotation(e, t)
}
/* Tagged Value - Construction d'une donnée */
/*
| const=located(constructor) tl=option(type_list) el=optionlist(expr_list) {
/* | const=located(constructor) tl=option(type_list) el=optionlist(expr_list) {
Tagged(const, tl, el)
}
*/
} */
/* Tuple n = 0 - Construction d'un 0-uplet */
| LPAREN RPAREN {
@ -315,7 +313,7 @@ simple_expression:
}
/* Lecture de variable
* !expr */
| EXCLA e=located(simple_expression){
| EXCLA e=located(simple_expression) {
Read(e)
}
@ -357,18 +355,15 @@ expression:
e
}
/* Field - Projection dun champ */
/*
| e=located(expression) DOT l=located(label_identifier) tl=option(type_list) {
/* | e=located(expression) DOT l=located(label_identifier) tl=option(type_list) {
Field(e, l, tl)
}
} */
/* Sequence - Séquencement *
* Pas sûr, voir s'il ne faut pas une troisième couche d'expression */
/*
| e=located(mid_expression)
/* | e=located(mid_expression)
SEMICOLON e_list=separated_nonempty_list(SEMICOLON, located(mid_expression)) {
Sequence(e :: e_list)
}*/
} */
| e=located(expression) SEMICOLON e2=located(expression){
Sequence([e;e2])
@ -385,10 +380,9 @@ expression:
Fun(FunctionDefinition(p, e))
}
/* Application */
/*
| e1=located(expression) e2=located(expression) %prec app1 {
/* | e1=located(expression) e2=located(expression) %prec app1 {
Apply(e1, e2)
}
} */
/* Operateurs binaires - Application infixe */
| e1=located(expression) b=binop e2=located(expression) {
@ -466,17 +460,14 @@ expression:
}
/* Parenthésage
* Pas sûr mais je vois pas sinon */
/*
| LPAREN e=expression RPAREN {
/* | LPAREN e=expression RPAREN {
e
}*/
} */
/* Annotation de type
* (e : ty) */
/*
| LPAREN e=located(expression) COLON t=located(ty) RPAREN {
/* | LPAREN e=located(expression) COLON t=located(ty) RPAREN {
TypeAnnotation(e, t)
}
} */
/******************************** BASIC TYPES *********************************/