summaryrefslogtreecommitdiff
path: root/src/GF/Grammar/Grammar.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2006-11-14 19:13:33 +0000
committeraarne <aarne@cs.chalmers.se>2006-11-14 19:13:33 +0000
commit546e778ba8c9ea4109fbe278c6363818a43eaa0f (patch)
tree7be636d1b0a58a4fa02e5aa5ce1cdf86b65429b4 /src/GF/Grammar/Grammar.hs
parentf10d657df18261c688241c4463074f8bc31cf95b (diff)
internal representation for param value index
Diffstat (limited to 'src/GF/Grammar/Grammar.hs')
-rw-r--r--src/GF/Grammar/Grammar.hs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/GF/Grammar/Grammar.hs b/src/GF/Grammar/Grammar.hs
index 1c963ac66..f49075f48 100644
--- a/src/GF/Grammar/Grammar.hs
+++ b/src/GF/Grammar/Grammar.hs
@@ -21,6 +21,7 @@ module GF.Grammar.Grammar (SourceGrammar,
SourceRes,
SourceCnc,
Info(..),
+ PValues,
Perh,
MPr,
Type,
@@ -68,6 +69,9 @@ type SourceAbs = Module Ident Option Info
type SourceRes = Module Ident Option Info
type SourceCnc = Module Ident Option Info
+-- this is created in CheckGrammar, and so are Val and PVal
+type PValues = [Term]
+
-- | the constructors are judgements in
--
-- - abstract syntax (/ABS/)
@@ -84,8 +88,8 @@ data Info =
| AbsTrans Term -- ^ (/ABS/)
-- judgements in resource
- | ResParam (Perh [Param]) -- ^ (/RES/)
- | ResValue (Perh Type) -- ^ (/RES/) to mark parameter constructors for lookup
+ | ResParam (Perh ([Param],Maybe PValues)) -- ^ (/RES/)
+ | ResValue (Perh (Type,Maybe Int)) -- ^ (/RES/) to mark parameter constructors for lookup
| ResOper (Perh Type) (Perh Term) -- ^ (/RES/)
-- judgements in concrete syntax
@@ -139,6 +143,7 @@ data Term =
| TSh TInfo [Cases] -- ^ table with discjunctive 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#
| Let LocalDef Term -- ^ local definition: @let {t : T = a} in b@
@@ -173,6 +178,8 @@ data Patt =
| PFloat Double -- ^ float literal pattern: @1.2@ -- only abstract
| PT Type Patt -- ^ type-annotated pattern
+ | PVal Type Int -- ^ parameter value number: @T # i#
+
| PAs Ident Patt -- ^ as-pattern: x@p
-- regular expression patterns