41 lines
883 B
OCaml
41 lines
883 B
OCaml
%{
|
|
open Structs;;
|
|
open Tactic;;
|
|
%}
|
|
|
|
/* Description des lexèmes définis dans lexer.mll */
|
|
%token LPAREN RPAREN RARROW TILDE FALSE
|
|
%token EOF
|
|
|
|
%token <string> VAR_NAME
|
|
%token <string> TYPE_NAME
|
|
|
|
%token DOT INTRO
|
|
|
|
/* L'ordre de définition définit la priorité */
|
|
%left RARROW
|
|
%nonassoc TILDE
|
|
|
|
%start main_type
|
|
%type <Structs.ty> main_type
|
|
|
|
%start main_tactic
|
|
%type <Tactic.tactic> main_tactic
|
|
|
|
%%
|
|
main_type:
|
|
| ty EOF { $1 }
|
|
|
|
ty:
|
|
| LPAREN ty RPAREN { $2 }
|
|
| ty RARROW ty { TImpl ($1, $3) }
|
|
| TYPE_NAME { TSimple $1 }
|
|
| TILDE ty { TImpl ($2, TFalse) }
|
|
| FALSE { TFalse }
|
|
|
|
main_tactic:
|
|
| tactic EOF { $1 }
|
|
|
|
tactic:
|
|
| INTRO VAR_NAME DOT { Intro $2 }
|