introducing multiple inheritance

This commit is contained in:
aarne
2004-09-15 14:36:27 +00:00
parent 9bc8ffe4d1
commit e6fd325d07
44 changed files with 214 additions and 74 deletions

View File

@@ -0,0 +1,7 @@
abstract City = {
cat
City ;
fun
MkCity : String -> City ;
} ;

View File

@@ -0,0 +1,5 @@
concrete CityEng of City = open Prelude in {
lin
MkCity s = s ;
} ;

View File

@@ -0,0 +1,7 @@
abstract Math = {
cat
Number ;
fun
MkNumber : Int -> Number ;
} ;

View File

@@ -0,0 +1,5 @@
concrete MathEng of Math = open Prelude in {
lin
MkNumber i = i ;
} ;

View File

@@ -0,0 +1,4 @@
abstract System = {
cat Reply ;
fun Bye : Reply ;
}

View File

@@ -0,0 +1,4 @@
abstract SystemCity = System, City ** {
fun
RDistance : City -> City -> Int -> Reply ;
} ;

View File

@@ -0,0 +1,6 @@
concrete SystemCityEng of SystemCity = SystemEng, CityEng ** open
Prelude in {
lin
RDistance x y d =
ss (["the distance from"] ++ x.s ++ "to" ++ y.s ++ "is" ++ d.s) ;
} ;

View File

@@ -0,0 +1,3 @@
concrete SystemEng of System = open Prelude in {
lin Bye = ss "bye" ;
}

View File

@@ -0,0 +1,4 @@
abstract SystemMath = System, Math ** {
fun
RSum : Number -> Number -> Int -> Reply ;
} ;

View File

@@ -0,0 +1,6 @@
concrete SystemMathEng of SystemMath = SystemEng, MathEng ** open
Prelude in {
lin
RSum x y d =
ss (["the sum of"] ++ x.s ++ "and" ++ y.s ++ "is" ++ d.s) ;
} ;

7
grammars/multiple/Top.gf Normal file
View File

@@ -0,0 +1,7 @@
abstract Top = User, System ** {
cat
Move ;
fun
MUser : Query -> Move ;
MSystem : Reply -> Move ;
}

View File

@@ -0,0 +1 @@
abstract TopCity = Top, UserCity, SystemCity ** {} ;

View File

@@ -0,0 +1,3 @@
--# -path=.:../prelude
concrete TopCityEng of TopCity = TopEng, UserCityEng, SystemCityEng ** {} ;

View File

@@ -0,0 +1,6 @@
concrete TopEng of Top = UserEng, SystemEng ** open Prelude in {
lin
MUser q = q ;
MSystem r = r ;
}

View File

@@ -0,0 +1 @@
abstract TopMath = Top, UserMath, SystemMath ** {} ;

View File

@@ -0,0 +1,3 @@
--# -path=.:../prelude
concrete TopMathEng of TopMath = TopEng, UserMathEng, SystemMathEng ** {} ;

View File

@@ -0,0 +1,7 @@
abstract User = {
cat
Query ;
fun
QQuit : Query ;
} ;

View File

@@ -0,0 +1,5 @@
abstract UserCity = User, City ** {
fun
QDistance : City -> City -> Query ;
} ;

View File

@@ -0,0 +1,6 @@
concrete UserCityEng of UserCity = UserEng, CityEng ** open Prelude in
{
lin
QDistance x y = ss (["what is the distance from"] ++ x.s ++ "to" ++ y.s) ;
}

View File

@@ -0,0 +1,5 @@
concrete UserEng of User = open Prelude in {
lin
QQuit = ss ["that's enough"] ;
} ;

View File

@@ -0,0 +1,5 @@
abstract UserMath = User, Math ** {
fun
QSum : Number -> Number -> Query ;
} ;

View File

@@ -0,0 +1,6 @@
concrete UserMathEng of UserMath = UserEng, MathEng ** open Prelude in
{
lin
QSum x y = ss (["what is the sum of"] ++ x.s ++ "and" ++ y.s) ;
}

View File

@@ -0,0 +1 @@
abstract UserUnionCity = union User, City ;

32
grammars/multiple/map.txt Normal file
View File

@@ -0,0 +1,32 @@
Using multiple inheritance in GF. AR 15/9/2004.
The following diagrams show inheritance between abstract syntaxes in two simple systems.
TopCity
/ | \
/ | \
SystemCity UserCity Top
/ \ / \
System City User
TopMath
/ | \
/ | \
SystemMath UserMath Top
/ \ / \
System Math User
Idea of each module:
User -- User's moves on any domain
System -- System's moves on any domain
Top -- grammar covering both kinds of moves
X = Math, City -- possible domains
UserX -- User's domain specific moves
SystemX -- System's domain specific moves
TopX -- all moves on the domain X
In parallel to the abstract syntax hierarchies, we have of course
hierarchies of concrete syntaxes for any language; this directory contains Eng.

View File

@@ -26,17 +26,19 @@ resource ParadigmsEng = open (Predef=Predef), Prelude, SyntaxEng, ResourceEng in
-- To abstract over gender names, we define the following identifiers.
oper
Gender : Type = SyntaxEng.Gender ;
Gender : Type ;
human : Gender ;
nonhuman : Gender ;
-- To abstract over number names, we define the following.
Number : Type ;
singular : Number ;
plural : Number ;
-- To abstract over case names, we define the following.
Case : Type ;
nominative : Case ;
genitive : Case ;
@@ -183,6 +185,9 @@ oper
-- hidden from the document.
--.
Gender = SyntaxEng.Gender ;
Number = SyntaxEng.Number ;
Case = SyntaxEng.Case ;
human = Hum ;
nonhuman = NoHum ;
singular = Sg ;

View File

@@ -23,7 +23,7 @@ data ModType =
deriving (Eq,Ord,Show)
data Extend =
Ext Ident
Ext [Ident]
| NoExt
deriving (Eq,Ord,Show)

View File

@@ -41,9 +41,7 @@ canon2sourceModule (i,mi) = do
return (i',info')
where
redExtOpen m = do
e' <- case M.extends m of
Just e -> liftM Just $ redIdent e
_ -> return Nothing
e' <- mapM redIdent $ M.extends m
os' <- mapM (\ (M.OSimple q i) -> liftM (\i -> M.OQualif q i i) (redIdent i)) $
M.opens m
return (e',os')

View File

@@ -16,7 +16,7 @@ MTTrans. ModType ::= "transfer" Ident ":" Ident "->" Ident ;
separator Module "" ;
Ext. Extend ::= Ident "**" ;
Ext. Extend ::= [Ident] "**" ;
NoExt. Extend ::= ;
Opens. Open ::= "open" [Ident] "in" ;

View File

@@ -33,8 +33,8 @@ canon2grammar (Gr modules) = M.MGrammar $ map mod2info modules where
MTCnc a x -> (a,M.MTConcrete x)
MTTrans a x y -> (a,M.MTTransfer (M.oSimple x) (M.oSimple y))
in (a,M.ModMod (M.Module mt' M.MSComplete flags (ee e) (oo os) defs'))
ee (Ext m) = Just m
ee _ = Nothing
ee (Ext m) = m
ee _ = []
oo (Opens ms) = map M.oSimple ms
oo _ = []
@@ -52,7 +52,7 @@ info2mod m = case m of
in
Mod mt' (gfcE me) (gfcO os) flags defs'
where
gfcE = maybe NoExt Ext
gfcE = ifNull NoExt Ext
gfcO os = if null os then NoOpens else Opens [m | M.OSimple _ m <- os]

View File

