fmt
This commit is contained in:
parent
885f2e0790
commit
397dade946
1 changed files with 19 additions and 28 deletions
|
@ -22,18 +22,18 @@
|
||||||
%left let1
|
%left let1
|
||||||
|
|
||||||
|
|
||||||
%left FUN
|
/* %left FUN */
|
||||||
%left STRING
|
%left STRING
|
||||||
%left INT CID CHAR WHILE
|
%left INT CID CHAR /* WHILE */
|
||||||
%left ID
|
%left ID
|
||||||
%right REF DO
|
/* %right REF DO */
|
||||||
%left LET MATCH IF FOR
|
/* %left LET MATCH IF FOR */
|
||||||
%right ARROW
|
%right ARROW
|
||||||
%right SEMICOLON
|
%right SEMICOLON
|
||||||
%left DOT
|
%left DOT
|
||||||
%left ASSIGN
|
%left ASSIGN
|
||||||
%left LBRACE
|
%left LBRACE
|
||||||
%left BACKSLASH
|
/* %left BACKSLASH */
|
||||||
|
|
||||||
%left EXCLA COLON
|
%left EXCLA COLON
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
%left PLUS MINUS
|
%left PLUS MINUS
|
||||||
%left SLASH STAR
|
%left SLASH STAR
|
||||||
|
|
||||||
%left ref1
|
/* %left ref1 */
|
||||||
%left fun1
|
%left fun1
|
||||||
%left app1
|
%left app1
|
||||||
|
|
||||||
|
@ -291,11 +291,9 @@ simple_expression:
|
||||||
TypeAnnotation(e, t)
|
TypeAnnotation(e, t)
|
||||||
}
|
}
|
||||||
/* Tagged Value - Construction d'une donnée */
|
/* 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)
|
Tagged(const, tl, el)
|
||||||
}
|
} */
|
||||||
*/
|
|
||||||
|
|
||||||
/* Tuple n = 0 - Construction d'un 0-uplet */
|
/* Tuple n = 0 - Construction d'un 0-uplet */
|
||||||
| LPAREN RPAREN {
|
| LPAREN RPAREN {
|
||||||
|
@ -315,7 +313,7 @@ simple_expression:
|
||||||
}
|
}
|
||||||
/* Lecture de variable
|
/* Lecture de variable
|
||||||
* !expr */
|
* !expr */
|
||||||
| EXCLA e=located(simple_expression){
|
| EXCLA e=located(simple_expression) {
|
||||||
Read(e)
|
Read(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,18 +355,15 @@ expression:
|
||||||
e
|
e
|
||||||
}
|
}
|
||||||
/* Field - Projection d’un champ */
|
/* Field - Projection d’un 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)
|
Field(e, l, tl)
|
||||||
}
|
} */
|
||||||
/* Sequence - Séquencement *
|
/* Sequence - Séquencement *
|
||||||
* Pas sûr, voir s'il ne faut pas une troisième couche d'expression */
|
* 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)) {
|
SEMICOLON e_list=separated_nonempty_list(SEMICOLON, located(mid_expression)) {
|
||||||
Sequence(e :: e_list)
|
Sequence(e :: e_list)
|
||||||
}*/
|
} */
|
||||||
|
|
||||||
| e=located(expression) SEMICOLON e2=located(expression){
|
| e=located(expression) SEMICOLON e2=located(expression){
|
||||||
Sequence([e;e2])
|
Sequence([e;e2])
|
||||||
|
@ -385,10 +380,9 @@ expression:
|
||||||
Fun(FunctionDefinition(p, e))
|
Fun(FunctionDefinition(p, e))
|
||||||
}
|
}
|
||||||
/* Application */
|
/* Application */
|
||||||
/*
|
/* | e1=located(expression) e2=located(expression) %prec app1 {
|
||||||
| e1=located(expression) e2=located(expression) %prec app1 {
|
|
||||||
Apply(e1, e2)
|
Apply(e1, e2)
|
||||||
}
|
} */
|
||||||
|
|
||||||
/* Operateurs binaires - Application infixe */
|
/* Operateurs binaires - Application infixe */
|
||||||
| e1=located(expression) b=binop e2=located(expression) {
|
| e1=located(expression) b=binop e2=located(expression) {
|
||||||
|
@ -466,17 +460,14 @@ expression:
|
||||||
}
|
}
|
||||||
/* Parenthésage
|
/* Parenthésage
|
||||||
* Pas sûr mais je vois pas sinon */
|
* Pas sûr mais je vois pas sinon */
|
||||||
|
/* | LPAREN e=expression RPAREN {
|
||||||
/*
|
|
||||||
| LPAREN e=expression RPAREN {
|
|
||||||
e
|
e
|
||||||
}*/
|
} */
|
||||||
/* Annotation de type
|
/* Annotation de type
|
||||||
* (e : ty) */
|
* (e : ty) */
|
||||||
/*
|
/* | LPAREN e=located(expression) COLON t=located(ty) RPAREN {
|
||||||
| LPAREN e=located(expression) COLON t=located(ty) RPAREN {
|
|
||||||
TypeAnnotation(e, t)
|
TypeAnnotation(e, t)
|
||||||
}
|
} */
|
||||||
|
|
||||||
|
|
||||||
/******************************** BASIC TYPES *********************************/
|
/******************************** BASIC TYPES *********************************/
|
||||||
|
|
Reference in a new issue