1 /**************************************************************************/
2 /* */
3 /* OCaml */
4 /* */
5 /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
6 /* */
7 /* Copyright 1996 Institut National de Recherche en Informatique et */
8 /* en Automatique. */
9 /* */
10 /* All rights reserved. This file is distributed under the terms of */
11 /* the GNU Lesser General Public License version 2.1, with the */
12 /* special exception on linking described in the file LICENSE. */
13 /* */
14 /**************************************************************************/
15
16 /* Based on public-domain code from Berkeley Yacc */
17
18 #include "defs.h"
19
20 char *header[] =
21 {
22 "open Parsing;;",
23 "let _ = parse_error;;", /* avoid warning 33 (PR#5719) */
24 0
25 };
26
27 char *define_tables[] =
28 {
29 "let yytables =",
30 " { Parsing.actions=yyact;",
31 " Parsing.transl_const=yytransl_const;",
32 " Parsing.transl_block=yytransl_block;",
33 " Parsing.lhs=yylhs;",
34 " Parsing.len=yylen;",
35 " Parsing.defred=yydefred;",
36 " Parsing.dgoto=yydgoto;",
37 " Parsing.sindex=yysindex;",
38 " Parsing.rindex=yyrindex;",
39 " Parsing.gindex=yygindex;",
40 " Parsing.tablesize=yytablesize;",
41 " Parsing.table=yytable;",
42 " Parsing.check=yycheck;",
43 " Parsing.error_function=parse_error;",
44 " Parsing.names_const=yynames_const;",
45 " Parsing.names_block=yynames_block }",
46 0
47 };
48
49 void write_section(char **section)
50 {
51 register int i;
52 register FILE *fp;
53
54 fp = code_file;
55 for (i = 0; section[i]; ++i)
56 {
57 ++outline;
58 fprintf(fp, "%s\n", section[i]);
59 }
60 }
61