]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - zephyr/zwgc/parser.h
r4264@bucket (orig r254): kcr | 2008-01-20 22:11:44 -0500
[1ts-debian.git] / zephyr / zwgc / parser.h
1 /* This file is part of the Project Athena Zephyr Notification System.
2  * It is one of the source files comprising zwgc, the Zephyr WindowGram
3  * client.
4  *
5  *      Created by:     Marc Horowitz <marc@athena.mit.edu>
6  *
7  *      $Id$
8  *
9  *      Copyright (c) 1989 by the Massachusetts Institute of Technology.
10  *      For copying and distribution information, see the file
11  *      "mit-copyright.h".
12  */
13
14
15 #include <zephyr/mit-copyright.h>
16
17 #ifndef parser_MODULE
18 #define parser_MODULE
19
20 /*
21  *  Parser-Lexer Internal Routine:
22  *
23  *    void report_parse_error(char *error_message, int line_number)
24  *        Modifies: error_occured, stderr
25  *        Effects: This routine is called to report a parser or lexer
26  *                 error.  Error_message is the error message and line_number
27  *                 the line number it occured on.  The reported error message
28  *                 is of the form "....<error_message> on line <line #>.\n".
29  *                 This routine sets error_occured (local to parser.y) to
30  *                 true.  If it was previously false, the error message
31  *                 is reported to the user via stderr. 
32  */
33
34 extern void report_parse_error(char *, int);
35
36 /*
37  *    struct _Node *parse_file(FILE *input_file)
38  *        Requires: input_file is opened for reading, no pointers to
39  *                  existing nodes will ever be dereferened.
40  *        Modifies: *input_file, stderr, all existing nodes
41  *        Effects: First this routine destroys all nodes.  Then it parses
42  *                 input_file as a zwgc description langauge file.  If
43  *                 an error is encountered, an error message is printed
44  *                 on stderr and NULL is returned.  If no error is
45  *                 encountered, a pointer to the node representation of
46  *                 the parsed program is returned, suitable for passing to
47  *                 exec.c.  Note that NULL will also be returned for a
48  *                 empty file & is a valid program.  Either way, input_file
49  *                 is closed before this routine returns.
50  */
51
52 extern struct _Node *parse_file(FILE *);
53
54 #endif