Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Utility definitions used by the lexer. None of the default Alex "wrappers" are precisely what we need. The code here is based on the "monad-bytestring" wrapper. The code here is completely Futhark-agnostic, and perhaps it can even serve as inspiration for other Alex lexer wrappers.
Synopsis
- runAlex :: Pos -> ByteString -> Alex a -> Either LexerError a
- data Alex a
- type AlexInput = (Pos, Char, ByteString, Int64)
- type Byte = Word8
- data LexerError = LexerError Loc Text
- alexSetInput :: AlexInput -> Alex ()
- alexGetInput :: Alex AlexInput
- alexGetByte :: AlexInput -> Maybe (Byte, AlexInput)
- alexGetStartCode :: Alex Int
- alexError :: Loc -> Text -> Alex a
- alexGetPos :: Alex Pos
Documentation
runAlex :: Pos -> ByteString -> Alex a -> Either LexerError a Source #
type AlexInput = (Pos, Char, ByteString, Int64) Source #
The input type. Contains:
- current position
- previous char
- current input string
- bytes consumed so far
data LexerError Source #
Instances
Show LexerError Source # | |
Defined in Language.Futhark.Parser.Lexer.Wrapper showsPrec :: Int -> LexerError -> ShowS # show :: LexerError -> String # showList :: [LexerError] -> ShowS # |
alexSetInput :: AlexInput -> Alex () Source #
alexGetPos :: Alex Pos Source #