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 "frames.h"
21 #include "lists.h"
22 #include "modules.h"
23 
24 
25 #define PARSE_APPEND    0
26 #define PARSE_FOREACH   1
27 #define PARSE_IF        2
28 #define PARSE_EVAL      3
29 #define PARSE_INCLUDE   4
30 #define PARSE_LIST      5
31 #define PARSE_LOCAL     6
32 #define PARSE_MODULE    7
33 #define PARSE_CLASS     8
34 #define PARSE_NULL      9
35 #define PARSE_ON        10
36 #define PARSE_RULE      11
37 #define PARSE_RULES     12
38 #define PARSE_SET       13
39 #define PARSE_SETCOMP   14
40 #define PARSE_SETEXEC   15
41 #define PARSE_SETTINGS  16
42 #define PARSE_SWITCH    17
43 #define PARSE_WHILE     18
44 #define PARSE_RETURN    19
45 #define PARSE_BREAK     20
46 #define PARSE_CONTINUE  21
47 
48 
49 /*
50  * Parse tree node.
51  */
52 
53 typedef struct _PARSE PARSE;
54 
55 struct _PARSE {
56     int      type;
57     PARSE  * left;
58     PARSE  * right;
59     PARSE  * third;
60     OBJECT * string;
61     OBJECT * string1;
62     int      num;
63     int      refs;
64     OBJECT * rulename;
65     OBJECT * file;
66     int      line;
67 };
68 
69 void parse_file( OBJECT *, FRAME * );
70 void parse_save( PARSE * );
71 
72 PARSE * parse_make( int type, PARSE * left, PARSE * right, PARSE * third,
73     OBJECT * string, OBJECT * string1, int num );
74 
75 void parse_refer( PARSE * );
76 void parse_free( PARSE * );
77 LIST * parse_evaluate( PARSE *, FRAME * );
78 
79 #endif
80