-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser.mly
More file actions
44 lines (35 loc) · 884 Bytes
/
parser.mly
File metadata and controls
44 lines (35 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
%{
(* Patchdep
*
* parser.mly
* Copyright (C) 2007-2008
* Sapan Bhatia <sapanb@cs.princeton.edu>
* PlanetLab*)
open Types
open Printf
let log s = printf "%s\n" s;flush Pervasives.stdout
%}
%token <int*int> CHANGESPEC
%token <string> FILEDEF
%token CHANGEDEF
%token EOF
%start file
%start filespeclist
%type <Types.filespeclist> filespeclist file
%%
changespec:
| CHANGESPEC CHANGESPEC {ChangeSpec($1 ,$2)}
;
changespeclist:
| changespeclist changespec {$1 @ [$2]}
| { [] }
;
filespec:
| FILEDEF changespeclist {FileSpec($1, $2)}
;
filespeclist:
| filespeclist filespec {$1 @ [$2]}
| { [] }
;
file: filespeclist EOF { $1 }
;