mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-07 18:22:50 -06:00
internal representation for param value index
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user