[project @ 1998-04-09 15:54:31 by simonm]
[ghc-hetmet.git] / ghc / compiler / rename / ParseIface.y
index 27f444d..35043d8 100644 (file)
@@ -83,6 +83,7 @@ import Outputable
        TYPE_PART       { ITtysig _ _ }
        ARITY_PART      { ITarity }
        UNFOLD_PART     { ITunfold $$ }
+        SPECIALISE      { ITspecialise }
        BOTTOM          { ITbottom }
        LAM             { ITlam }
        BIGLAM          { ITbiglam }
@@ -92,11 +93,11 @@ import Outputable
        LETREC          { ITletrec }
        IN              { ITin }
        OF              { ITof }
-       COERCE_IN       { ITcoerce_in }
-       COERCE_OUT      { ITcoerce_out }
+       COERCE          { ITcoerce }
        ATSIGN          { ITatsign }
        CCALL           { ITccall $$ }
        SCC             { ITscc $$ }
+        INLINE_CALL     { ITinline }
 
        CHAR            { ITchar $$ }
        STRING          { ITstring $$ } 
@@ -125,7 +126,7 @@ iface_stuff : iface         { PIface  $1 }
 
 
 iface          :: { ParsedIface }
-iface          : INTERFACE CONID INTEGER
+iface          : INTERFACE CONID INTEGER checkVersion
                  inst_modules_part 
                  usages_part
                  exports_part fixities_part
@@ -134,12 +135,12 @@ iface             : INTERFACE CONID INTEGER
                  { ParsedIface 
                        $2                      -- Module name
                        (fromInteger $3)        -- Module version
-                       $5                      -- Usages
-                       $6                      -- Exports
-                       $4                      -- Instance modules
-                       $7                      -- Fixities
-                       $9                      -- Decls
-                       $8                      -- Local instances
+                       $6                      -- Usages
+                       $7                      -- Exports
+                       $5                      -- Instance modules
+                       $8                      -- Fixities
+                       $10                     -- Decls
+                       $9                      -- Local instances
                    }
 
 
@@ -485,6 +486,13 @@ id_info_item       : ARITY_PART arity_info                 { HsArity $2 }
                | strict_info                           { HsStrictness $1 }
                | BOTTOM                                { HsStrictness HsBottom }
                | UNFOLD_PART core_expr                 { HsUnfold $1 $2 }
+                | SPECIALISE spec_tvs
+                     atypes EQUAL core_expr             { HsSpecialise $2 $3 $5 }
+
+
+spec_tvs       :: { [HsTyVar RdrName] }
+spec_tvs       : OBRACK tv_bndrs CBRACK                { $2 }
+       
 
 arity_info     :: { ArityInfo }
 arity_info     : INTEGER                                       { exactArity (fromInteger $1) }
@@ -517,8 +525,6 @@ core_expr   : qvar_name                                     { UfVar $1 }
                | LETREC OCURLY rec_binds CCURLY                
                  IN core_expr                                  { UfLet (UfRec $3) $6 }
 
-               | coerce atype core_expr                        { UfCoerce $1 $2 $3 }
-
                | CCALL ccall_string 
                        OBRACK atype atypes CBRACK core_args    { let
                                                                        (is_casm, may_gc) = $1
@@ -526,16 +532,14 @@ core_expr : qvar_name                                     { UfVar $1 }
                                                                  UfPrim (UfCCallOp $2 is_casm may_gc $5 $4)
                                                                         $7
                                                                }
-               | SCC core_expr                                 {  UfSCC $1 $2  }
+                | INLINE_CALL core_expr                         {  UfNote UfInlineCall $2 }
+                | COERCE atype core_expr                        {  UfNote (UfCoerce $2) $3 }
+               | SCC core_expr                                 {  UfNote (UfSCC $1) $2 }
 
 rec_binds      :: { [(UfBinder RdrName, UfExpr RdrName)] }
                :                                               { [] }
                | core_val_bndr EQUAL core_expr SEMI rec_binds  { ($1,$3) : $5 }
 
-coerce         :: { UfCoercion RdrName }
-coerce         : COERCE_IN  qdata_name                         { UfIn  $2 }
-               | COERCE_OUT qdata_name                         { UfOut $2 }
-               
 prim_alts      :: { [(Literal,UfExpr RdrName)] }
                :                                               { [] }
                | core_lit RARROW core_expr SEMI prim_alts      { ($1,$3) : $5 }
@@ -607,12 +611,15 @@ prim_rep  :: { Char }
          : VARID                                               { head (_UNPK_ $1) }
          | CONID                                               { head (_UNPK_ $1) }
 
-
 -------------------------------------------------------------------
 
 src_loc :: { SrcLoc }
 src_loc :                              {% getSrcLocIf }
 
+checkVersion :: { () }
+          : {-empty-}                  {% checkVersion Nothing }
+          | INTEGER                    {% checkVersion (Just (fromInteger $1)) }
+
 ------------------------------------------------------------------- 
 
 --                     Haskell code