[project @ 1996-03-22 09:24:22 by partain]
[ghc-hetmet.git] / ghc / compiler / yaccParser / atype.h
1 #ifndef atype_defined
2 #define atype_defined
3
4 #include <stdio.h>
5
6 #ifndef PROTO
7 #ifdef __STDC__
8 #define PROTO(x) x
9 #else
10 #define PROTO(x) /**/
11 #endif
12 #endif
13
14 typedef enum {
15         atc
16 } Tatype;
17
18 typedef struct { Tatype tag; } *atype;
19
20 #ifdef __GNUC__
21 Tatype tatype(atype t);
22 extern __inline__ Tatype tatype(atype t)
23 {
24         return(t -> tag);
25 }
26 #else  /* ! __GNUC__ */
27 extern Tatype tatype PROTO((atype));
28 #endif /* ! __GNUC__ */
29
30 struct Satc {
31         Tatype tag;
32         unkId Xgatcid;
33         list Xgatctypel;
34         long Xgatcline;
35 };
36
37 extern atype mkatc PROTO((unkId, list, long));
38 #ifdef __GNUC__
39
40 unkId *Rgatcid PROTO((struct Satc *));
41
42 extern __inline__ unkId *Rgatcid(struct Satc *t)
43 {
44 #ifdef UGEN_DEBUG
45         if(t -> tag != atc)
46                 fprintf(stderr,"gatcid: illegal selection; was %d\n", t -> tag);
47 #endif /* UGEN_DEBUG */
48         return(& t -> Xgatcid);
49 }
50 #else  /* ! __GNUC__ */
51 extern unkId *Rgatcid PROTO((struct Satc *));
52 #endif /* ! __GNUC__ */
53
54 #define gatcid(xyzxyz) (*Rgatcid((struct Satc *) (xyzxyz)))
55 #ifdef __GNUC__
56
57 list *Rgatctypel PROTO((struct Satc *));
58
59 extern __inline__ list *Rgatctypel(struct Satc *t)
60 {
61 #ifdef UGEN_DEBUG
62         if(t -> tag != atc)
63                 fprintf(stderr,"gatctypel: illegal selection; was %d\n", t -> tag);
64 #endif /* UGEN_DEBUG */
65         return(& t -> Xgatctypel);
66 }
67 #else  /* ! __GNUC__ */
68 extern list *Rgatctypel PROTO((struct Satc *));
69 #endif /* ! __GNUC__ */
70
71 #define gatctypel(xyzxyz) (*Rgatctypel((struct Satc *) (xyzxyz)))
72 #ifdef __GNUC__
73
74 long *Rgatcline PROTO((struct Satc *));
75
76 extern __inline__ long *Rgatcline(struct Satc *t)
77 {
78 #ifdef UGEN_DEBUG
79         if(t -> tag != atc)
80                 fprintf(stderr,"gatcline: illegal selection; was %d\n", t -> tag);
81 #endif /* UGEN_DEBUG */
82         return(& t -> Xgatcline);
83 }
84 #else  /* ! __GNUC__ */
85 extern long *Rgatcline PROTO((struct Satc *));
86 #endif /* ! __GNUC__ */
87
88 #define gatcline(xyzxyz) (*Rgatcline((struct Satc *) (xyzxyz)))
89
90 #endif