Copyright | (c) Christian Maeder and Uni Bremen 2002-2005 |
---|---|
License | GPLv2 or higher, see LICENSE.txt |
Maintainer | Christian.Maeder@dfki.de |
Stability | provisional |
Portability | portable |
Safe Haskell | None |
parser for HasCASL kinds, types, terms, patterns and equations
- colT :: AParser st Token
- bracketParser :: AParser st a -> AParser st Token -> AParser st Token -> AParser st Token -> ([a] -> Range -> b) -> AParser st b
- mkBrackets :: AParser st a -> ([a] -> Range -> b) -> AParser st b
- mkBraces :: AParser st a -> ([a] -> Range -> b) -> AParser st b
- parseClassId :: AParser st Kind
- parseSimpleKind :: AParser st Kind
- parseExtKind :: AParser st (Variance, Kind)
- arrowKind :: (Variance, Kind) -> AParser st Kind
- kind :: AParser st Kind
- extKind :: AParser st (Variance, Kind)
- variance :: AParser st Variance
- extVar :: AParser st Id -> AParser st (Id, Variance)
- typeVars :: AParser st [TypeArg]
- allIsNonVar :: [(Id, Variance)] -> Bool
- typeKind :: Bool -> [(Id, Variance)] -> [Token] -> AParser st [TypeArg]
- makeTypeArgs :: [(Id, Variance)] -> [Token] -> Variance -> VarKind -> Range -> [TypeArg]
- singleTypeArg :: AParser st TypeArg
- parenTypeArg :: AParser st (TypeArg, [Token])
- typeArg :: AParser st (TypeArg, [Token])
- typePatternArg :: AParser st TypePattern
- type TokenMode = [String]
- aToken :: TokenMode -> AParser st Token
- idToken :: AParser st Token
- primTypePatternOrId :: AParser st TypePattern
- mixTypePattern :: AParser st TypePattern -> AParser st TypePattern
- typePatternOrId :: AParser st TypePattern
- typePatternToken :: AParser st TypePattern
- primTypePattern :: AParser st TypePattern
- typePattern :: AParser st TypePattern
- typeToken :: AParser st Type
- primTypeOrId :: AParser st Type
- mkMixfixType :: AParser st Type -> AParser st Type
- mkKindedMixType :: AParser st Type -> AParser st Type
- typeOrId :: AParser st Type
- kindAnno :: Type -> AParser st Type
- primType :: AParser st Type
- lazyType :: AParser st Type
- mixType :: AParser st Type
- prodType :: AParser st Type
- parseType :: AParser st Type
- arrowT :: AParser st Id
- typeScheme :: PolyId -> AParser st TypeScheme
- varDecls :: AParser st [VarDecl]
- varDeclType :: [Id] -> [Token] -> AParser st [VarDecl]
- makeVarDecls :: [Id] -> [Token] -> Type -> Range -> [VarDecl]
- genVarDecls :: AParser st [GenVarDecl]
- tokenPattern :: TokenMode -> AParser st Term
- primPattern :: TokenMode -> AParser st Term
- mkMixfixTerm :: [Term] -> Term
- mixPattern :: TokenMode -> AParser st Term
- typedPattern :: TokenMode -> AParser st Term
- asPattern :: TokenMode -> AParser st Term
- pattern :: AParser st Term
- myChoice :: [(AParser st Token, a)] -> AParser st (a, Token)
- lamDot :: AParser st (Partiality, Token)
- lamPattern :: AParser st [Term]
- tToken :: TokenMode -> AParser st Token
- termToken :: TokenMode -> AParser st Term
- primTerm :: TokenMode -> AParser st Term
- data InMode
- baseTerm :: (InMode, TokenMode) -> AParser st Term
- whenTerm :: (InMode, TokenMode) -> AParser st Term
- ifTerm :: (InMode, TokenMode) -> AParser st Term
- termInParens :: AParser st Term
- varTerm :: AParser st Term
- opBrand :: AParser st (Token, OpBrand)
- parsePolyId :: AParser st PolyId
- qualOpName :: AParser st Term
- qualPredName :: AParser st Term
- typeQual :: InMode -> AParser st (TypeQual, Token)
- qualAndType :: InMode -> AParser st Term
- typedTerm :: (InMode, TokenMode) -> AParser st Term
- mixTerm :: (InMode, TokenMode) -> AParser st Term
- hasCaslStartKeywords :: [String]
- whereTerm :: (InMode, TokenMode) -> AParser st Term
- term :: AParser st Term
- exQuant :: AParser st (Token, Quantifier)
- exTerm :: (InMode, TokenMode) -> AParser st Term
- lamDecls :: AParser st [Term]
- lambdaTerm :: (InMode, TokenMode) -> AParser st Term
- caseTerm :: (InMode, TokenMode) -> AParser st Term
- letTerm :: (InMode, TokenMode) -> AParser st Term
- patternTermPair :: TokenMode -> (InMode, TokenMode) -> String -> AParser st ProgEq
key sign tokens
parser for bracketed lists
bracketParser :: AParser st a -> AParser st Token -> AParser st Token -> AParser st Token -> ([a] -> Range -> b) -> AParser st b
a generic bracket parser
mkBrackets :: AParser st a -> ([a] -> Range -> b) -> AParser st b
parser for square brackets
kinds
parseClassId :: AParser st Kind
parse a simple class name or the type universe as kind
parseSimpleKind :: AParser st Kind
do parseClassId
or a kind in parenthessis
parseExtKind :: AParser st (Variance, Kind)
do parseSimpleKind
and check for an optional Variance
arrowKind :: (Variance, Kind) -> AParser st Kind
parse a (right associative) function kind for a given argument kind
type variables
allIsNonVar :: [(Id, Variance)] -> Bool
singleTypeArg :: AParser st TypeArg
parenTypeArg :: AParser st (TypeArg, [Token])
a singleTypeArg
put in parentheses
typeArg :: AParser st (TypeArg, [Token])
a singleTypeArg
possibly put in parentheses
typePatternArg :: AParser st TypePattern
a singleTypeArg
put in parentheses as TypePattern
parse special identifier tokens
type patterns
mixTypePattern :: AParser st TypePattern -> AParser st TypePattern
typePatternToken :: AParser st TypePattern
those (top-level) Token
s (less than idToken
)
that may appear in TypePattern
s as TypePatternToken
.
primTypePattern :: AParser st TypePattern
a typePatternToken
or something in braces (a typePattern
),
in square brackets (a typePatternOrId
covering compound lists)
or parenthesis (typePatternArg
)
typePattern :: AParser st TypePattern
types a parsed type may also be interpreted as a kind (by the mixfix analysis)
primTypeOrId :: AParser st Type
TypeToken
s within BracketType
s may recusively be
idToken
s. Parenthesis may group a mixfix type
or may be interpreted as a kind later on in a GEN-VAR-DECL.
mkMixfixType :: AParser st Type -> AParser st Type
mkKindedMixType :: AParser st Type -> AParser st Type
several primTypeOrId
s possibly yielding a MixfixType
and possibly followed by a kindAnno
.
a typeToken' or a BracketType
. Square brackets may contain typeOrId
.
typeScheme :: PolyId -> AParser st TypeScheme
parse a TypeScheme
using forallT
, typeVars
, dotT
and parseType
varDecls and genVarDecls
varDecls :: AParser st [VarDecl]
comma separated var
with varDeclType
genVarDecls :: AParser st [GenVarDecl]
either like varDecls
or declared type variables.
A GenVarDecl
may later become a GenTypeVarDecl
.
patterns
tokenPattern :: TokenMode -> AParser st Term
primPattern :: TokenMode -> AParser st Term
mkMixfixTerm :: [Term] -> Term
mixPattern :: TokenMode -> AParser st Term
several typedPattern
typedPattern :: TokenMode -> AParser st Term
a possibly typed (parseType
) pattern
lamPattern :: AParser st [Term]
terms
ifTerm :: (InMode, TokenMode) -> AParser st Term
ifS
possibly followed by thenS
and elseS
yielding a MixfixTerm
termInParens :: AParser st Term
unrestricted terms including qualified names
parsePolyId :: AParser st PolyId
qualOpName :: AParser st Term
a qualified operation (with opBrand
)
qualPredName :: AParser st Term
a qualified predicate
qualAndType :: InMode -> AParser st Term
a qualifier plus a subsequent type as mixfix term component
hasCaslStartKeywords :: [String]
keywords that start a new item
exQuant :: AParser st (Token, Quantifier)
lambdaTerm :: (InMode, TokenMode) -> AParser st Term