[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / compiler / yaccParser / U_pbinding.hs
1
2
3 module U_pbinding where
4 import UgenUtil
5 import Util
6
7 import U_binding
8 import U_coresyn        ( U_coresyn )   -- interface only
9 import U_hpragma        ( U_hpragma )   -- interface only
10 import U_list
11 import U_literal        ( U_literal )   -- ditto
12 import U_treeHACK
13 import U_ttype          ( U_ttype )     -- ditto
14 data U_pbinding = U_pgrhs U_tree U_list U_binding U_stringId U_long 
15
16 rdU_pbinding :: _Addr -> UgnM U_pbinding
17 rdU_pbinding t
18   = ioToUgnM (_ccall_ tpbinding t) `thenUgn` \ tag@(I# _) ->
19     if tag == ``pgrhs'' then
20         ioToUgnM (_ccall_ ggpat t) `thenUgn` \ x_ggpat ->
21         rdU_tree x_ggpat `thenUgn` \ y_ggpat ->
22         ioToUgnM (_ccall_ ggdexprs t) `thenUgn` \ x_ggdexprs ->
23         rdU_list x_ggdexprs `thenUgn` \ y_ggdexprs ->
24         ioToUgnM (_ccall_ ggbind t) `thenUgn` \ x_ggbind ->
25         rdU_binding x_ggbind `thenUgn` \ y_ggbind ->
26         ioToUgnM (_ccall_ ggfuncname t) `thenUgn` \ x_ggfuncname ->
27         rdU_stringId x_ggfuncname `thenUgn` \ y_ggfuncname ->
28         ioToUgnM (_ccall_ ggline t) `thenUgn` \ x_ggline ->
29         rdU_long x_ggline `thenUgn` \ y_ggline ->
30         returnUgn (U_pgrhs y_ggpat y_ggdexprs y_ggbind y_ggfuncname y_ggline)
31     else
32         error ("rdU_pbinding: bad tag selection:"++show tag++"\n")