]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/ocaml/contrib/yacc/skeleton.c
update
[l4.git] / l4 / pkg / ocaml / contrib / yacc / skeleton.c
1 /***********************************************************************/
2 /*                                                                     */
3 /*                           Objective Caml                            */
4 /*                                                                     */
5 /*            Xavier Leroy, projet Cristal, INRIA Rocquencourt         */
6 /*                                                                     */
7 /*  Copyright 1996 Institut National de Recherche en Informatique et   */
8 /*  en Automatique.  All rights reserved.  This file is distributed    */
9 /*  under the terms of the Q Public License version 1.0.               */
10 /*                                                                     */
11 /***********************************************************************/
12
13 /* Based on public-domain code from Berkeley Yacc */
14
15 /* $Id: skeleton.c 7019 2005-08-13 20:59:37Z doligez $ */
16
17 #include "defs.h"
18
19 char *header[] =
20 {
21   "open Parsing;;",
22   0
23 };
24
25 char *define_tables[] =
26 {
27   "let yytables =",
28   "  { Parsing.actions=yyact;",
29   "    Parsing.transl_const=yytransl_const;",
30   "    Parsing.transl_block=yytransl_block;",
31   "    Parsing.lhs=yylhs;",
32   "    Parsing.len=yylen;",
33   "    Parsing.defred=yydefred;",
34   "    Parsing.dgoto=yydgoto;",
35   "    Parsing.sindex=yysindex;",
36   "    Parsing.rindex=yyrindex;",
37   "    Parsing.gindex=yygindex;",
38   "    Parsing.tablesize=yytablesize;",
39   "    Parsing.table=yytable;",
40   "    Parsing.check=yycheck;",
41   "    Parsing.error_function=parse_error;",
42   "    Parsing.names_const=yynames_const;",
43   "    Parsing.names_block=yynames_block }",
44   0
45 };
46
47 void write_section(char **section)
48 {
49     register int i;
50     register FILE *fp;
51
52     fp = code_file;
53     for (i = 0; section[i]; ++i)
54     {
55         ++outline;
56         fprintf(fp, "%s\n", section[i]);
57     }
58 }