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
5 * Created by: Marc Horowitz <marc@athena.mit.edu>
9 * Copyright (c) 1989 by the Massachusetts Institute of Technology.
10 * For copying and distribution information, see the file
15 #include <zephyr/mit-copyright.h>
21 * Parser-Lexer Internal Routine:
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.
34 extern void report_parse_error();
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.
52 extern struct _Node *parse_file();