1 /* $Header$ */
2 
3 /*
4  *   Copyright (c) 2000, 2002 Michael J. Roberts.  All Rights Reserved.
5  *
6  *   Please see the accompanying license file, LICENSE.TXT, for information
7  *   on using and copying this software.
8  */
9 /*
10 Name
11   tcprstyp.h - TADS 3 compiler - parser type definitions
12 Function
13   Defines some types for the TADS 3 compiler's parser.  Separated from
14   the main parser include file to reduce the amount of the parser that
15   has to be included simply for the type definitions.
16 Notes
17 
18 Modified
19   04/09/00 MJRoberts  - Creation
20 */
21 
22 #ifndef TCPRSTYP_H
23 #define TCPRSTYP_H
24 
25 
26 /* ------------------------------------------------------------------------ */
27 /*
28  *   Expression evaluation constant value types.  As we evaluate an
29  *   expression, we'll attempt to evaluate the constant elements of the
30  *   expression, so that the code we generate has any constant expressions
31  *   computed at compile-time rather than executed at run-time.
32  */
33 enum tc_constval_type_t
34 {
35     TC_CVT_UNK,                      /* unknown type or non-constant value  */
36     TC_CVT_NIL,                                                      /* nil */
37     TC_CVT_TRUE,                                                    /* true */
38     TC_CVT_INT,                                            /* integer value */
39     TC_CVT_SSTR,                              /* single-quoted string value */
40     TC_CVT_LIST,                                           /* list constant */
41     TC_CVT_OBJ,                                         /* object reference */
42     TC_CVT_PROP,                                        /* property pointer */
43     TC_CVT_FUNCPTR,                                     /* function pointer */
44     TC_CVT_VOCAB_LIST,                       /* vocabulary list placeholder */
45     TC_CVT_ANONFUNCPTR,                       /* anonymous function pointer */
46     TC_CVT_ENUM,                                              /* enumerator */
47     TC_CVT_FLOAT                                   /* floating point number */
48 };
49 
50 /* ------------------------------------------------------------------------ */
51 /*
52  *   Symbol types.  These values are stored in symbol export files, so the
53  *   order of these entries must not be changed.  If new entries are to be
54  *   added, they must be added at the end of the list, and existing
55  *   entries must not be deleted (instead, make an existing entry
56  *   obsolete, but leave its slot occupied).
57  */
58 enum tc_symtype_t
59 {
60     /* unknown */
61     TC_SYM_UNKNOWN = 0,
62 
63     /* function */
64     TC_SYM_FUNC,
65 
66     /* object */
67     TC_SYM_OBJ,
68 
69     /* property */
70     TC_SYM_PROP,
71 
72     /* local variable */
73     TC_SYM_LOCAL,
74 
75     /* parameter */
76     TC_SYM_PARAM,
77 
78     /* built-in function */
79     TC_SYM_BIF,
80 
81     /* external function */
82     TC_SYM_EXTFN,
83 
84     /* code label */
85     TC_SYM_LABEL,
86 
87     /* metaclass */
88     TC_SYM_METACLASS,
89 
90     /* enumerator */
91     TC_SYM_ENUM,
92 
93     /* 'grammar token' */
94     TC_SYM_GRAMTOK
95 };
96 
97 
98 #endif /* TCPRSTYP_H */
99