49ef6bb48348a517150ca9d6911ed19f35c177ea
[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 extern __inline__ Tatype tatype(atype t)
22 {
23         return(t -> tag);
24 }
25 #else  /* ! __GNUC__ */
26 extern Tatype tatype PROTO((atype));
27 #endif /* ! __GNUC__ */
28
29 struct Satc {
30         Tatype tag;
31         unkId Xgatcid;
32         list Xgatctypel;
33         long Xgatcline;
34 };
35
36 extern atype mkatc PROTO((unkId, list, long));
37 #ifdef __GNUC__
38
39 extern __inline__ unkId *Rgatcid(struct Satc *t)
40 {
41 #ifdef UGEN_DEBUG
42         if(t -> tag != atc)
43                 fprintf(stderr,"gatcid: illegal selection; was %d\n", t -> tag);
44 #endif /* UGEN_DEBUG */
45         return(& t -> Xgatcid);
46 }
47 #else  /* ! __GNUC__ */
48 extern unkId *Rgatcid PROTO((struct Satc *));
49 #endif /* ! __GNUC__ */
50
51 #define gatcid(xyzxyz) (*Rgatcid((struct Satc *) (xyzxyz)))
52 #ifdef __GNUC__
53
54 extern __inline__ list *Rgatctypel(struct Satc *t)
55 {
56 #ifdef UGEN_DEBUG
57         if(t -> tag != atc)
58                 fprintf(stderr,"gatctypel: illegal selection; was %d\n", t -> tag);
59 #endif /* UGEN_DEBUG */
60         return(& t -> Xgatctypel);
61 }
62 #else  /* ! __GNUC__ */
63 extern list *Rgatctypel PROTO((struct Satc *));
64 #endif /* ! __GNUC__ */
65
66 #define gatctypel(xyzxyz) (*Rgatctypel((struct Satc *) (xyzxyz)))
67 #ifdef __GNUC__
68
69 extern __inline__ long *Rgatcline(struct Satc *t)
70 {
71 #ifdef UGEN_DEBUG
72         if(t -> tag != atc)
73                 fprintf(stderr,"gatcline: illegal selection; was %d\n", t -> tag);
74 #endif /* UGEN_DEBUG */
75         return(& t -> Xgatcline);
76 }
77 #else  /* ! __GNUC__ */
78 extern long *Rgatcline PROTO((struct Satc *));
79 #endif /* ! __GNUC__ */
80
81 #define gatcline(xyzxyz) (*Rgatcline((struct Satc *) (xyzxyz)))
82
83 #endif