Safe Haskell | None |
---|---|
Language | Haskell98 |
Parser for the Source Tetra language.
- type Parser n a = Parser (Tok n) a
- data Context n :: * -> * = Context {}
- context :: Context Name
- pModule :: Context Name -> Parser Name (Module (Annot SP))
- pExp :: Context Name -> Parser Name (Exp SP)
- pExpApp :: Context Name -> Parser Name (Exp SP)
- pExpAtom :: Context Name -> Parser Name (Exp SP)
- pType :: Ord n => Context n -> Parser n (Type n)
- pTypeApp :: Ord n => Context n -> Parser n (Type n)
- pTypeAtom :: Ord n => Context n -> Parser n (Type n)
- pWitness :: Ord n => Context n -> Parser n (Witness SourcePos n)
- pWitnessApp :: Ord n => Context n -> Parser n (Witness SourcePos n)
- pWitnessAtom :: Ord n => Context n -> Parser n (Witness SourcePos n)
- pCon :: Eq (Tok n) => ParsecT [Token (Tok n)] (ParserState (Tok n)) Identity n
- pLit :: Eq (Tok n) => ParsecT [Token (Tok n)] (ParserState (Tok n)) Identity n
- pBinder :: (Ord n, Eq (Tok n)) => ParsecT [Token (Tok n)] (ParserState (Tok n)) Identity (Binder n)
- pIndex :: Eq (Tok n) => ParsecT [Token (Tok n)] (ParserState (Tok n)) Identity Int
- pVar :: Eq (Tok n) => ParsecT [Token (Tok n)] (ParserState (Tok n)) Identity n
- pName :: Eq (Tok n) => ParsecT [Token (Tok n)] (ParserState (Tok n)) Identity n
- pTok :: TokAtom -> Parser n ()
- pTokAs :: TokAtom -> a -> Parser n a
Documentation
data Context n :: * -> *
Configuration and information from the context. Used for context sensitive parsing.
context :: Context Name Source
Starting context for the parser. Holds flags about what language features we should accept.
Modules
Expressions
pExpAtom :: Context Name -> Parser Name (Exp SP) Source
Parse a variable, constructor or parenthesised expression.
Types
pTypeAtom :: Ord n => Context n -> Parser n (Type n)
Parse a variable, constructor or parenthesised type.
Witnesses
pWitnessAtom :: Ord n => Context n -> Parser n (Witness SourcePos n)
Parse a variable, constructor or parenthesised witness.
Constructors
pCon :: Eq (Tok n) => ParsecT [Token (Tok n)] (ParserState (Tok n)) Identity n
Parse a constructor name.
Variables
pBinder :: (Ord n, Eq (Tok n)) => ParsecT [Token (Tok n)] (ParserState (Tok n)) Identity (Binder n)
Parse a binder.
pIndex :: Eq (Tok n) => ParsecT [Token (Tok n)] (ParserState (Tok n)) Identity Int
Parse a deBruijn index.
pName :: Eq (Tok n) => ParsecT [Token (Tok n)] (ParserState (Tok n)) Identity n
Parse a constructor or variable name.