@@ -340,19 +340,19 @@ happyOutTok x = unsafeCoerce# x
{-# INLINE happyOutTok #-}
happyActOffsets :: HappyAddr
happyActOffsets = HappyA# "\x07\x02\x03\x02\x00\x00\x02\x02\x2d\x01\xfe\x01\x11\x02\x01\x02\x00\x00\x24\x02\xf9\x01\xf9\x01\xf9\x01\xf9\x01\x1f\x02\x00\x00\x00\x02\x00\x00\xf3\x01\xf3\x01\xf3\x01\x00\x00\x21\x02\x15\x02\xfd\x01\xf1\x01\xf1\x01\x1a\x02\x00\x00\x16\x02\xee\x01\x00\x00\x00\x00\x2d\x01\xfb\x01\x00\x00\xed\x01\x00\x00\xfa\x01\x00\x00\x17\x02\x67\x00\xea\x01\x14\x02\xf7\x01\x13\x02\x00\x00\xe5\x01\xe5\x01\xe5\x01\xe5\x01\xe5\x01\xe5\x01\xe5\x01\x00\x00\x10\x02\x0f\x02\x0b\x02\x0d\x02\x09\x02\x05\x02\xff\x01\x00\x00\xe4\x01\x00\x00\xcf\x01\x00\x00\xcf\x01\xcf\x01\x0a\x00\xcf\x01\x58\x00\x58\x00\xcf\x01\x0a\x00\xe0\x01\x00\x00\x00\x00\x00\x00\x98\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xcb\x01\x0a\x00\xcb\x01\xcb\x01\xd4\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe7\x01\x00\x00\x00\x00\xf8\x01\x3d\x00\x58\x00\x00\x00\xf6\x01\xf5\x01\xec\x01\xe8\x01\xe3\x01\xe9\x01\x00\x00\xb9\x01\xe6\x01\x0a\x00\x0a\x00\xdc\x01\x12\x00\xd2\x01\x00\x00\xd9\x01\xd7\x01\xd5\x01\xa9\x01\x12\x00\xa7\x01\x58\x00\x00\x00\x00\x00\xc8\x01\x10\x01\xc9\x01\xcd\x01\xc5\x01\x00\x00\x0a\x00\xa4\x01\x00\x00\xc7\x01\x6e\x00\x00\x00\x0a\x00\x00\x00\x0a\x00\x00\x00\x00\x00\x00\x00\xa7\x00\x00\x00\x00\x00\xbc\x01\xb6\x01\xb1\x01\x00\x00\x00\x00\x3d\x00\x1c\x00\x12\x00\x95\x01\x95\x01\x58\x00\xb5\x01\x00\x00\x00\x00\x58\x00\x3d\x00\x58\x00\xb2\x00\x94\x01\x00\x00\x00\x00\x00\x00\x00\x00\x94\x01\x26\x01\xa8\x01\xbb\x01\x12\x00\x12\x00\xaa\x01\x00\x00\x00\x00\x00\x00\xb3\x01\x00\x00\x00\x00\xaf\x00\x00\x00\x00\x00\xb4\x01\xb2\x01\xaf\x01\x51\x00\x3d\x00\x74\x01\x74\x01\xa3\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x82\x01\x00\x00\x00\x00\x00\x00\x00\x00\x9d\x01\x98\x01\x00\x00\x00\x00\x00\x00\x00\x00\x12\x00\x3d\x00\x0c\x00\x00\x00\x47\x00\x9e\x01\x41\x00\x00\x00\x91\x01\x8f\x01\x12\x00\x71\x01\x00\x00\x00\x00\x60\x00\x00\x00\x00\x00\x9f\x01\x99\x01\x57\x00\x00\x00\x00\x00\x7e\x00\x00\x00\x89\x01\x62\x01\x0a\x00\x9f\x00\x00\x00\x00\x00\x00\x00\x92\x01\x70\x00\x8e\x01\x00\x00\x00\x00\x3d\x00\x60\x01\x00\x00\x12\x00\x00\x00\x8d\x01\x12\x00\x7a\x01\x00\x00\x7a\x01\x00\x00\x8c\x01\x8b\x01\x87\x01\x78\x01\x00\x00\x68\x00\x00\x00\x51\x01\x00\x00\x00\x00\x3d\x00\x5b\x00\x21\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
happyActOffsets = HappyA# "\x0a\x02\x06\x02\x00\x00\x04\x02\xdd\x00\x02\x02\x14\x02\x00\x02\x00\x00\x29\x02\xfc\x01\xfc\x01\xfc\x01\xfc\x01\x25\x02\x00\x00\xff\x01\x00\x00\xff\xff\xf9\x01\xf9\x01\x00\x00\x22\x02\xfd\x01\x1d\x02\xf8\x01\xf8\x01\x1b\x02\x00\x00\x00\x00\x1c\x02\xf0\x01\x00\x00\xdd\x00\xf5\x01\x00\x00\xee\x01\x00\x00\xf6\x01\x00\x00\x15\x02\x66\x00\xed\x01\x13\x02\xef\x01\x0d\x02\x00\x00\xda\x01\xda\x01\xda\x01\xda\x01\xda\x01\xda\x01\xda\x01\x00\x00\x07\x02\x05\x02\x01\x02\xfb\x01\xf7\x01\xf4\x01\xf3\x01\x00\x00\xd6\x01\x00\x00\xc8\x01\x00\x00\xc8\x01\xc8\x01\x11\x00\xc8\x01\x44\x00\x44\x00\xc8\x01\x11\x00\xe9\x01\x00\x00\x00\x00\x00\x00\x94\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc7\x01\x11\x00\xc7\x01\xc7\x01\xc3\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd2\x01\x00\x00\x00\x00\xe8\x01\x5d\x00\x44\x00\x00\x00\xe7\x01\xe6\x01\xe4\x01\xe2\x01\xdc\x01\xe1\x01\x00\x00\xb3\x01\xd7\x01\x11\x00\x11\x00\xce\x01\x0d\x00\xc4\x01\x00\x00\xd5\x01\xd0\x01\xcf\x01\xa2\x01\x0d\x00\xa1\x01\x44\x00\x00\x00\x00\x00\xc0\x01\xa3\x00\xba\x01\xbf\x01\xc2\x01\x00\x00\x11\x00\x93\x01\x00\x00\xc1\x01\x69\x00\x00\x00\x11\x00\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\xc7\x00\x00\x00\x00\x00\xb6\x01\xaa\x01\xaf\x01\x00\x00\x00\x00\x5d\x00\x72\x00\x0d\x00\x8f\x01\x8f\x01\x44\x00\xb2\x01\x00\x00\x00\x00\x44\x00\x5d\x00\x44\x00\xa6\x00\x84\x01\x00\x00\x00\x00\x00\x00\x00\x00\x84\x01\xcf\x00\x99\x01\xac\x01\x0d\x00\x0d\x00\xa4\x01\x00\x00\x00\x00\x00\x00\xad\x01\x00\x00\x00\x00\xfd\xff\x00\x00\x00\x00\xae\x01\xab\x01\x9f\x01\x4c\x00\x5d\x00\x70\x01\x70\x01\x90\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x71\x01\x00\x00\x00\x00\x00\x00\x00\x00\x9a\x01\x95\x01\x00\x00\x00\x00\x00\x00\x00\x00\x0d\x00\x5d\x00\x15\x00\x00\x00\x42\x00\x96\x01\x3c\x00\x00\x00\x8b\x01\x89\x01\x0d\x00\x6b\x01\x00\x00\x00\x00\x65\x00\x00\x00\x00\x00\x8e\x01\x8a\x01\x56\x00\x00\x00\x00\x00\x51\x00\x00\x00\x7c\x01\x57\x01\x11\x00\x85\x00\x00\x00\x00\x00\x00\x00\x8c\x01\xf9\xff\x88\x01\x00\x00\x00\x00\x5d\x00\x4f\x01\x00\x00\x0d\x00\x00\x00\x87\x01\x0d\x00\x7b\x01\x00\x00\x7b\x01\x00\x00\x86\x01\x7d\x01\x78\x01\x74\x01\x00\x00\xf7\xff\x00\x00\x4a\x01\x00\x00\x00\x00\x5d\x00\x57\x00\x49\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
happyGotoOffsets :: HappyAddr
happyGotoOffsets = HappyA# "\x59\x00\x00\x00\x00\x00\x00\x00\xd6\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01\x7f\x01\x7e\x01\x7d\x01\x00\x00\x00\x00\x00\x00\x00\x00\x11\x01\x7c\x01\x02\x00\x00\x00\x00\x00\x00\x00\x72\x01\x79\x01\x70\x01\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x69\x01\xd6\x00\x00\x00\x48\x01\x6d\x01\x00\x00\x17\x00\x00\x00\x00\x00\x84\x00\x6a\x01\x00\x00\x5c\x01\x00\x00\x00\x00\x67\x01\x5e\x01\x5a\x01\x57\x01\x50\x01\x4f\x01\x44\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x43\x01\x00\x00\x42\x01\x21\x01\xf4\x01\x3c\x01\x32\x01\x09\x01\x40\x00\xe2\x01\x00\x00\x00\x00\x00\x00\x00\x00\xfc\x01\x00\x00\x00\x00\x00\x00\x00\x00\x2b\x01\x38\x01\xd0\x01\x0c\x01\x2c\x01\x27\x01\x00\x00\x00\x00\x00\x00\x00\x00\xfa\x00\x00\x00\x00\x00\x00\x00\x00\x00\x4c\x00\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa3\x00\x00\x00\xbe\x01\xac\x01\x00\x00\x13\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x01\x0a\x01\x08\x00\xdf\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf7\xff\x00\x00\x9a\x01\x12\x01\x00\x00\x00\x00\xe7\x00\x00\x00\x88\x01\x00\x00\x76\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x83\x00\x00\x00\x01\x01\x03\x01\x00\x01\xc5\x00\x00\x00\x00\x00\x00\x00\xa8\x00\x05\x00\x7d\x00\x00\x00\x6f\x00\x00\x00\x00\x00\xe5\x00\x00\x00\xe4\x00\x00\x00\x00\x00\x00\x00\xea\x00\x2a\x01\x00\x00\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\xb7\x00\x00\x00\x00\x00\xbf\x00\x00\x00\x00\x00\x00\x00\x3a\x01\x11\x00\xdb\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x64\x01\xe3\x00\x00\x00\x00\x00\xab\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe1\x00\x7b\x00\x9b\x00\x00\x00\x33\x01\xea\xff\x33\x01\x00\x00\x00\x00\x00\x00\xd8\x00\x6c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x31\x00\x00\x00\x00\x00\x3b\x01\x00\x00\x00\x00\x91\x00\x52\x01\xe7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x75\x00\x00\x00\x00\x00\x00\x00\x07\x00\xb6\x00\x00\x00\xb9\x00\x00\x00\xe4\xff\xb0\x00\x00\x00\x00\x00\x00\x00\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\xdb\xff\x4f\x00\x00\x00\x0d\x00\x00\x00\x00\x00\x06\x00\x22\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
happyGotoOffsets = HappyA# "\x51\x01\x00\x00\x00\x00\x00\x00\xc9\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7a\x01\x79\x01\x77\x01\x76\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x6d\x01\x03\x00\x00\x00\x00\x00\x63\x01\x00\x00\x6a\x01\x69\x01\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x58\x01\xc9\x00\x00\x00\x36\x01\x5a\x01\x00\x00\x93\x00\x00\x00\x00\x00\x1a\x00\x55\x01\x00\x00\x4c\x01\x00\x00\x00\x00\x44\x01\x40\x01\x3f\x01\x39\x01\x38\x01\x28\x01\x27\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1e\x01\x00\x00\x16\x01\x26\x01\x03\x02\x5b\x01\xfb\x00\xea\x00\x0c\x00\xf1\x01\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x02\x00\x00\x00\x00\x00\x00\x00\x00\xff\x00\x0e\x01\xdf\x01\x59\x01\x0c\x01\x08\x01\x00\x00\x00\x00\x00\x00\x00\x00\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5c\x00\xe9\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1a\x01\x00\x00\xcd\x01\xbb\x01\x00\x00\x2a\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf7\x00\x18\x01\x0b\x00\xd8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x01\x00\x00\xa9\x01\xf8\x00\x00\x00\x00\x00\xc1\x00\x00\x00\x97\x01\x00\x00\x85\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x06\x01\x52\x01\xd6\x00\xd7\x00\x00\x00\x00\x00\x00\x00\xb3\x00\x05\x00\xa4\x00\x00\x00\x6b\x00\x00\x00\x00\x00\xab\x00\x00\x00\x2f\x01\x00\x00\x00\x00\x00\x00\xf4\x00\x30\x01\x00\x00\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\xb9\x00\x00\x00\x00\x00\x88\x00\x00\x00\x00\x00\x00\x00\x49\x01\x0e\x00\xb0\x00\xa7\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x73\x01\xd3\x00\x00\x00\x00\x00\x83\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe2\x00\x7f\x00\x82\x00\x00\x00\x42\x01\xed\x00\x42\x01\x00\x00\x00\x00\x00\x00\xd0\x00\x5e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x71\x00\x00\x00\x00\x00\x20\x01\x00\x00\x00\x00\x76\x00\x61\x01\xc1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6f\x00\x00\x00\x00\x00\x00\x00\x09\x00\xaf\x00\x00\x00\xbe\x00\x00\x00\xf3\xff\xac\x00\x00\x00\x00\x00\x00\x00\x35\x00\x00\x00\x00\x00\x00\x00\x00\x00\x30\x00\xfc\x00\x00\x00\x10\x00\x00\x00\x00\x00\x07\x00\x61\x00\x25\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
happyDefActions :: HappyAddr
happyDefActions = HappyA# "\xf4\xff\x00\x00\xfe\xff\x00\x00\xfa\xff\x7d\xff\x7c\xff\x00\x00\xf3\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\xff\x00\x00\xf8\xff\xf1\xff\x00\x00\x7d\xff\x7b\xff\x00\x00\x00\x00\xef\xff\x00\x00\x00\x00\x00\x00\xf7\xff\x00\x00\x7d\xff\xf2\xff\xf4\xff\xfb\xff\x00\x00\xa0\xff\x00\x00\xf5\xff\x9e\xff\xf0\xff\x00\x00\x00\x00\x00\x00\x00\x00\xe3\xff\x00\x00\xf9\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9f\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9d\xff\x00\x00\xe4\xff\x00\x00\xee\xff\x00\x00\xd1\xff\x00\x00\x00\x00\x00\x00\x00\x00\x9c\xff\x00\x00\x00\x00\xc6\xff\xc5\xff\xca\xff\xdc\xff\xeb\xff\xe0\xff\xc4\xff\xdb\xff\xcc\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd8\xff\xda\xff\xfd\xff\xfc\xff\x99\xff\x9b\xff\xea\xff\xc0\xff\x00\x00\x8f\xff\x00\x00\xbf\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd0\xff\xe6\xff\xd1\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa9\xff\x8e\xff\x00\x00\x00\x00\x00\x00\x00\x00\x9c\xff\xe5\xff\xc7\xff\xc8\xff\x00\x00\x00\x00\x00\x00\x00\x00\xce\xff\xe1\xff\x00\x00\x00\x00\xe2\xff\x00\x00\x00\x00\xdd\xff\x00\x00\xd9\xff\x00\x00\xc9\xff\x98\xff\x9a\xff\x00\x00\xae\xff\xbc\xff\xb1\xff\xaf\xff\xe9\xff\xb8\xff\xbd\xff\x95\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa8\xff\xc2\xff\x00\x00\x8f\xff\x00\x00\x00\x00\x92\xff\xec\xff\xc3\xff\x97\xff\xcf\xff\xed\xff\x00\x00\x91\xff\x00\x00\x00\x00\x00\x00\x00\x00\x8d\xff\xbe\xff\x89\xff\x00\x00\xba\xff\x89\xff\x00\x00\xb7\xff\x87\xff\x94\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xde\xff\xd5\xff\xd4\xff\xd3\xff\xcd\xff\x00\x00\x00\x00\xd2\xff\xcb\xff\xce\xff\xd7\xff\x00\x00\x00\x00\xa7\xff\xb5\xff\xb3\xff\xb9\xff\x00\x00\x95\xff\x00\x00\xb6\xff\x00\x00\x7f\xff\x00\x00\xc1\xff\xb0\xff\xe8\xff\x00\x00\x92\xff\x96\xff\x90\xff\x00\x00\x88\xff\xb2\xff\x8b\xff\x00\x00\x00\x00\xbb\xff\x86\xff\x85\xff\x93\xff\xac\xff\x00\x00\x00\x00\x00\x00\xd6\xff\xdf\xff\xa6\xff\x84\xff\x00\x00\x00\x00\xa4\xff\x7e\xff\x82\xff\x00\x00\xa3\xff\x00\x00\xb4\xff\x7f\xff\x00\x00\xe7\xff\x8a\xff\xab\xff\x7f\xff\x00\x00\x81\xff\x00\x00\x00\x00\x87\xff\x85\xff\x83\xff\xaa\xff\xad\xff\xa2\xff\x82\xff\x00\x00\x00\x00\xa5\xff\xa1\xff\x80\xff"#
happyDefActions = HappyA# "\xf4\xff\x00\x00\xfe\xff\x00\x00\xfa\xff\x7d\xff\x7c\xff\x00\x00\xf3\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\xff\x00\x00\xf8\xff\xf1\xff\x00\x00\x7d\xff\x7b\xff\x00\x00\xef\xff\x00\x00\x00\x00\x00\x00\x00\x00\xf7\xff\xf2\xff\x00\x00\x7d\xff\xf4\xff\xfb\xff\x00\x00\xa0\xff\x00\x00\xf5\xff\x9e\xff\xf0\xff\x00\x00\x00\x00\x00\x00\x00\x00\xe3\xff\x00\x00\xf9\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9f\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9d\xff\x00\x00\xe4\xff\x00\x00\xee\xff\x00\x00\xd1\xff\x00\x00\x00\x00\x00\x00\x00\x00\x9c\xff\x00\x00\x00\x00\xc6\xff\xc5\xff\xca\xff\xdc\xff\xeb\xff\xe0\xff\xc4\xff\xdb\xff\xcc\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd8\xff\xda\xff\xfd\xff\xfc\xff\x99\xff\x9b\xff\xea\xff\xc0\xff\x00\x00\x8f\xff\x00\x00\xbf\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd0\xff\xe6\xff\xd1\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa9\xff\x8e\xff\x00\x00\x00\x00\x00\x00\x00\x00\x9c\xff\xe5\xff\xc7\xff\xc8\xff\x00\x00\x00\x00\x00\x00\x00\x00\xce\xff\xe1\xff\x00\x00\x00\x00\xe2\xff\x00\x00\x00\x00\xdd\xff\x00\x00\xd9\xff\x00\x00\xc9\xff\x98\xff\x9a\xff\x00\x00\xae\xff\xbc\xff\xb1\xff\xaf\xff\xe9\xff\xb8\xff\xbd\xff\x95\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa8\xff\xc2\xff\x00\x00\x8f\xff\x00\x00\x00\x00\x92\xff\xec\xff\xc3\xff\x97\xff\xcf\xff\xed\xff\x00\x00\x91\xff\x00\x00\x00\x00\x00\x00\x00\x00\x8d\xff\xbe\xff\x89\xff\x00\x00\xba\xff\x89\xff\x00\x00\xb7\xff\x87\xff\x94\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xde\xff\xd5\xff\xd4\xff\xd3\xff\xcd\xff\x00\x00\x00\x00\xd2\xff\xcb\xff\xce\xff\xd7\xff\x00\x00\x00\x00\xa7\xff\xb5\xff\xb3\xff\xb9\xff\x00\x00\x95\xff\x00\x00\xb6\xff\x00\x00\x7f\xff\x00\x00\xc1\xff\xb0\xff\xe8\xff\x00\x00\x92\xff\x96\xff\x90\xff\x00\x00\x88\xff\xb2\xff\x8b\xff\x00\x00\x00\x00\xbb\xff\x86\xff\x85\xff\x93\xff\xac\xff\x00\x00\x00\x00\x00\x00\xd6\xff\xdf\xff\xa6\xff\x84\xff\x00\x00\x00\x00\xa4\xff\x7e\xff\x82\xff\x00\x00\xa3\xff\x00\x00\xb4\xff\x7f\xff\x00\x00\xe7\xff\x8a\xff\xab\xff\x7f\xff\x00\x00\x81\xff\x00\x00\x00\x00\x87\xff\x85\xff\x83\xff\xaa\xff\xad\xff\xa2\xff\x82\xff\x00\x00\x00\x00\xa5\xff\xa1\xff\x80\xff"#
happyCheck :: HappyAddr
happyCheck = HappyA# "\xff\xff\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12\x00\x20\x00\x30\x00\x15\x00\x03\x00\x01\x00\x03\x00\x00\x00\x00\x00\x2e\x00\x0b\x00\x0a\x00\x03\x00\x0c\x00\x33\x00\x2e\x00\x0f\x00\x08\x00\x11\x00\x12\x00\x33\x00\x0c\x00\x1a\x00\x09\x00\x0f\x00\x00\x00\x11\x00\x03\x00\x09\x00\x1c\x00\x22\x00\x22\x00\x22\x00\x20\x00\x25\x00\x25\x00\x0c\x00\x0d\x00\x0e\x00\x28\x00\x00\x00\x2d\x00\x22\x00\x24\x00\x34\x00\x34\x00\x34\x00\x32\x00\x32\x00\x30\x00\x31\x00\x32\x00\x31\x00\x27\x00\x2d\x00\x00\x00\x2f\x00\x30\x00\x31\x00\x03\x00\x04\x00\x24\x00\x2b\x00\x33\x00\x08\x00\x03\x00\x0b\x00\x00\x00\x0c\x00\x11\x00\x08\x00\x0f\x00\x30\x00\x11\x00\x0c\x00\x03\x00\x24\x00\x0f\x00\x10\x00\x11\x00\x08\x00\x03\x00\x03\x00\x03\x00\x0c\x00\x03\x00\x06\x00\x0f\x00\x01\x00\x11\x00\x0c\x00\x0c\x00\x0e\x00\x1a\x00\x0c\x00\x28\x00\x0e\x00\x13\x00\x04\x00\x00\x00\x30\x00\x22\x00\x00\x00\x21\x00\x30\x00\x31\x00\x1b\x00\x06\x00\x15\x00\x01\x00\x30\x00\x31\x00\x2d\x00\x0c\x00\x00\x00\x0e\x00\x00\x00\x16\x00\x30\x00\x31\x00\x30\x00\x31\x00\x00\x00\x00\x00\x1e\x00\x16\x00\x30\x00\x30\x00\x22\x00\x0d\x00\x30\x00\x25\x00\x26\x00\x0a\x00\x23\x00\x29\x00\x2a\x00\x23\x00\x02\x00\x16\x00\x2e\x00\x19\x00\x30\x00\x2c\x00\x31\x00\x1f\x00\x2c\x00\x01\x00\x22\x00\x30\x00\x31\x00\x32\x00\x31\x00\x1f\x00\x00\x00\x0c\x00\x22\x00\x2b\x00\x0f\x00\x00\x00\x11\x00\x12\x00\x0c\x00\x0d\x00\x0e\x00\x2b\x00\x31\x00\x00\x00\x01\x00\x0b\x00\x01\x00\x1c\x00\x0d\x00\x00\x00\x14\x00\x20\x00\x00\x00\x01\x00\x18\x00\x0d\x00\x0d\x00\x17\x00\x18\x00\x15\x00\x19\x00\x02\x00\x0d\x00\x15\x00\x00\x00\x0d\x00\x15\x00\x30\x00\x31\x00\x32\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x30\x00\x31\x00\x32\x00\x0d\x00\x23\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x04\x00\x05\x00\x23\x00\x02\x00\x19\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x0d\x00\x2f\x00\x00\x00\x01\x00\x02\x00\x00\x00\x01\x00\x0d\x00\x0d\x00\x0d\x00\x30\x00\x0d\x00\x0d\x00\x2f\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x0d\x00\x19\x00\x19\x00\x13\x00\x23\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x00\x00\x01\x00\x00\x00\x23\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x00\x00\x01\x00\x00\x00\x23\x00\x0d\x00\x2a\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x01\x00\x05\x00\x0d\x00\x0d\x00\x07\x00\x0d\x00\x02\x00\x0b\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x0d\x00\x00\x00\x19\x00\x29\x00\x23\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x02\x00\x00\x00\x01\x00\x00\x00\x23\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x00\x00\x01\x00\x14\x00\x23\x00\x0d\x00\x00\x00\x18\x00\x00\x00\x01\x00\x00\x00\x17\x00\x18\x00\x0d\x00\x0d\x00\x16\x00\x00\x00\x00\x00\x00\x00\x1b\x00\x1c\x00\x0d\x00\x1e\x00\x0d\x00\x1d\x00\x19\x00\x1f\x00\x23\x00\x1b\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x1b\x00\x23\x00\x00\x00\x1e\x00\x2c\x00\x00\x00\x2e\x00\x21\x00\x23\x00\x00\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x00\x00\x01\x00\x02\x00\x00\x00\x0c\x00\x17\x00\x00\x00\x30\x00\x31\x00\x00\x00\x26\x00\x06\x00\x00\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x00\x00\x01\x00\x02\x00\x00\x00\x08\x00\x17\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x31\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x00\x00\x01\x00\x02\x00\x04\x00\x01\x00\x17\x00\x02\x00\x15\x00\x30\x00\x04\x00\x04\x00\x01\x00\x32\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x00\x00\x01\x00\x02\x00\x04\x00\x15\x00\x17\x00\x01\x00\x30\x00\x04\x00\x06\x00\x15\x00\x14\x00\x32\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x00\x00\x01\x00\x02\x00\x17\x00\x0d\x00\x17\x00\x30\x00\x04\x00\x02\x00\x01\x00\x03\x00\x0d\x00\x03\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x00\x00\x01\x00\x02\x00\x06\x00\x1a\x00\x17\x00\x30\x00\x30\x00\x15\x00\x0b\x00\x01\x00\x04\x00\x14\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x00\x00\x01\x00\x02\x00\x06\x00\x30\x00\x17\x00\x0d\x00\x30\x00\x10\x00\x04\x00\x01\x00\x32\x00\x05\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x00\x00\x01\x00\x02\x00\x13\x00\x0a\x00\x17\x00\x02\x00\x30\x00\x01\x00\x0b\x00\x09\x00\x05\x00\x02\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x00\x00\x01\x00\x02\x00\x02\x00\x02\x00\x17\x00\x02\x00\x30\x00\x00\x00\x01\x00\x02\x00\x30\x00\x19\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x32\x00\x08\x00\x24\x00\x0d\x00\x05\x00\x17\x00\x10\x00\x11\x00\x05\x00\x02\x00\x05\x00\x02\x00\x02\x00\x17\x00\x01\x00\x30\x00\x02\x00\x20\x00\x01\x00\x03\x00\x30\x00\x21\x00\x07\x00\x30\x00\x30\x00\x24\x00\x06\x00\x30\x00\x01\x00\x30\x00\x05\x00\x28\x00\x02\x00\x27\x00\x27\x00\x30\x00\x23\x00\x1a\x00\xff\xff\xff\xff\x30\x00\xff\xff\xff\xff\xff\xff\xff\xff\x30\x00\xff\xff\xff\xff\x34\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
happyCheck = HappyA# "\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x0d\x00\x00\x00\x00\x00\x16\x00\x00\x00\x16\x00\x03\x00\x01\x00\x15\x00\x20\x00\x03\x00\x08\x00\x0b\x00\x0b\x00\x03\x00\x0c\x00\x00\x00\x0a\x00\x0f\x00\x0c\x00\x11\x00\x1a\x00\x0f\x00\x2e\x00\x11\x00\x12\x00\x0a\x00\x00\x00\x33\x00\x22\x00\x31\x00\x22\x00\x31\x00\x22\x00\x25\x00\x1c\x00\x25\x00\x30\x00\x22\x00\x20\x00\x2d\x00\x28\x00\x28\x00\x34\x00\x34\x00\x34\x00\x34\x00\x32\x00\x2d\x00\x32\x00\x2f\x00\x30\x00\x31\x00\x03\x00\x04\x00\x30\x00\x31\x00\x32\x00\x08\x00\x03\x00\x31\x00\x03\x00\x0c\x00\x24\x00\x08\x00\x0f\x00\x03\x00\x11\x00\x0c\x00\x03\x00\x0c\x00\x0f\x00\x10\x00\x11\x00\x08\x00\x0c\x00\x0d\x00\x0e\x00\x0c\x00\x03\x00\x03\x00\x0f\x00\x00\x00\x11\x00\x00\x00\x1b\x00\x30\x00\x00\x00\x0c\x00\x0c\x00\x0e\x00\x0e\x00\x01\x00\x16\x00\x33\x00\x13\x00\x04\x00\x00\x00\x30\x00\x31\x00\x11\x00\x06\x00\x01\x00\x00\x00\x30\x00\x31\x00\x30\x00\x0c\x00\x1a\x00\x0e\x00\x02\x00\x30\x00\x15\x00\x09\x00\x30\x00\x31\x00\x22\x00\x00\x00\x00\x00\x23\x00\x31\x00\x01\x00\x1e\x00\x24\x00\x30\x00\x30\x00\x22\x00\x2d\x00\x2c\x00\x25\x00\x26\x00\x30\x00\x23\x00\x29\x00\x2a\x00\x0c\x00\x0d\x00\x0e\x00\x2e\x00\x24\x00\x30\x00\x2c\x00\x15\x00\x30\x00\x31\x00\x32\x00\x09\x00\x2b\x00\x1f\x00\x1f\x00\x0c\x00\x22\x00\x22\x00\x0f\x00\x00\x00\x11\x00\x12\x00\x01\x00\x05\x00\x02\x00\x2b\x00\x2b\x00\x00\x00\x01\x00\x0b\x00\x00\x00\x1c\x00\x0d\x00\x02\x00\x00\x00\x20\x00\x30\x00\x31\x00\x32\x00\x30\x00\x0d\x00\x27\x00\x15\x00\x0d\x00\x19\x00\x00\x00\x01\x00\x0d\x00\x00\x00\x01\x00\x02\x00\x30\x00\x31\x00\x32\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x0d\x00\x19\x00\x04\x00\x05\x00\x23\x00\x00\x00\x01\x00\x0b\x00\x00\x00\x13\x00\x2a\x00\x00\x00\x00\x00\x00\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x0d\x00\x17\x00\x18\x00\x0d\x00\x23\x00\x00\x00\x01\x00\x0d\x00\x0d\x00\x17\x00\x18\x00\x2f\x00\x00\x00\x00\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x0d\x00\x19\x00\x19\x00\x2f\x00\x23\x00\x00\x00\x01\x00\x0d\x00\x0d\x00\x00\x00\x02\x00\x1d\x00\x00\x00\x1f\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x0d\x00\x19\x00\x19\x00\x29\x00\x23\x00\x00\x00\x01\x00\x0d\x00\x2c\x00\x02\x00\x2e\x00\x00\x00\x20\x00\x00\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x0d\x00\x19\x00\x16\x00\x00\x00\x23\x00\x00\x00\x01\x00\x00\x00\x2e\x00\x12\x00\x21\x00\x00\x00\x15\x00\x33\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x0d\x00\x00\x00\x00\x00\x00\x00\x23\x00\x00\x00\x01\x00\x30\x00\x31\x00\x14\x00\x00\x00\x00\x00\x01\x00\x18\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x0d\x00\x00\x00\x00\x00\x14\x00\x23\x00\x0d\x00\x0d\x00\x18\x00\x00\x00\x00\x00\x21\x00\x00\x00\x01\x00\x00\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x00\x00\x01\x00\x1b\x00\x1c\x00\x23\x00\x1e\x00\x0d\x00\x30\x00\x31\x00\x00\x00\x23\x00\x03\x00\x00\x00\x0d\x00\x06\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x26\x00\x1b\x00\x06\x00\x0d\x00\x1e\x00\x00\x00\x01\x00\x02\x00\x1b\x00\x23\x00\x0d\x00\x1e\x00\x0d\x00\x00\x00\x00\x00\x08\x00\x23\x00\x00\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x00\x00\x01\x00\x02\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x00\x31\x00\x04\x00\x09\x00\x01\x00\x30\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x00\x00\x01\x00\x02\x00\x02\x00\x32\x00\x17\x00\x04\x00\x04\x00\x01\x00\x04\x00\x01\x00\x15\x00\x15\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x00\x00\x01\x00\x02\x00\x04\x00\x30\x00\x17\x00\x0d\x00\x15\x00\x14\x00\x06\x00\x30\x00\x32\x00\x04\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x00\x00\x01\x00\x02\x00\x17\x00\x02\x00\x17\x00\x01\x00\x03\x00\x0d\x00\x06\x00\x1a\x00\x30\x00\x03\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x00\x00\x01\x00\x02\x00\x14\x00\x30\x00\x17\x00\x0b\x00\x01\x00\x30\x00\x15\x00\x06\x00\x04\x00\x0d\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x00\x00\x01\x00\x02\x00\x10\x00\x30\x00\x17\x00\x04\x00\x32\x00\x05\x00\x01\x00\x13\x00\x0a\x00\x02\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x00\x00\x01\x00\x02\x00\x01\x00\x30\x00\x17\x00\x09\x00\x02\x00\x05\x00\x02\x00\x02\x00\x02\x00\x19\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x00\x00\x01\x00\x02\x00\x0b\x00\x32\x00\x17\x00\x30\x00\x30\x00\x05\x00\x24\x00\x08\x00\x05\x00\x02\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x00\x00\x01\x00\x02\x00\x05\x00\x02\x00\x17\x00\x02\x00\x30\x00\x00\x00\x01\x00\x02\x00\x01\x00\x20\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x02\x00\x01\x00\x21\x00\x0d\x00\x24\x00\x17\x00\x10\x00\x11\x00\x30\x00\x30\x00\x03\x00\x30\x00\x06\x00\x17\x00\x01\x00\x07\x00\x28\x00\x27\x00\x27\x00\x30\x00\x30\x00\x05\x00\x02\x00\x30\x00\x23\x00\x1a\x00\xff\xff\xff\xff\xff\xff\x30\x00\xff\xff\xff\xff\xff\xff\x30\x00\xff\xff\x34\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#
happyTable :: HappyAddr
happyTable = HappyA# "\x00\x00\x06\x00\x06\x00\x06\x00\xe4\x00\x74\x00\x74\x00\x74\x00\x5e\x00\x87\x00\xe4\x00\x09\x01\x88\x00\x55\x00\xe8\x00\xea\x00\xf5\x00\x74\x00\xff\x00\x5f\x00\x56\x00\x99\x00\x57\x00\xe6\x00\xe5\x00\x58\x00\x9a\x00\x59\x00\x5a\x00\xe6\x00\x9b\x00\x75\x00\x28\x00\x9c\x00\xf5\x00\x9d\x00\xf8\x00\xb9\x00\x5b\x00\x76\x00\x02\x01\x02\x01\x5c\x00\x03\x01\x03\x01\xf9\x00\x10\x01\xfa\x00\x8f\x00\xf5\x00\xb1\x00\xd0\x00\xf6\x00\x22\x00\x15\x00\x07\x00\x11\x01\x04\x01\x03\x00\x5d\x00\x5e\x00\x5d\x00\x29\x00\x9e\x00\x5e\x00\x9f\x00\x03\x00\x5d\x00\x99\x00\xe4\x00\x10\x01\xba\x00\x0e\x01\x9a\x00\x99\x00\x5f\x00\x74\x00\x9b\x00\x79\x00\x9a\x00\x9c\x00\x03\x00\x9d\x00\x9b\x00\x99\x00\xf6\x00\x9c\x00\xe8\x00\x9d\x00\x9a\x00\xf8\x00\x64\x00\x03\x00\x9b\x00\xf8\x00\x04\x00\x9c\x00\xfe\x00\x9d\x00\xf9\x00\x65\x00\xfa\x00\x75\x00\xf9\x00\x60\x00\xfa\x00\xfb\x00\x2f\x00\xab\x00\x03\x00\x76\x00\xab\x00\xf2\x00\x03\x00\x5d\x00\x66\x00\xc8\x00\xb0\x00\xe8\x00\x03\x00\x5d\x00\x77\x00\xc9\x00\x74\x00\xca\x00\x4b\x00\x87\xff\xf3\x00\x08\x01\x03\x00\x5d\x00\x74\x00\x2c\x00\x30\x00\x07\x01\x03\x00\x03\x00\x31\x00\x61\x00\x03\x00\x32\x00\x33\x00\x2d\x00\xac\x00\x34\x00\x35\x00\xac\x00\xf1\x00\x87\xff\x36\x00\xb0\x00\x03\x00\xe0\x00\x87\xff\xba\x00\xad\x00\xe8\x00\xbb\x00\x03\x00\x5d\x00\x5e\x00\x5d\x00\xba\x00\x69\x00\x85\x00\xbb\x00\xea\x00\x58\x00\x4b\x00\x59\x00\x5a\x00\xc9\x00\xf0\x00\xca\x00\xbc\x00\x87\xff\x90\x00\x91\x00\x86\x00\xaf\x00\x5b\x00\x61\x00\x4b\x00\xa9\x00\x5c\x00\x90\x00\x91\x00\x6b\x00\xd7\x00\x92\x00\xc0\x00\xc1\x00\xee\x00\xb2\x00\xce\x00\x01\x01\xb0\x00\x4b\x00\x92\x00\xb0\x00\x03\x00\x5d\x00\x5e\x00\x93\x00\x94\x00\xfe\x00\x96\x00\x03\x00\x5d\x00\x5e\x00\x61\x00\x97\x00\x93\x00\x94\x00\x00\x01\x96\x00\x90\x00\x91\x00\x08\x00\x09\x00\x97\x00\xcf\x00\xb4\x00\x4b\x00\x4b\x00\x90\x00\x91\x00\x4b\x00\x4b\x00\x92\x00\xd7\x00\xc3\x00\xc4\x00\xc5\x00\x90\x00\x91\x00\x61\x00\x61\x00\x92\x00\xd5\x00\xcb\x00\xdf\x00\xd9\x00\x93\x00\x94\x00\xe1\x00\x96\x00\x92\x00\x8e\x00\x73\x00\xc6\x00\x97\x00\x93\x00\x94\x00\xeb\x00\x96\x00\xb5\x00\x90\x00\x91\x00\x4b\x00\x97\x00\x93\x00\x94\x00\xdc\x00\x96\x00\x4b\x00\x90\x00\x91\x00\x4b\x00\x97\x00\x92\x00\xaa\x00\xb6\x00\x17\x00\x86\x00\x90\x00\x91\x00\x8d\x00\x61\x00\x92\x00\x18\x00\x7e\x00\x9f\x00\x86\x00\x93\x00\x94\x00\xb7\x00\x96\x00\x92\x00\x69\x00\x62\x00\x7b\x00\x97\x00\x93\x00\x94\x00\x95\x00\x96\x00\x7c\x00\x90\x00\x91\x00\x7d\x00\x97\x00\x93\x00\x94\x00\xa4\x00\x96\x00\x4b\x00\x90\x00\x91\x00\x6a\x00\x97\x00\x92\x00\x81\x00\x6b\x00\x90\x00\x91\x00\x4b\x00\xc0\x00\xc1\x00\x61\x00\x92\x00\x82\x00\x6c\x00\x42\x00\x37\x00\x93\x00\xdb\x00\x92\x00\x96\x00\x67\x00\x0b\x00\x66\x00\x0c\x00\x97\x00\xe2\x00\x38\x00\x39\x00\x96\x00\x4b\x00\x4c\x00\x4d\x00\xd1\x00\x97\x00\x3a\x00\x96\x00\x0d\x00\x3b\x00\x0e\x00\xf2\x00\x97\x00\x3c\x00\x4e\x00\x4f\x00\xf0\x00\x51\x00\x52\x00\x4b\x00\x4c\x00\x4d\x00\x3d\x00\x3f\x00\x53\x00\x2b\x00\xf3\x00\xf4\x00\x25\x00\x26\x00\x21\x00\x1b\x00\x4e\x00\x4f\x00\xcc\x00\x51\x00\x52\x00\x4b\x00\x4c\x00\x4d\x00\x1c\x00\x1d\x00\x53\x00\x16\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x0b\x01\x5d\x00\x4e\x00\x4f\x00\xc1\x00\x51\x00\x52\x00\x4b\x00\x4c\x00\x4d\x00\x0c\x01\x0d\x01\x53\x00\x0e\x01\xb0\x00\x03\x00\x8c\xff\x06\x01\x08\x01\x5e\x00\x4e\x00\x4f\x00\xc2\x00\x51\x00\x52\x00\x4b\x00\x4c\x00\x4d\x00\xfc\x00\xb0\x00\x53\x00\xfd\x00\x03\x00\x8c\xff\xee\x00\xb0\x00\xbe\x00\x5e\x00\x4e\x00\x4f\x00\x80\x00\x51\x00\x52\x00\x4b\x00\x4c\x00\x4d\x00\xed\x00\xce\x00\x53\x00\x03\x00\xd3\x00\xd4\x00\xd5\x00\xd9\x00\xdb\x00\xb4\x00\x4e\x00\x4f\x00\xa6\x00\x51\x00\x52\x00\x4b\x00\x4c\x00\x4d\x00\xde\x00\xdf\x00\x53\x00\x03\x00\x03\x00\xb0\x00\xbf\x00\xcb\x00\x8a\x00\xbe\x00\x4e\x00\x4f\x00\xa7\x00\x51\x00\x52\x00\x7f\x00\x4c\x00\x4d\x00\x8b\x00\x03\x00\x53\x00\x8c\x00\x03\x00\x8e\x00\xa1\x00\xa3\x00\x5e\x00\xa2\x00\x4e\x00\x4f\x00\x80\x00\x51\x00\x52\x00\x4b\x00\x4c\x00\x4d\x00\xa4\x00\xa6\x00\x53\x00\xa9\x00\x03\x00\x6e\x00\x86\x00\x6f\x00\x70\x00\x71\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x4b\x00\x4c\x00\x4d\x00\x72\x00\x73\x00\x53\x00\x7a\x00\x03\x00\x4b\x00\x4c\x00\x4d\x00\x03\x00\x7b\x00\x4e\x00\x4f\x00\x68\x00\x51\x00\x52\x00\x5e\x00\x45\x00\x44\x00\x4e\x00\x46\x00\x53\x00\x83\x00\x52\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x53\x00\x3f\x00\x03\x00\x42\x00\x41\x00\x37\x00\x24\x00\x03\x00\x2b\x00\x20\x00\x03\x00\x03\x00\x28\x00\x25\x00\x03\x00\x21\x00\x03\x00\x1b\x00\x1f\x00\x13\x00\x1a\x00\x14\x00\x03\x00\x06\x00\x15\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
happyTable = HappyA# "\x00\x00\x06\x00\x06\x00\x06\x00\x06\x00\x74\x00\x7d\xff\x74\x00\x17\x00\x74\x00\xd7\x00\x5e\x00\x5e\x00\x87\xff\x74\x00\x07\x01\x99\x00\xe8\x00\xb0\x00\xe4\x00\x55\x00\x9a\x00\x5f\x00\x5f\x00\xea\x00\x9b\x00\x2c\x00\x56\x00\x9c\x00\x57\x00\x9d\x00\x75\x00\x58\x00\xff\x00\x59\x00\x5a\x00\x2d\x00\xf5\x00\xe6\x00\x76\x00\x87\xff\x02\x01\x5d\x00\x02\x01\x03\x01\x5b\x00\x03\x01\x03\x00\xd0\x00\x5c\x00\xb1\x00\x8f\x00\x60\x00\x18\x00\x22\x00\x15\x00\x07\x00\x11\x01\x9e\x00\x04\x01\x9f\x00\x03\x00\x5d\x00\x99\x00\xe4\x00\x03\x00\x5d\x00\x5e\x00\x9a\x00\x99\x00\x5d\x00\x64\x00\x9b\x00\xf6\x00\x9a\x00\x9c\x00\xf8\x00\x9d\x00\x9b\x00\x99\x00\x65\x00\x9c\x00\xe8\x00\x9d\x00\x9a\x00\xf9\x00\x10\x01\xfa\x00\x9b\x00\xf8\x00\xf8\x00\x9c\x00\x74\x00\x9d\x00\xab\x00\x66\x00\x09\x01\xf5\x00\xf9\x00\xf9\x00\xfa\x00\xfa\x00\xfe\x00\x87\xff\x0e\x01\xfb\x00\x2f\x00\xab\x00\x03\x00\x5d\x00\x79\x00\xc8\x00\xe8\x00\xf5\x00\x03\x00\x5d\x00\x03\x00\xc9\x00\x75\x00\xca\x00\xf1\x00\x03\x00\xb0\x00\xb9\x00\x03\x00\x5d\x00\x76\x00\x74\x00\x74\x00\xac\x00\x87\xff\xe8\x00\x30\x00\x10\x01\x03\x00\x03\x00\x31\x00\x77\x00\xe0\x00\x32\x00\x33\x00\x03\x00\xac\x00\x34\x00\x35\x00\xc9\x00\xf0\x00\xca\x00\x36\x00\xf6\x00\x03\x00\xad\x00\xee\x00\x03\x00\x5d\x00\x5e\x00\x28\x00\xba\x00\xba\x00\xba\x00\x85\x00\xbb\x00\xbb\x00\x58\x00\x4b\x00\x59\x00\x5a\x00\xaf\x00\x8d\x00\xce\x00\xea\x00\xbc\x00\x90\x00\x91\x00\x86\x00\x4b\x00\x5b\x00\x61\x00\xcf\x00\x4b\x00\x5c\x00\x03\x00\x5d\x00\x5e\x00\xd5\x00\x92\x00\x29\x00\xb0\x00\x01\x01\xb0\x00\x90\x00\x91\x00\x61\x00\xc3\x00\xc4\x00\xc5\x00\x03\x00\x5d\x00\x5e\x00\x93\x00\x94\x00\xfe\x00\x96\x00\x92\x00\xb2\x00\x08\x00\x09\x00\x97\x00\x90\x00\x91\x00\x86\x00\x4b\x00\xc6\x00\xaa\x00\xb5\x00\x4b\x00\x4b\x00\x93\x00\x94\x00\x00\x01\x96\x00\x92\x00\xc0\x00\xc1\x00\xcb\x00\x97\x00\x90\x00\x91\x00\x61\x00\x61\x00\xc0\x00\xc1\x00\xd7\x00\x4b\x00\x4b\x00\x93\x00\x94\x00\xe1\x00\x96\x00\x92\x00\xb4\x00\x8e\x00\xd9\x00\x97\x00\x90\x00\x91\x00\x61\x00\x61\x00\x86\x00\x9f\x00\x0b\x00\x4b\x00\x0c\x00\x93\x00\x94\x00\xeb\x00\x96\x00\x92\x00\x73\x00\x62\x00\x7b\x00\x97\x00\x90\x00\x91\x00\x61\x00\x0d\x00\x7c\x00\x0e\x00\x7d\x00\xe4\x00\x81\x00\x93\x00\x94\x00\xdc\x00\x96\x00\x92\x00\x66\x00\x82\x00\x6c\x00\x97\x00\x90\x00\x91\x00\x69\x00\xe5\x00\x87\x00\xf2\x00\x42\x00\x88\x00\xe6\x00\x93\x00\x94\x00\xb7\x00\x96\x00\x92\x00\x69\x00\x37\x00\x38\x00\x97\x00\x90\x00\x91\x00\xf3\x00\x08\x01\xa9\x00\x4b\x00\x90\x00\x91\x00\x6b\x00\x93\x00\x94\x00\x95\x00\x96\x00\x92\x00\x39\x00\x3a\x00\x6a\x00\x97\x00\xdf\x00\x92\x00\x6b\x00\x3b\x00\x3c\x00\xf2\x00\x90\x00\x91\x00\x3d\x00\x93\x00\x94\x00\xa4\x00\x96\x00\x90\x00\x91\x00\x93\x00\xdb\x00\x97\x00\x96\x00\x92\x00\xf3\x00\xf4\x00\x4b\x00\x97\x00\x03\x00\x2b\x00\x92\x00\x04\x00\x3f\x00\x4b\x00\x25\x00\x4b\x00\x26\x00\xe2\x00\x21\x00\xb6\x00\x96\x00\x4b\x00\x4c\x00\x4d\x00\xd1\x00\x97\x00\x7e\x00\x96\x00\x67\x00\x1b\x00\x1c\x00\x1e\x00\x97\x00\x16\x00\x4e\x00\x4f\x00\xf0\x00\x51\x00\x52\x00\x4b\x00\x4c\x00\x4d\x00\x0e\x00\x0f\x00\x53\x00\x10\x00\x11\x00\x5d\x00\x0c\x01\x0b\x01\x0d\x01\x03\x00\x4e\x00\x4f\x00\xcc\x00\x51\x00\x52\x00\x4b\x00\x4c\x00\x4d\x00\x0e\x01\x5e\x00\x53\x00\x8c\xff\x06\x01\x08\x01\xfc\x00\xfd\x00\xb0\x00\xb0\x00\x4e\x00\x4f\x00\xc1\x00\x51\x00\x52\x00\x4b\x00\x4c\x00\x4d\x00\x8c\xff\x03\x00\x53\x00\xce\x00\xb0\x00\xbe\x00\xee\x00\x03\x00\x5e\x00\xd3\x00\x4e\x00\x4f\x00\xc2\x00\x51\x00\x52\x00\x4b\x00\x4c\x00\x4d\x00\xed\x00\xd4\x00\x53\x00\xd5\x00\xd9\x00\xdb\x00\xde\x00\xdf\x00\x03\x00\xb4\x00\x4e\x00\x4f\x00\x80\x00\x51\x00\x52\x00\x4b\x00\x4c\x00\x4d\x00\xbe\x00\x03\x00\x53\x00\xbf\x00\xcb\x00\x03\x00\xb0\x00\x8b\x00\x8a\x00\x8c\x00\x4e\x00\x4f\x00\xa6\x00\x51\x00\x52\x00\x4b\x00\x4c\x00\x4d\x00\x8e\x00\x03\x00\x53\x00\xa1\x00\x5e\x00\xa2\x00\xa3\x00\xa4\x00\xa6\x00\xa9\x00\x4e\x00\x4f\x00\xa7\x00\x51\x00\x52\x00\x7f\x00\x4c\x00\x4d\x00\x6e\x00\x03\x00\x53\x00\x6f\x00\x71\x00\x70\x00\x72\x00\x73\x00\x7a\x00\x7b\x00\x4e\x00\x4f\x00\x80\x00\x51\x00\x52\x00\x4b\x00\x4c\x00\x4d\x00\x86\x00\x5e\x00\x53\x00\x03\x00\x03\x00\x46\x00\x44\x00\x45\x00\x47\x00\x48\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x4b\x00\x4c\x00\x4d\x00\x49\x00\x4a\x00\x53\x00\x4b\x00\x03\x00\x4b\x00\x4c\x00\x4d\x00\x3f\x00\x41\x00\x4e\x00\x4f\x00\x68\x00\x51\x00\x52\x00\x42\x00\x37\x00\x2b\x00\x4e\x00\x28\x00\x53\x00\x83\x00\x52\x00\x03\x00\x03\x00\x24\x00\x03\x00\x25\x00\x53\x00\x21\x00\x1e\x00\x20\x00\x1a\x00\x14\x00\x03\x00\x03\x00\x1b\x00\x13\x00\x03\x00\x06\x00\x15\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#
happyReduceArr = array (1, 132) [
(1 , happyReduce_1),
@@ -614,7 +614,7 @@ happyReduction_12 happy_x_2
happyReduce_13 = happySpecReduce_2 7# happyReduction_13
happyReduction_13 happy_x_2
happy_x_1
= case happyOut4 happy_x_1 of { happy_var_1 ->
= case happyOut56 happy_x_1 of { happy_var_1 ->
happyIn11
(Ext happy_var_1
)}
@@ -1727,7 +1727,7 @@ happyError ts =
myLexer = tokens
{-# LINE 1 "GenericTemplate.hs" #-}
-- $Id: ParGFC.hs,v 1.2 2004/09/14 18:05:47 aarne Exp $
-- $Id: ParGFC.hs,v 1.3 2004/09/15 15:36:32 aarne Exp $

View File

@@ -117,7 +117,7 @@ instance Print ModType where
instance Print Extend where
prt i e = case e of
Ext id -> prPrec i 0 (concatD [prt 0 id , doc (showString "**")])
Ext ids -> prPrec i 0 (concatD [prt 0 ids , doc (showString "**")])
NoExt -> prPrec i 0 (concatD [])

View File

@@ -10,7 +10,7 @@ import Modules
import ReadFiles
import ShellState
import MkResource
import MkUnion
---- import MkUnion
-- the main compiler passes
import GetGrammar
@@ -202,9 +202,12 @@ makeSourceModule opts env@(k,gr,can) mo@(i,mi) = case mi of
mos = modules gr
--- putp " type checking reused" $ ioeErr $ showCheckModule mos mo2
return $ (k,mo2)
{- ---- obsolete
MTUnion ty imps -> do
mo' <- ioeErr $ makeUnion gr i ty imps
compileSourceModule opts env mo'
-}
_ -> compileSourceModule opts env mo
_ -> compileSourceModule opts env mo
where

View File

@@ -17,21 +17,11 @@ import Monad
extendModule :: [SourceModule] -> SourceModule -> Err SourceModule
extendModule ms (name,mod) = case mod of
ModMod (Module mt st fs me ops js) -> do
{- --- building the {s : Str} lincat from js0
js <- case mt of
MTConcrete a -> do
ModMod ma <- lookupModule (MGrammar ms) a
let cats = [c | (c,AbsCat _ _) <- tree2list $ jments ma]
jscs = [(c,CncCat (yes defLinType) nope nope) | c <- cats]
return $ updatesTreeNondestr jscs js0
_ -> return js0
-}
case me of
-- if the module is an extension of another one...
Just n -> do
ModMod m -> do
mod' <- foldM extOne m (extends m)
return (name,ModMod mod')
where
extOne mod@(Module mt st fs es ops js) n = do
(m0,isCompl) <- do
m <- lookupModMod (MGrammar ms) n
@@ -44,11 +34,8 @@ extendModule ms (name,mod) = case mod of
js1 <- extendMod isCompl n (jments m0) js
-- if incomplete, throw away extension information
let me' = if isCompl then me else Nothing
return $ (name,ModMod (Module mt st fs me' ops js1))
-- if the module is not an extension, just return it
_ -> return (name,mod)
let me' = if isCompl then es else (filter (/=n) es)
return $ Module mt st fs me' ops js1
-- When extending a complete module: new information is inserted,
-- and the process is interrupted if unification fails.
@@ -94,6 +81,12 @@ extendAnyInfo isc n i j = errIn ("building extension for" +++ prt n) $ case (i,j
---- (AnyInd _ _, ResOper _ _) -> return j ----
(AnyInd b1 m1, AnyInd b2 m2) -> do
testErr (b1 == b2) "inconsistent indirection status"
testErr (m1 == m2) $
"different sources of indirection: " +++ show m1 +++ show m2
return i
_ -> Bad $ "cannot unify information in" ++++ show i ++++ "and" ++++ show j
--- where

View File

@@ -39,7 +39,7 @@ redModInfo (c,info) = do
info' <- case info of
ModMod m -> do
let isIncompl = not $ isCompleteModule m
(e,os) <- if isIncompl then return (Nothing,[]) else redExtOpen m ----
(e,os) <- if isIncompl then return ([],[]) else redExtOpen m ----
flags <- mapM redFlag $ flags m
(a,mt) <- case mtype m of
MTConcrete a -> do
@@ -61,8 +61,7 @@ redModInfo (c,info) = do
where
redExtOpen m = do
e' <- case extends m of
Just e -> liftM Just $ redIdent e
_ -> return Nothing
es -> mapM redIdent es
os' <- mapM (\o -> case o of
OQualif q _ i -> liftM (OSimple q) (redIdent i)
_ -> prtBad "cannot translate unqualified open in" c) $ opens m

View File

@@ -13,7 +13,7 @@ import Monad
-- extracting resource r from abstract + concrete syntax
-- AR 21/8/2002 -- 22/6/2003 for GF with modules
makeReuse :: SourceGrammar -> Ident -> Maybe Ident ->
makeReuse :: SourceGrammar -> Ident -> [Ident] ->
MReuseType Ident -> Err SourceRes
makeReuse gr r me mrc = do
flags <- return [] --- no flags are passed: they would not make sense
@@ -59,7 +59,7 @@ makeReuse gr r me mrc = do
-- the second Boolean indicates if the definition needs be given
mkResDefs :: Bool -> Bool ->
SourceGrammar -> Ident -> Ident -> Maybe Ident -> Maybe Ident ->
SourceGrammar -> Ident -> Ident -> [Ident] -> [Ident] ->
BinTree (Ident,Info) -> BinTree (Ident,Info) ->
Err (BinTree (Ident,Info))
mkResDefs hasT isC gr r a mext maext abs cnc = mapMTree (mkOne a maext) abs where
@@ -101,7 +101,7 @@ mkResDefs hasT isC gr r a mext maext abs cnc = mapMTree (mkOne a maext) abs wher
-- type constant qualifications changed from abstract to resource
redirTyp always a mae ty = case ty of
Q _ c | always -> return $ Q r c
Q n c | n == a || Just n == mae -> return $ Q r c
Q n c | n == a || [n] == mae -> return $ Q r c ---- FIX for non-singleton exts
_ -> composOp (redirTyp always a mae) ty
lockRecType :: Ident -> Type -> Err Type

View File

@@ -13,7 +13,7 @@ import List
import Monad
-- building union of modules
-- AR 1/3/2004
-- AR 1/3/2004 --- OBSOLETE 15/9/2004 with multiple inheritance
makeUnion :: SourceGrammar -> Ident -> ModuleType Ident -> [(Ident,[Ident])] ->
Err SourceModule

View File

@@ -65,9 +65,7 @@ moduleDeps ms = mapM deps ms where
t -> chDep (IdentM c t) (extends m) t (opens m) t
chDep it es ety os oty = do
ests <- case es of
Just e -> liftM singleton $ lookupModuleType gr e
_ -> return []
ests <- mapM (lookupModuleType gr) es
testErr (all (compatMType ety) ests) "inappropriate extension module type"
osts <- mapM (lookupModuleType gr . openedModule) os
testErr (all (compatOType oty) osts) "inappropriate open module type"
@@ -75,7 +73,7 @@ moduleDeps ms = mapM deps ms where
IdentM _ (MTConcrete a) -> [IdentM a MTAbstract]
_ -> [] ----
return (it, ab ++
[IdentM e ety | Just e <- [es]] ++
[IdentM e ety | e <- es] ++
[IdentM (openedModule o) oty | o <- os])
-- check for superficial compatibility, not submodule relation etc: what can be extended
@@ -114,7 +112,7 @@ requiredCanModules :: (Eq i, Show i) => MGrammar i f a -> i -> [i]
requiredCanModules gr = nub . iterFix (concatMap more) . singleton where
more i = errVal [] $ do
m <- lookupModMod gr i
return $ maybe [] return (extends m) ++ map openedModule (opens m)
return $ extends m ++ map openedModule (opens m)

View File

@@ -34,12 +34,14 @@ rebuildModule ms mo@(i,mi) = do
js' <- extendMod False i0 (jments m1) (jments m)
--- to avoid double inclusions, in instance I of I0 = J0 ** ...
case extends m of
Nothing -> return $ replaceJudgements m js'
Just j0 -> do
[] -> return $ replaceJudgements m js'
j0:jj -> do
m0 <- lookupModMod gr j0
let notInM0 c = not $ isInBinTree (fst c) $ mapTree fst $ jments m0
let js2 = sorted2tree $ filter notInM0 $ tree2list js'
return $ replaceJudgements m js2
if null jj
then return $ replaceJudgements m js2
else Bad "FIXME: handle multiple inheritance in instance"
return $ ModMod m'
_ -> return mi

View File

@@ -181,11 +181,10 @@ filterAbstracts abstr cgr = M.MGrammar (nubBy (\x y -> fst x == fst y) [m | m <-
Just a -> elem i $ needs a
_ -> True
needs a = [i | (i,M.ModMod m) <- ms, not (M.isModAbs m) || dep i a]
dep i a = elem i (ext a mse)
dep i a = elem i (ext mse a)
mse = [(i,me) | (i,M.ModMod m) <- ms, M.isModAbs m, me <- [M.extends m]]
ext a es = case lookup a es of
Just (Just e) -> a : ext e es
Just _ -> a : []
ext es a = case lookup a es of
Just e -> a : concatMap (ext es) e ---- FIX multiple exts
_ -> []

View File

@@ -26,7 +26,7 @@ data Module i f a = Module {
mtype :: ModuleType i ,
mstatus :: ModuleStatus ,
flags :: [f] ,
extends :: Maybe i ,
extends :: [i],
opens :: [OpenSpec i] ,
jments :: BinTree (i,a)
}
@@ -50,6 +50,11 @@ data ModuleType i =
data MReuseType i = MRInterface i | MRInstance i i | MRResource i
deriving (Show,Eq)
-- previously: single inheritance
extendm :: Module i f a -> Maybe i
extendm m = case extends m of
[i] -> Just i
_ -> Nothing
-- destructive update
@@ -131,7 +136,7 @@ depPathModule m = fors m ++ exts m ++ opens m where
MTConcrete i -> [oSimple i]
MTInstance i -> [oSimple i]
_ -> []
exts m = map oSimple $ maybe [] return $ extends m
exts m = map oSimple $ extends m
-- all dependencies
allDepsModule :: Ord i => MGrammar i f a -> Module i f a -> [OpenSpec i]
@@ -155,8 +160,8 @@ partOfGrammar gr (i,m) = MGrammar [mo | mo@(j,_) <- mods, elem j modsFor]
allExtends :: (Show i,Ord i) => MGrammar i f a -> i -> [i]
allExtends gr i = case lookupModule gr i of
Ok (ModMod m) -> case extends m of
Just i1 -> i : allExtends gr i1
_ -> [i]
[] -> [i]
is -> i : concatMap (allExtends gr) is
_ -> []
-- this plus that an instance extends its interface
@@ -165,7 +170,7 @@ allExtendsPlus gr i = case lookupModule gr i of
Ok (ModMod m) -> i : concatMap (allExtendsPlus gr) (exts m)
_ -> []
where
exts m = [j | Just j <- [extends m]] ++ [j | MTInstance j <- [mtype m]]
exts m = extends m ++ [j | MTInstance j <- [mtype m]]
-- conversely: all modules that extend a given module, incl. instances of interface
allExtensions :: (Show i,Ord i) => MGrammar i f a -> i -> [i]
@@ -173,7 +178,7 @@ allExtensions gr i = case lookupModule gr i of
Ok (ModMod m) -> let es = exts i in es ++ concatMap (allExtensions gr) es
_ -> []
where
exts i = [j | (j,m) <- mods, elem (Just i) [extends m]
exts i = [j | (j,m) <- mods, elem i (extends m)
|| elem (MTInstance i) [mtype m]]
mods = [(j,m) | (j,ModMod m) <- modules gr]
@@ -193,7 +198,7 @@ emptyModInfo :: ModInfo i f a
emptyModInfo = ModMod emptyModule
emptyModule :: Module i f a
emptyModule = Module MTResource MSComplete [] Nothing [] NT
emptyModule = Module MTResource MSComplete [] [] [] NT
-- we store the module type with the identifier

View File

@@ -30,7 +30,6 @@ data Command =
| CGenerateRandom
| CGenerateTrees
| CPutTerm
| CReadTerm
| CWrapTerm I.Ident
| CMorphoAnalyse
| CTestTokenizer

View File

@@ -30,8 +30,8 @@ trModule (i,mo) = case mo of
(mkOpens (map trOpen (opens m)))
(mkTopDefs (concatMap trAnyDef (tree2list (jments m)) ++ map trFlag (flags m)))
trExtend :: Maybe Ident -> P.Extend
trExtend i = maybe P.NoExt (P.Ext . singleton . tri) i
trExtend :: [Ident] -> P.Extend
trExtend i = ifNull P.NoExt (P.Ext . map tri) i
---- this has to be completed with other mtys
forName (MTConcrete a) = tri a

View File

@@ -75,11 +75,11 @@ transModDef x = case x of
flags' <- return [f | Right fs <- defs0, f <- fs]
return (id',GM.ModMod (GM.Module mtyp' mstat' flags' extends' opens' defs'))
MReuse _ -> do
return (id', GM.ModMod (GM.Module mtyp' mstat' [] Nothing [] NT))
return (id', GM.ModMod (GM.Module mtyp' mstat' [] [] [] NT))
MUnion imps -> do
imps' <- mapM transIncluded imps
return (id',
GM.ModMod (GM.Module (GM.MTUnion mtyp' imps') mstat' [] Nothing [] NT))
GM.ModMod (GM.Module (GM.MTUnion mtyp' imps') mstat' [] [] [] NT))
MWith m opens -> do
m' <- transIdent m
@@ -137,11 +137,10 @@ transTransfer x = case x of
TransferIn open -> liftM Left $ transOpen open
TransferOut open -> liftM Right $ transOpen open
transExtend :: Extend -> Err (Maybe Ident)
transExtend :: Extend -> Err [Ident]
transExtend x = case x of
Ext [id] -> transIdent id >>= return . Just
Ext ids -> Bad "sorry, no support for multiple inheritance yet"
NoExt -> return Nothing
Ext ids -> mapM transIdent ids
NoExt -> return []
transOpens :: Opens -> Err [GM.OpenSpec Ident]
transOpens x = case x of

View File

@@ -4,7 +4,8 @@ include config.mk
GHMAKE=$(GHC) --make
GHCXMAKE=ghcxmake
GHCFLAGS=-package lang -package util -fglasgow-exts $(CPPFLAGS) $(LDFLAGS)
GHCOPTFLAGS=-O $(GHCFLAGS)
GHCOPTFLAGS=$(GHCFLAGS)
##GHCOPTFLAGS=-O $(GHCFLAGS)
GHCFUDFLAG=
JAVAFLAGS=-target 1.4 -source 1.4