[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / compiler / yaccParser / pbinding.c
1
2
3 #include "hspincl.h"
4 #include "yaccParser/pbinding.h"
5
6 Tpbinding tpbinding(t)
7  pbinding t;
8 {
9         return(t -> tag);
10 }
11
12
13 /************** pgrhs ******************/
14
15 pbinding mkpgrhs(PPggpat, PPggdexprs, PPggbind, PPggfuncname, PPggline)
16  tree PPggpat;
17  list PPggdexprs;
18  binding PPggbind;
19  stringId PPggfuncname;
20  long PPggline;
21 {
22         register struct Spgrhs *pp =
23                 (struct Spgrhs *) malloc(sizeof(struct Spgrhs));
24         pp -> tag = pgrhs;
25         pp -> Xggpat = PPggpat;
26         pp -> Xggdexprs = PPggdexprs;
27         pp -> Xggbind = PPggbind;
28         pp -> Xggfuncname = PPggfuncname;
29         pp -> Xggline = PPggline;
30         return((pbinding)pp);
31 }
32
33 tree *Rggpat(t)
34  struct Spgrhs *t;
35 {
36 #ifdef UGEN_DEBUG
37         if(t -> tag != pgrhs)
38                 fprintf(stderr,"ggpat: illegal selection; was %d\n", t -> tag);
39 #endif /* UGEN_DEBUG */
40         return(& t -> Xggpat);
41 }
42
43 list *Rggdexprs(t)
44  struct Spgrhs *t;
45 {
46 #ifdef UGEN_DEBUG
47         if(t -> tag != pgrhs)
48                 fprintf(stderr,"ggdexprs: illegal selection; was %d\n", t -> tag);
49 #endif /* UGEN_DEBUG */
50         return(& t -> Xggdexprs);
51 }
52
53 binding *Rggbind(t)
54  struct Spgrhs *t;
55 {
56 #ifdef UGEN_DEBUG
57         if(t -> tag != pgrhs)
58                 fprintf(stderr,"ggbind: illegal selection; was %d\n", t -> tag);
59 #endif /* UGEN_DEBUG */
60         return(& t -> Xggbind);
61 }
62
63 stringId *Rggfuncname(t)
64  struct Spgrhs *t;
65 {
66 #ifdef UGEN_DEBUG
67         if(t -> tag != pgrhs)
68                 fprintf(stderr,"ggfuncname: illegal selection; was %d\n", t -> tag);
69 #endif /* UGEN_DEBUG */
70         return(& t -> Xggfuncname);
71 }
72
73 long *Rggline(t)
74  struct Spgrhs *t;
75 {
76 #ifdef UGEN_DEBUG
77         if(t -> tag != pgrhs)
78                 fprintf(stderr,"ggline: illegal selection; was %d\n", t -> tag);
79 #endif /* UGEN_DEBUG */
80         return(& t -> Xggline);
81 }