[project @ 1996-01-08 20:28:12 by partain]
[ghc.git] / ghc / compiler / yaccParser / finfot.c
1
2
3 #include "hspincl.h"
4 #include "yaccParser/finfot.h"
5
6 Tfinfot tfinfot(t)
7 finfot t;
8 {
9 return(t -> tag);
10 }
11
12
13 /************** nofinfo ******************/
14
15 finfot mknofinfo()
16 {
17 register struct Snofinfo *pp =
18 (struct Snofinfo *) malloc(sizeof(struct Snofinfo));
19 pp -> tag = nofinfo;
20 return((finfot)pp);
21 }
22
23 /************** finfo ******************/
24
25 finfot mkfinfo(PPfi1, PPfi2)
26 stringId PPfi1;
27 stringId PPfi2;
28 {
29 register struct Sfinfo *pp =
30 (struct Sfinfo *) malloc(sizeof(struct Sfinfo));
31 pp -> tag = finfo;
32 pp -> Xfi1 = PPfi1;
33 pp -> Xfi2 = PPfi2;
34 return((finfot)pp);
35 }
36
37 stringId *Rfi1(t)
38 struct Sfinfo *t;
39 {
40 #ifdef UGEN_DEBUG
41 if(t -> tag != finfo)
42 fprintf(stderr,"fi1: illegal selection; was %d\n", t -> tag);
43 #endif /* UGEN_DEBUG */
44 return(& t -> Xfi1);
45 }
46
47 stringId *Rfi2(t)
48 struct Sfinfo *t;
49 {
50 #ifdef UGEN_DEBUG
51 if(t -> tag != finfo)
52 fprintf(stderr,"fi2: illegal selection; was %d\n", t -> tag);
53 #endif /* UGEN_DEBUG */
54 return(& t -> Xfi2);
55 }