packages feed

helium-1.8: src/Helium/StaticAnalysis/Directives/TS_Syntax.ag

-----------------------------------------------------------------------------
-- |The Helium Compiler : Static Analysis
--
-- Maintainer  :  bastiaan@cs.uu.nl
-- Stability   :  experimental
-- Portability :  unknown
--
-- A datatype for type inference directives.
--
-- (directives based on "Scripting the Type Inference Process", ICFP 2003)
-----------------------------------------------------------------------------

imports {
import Helium.Syntax.UHA_Syntax
}

TYPE TypingStrategies = [TypingStrategy] 

DATA TypingStrategy 
   | Siblings 
        names       : Names
   | TypingStrategy       
        typerule    : TypeRule
        statements  : UserStatements
        
DATA TypeRule 
   | TypeRule 
        premises    : SimpleJudgements
        conclusion  : Judgement

DATA Judgement
   | Judgement
        expression  : Expression
        type        : Type

TYPE SimpleJudgements = [SimpleJudgement]

DATA SimpleJudgement
   | SimpleJudgement
        name        : Name
        type        : Type
        
TYPE UserStatements = [UserStatement]

DATA UserStatement 
   | Equal
        leftType    : Type
        rightType   : Type
        message     : String
   | Pred
        predClass   : Name
        predType    : Type
        message     : String
   | MetaVariableConstraints        
        name        : Name
   | Phase 
        phase       : Int