judicael.opp.exp 660 Bytes
Newer Older
1 2 3 4
File "judicael.mly", line 7, characters 7-10:
Warning: the token FIN is unused.
%start main
%token FIN
5 6 7 8
%token <string> IDENT
%token <int> INT
%token PAREND
%token PARENG
9
%token PLUS
10
%left PLUS
11 12 13 14
%type <unit> main
%%

main:
15
  _1 = instruction
16
    {                    (print_string "\ninstruction\n"; flush stdout)}
17 18

expr:
19
  _1 = INT
20 21 22 23 24
    { (
		print_string "\nINT:"; print_int _1;flush stdout
	)}
| _1 = expr _2 = PLUS _3 = expr
    { (
25
	  print_string "\nPlus"
26
	)}
27 28

instruction:
29
  _1 = expr
30 31 32
    {     ( print_string "\ninstruction\n" ; flush stdout )}
| _1 = IDENT _2 = PARENG _3 = PAREND
    {                     ( print_string "\nCall" ; flush stdout)}
33 34 35 36

%%