futhark-0.25.27: An optimising compiler for a functional, array-oriented language.

Safe Haskell | Safe-Inferred
Language | GHC2021

Language.Futhark.Parser.Lexer.Wrapper

Description

Utility definitions used by the lexer. None of the default Alex "wrappers" are precisely what we need. The code here is highly minimalistic. Lexers should not be complicated!

Synopsis

- initialLexerState :: Pos -> ByteString -> AlexInput
- type AlexInput = (Pos, Char, ByteString, Int64)
- alexInputPrevChar :: AlexInput -> Char
- data LexerError = LexerError Loc Text
- alexGetByte :: AlexInput -> Maybe (Byte, AlexInput)
- alexGetPos :: AlexInput -> Pos

# Documentation

initialLexerState :: Pos -> ByteString -> AlexInput Source #

type AlexInput = (Pos, Char, ByteString, Int64) Source #

The input type. Contains:

1. current position
2. previous char
3. current input string
4. bytes consumed so far

alexInputPrevChar :: AlexInput -> Char Source #

data LexerError Source #

Constructors

LexerError Loc Text |

#### Instances

Instances details

Show LexerError Source # |
Instance details Defined in Language.Futhark.Parser.Lexer.Wrapper Methods showsPrec :: Int -> LexerError -> ShowS Source # show :: LexerError -> String Source # showList :: [LexerError] -> ShowS Source #

alexGetByte :: AlexInput -> Maybe (Byte, AlexInput) Source #

alexGetPos :: AlexInput -> Pos Source #