- type Token = (SourcePos, Keyword)
- data Keyword
- = IDENT String
- | SQUOTE
- | DQUOTE
- | RIGHTARROW
- | LEFTARROW
- | LONGRIGHTARROW
- | LONGLEFTARROW
- | COMMA
- | DOT
- | COLON
- | QUESTIONMARK
- | AND
- | MID
- | DOLLAR
- | SHARP
- | LPAREN
- | RPAREN
- | LBRACKET
- | RBRACKET
- | LBRACE
- | RBRACE
- | TILDE
- | HAT
- | STAR
- | UNDERSCORE
- | MINUS
- | PLUS
- | EQUAL
- | LESS
- | GREATER
- | EOF
- | FORALL
- | EXISTS
- | LAND
- | LOR
- | LNOT
- | APPROX
- | DUMMY_KEYWORD
- scanString :: FilePath -> String -> [Token]
- scanFile :: FilePath -> IO [Token]
- type Parser s a = Parsec [Token] s a
- parseFile :: Parser s a -> s -> FilePath -> IO a
- liftMaybe :: MonadPlus m => Maybe a -> m a
- liftMaybe' :: Monad m => String -> Maybe a -> m a
- token :: (Keyword -> Maybe a) -> Parser s a
- kw :: Keyword -> Parser s ()
- betweenKWs :: Keyword -> Keyword -> Parser s a -> Parser s a
- commaSep :: Parser s a -> Parser s [a]
- commaSep1 :: Parser s a -> Parser s [a]
- list :: Parser s a -> Parser s [a]
- braced :: Parser s a -> Parser s a
- parens :: Parser s a -> Parser s a
- brackets :: Parser s a -> Parser s a
- singleQuoted :: Parser s a -> Parser s a
- doubleQuoted :: Parser s a -> Parser s a
- identifier :: Parser s String
- string :: String -> Parser s ()
- strings :: [String] -> Parser s ()
- integer :: Parser s Int
- genFunOpen :: Parser s a -> Parser s b -> Parser s a
- genFunApp :: Parser s a -> Parser s b -> Parser s d -> Parser s c -> Parser s c
- funOpen :: String -> Parser s ()
- funApp :: String -> Parser s a -> Parser s a
- protocol :: Parser s Protocol
- claims :: (String -> Maybe Protocol) -> Parser s [ThyItem]
- theory :: Parser s Theory
- parseTheory :: FilePath -> IO Theory
- mkLTSPat :: Pattern -> Pattern
- mkMultIdentityPat :: Pattern
- mkExpPat :: Pattern -> Pattern -> Pattern
- mkMultPat :: Pattern -> Pattern -> Pattern
- destLTSPat :: Pattern -> Maybe Pattern
- destMultIdentityPat :: Pattern -> Maybe ()
- destExpPat :: Pattern -> Maybe (Pattern, Pattern)
- destMultPat :: Pattern -> Maybe (Pattern, Pattern)
Lexing
Lexable Keywords
scanString :: FilePath -> String -> [Token]Source
Scan a string using the given filename in the error messages.
NOTE: Lexical errors are thrown using error
.
Parsing
type Parser s a = Parsec [Token] s aSource
A parser with an arbitrary user state for a stream of tokens.
Additional combinators
liftMaybe' :: Monad m => String -> Maybe a -> m aSource
Lift a maybe to a monad action with the given failure message.
Keyword combinations
singleQuoted :: Parser s a -> Parser s aSource
Between single quotes.
doubleQuoted :: Parser s a -> Parser s aSource
Between double quotes.
identifier :: Parser s StringSource
Parse an identifier as a string
genFunOpen :: Parser s a -> Parser s b -> Parser s aSource
Left-hand-side of a function application written with the given delimiter.
genFunApp :: Parser s a -> Parser s b -> Parser s d -> Parser s c -> Parser s cSource
Left-hand-side of a function application.
Security protocol theorys for the free-algebra
parseTheory :: FilePath -> IO TheorySource
Parse a security protocol theory given as a string using the given filename for the error messages
Extended patterns
destLTSPat :: Pattern -> Maybe PatternSource