[project @ 1999-01-26 11:12:41 by simonm]
[ghc-hetmet.git] / ghc / compiler / parser / binding.ugn
index 2f6bcca..4e9745b 100644 (file)
@@ -2,10 +2,10 @@
 #include "hspincl.h"
 %}
 %{{
+module U_binding where
+
 #include "HsVersions.h"
 
-module U_binding where
-IMP_Ubiq() --  debugging consistency check
 import UgenUtil
 
 import U_constr
@@ -15,48 +15,86 @@ import U_qid
 import U_ttype
 %}}
 type binding;
+       nullbind : < >;
+
+       /* And-bind; just concat two decl blobs together */
+       abind   : < gabindfst   : binding;
+                   gabindsnd   : binding; >;
+
+       /* Import decl */
+       import  : < gibindimod   : stringId;
+                   gibindqual   : long;
+                   gibindas     : maybe;
+                   gibindspec   : maybe;
+                   gibindsource : long;
+                   gibindline   : long; >;
+
+       /* Fixity decl */
+       fixd    : < gfixop      : qid;
+                   gfixinfx    : long;
+                   gfixprec    : long; 
+                   gfixline    : long; >;
+
+
+       /* Class declaration */
+       cbind   : < gcbindc     : list;
+                   gcbindid    : ttype;
+                   gcbindw     : binding;
+                   gcline      : long; >;
+
+       /* Instance declaration */
+       ibind   : < gibindi     : ttype;
+                   gibindw     : binding;
+                   giline      : long; >;
+
+       /* data type declaration */
        tbind   : < gtbindc     : list;         /* [context entries] */
                    gtbindid    : ttype;        /* applied tycon */
                    gtbindl     : list;         /* [constr] */
                    gtbindd     : maybe;        /* Maybe [deriving] */
                    gtline      : long; >;
+
+       /* newtype declaration */
        ntbind  : < gntbindc    : list;         /* [context entries] */
                    gntbindid   : ttype;        /* applied tycon */
                    gntbindcty  : list;         /* [constr]  (only 1 constrnew) */ 
                    gntbindd    : maybe;        /* Maybe [deriving] */
                    gntline     : long; >;
+
+       /* type synonym declaration */
        nbind   : < gnbindid    : ttype;
                    gnbindas    : ttype;
                    gnline      : long; >;
-       pbind   : < gpbindl     : list;
+
+       /* Pattern binding */
+       pbind   : < gpbindl     : VOID_STAR;    /* The pattern, of type tree; 
+                                                  we can't say 'tree' because
+                                                  that gives mutual recursion in the C */
+                   gpbindr     : VOID_STAR;    /* The RHS, of type grhsb; same nonsense */
                    gpline      : long; >;
-       fbind   : < gfbindl     : list;
+       /* Function binding */
+       fbind   : < gfbindm     : list;         /* List of matches */
+                                               /* The match encodes the LHS as well as RHS */
                    gfline      : long; >;
-       abind   : < gabindfst   : binding;
-                   gabindsnd   : binding; >;
-       ibind   : < gibindc     : list;
-                   gibindid    : qid;
-                   gibindi     : ttype;
-                   gibindw     : binding;
-                   giline      : long; >;
+
+       /* Default decl */
        dbind   : < gdbindts    : list;
                    gdline      : long; >;
-       cbind   : < gcbindc     : list;
-                   gcbindid    : ttype;
-                   gcbindw     : binding;
-                   gcline      : long; >;
+
+       /* Type signature */
        sbind   : < gsbindids   : list;
                    gsbindid    : ttype;
                    gsline      : long; >;
 
-       nullbind : < >;
-
-       import  : < gibindimod   : stringId;
-                   gibindqual   : long;
-                   gibindas     : maybe;
-                   gibindspec   : maybe;
-                   gibindsource : long;
-                   gibindline   : long; >;
+        /* FFI declarations */
+       fobind  : < gfobind_id   : qid;
+                   gfobind_ty   : ttype;
+                   gfobind_ext  : maybe;
+                   gfobind_flag : long;
+                   gfobind_cc   : long;
+                   gfobind_kind : long;
+                   gfobind_line : long; >;
+                   
 
        /* user-specified pragmas:XXXX */
 
@@ -74,6 +112,9 @@ type binding;
        inline_uprag: < ginline_id   : qid;
                        ginline_line : long; >;
 
+       noinline_uprag: < gnoinline_id   : qid;
+                         gnoinline_line : long; >;
+
        magicuf_uprag:< gmagicuf_id   : qid;
                        gmagicuf_str  : stringId;
                        gmagicuf_line : long; >;