1 /*
2  * Copyright 1993, 2000 Christopher Seiwald.
3  *
4  * This file is part of Jam - see jam.c for Copyright information.
5  */
6 
7 /* This file is ALSO:
8  * Copyright 2001-2004 David Abrahams.
9  * Distributed under the Boost Software License, Version 1.0.
10  * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
11  */
12 
13 /*
14  * parse.h - make and destroy parse trees as driven by the parser.
15  */
16 
17 #ifndef PARSE_DWA20011020_H
18 #define PARSE_DWA20011020_H
19 
20 #include "config.h"
21 #include "frames.h"
22 #include "lists.h"
23 #include "modules.h"
24 
25 
26 #define PARSE_APPEND    0
27 #define PARSE_FOREACH   1
28 #define PARSE_IF        2
29 #define PARSE_EVAL      3
30 #define PARSE_INCLUDE   4
31 #define PARSE_LIST      5
32 #define PARSE_LOCAL     6
33 #define PARSE_MODULE    7
34 #define PARSE_CLASS     8
35 #define PARSE_NULL      9
36 #define PARSE_ON        10
37 #define PARSE_RULE      11
38 #define PARSE_RULES     12
39 #define PARSE_SET       13
40 #define PARSE_SETCOMP   14
41 #define PARSE_SETEXEC   15
42 #define PARSE_SETTINGS  16
43 #define PARSE_SWITCH    17
44 #define PARSE_WHILE     18
45 #define PARSE_RETURN    19
46 #define PARSE_BREAK     20
47 #define PARSE_CONTINUE  21
48 
49 
50 /*
51  * Parse tree node.
52  */
53 
54 typedef struct _PARSE PARSE;
55 
56 struct _PARSE {
57     int      type;
58     PARSE  * left;
59     PARSE  * right;
60     PARSE  * third;
61     OBJECT * string;
62     OBJECT * string1;
63     int      num;
64     int      refs;
65     OBJECT * rulename;
66     OBJECT * file;
67     int      line;
68 };
69 
70 void parse_file( OBJECT *, FRAME * );
71 void parse_string( OBJECT * name, const char * * lines, FRAME * frame );
72 void parse_save( PARSE * );
73 
74 PARSE * parse_make( int type, PARSE * left, PARSE * right, PARSE * third,
75     OBJECT * string, OBJECT * string1, int num );
76 
77 void parse_refer( PARSE * );
78 void parse_free( PARSE * );
79 LIST * parse_evaluate( PARSE *, FRAME * );
80 
81 #endif
82