Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Parser.Lexer
Description
Provides lexer parts for the Parser module.
Synopsis
- type Parser = Parsec Void Text
- sc :: Parser ()
- lexeme :: Parser a -> Parser a
- symbol :: Text -> Parser Text
- parens :: Parser a -> Parser a
- braces :: Parser a -> Parser a
- brackets :: Parser a -> Parser a
- comma :: Parser Text
- semicolon :: Parser Text
- listed :: Parser a -> Parser [a]
- listed1 :: Parser a -> Parser [a]
- listedInPar :: Parser a -> Parser [a]
- intLitP :: Parser Integer
- decimalInt :: Parser Integer
- binaryInt :: Parser Integer
- octalInt :: Parser Integer
- hexInt :: Parser Integer
- abstractInt :: Parser a -> Parser Char -> ReadS Integer -> Parser Integer
- readInteger :: ReadS Integer -> String -> Integer
- boolLitP :: Parser Bool
- stringLitP :: Parser Text
- stringChar :: Parser Text
- escapedChar :: Parser Text
- identifierP :: Parser Identifier
- kwVar :: Parser Text
- kwFunc :: Parser Text
- kwReturn :: Parser Text
- kwIf :: Parser Text
- kwElse :: Parser Text
- kwFor :: Parser Text
- kwBreak :: Parser Text
- kwContinue :: Parser Text
- kwVar' :: Text
- kwFunc' :: Text
- kwReturn' :: Text
- kwIf' :: Text
- kwElse' :: Text
- kwFor' :: Text
- kwBreak' :: Text
- kwContinue' :: Text
- keywords :: [Text]
- idBool :: Parser Text
- idInt :: Parser Text
- idString :: Parser Text
- idTrue :: Parser Text
- idFalse :: Parser Text
- idNil :: Parser Text
- idLenFunc :: Parser Text
- idPrintFunc :: Parser Text
- idPrintlnFunc :: Parser Text
- idPanicFunc :: Parser Text
- idBool' :: Text
- idInt' :: Text
- idString' :: Text
- idTrue' :: Text
- idFalse' :: Text
- idNil' :: Text
- idLenFunc' :: Text
- idPrintFunc' :: Text
- idPrintlnFunc' :: Text
- idPanicFunc' :: Text
- predeclaredIdentifiers :: [Identifier]
Basic lexer parts
lexeme :: Parser a -> Parser a Source #
Lexeme, automatically parses trailing whitespace and comments.
symbol :: Text -> Parser Text Source #
Symbol, automatically parses trailing whitespace and comments.
Symbols
listedInPar :: Parser a -> Parser [a] Source #
List parser.
Literals
decimalInt :: Parser Integer Source #
Decimal integer literal parser.
abstractInt :: Parser a -> Parser Char -> ReadS Integer -> Parser Integer Source #
Abstract integer parser, encapsulates integer parser structure.
readInteger :: ReadS Integer -> String -> Integer Source #
Parse integer using given reader and integer string.
stringLitP :: Parser Text Source #
String literal parser.
stringChar :: Parser Text Source #
String character parser.
escapedChar :: Parser Text Source #
Escaped character parser.
Identifiers and reserved
Identifier
identifierP :: Parser Identifier Source #
Custom identifier parser.
Keywords
kwContinue :: Parser Text Source #
continue
keyword parser.
kwContinue' :: Text Source #
Predeclared identifiers
idPrintFunc :: Parser Text Source #
print
identifier parser.
idPrintlnFunc :: Parser Text Source #
println
identifier parser.
idPanicFunc :: Parser Text Source #
panic
identifier parser.
idLenFunc' :: Text Source #
idPrintFunc' :: Text Source #
idPanicFunc' :: Text Source #
predeclaredIdentifiers :: [Identifier] Source #
Predeclared identifiers.