summaryrefslogtreecommitdiffstats
path: root/testsuite/tests/tool-lexyacc/main.reference
blob: f3dac422910d44f94ae1dd1e97f37ae1cfd58d6f (plain)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
66 states, 44 actions.

open Syntax
open Grammar
open Scan_aux

let rec action_43 lexbuf = (
 comment lexbuf )
and action_42 lexbuf = (
 raise(Lexical_error "unterminated comment") )
and action_41 lexbuf = (
 reset_string_buffer();
      string lexbuf;
      reset_string_buffer();
      comment lexbuf )
and action_40 lexbuf = (
 decr comment_depth;
      if !comment_depth = 0 then () else comment lexbuf )
and action_39 lexbuf = (
 incr comment_depth; comment lexbuf )
and action_38 lexbuf = (
 raise(Lexical_error "bad character constant") )
and action_37 lexbuf = (
 char_for_decimal_code lexbuf 1 )
and action_36 lexbuf = (
 char_for_backslash (Lexing.lexeme_char lexbuf 1) )
and action_35 lexbuf = (
 Lexing.lexeme_char lexbuf 0 )
and action_34 lexbuf = (
 store_string_char(Lexing.lexeme_char lexbuf 0);
      string lexbuf )
and action_33 lexbuf = (
 raise(Lexical_error "unterminated string") )
and action_32 lexbuf = (
 store_string_char(char_for_decimal_code lexbuf 1);
      string lexbuf )
and action_31 lexbuf = (
 store_string_char(char_for_backslash(Lexing.lexeme_char lexbuf 1));
      string lexbuf )
and action_30 lexbuf = (
 string lexbuf )
and action_29 lexbuf = (
 () )
and action_28 lexbuf = (
 action lexbuf )
and action_27 lexbuf = (
 raise (Lexical_error "unterminated action") )
and action_26 lexbuf = (
 comment_depth := 1;
      comment lexbuf;
      action lexbuf )
and action_25 lexbuf = (
 let _ = char lexbuf in action lexbuf )
and action_24 lexbuf = (
 reset_string_buffer();
      string lexbuf;
      reset_string_buffer();
      action lexbuf )
and action_23 lexbuf = (
 decr brace_depth;
      if !brace_depth = 0 then Lexing.lexeme_start lexbuf else action lexbuf )
and action_22 lexbuf = (
 incr brace_depth;
      action lexbuf )
and action_21 lexbuf = (
 raise(Lexical_error("illegal character " ^ Lexing.lexeme lexbuf)) )
and action_20 lexbuf = (
 raise(Lexical_error "unterminated lexer definition") )
and action_19 lexbuf = (
 Tdash )
and action_18 lexbuf = (
 Tcaret )
and action_17 lexbuf = (
 Trparen )
and action_16 lexbuf = (
 Tlparen )
and action_15 lexbuf = (
 Tplus )
and action_14 lexbuf = (
 Tmaybe )
and action_13 lexbuf = (
 Tstar )
and action_12 lexbuf = (
 Trbracket )
and action_11 lexbuf = (
 Tlbracket )
and action_10 lexbuf = (
 Teof )
and action_9 lexbuf = (
 Tunderscore )
and action_8 lexbuf = (
 Tor )
and action_7 lexbuf = (
 Tend )
and action_6 lexbuf = (
 Tequal )
and action_5 lexbuf = (
 let n1 = Lexing.lexeme_end lexbuf in
        brace_depth := 1;
        let n2 = action lexbuf in
          Taction(Location(n1, n2)) )
and action_4 lexbuf = (
 Tchar(char lexbuf) )
and action_3 lexbuf = (
 reset_string_buffer();
      string lexbuf;
      Tstring(get_stored_string()) )
and action_2 lexbuf = (
 match Lexing.lexeme lexbuf with
        "rule" -> Trule
      | "parse" -> Tparse
      | "and" -> Tand
      | "eof" -> Teof
      | s -> Tident s )
and action_1 lexbuf = (
 comment_depth := 1;
      comment lexbuf;
      main lexbuf )
