futhark-0.23.1: An optimising compiler for a functional, array-oriented language.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Futhark.Parser.Lexer.Tokens

Description

Definition of the tokens used in the lexer.

Also defines other useful building blocks for constructing tokens.

Synopsis

Documentation

data Token Source #

A lexical token. It does not itself contain position information, so in practice the parser will consume tokens tagged with a source position.

Instances

Instances details
Show Token Source # 
Instance details

Defined in Language.Futhark.Parser.Lexer.Tokens

Methods

showsPrec :: Int -> Token -> ShowS #

show :: Token -> String #

showList :: [Token] -> ShowS #

Eq Token Source # 
Instance details

Defined in Language.Futhark.Parser.Lexer.Tokens

Methods

(==) :: Token -> Token -> Bool #

(/=) :: Token -> Token -> Bool #

Ord Token Source # 
Instance details

Defined in Language.Futhark.Parser.Lexer.Tokens

Methods

compare :: Token -> Token -> Ordering #

(<) :: Token -> Token -> Bool #

(<=) :: Token -> Token -> Bool #

(>) :: Token -> Token -> Bool #

(>=) :: Token -> Token -> Bool #

max :: Token -> Token -> Token #

min :: Token -> Token -> Token #

type Lexeme a = (Pos, Pos, a) Source #

tokenPosM :: ((Loc, Text) -> Alex a) -> (Pos, Char, ByteString, Int64) -> Int64 -> Alex (Lexeme a) Source #

tokenM :: (Text -> Alex a) -> (Pos, Char, ByteString, Int64) -> Int64 -> Alex (Lexeme a) Source #

tokenS :: (Text -> a) -> (Pos, Char, ByteString, Int64) -> Int64 -> Alex (Lexeme a) Source #

suffZero :: Text -> Text Source #

Suffix a zero if the last character is dot.

tryRead :: Read a => String -> Text -> Alex a Source #