summaryrefslogtreecommitdiff
path: root/ghc/compiler/yaccParser/atype.c
blob: b1cbfe38029b8a1d8d1703077ebc32cd57bb7adb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57


#include "hspincl.h"
#include "yaccParser/atype.h"

Tatype tatype(t)
 atype t;
{
	return(t -> tag);
}


/************** atc ******************/

atype mkatc(PPgatcid, PPgatctypel, PPgatcline)
 unkId PPgatcid;
 list PPgatctypel;
 long PPgatcline;
{
	register struct Satc *pp =
		(struct Satc *) malloc(sizeof(struct Satc));
	pp -> tag = atc;
	pp -> Xgatcid = PPgatcid;
	pp -> Xgatctypel = PPgatctypel;
	pp -> Xgatcline = PPgatcline;
	return((atype)pp);
}

unkId *Rgatcid(t)
 struct Satc *t;
{
#ifdef UGEN_DEBUG
	if(t -> tag != atc)
		fprintf(stderr,"gatcid: illegal selection; was %d\n", t -> tag);
#endif /* UGEN_DEBUG */
	return(& t -> Xgatcid);
}

list *Rgatctypel(t)
 struct Satc *t;
{
#ifdef UGEN_DEBUG
	if(t -> tag != atc)
		fprintf(stderr,"gatctypel: illegal selection; was %d\n", t -> tag);
#endif /* UGEN_DEBUG */
	return(& t -> Xgatctypel);
}

long *Rgatcline(t)
 struct Satc *t;
{
#ifdef UGEN_DEBUG
	if(t -> tag != atc)
		fprintf(stderr,"gatcline: illegal selection; was %d\n", t -> tag);
#endif /* UGEN_DEBUG */
	return(& t -> Xgatcline);
}