and action_0 lexbuf = (
 main lexbuf )
and state_0 lexbuf =
  match lexing.next_char lexbuf with
    'z'|'y'|'x'|'w'|'v'|'u'|'t'|'s'|'r'|'q'|'p'|'o'|'n'|'m'|'l'|'k'|'j'|'i'|'h'|'g'|'f'|'d'|'c'|'b'|'a'|'Z'|'Y'|'X'|'W'|'V'|'U'|'T'|'S'|'R'|'Q'|'P'|'O'|'N'|'M'|'L'|'K'|'J'|'I'|'H'|'G'|'F'|'E'|'D'|'C'|'B'|'A' -> state_51 lexbuf
 |  ' '|'\013'|'\n'|'\t' -> state_40 lexbuf
 |  '|' -> action_8 lexbuf
 |  '{' -> action_5 lexbuf
 |  'e' -> state_56 lexbuf
 |  '_' -> state_55 lexbuf
 |  '^' -> action_18 lexbuf
 |  ']' -> action_12 lexbuf
 |  '[' -> action_11 lexbuf
 |  '?' -> action_14 lexbuf
 |  '=' -> action_6 lexbuf
 |  ';' -> state_48 lexbuf
 |  '-' -> action_19 lexbuf
 |  '+' -> action_15 lexbuf
 |  '*' -> action_13 lexbuf
 |  ')' -> action_17 lexbuf
 |  '(' -> state_43 lexbuf
 |  '\'' -> action_4 lexbuf
 |  '"' -> action_3 lexbuf
 |  '\000' -> action_20 lexbuf
 |  _ -> action_21 lexbuf
and state_1 lexbuf =
  match lexing.next_char lexbuf with
    '}' -> action_23 lexbuf
 |  '{' -> action_22 lexbuf
 |  '(' -> state_34 lexbuf
 |  '\'' -> action_25 lexbuf
 |  '"' -> action_24 lexbuf
 |  '\000' -> action_27 lexbuf
 |  _ -> action_28 lexbuf
and state_2 lexbuf =
  match lexing.next_char lexbuf with
    '\\' -> state_24 lexbuf
 |  '"' -> action_29 lexbuf
 |  '\000' -> action_33 lexbuf
 |  _ -> action_34 lexbuf
and state_3 lexbuf =
  match lexing.next_char lexbuf with
    '\\' -> state_13 lexbuf
 |  '\000' -> lexing.backtrack lexbuf
 |  _ -> state_12 lexbuf
and state_4 lexbuf =
  match lexing.next_char lexbuf with
    '*' -> state_9 lexbuf
 |  '(' -> state_8 lexbuf
 |  '"' -> action_41 lexbuf
 |  '\000' -> action_42 lexbuf
 |  _ -> action_43 lexbuf
