[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / compiler / yaccParser / tree.ugn
1 %{
2 #include "hspincl.h"
3 %}
4 %{{
5 module U_tree where
6 import UgenUtil
7 import Util
8
9 import U_binding
10 import U_coresyn        ( U_coresyn )   -- interface only
11 import U_hpragma        ( U_hpragma )   -- interface only
12 import U_list
13 import U_literal
14 import U_ttype
15
16 type U_infixTree = (ProtoName, U_tree, U_tree)
17
18 rdU_infixTree :: _Addr -> UgnM U_infixTree
19 rdU_infixTree pt
20   = ioToUgnM (_casm_ ``%r = gident(*Rginfun_hs((struct Sap *)%0));'' pt) `thenUgn` \ op_t ->
21     ioToUgnM (_casm_ ``%r = (*Rginarg1_hs((struct Sap *)%0));'' pt) `thenUgn` \ arg1_t ->
22     ioToUgnM (_casm_ ``%r = (*Rginarg2_hs((struct Sap *)%0));'' pt) `thenUgn` \ arg2_t ->
23
24     rdU_unkId op_t              `thenUgn` \ op   ->
25     rdU_tree  arg1_t            `thenUgn` \ arg1 ->
26     rdU_tree  arg2_t            `thenUgn` \ arg2 ->
27     returnUgn (op, arg1, arg2)
28 %}}
29 type tree;
30         hmodule : < ghname      : stringId;
31                     ghimplist   : list;
32                     ghexplist   : list;
33                     ghmodlist   : binding;
34                     ghmodline   : long; >;
35         ident   : < gident      : unkId; >;
36         lit     : < glit        : literal; >;
37         tuple   : < gtuplelist  : list; >;
38         ap      : < gfun        : tree;
39                     garg        : tree; >;
40         lambda  : < glampats    : list;
41                     glamexpr    : tree;
42                     glamline    : long; >;
43         let     : < gletvdeflist : binding;
44                     gletvexpr   : tree; >;
45         casee   : < gcaseexpr   : tree;
46                     gcasebody   : list; >;
47         ife     : < gifpred     : tree;
48                     gifthen     : tree;
49                     gifelse     : tree; >;
50         par     : < gpare       : tree; >;
51         as      : < gasid       : unkId;
52                     gase        : tree; >;
53         lazyp   : < glazyp      : tree; >;
54         plusp   : < gplusp      : tree; 
55                     gplusi      : literal; >;
56         wildp   : < >;
57         restr   : < grestre     : tree;
58                     grestrt     : ttype; >;
59         comprh  : < gcexp       : tree;
60                     gcquals     : list; >;
61         qual    : < gqpat       : tree;
62                     gqexp       : tree; >;
63         guard   : < ggexp       : tree; >;
64         def     : < ggdef       : tree; >;
65         tinfixop: < gdummy      : infixTree; >;
66         lsection: < glsexp      : tree; 
67                     glsop       : unkId; >;
68         rsection: < grsop       : unkId;
69                     grsexp      : tree; >;
70         eenum   : < gefrom      : tree;
71                     gestep      : list;
72                     geto        : list; >;
73         llist   : < gllist      : list; >;
74         ccall   : < gccid       : stringId;
75                     gccinfo     : stringId;
76                     gccargs     : list; >;
77         scc     : < gsccid      : hstring;
78                     gsccexp     : tree; >;
79         negate  : < gnexp       : tree; >;
80 end;