diff options
| author | aarne <aarne@cs.chalmers.se> | 2007-05-15 16:35:13 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2007-05-15 16:35:13 +0000 |
| commit | 035689f8c745a23c9a3a073d316adf82e5f7d00b (patch) | |
| tree | e1e8921cfd504dcddca5fa3fff5271598aa9b01f /src/GF/Grammar | |
| parent | 8af473a6f5e04ce2aaf74916d91866f1bdb62151 (diff) | |
started direct compiler from GF to GFCC
Diffstat (limited to 'src/GF/Grammar')
| -rw-r--r-- | src/GF/Grammar/Compute.hs | 3 | ||||
| -rw-r--r-- | src/GF/Grammar/Grammar.hs | 3 | ||||
| -rw-r--r-- | src/GF/Grammar/Macros.hs | 3 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/GF/Grammar/Compute.hs b/src/GF/Grammar/Compute.hs index 1fda827eb..24f475f03 100644 --- a/src/GF/Grammar/Compute.hs +++ b/src/GF/Grammar/Compute.hs @@ -125,6 +125,8 @@ computeTermOpt rec gr = comp where _ -> returnC $ P t' l + PI t l i -> comp g $ P t l ----- + S t@(T _ cc) v -> do v' <- comp g v case v' of @@ -258,7 +260,6 @@ computeTermOpt rec gr = comp where -- if there are no variables, don't even go inside cs' <- if (null g) then return cs else mapPairsM (comp g) cs return $ T i cs' - --- this means some extra work; should implement TSh directly TSh i cs -> comp g $ T i [(p,v) | (ps,v) <- cs, p <- ps] diff --git a/src/GF/Grammar/Grammar.hs b/src/GF/Grammar/Grammar.hs index 40f18bd35..58634c31c 100644 --- a/src/GF/Grammar/Grammar.hs +++ b/src/GF/Grammar/Grammar.hs @@ -138,11 +138,12 @@ data Term = | RecType [Labelling] -- ^ record type: @{ p : A ; ...}@ | R [Assign] -- ^ record: @{ p = a ; ...}@ | P Term Label -- ^ projection: @r.p@ + | PI Term Label Int -- ^ index-annotated projection | ExtR Term Term -- ^ extension: @R ** {x : A}@ (both types and terms) | Table Term Term -- ^ table type: @P => A@ | T TInfo [Case] -- ^ table: @table {p => c ; ...}@ - | TSh TInfo [Cases] -- ^ table with discjunctive patters (only back end opt) + | TSh TInfo [Cases] -- ^ table with disjunctive patters (only back end opt) | V Type [Term] -- ^ table given as course of values: @table T [c1 ; ... ; cn]@ | S Term Term -- ^ selection: @t ! p@ | Val Type Int -- ^ parameter value number: @T # i# diff --git a/src/GF/Grammar/Macros.hs b/src/GF/Grammar/Macros.hs index 9d93a0258..51f483a0a 100644 --- a/src/GF/Grammar/Macros.hs +++ b/src/GF/Grammar/Macros.hs @@ -672,6 +672,9 @@ composOp co trm = P t i -> do t' <- co t return (P t' i) + PI t i j -> + do t' <- co t + return (PI t' i j) ExtR a c -> do a' <- co a c' <- co c |