and state_8 lexbuf =
  Lexing.set_backtrack lexbuf action_43;
  match lexing.next_char lexbuf with
    '*' -> action_39 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_9 lexbuf =
  Lexing.set_backtrack lexbuf action_43;
  match lexing.next_char lexbuf with
    ')' -> action_40 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_12 lexbuf =
  Lexing.set_backtrack lexbuf action_38;
  match lexing.next_char lexbuf with
    '\'' -> action_35 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_13 lexbuf =
  Lexing.set_backtrack lexbuf action_38;
  match lexing.next_char lexbuf with
    '9'|'8'|'7'|'6'|'5'|'4'|'3'|'2'|'1'|'0' -> state_15 lexbuf
 |  't'|'r'|'n'|'b'|'\\'|'\'' -> state_14 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_14 lexbuf =
  match lexing.next_char lexbuf with
    '\'' -> action_36 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_15 lexbuf =
  match lexing.next_char lexbuf with
    '9'|'8'|'7'|'6'|'5'|'4'|'3'|'2'|'1'|'0' -> state_16 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_16 lexbuf =
  match lexing.next_char lexbuf with
    '9'|'8'|'7'|'6'|'5'|'4'|'3'|'2'|'1'|'0' -> state_17 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_17 lexbuf =
  match lexing.next_char lexbuf with
    '\'' -> action_37 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_24 lexbuf =
  Lexing.set_backtrack lexbuf action_34;
  match lexing.next_char lexbuf with
    '9'|'8'|'7'|'6'|'5'|'4'|'3'|'2'|'1'|'0' -> state_27 lexbuf
 |  't'|'r'|'n'|'b'|'\\'|'"' -> action_31 lexbuf
 |  ' '|'\026'|'\013'|'\012'|'\n'|'\t' -> state_25 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_25 lexbuf =
  Lexing.set_backtrack lexbuf action_30;
  match lexing.next_char lexbuf with
    ' '|'\026'|'\013'|'\012'|'\n'|'\t' -> state_25 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_27 lexbuf =
  match lexing.next_char lexbuf with
    '9'|'8'|'7'|'6'|'5'|'4'|'3'|'2'|'1'|'0' -> state_28 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_28 lexbuf =
  match lexing.next_char lexbuf with
    '9'|'8'|'7'|'6'|'5'|'4'|'3'|'2'|'1'|'0' -> action_32 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_34 lexbuf =
  Lexing.set_backtrack lexbuf action_28;
  match lexing.next_char lexbuf with
    '*' -> action_26 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_40 lexbuf =
  Lexing.set_backtrack lexbuf action_0;
  match lexing.next_char lexbuf with
    ' '|'\013'|'\n'|'\t' -> state_65 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_43 lexbuf =
  Lexing.set_backtrack lexbuf action_16;
  match lexing.next_char lexbuf with
    '*' -> action_1 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_48 lexbuf =
  Lexing.set_backtrack lexbuf action_21;
  match lexing.next_char lexbuf with
    ';' -> action_7 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_51 lexbuf =
  Lexing.set_backtrack lexbuf action_2;
  match lexing.next_char lexbuf with
    'z'|'y'|'x'|'w'|'v'|'u'|'t'|'s'|'r'|'q'|'p'|'o'|'n'|'m'|'l'|'k'|'j'|'i'|'h'|'g'|'f'|'e'|'d'|'c'|'b'|'a'|'Z'|'Y'|'X'|'W'|'V'|'U'|'T'|'S'|'R'|'Q'|'P'|'O'|'N'|'M'|'L'|'K'|'J'|'I'|'H'|'G'|'F'|'E'|'D'|'C'|'B'|'A'|'9'|'8'|'7'|'6'|'5'|'4'|'3'|'2'|'1'|'0'|'\'' -> state_59 lexbuf
 |  '_' -> state_60 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_55 lexbuf =
  Lexing.set_backtrack lexbuf action_9;
  match lexing.next_char lexbuf with
    'z'|'y'|'x'|'w'|'v'|'u'|'t'|'s'|'r'|'q'|'p'|'o'|'n'|'m'|'l'|'k'|'j'|'i'|'h'|'g'|'f'|'e'|'d'|'c'|'b'|'a'|'Z'|'Y'|'X'|'W'|'V'|'U'|'T'|'S'|'R'|'Q'|'P'|'O'|'N'|'M'|'L'|'K'|'J'|'I'|'H'|'G'|'F'|'E'|'D'|'C'|'B'|'A'|'9'|'8'|'7'|'6'|'5'|'4'|'3'|'2'|'1'|'0'|'\'' -> state_59 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_56 lexbuf =
  Lexing.set_backtrack lexbuf action_2;
  match lexing.next_char lexbuf with
    'z'|'y'|'x'|'w'|'v'|'u'|'t'|'s'|'r'|'q'|'p'|'n'|'m'|'l'|'k'|'j'|'i'|'h'|'g'|'f'|'e'|'d'|'c'|'b'|'a'|'Z'|'Y'|'X'|'W'|'V'|'U'|'T'|'S'|'R'|'Q'|'P'|'O'|'N'|'M'|'L'|'K'|'J'|'I'|'H'|'G'|'F'|'E'|'D'|'C'|'B'|'A'|'9'|'8'|'7'|'6'|'5'|'4'|'3'|'2'|'1'|'0'|'\'' -> state_59 lexbuf
 |  'o' -> state_61 lexbuf
 |  '_' -> state_60 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_59 lexbuf =
  Lexing.set_backtrack lexbuf action_2;
  match lexing.next_char lexbuf with
    'z'|'y'|'x'|'w'|'v'|'u'|'t'|'s'|'r'|'q'|'p'|'o'|'n'|'m'|'l'|'k'|'j'|'i'|'h'|'g'|'f'|'e'|'d'|'c'|'b'|'a'|'Z'|'Y'|'X'|'W'|'V'|'U'|'T'|'S'|'R'|'Q'|'P'|'O'|'N'|'M'|'L'|'K'|'J'|'I'|'H'|'G'|'F'|'E'|'D'|'C'|'B'|'A'|'9'|'8'|'7'|'6'|'5'|'4'|'3'|'2'|'1'|'0'|'\'' -> state_59 lexbuf
 |  '_' -> state_60 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_60 lexbuf =
  match lexing.next_char lexbuf with
    'z'|'y'|'x'|'w'|'v'|'u'|'t'|'s'|'r'|'q'|'p'|'o'|'n'|'m'|'l'|'k'|'j'|'i'|'h'|'g'|'f'|'e'|'d'|'c'|'b'|'a'|'Z'|'Y'|'X'|'W'|'V'|'U'|'T'|'S'|'R'|'Q'|'P'|'O'|'N'|'M'|'L'|'K'|'J'|'I'|'H'|'G'|'F'|'E'|'D'|'C'|'B'|'A'|'9'|'8'|'7'|'6'|'5'|'4'|'3'|'2'|'1'|'0'|'\'' -> state_59 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_61 lexbuf =
  Lexing.set_backtrack lexbuf action_2;
  match lexing.next_char lexbuf with
    'z'|'y'|'x'|'w'|'v'|'u'|'t'|'s'|'r'|'q'|'p'|'o'|'n'|'m'|'l'|'k'|'j'|'i'|'h'|'g'|'e'|'d'|'c'|'b'|'a'|'Z'|'Y'|'X'|'W'|'V'|'U'|'T'|'S'|'R'|'Q'|'P'|'O'|'N'|'M'|'L'|'K'|'J'|'I'|'H'|'G'|'F'|'E'|'D'|'C'|'B'|'A'|'9'|'8'|'7'|'6'|'5'|'4'|'3'|'2'|'1'|'0'|'\'' -> state_59 lexbuf
 |  'f' -> state_62 lexbuf
 |  '_' -> state_60 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_62 lexbuf =
  Lexing.set_backtrack lexbuf action_2;
  match lexing.next_char lexbuf with
    'z'|'y'|'x'|'w'|'v'|'u'|'t'|'s'|'r'|'q'|'p'|'o'|'n'|'m'|'l'|'k'|'j'|'i'|'h'|'g'|'f'|'e'|'d'|'c'|'b'|'a'|'Z'|'Y'|'X'|'W'|'V'|'U'|'T'|'S'|'R'|'Q'|'P'|'O'|'N'|'M'|'L'|'K'|'J'|'I'|'H'|'G'|'F'|'E'|'D'|'C'|'B'|'A'|'9'|'8'|'7'|'6'|'5'|'4'|'3'|'2'|'1'|'0'|'\'' -> state_59 lexbuf
 |  '_' -> state_60 lexbuf
 |  _ -> lexing.backtrack lexbuf
and state_65 lexbuf =
  Lexing.set_backtrack lexbuf action_0;
  match lexing.next_char lexbuf with
    ' '|'\013'|'\n'|'\t' -> state_65 lexbuf
 |  _ -> lexing.backtrack lexbuf
and main lexbuf =
  Lexing.init lexbuf;
  state_0 lexbuf

and action lexbuf =
  Lexing.init lexbuf;
  state_1 lexbuf

and string lexbuf =
  Lexing.init lexbuf;
  state_2 lexbuf

and char lexbuf =
  Lexing.init lexbuf;
  state_3 lexbuf

and comment lexbuf =
  Lexing.init lexbuf;
  state_4 lexbuf