[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / compiler / yaccParser / U_list.hs
1
2
3 module U_list where
4 import UgenUtil
5 import Util
6 data U_list = U_lcons U_VOID_STAR U_list | U_lnil 
7
8 rdU_list :: _Addr -> UgnM U_list
9 rdU_list t
10   = ioToUgnM (_ccall_ tlist t) `thenUgn` \ tag@(I# _) ->
11     if tag == ``lcons'' then
12         ioToUgnM (_ccall_ lhd t) `thenUgn` \ x_lhd ->
13         rdU_VOID_STAR x_lhd `thenUgn` \ y_lhd ->
14         ioToUgnM (_ccall_ ltl t) `thenUgn` \ x_ltl ->
15         rdU_list x_ltl `thenUgn` \ y_ltl ->
16         returnUgn (U_lcons y_lhd y_ltl)
17     else if tag == ``lnil'' then
18         returnUgn (U_lnil )
19     else
20         error ("rdU_list: bad tag selection:"++show tag++"\n")