ogma-language-lustre-1.15.0: Ogma: Runtime Monitor translator: Lustre Language Frontend

Safe Haskell | None
Language | Haskell2010

Language.Lustre.LexLustre

Synopsis

- alex_tab_size :: Int
- alex_base :: AlexAddr
- alex_table :: AlexAddr
- alex_check :: AlexAddr
- alex_deflt :: AlexAddr
- alex_accept :: Array Int (AlexAcc user)
- alex_actions :: Array Int (Posn -> String -> Token)
- alex_action_1 :: Posn -> String -> Token
- alex_action_2 :: Posn -> String -> Token
- alex_action_3 :: Posn -> String -> Token
- alex_action_4 :: Posn -> String -> Token
- data AlexAddr = AlexA# Addr#
- alexIndexInt16OffAddr :: AlexAddr -> Int# -> Int#
- alexIndexInt32OffAddr :: AlexAddr -> Int# -> Int#
- quickIndex :: Array Int (AlexAcc (ZonkAny 0 :: Type)) -> Int -> AlexAcc (ZonkAny 0 :: Type)
- data AlexReturn a
  - = AlexEOF
  - | AlexError !AlexInput
  - | AlexSkip !AlexInput !Int
  - | AlexToken !AlexInput !Int a
- alexScan :: (Posn, Char, [Byte], String) -> Int -> AlexReturn (Posn -> String -> Token)
- alexScanUser :: t -> (Posn, Char, [Byte], String) -> Int -> AlexReturn (Posn -> String -> Token)
- alex_scan_tkn :: t1 -> t2 -> Int# -> AlexInput -> Int# -> AlexLastAcc -> (AlexLastAcc, AlexInput)
- data AlexLastAcc
  - = AlexNone
  - | AlexLastAcc !Int !AlexInput !Int
  - | AlexLastSkip !AlexInput !Int
- data AlexAcc user
  - = AlexAccNone
  - | AlexAcc Int
  - | AlexAccSkip
- tok :: (String -> Tok) -> Posn -> String -> Token
- data Tok
  - = TK !TokSymbol
  - | TL !String
  - | TI !String
  - | TV !String
  - | TD !String
  - | TC !String
- pattern TS :: String -> Int -> Tok
- data TokSymbol = TokSymbol {
  - tsText :: String
  - tsID :: !Int
  }
- data Token
  - = PT Posn Tok
  - | Err Posn
- printPosn :: Posn -> String
- tokenPos :: [Token] -> String
- tokenPosn :: Token -> Posn
- tokenLineCol :: Token -> (Int, Int)
- posLineCol :: Posn -> (Int, Int)
- mkPosToken :: Token -> ((Int, Int), String)
- tokenText :: Token -> String
- prToken :: Token -> String
- data BTree
  - = N
  - | B String Tok BTree BTree
- eitherResIdent :: (String -> Tok) -> String -> Tok
- resWords :: BTree
- unescapeInitTail :: String -> String
- data Posn = Pn !Int !Int !Int
- alexStartPos :: Posn
- alexMove :: Posn -> Char -> Posn
- type Byte = Word8
- type AlexInput = (Posn, Char, [Byte], String)
- tokens :: String -> [Token]
- alexGetByte :: AlexInput -> Maybe (Byte, AlexInput)
- alexInputPrevChar :: AlexInput -> Char
- utf8Encode :: Char -> [Word8]

# Documentation

alex_tab_size :: Int Source #

alex_base :: AlexAddr Source #

alex_table :: AlexAddr Source #

alex_check :: AlexAddr Source #

alex_deflt :: AlexAddr Source #

alex_accept :: Array Int (AlexAcc user) Source #

alex_actions :: Array Int (Posn -> String -> Token) Source #

alex_action_1 :: Posn -> String -> Token Source #

alex_action_2 :: Posn -> String -> Token Source #

alex_action_3 :: Posn -> String -> Token Source #

alex_action_4 :: Posn -> String -> Token Source #

data AlexAddr Source #

Constructors

AlexA# Addr# |

alexIndexInt16OffAddr :: AlexAddr -> Int# -> Int# Source #

alexIndexInt32OffAddr :: AlexAddr -> Int# -> Int# Source #

quickIndex :: Array Int (AlexAcc (ZonkAny 0 :: Type)) -> Int -> AlexAcc (ZonkAny 0 :: Type) Source #

data AlexReturn a Source #

Constructors

AlexEOF |
AlexError !AlexInput |
AlexSkip !AlexInput !Int |
AlexToken !AlexInput !Int a |

alexScan :: (Posn, Char, [Byte], String) -> Int -> AlexReturn (Posn -> String -> Token) Source #

alexScanUser :: t -> (Posn, Char, [Byte], String) -> Int -> AlexReturn (Posn -> String -> Token) Source #

alex_scan_tkn :: t1 -> t2 -> Int# -> AlexInput -> Int# -> AlexLastAcc -> (AlexLastAcc, AlexInput) Source #

data AlexLastAcc Source #

Constructors

AlexNone |
AlexLastAcc !Int !AlexInput !Int |
AlexLastSkip !AlexInput !Int |

data AlexAcc user Source #

Constructors

AlexAccNone |
AlexAcc Int |
AlexAccSkip |

tok :: (String -> Tok) -> Posn -> String -> Token Source #

Create a token with position.

data Tok Source #

Token without position.

Constructors

TK !TokSymbol | Reserved word or symbol.
TL !String | String literal.
TI !String | Integer literal.
TV !String | Identifier.
TD !String | Float literal.
TC !String | Character literal.

#### Instances

Instances details

Show Tok Source # |
Instance details Defined in Language.Lustre.LexLustre Methods showsPrec :: Int -> Tok -> ShowS Source # show :: Tok -> String Source # showList :: [Tok] -> ShowS Source #
Eq Tok Source # |
Instance details Defined in Language.Lustre.LexLustre Methods (==) :: Tok -> Tok -> Bool Source # (/=) :: Tok -> Tok -> Bool Source #
Ord Tok Source # |
Instance details Defined in Language.Lustre.LexLustre Methods compare :: Tok -> Tok -> Ordering Source # (<) :: Tok -> Tok -> Bool Source # (<=) :: Tok -> Tok -> Bool Source # (>) :: Tok -> Tok -> Bool Source # (>=) :: Tok -> Tok -> Bool Source # max :: Tok -> Tok -> Tok Source # min :: Tok -> Tok -> Tok Source #

pattern TS :: String -> Int -> Tok Source #

Smart constructor for `Tok` for the sake of backwards compatibility.

data TokSymbol Source #

Keyword or symbol tokens have a unique ID.

Constructors

TokSymbol |

Fields

- tsText :: String

  Keyword or symbol text.

- tsID :: !Int

  Unique ID.

#### Instances

Instances details

Show TokSymbol Source # |
Instance details Defined in Language.Lustre.LexLustre Methods showsPrec :: Int -> TokSymbol -> ShowS Source # show :: TokSymbol -> String Source # showList :: [TokSymbol] -> ShowS Source #
Eq TokSymbol Source # | Keyword/symbol equality is determined by the unique ID.
Instance details Defined in Language.Lustre.LexLustre Methods (==) :: TokSymbol -> TokSymbol -> Bool Source # (/=) :: TokSymbol -> TokSymbol -> Bool Source #
Ord TokSymbol Source # | Keyword/symbol ordering is determined by the unique ID.

Instance details

Defined in Language.Lustre.LexLustre

Methods

compare :: TokSymbol -> TokSymbol -> Ordering Source #

(<) :: TokSymbol -> TokSymbol -> Bool Source #

(<=) :: TokSymbol -> TokSymbol -> Bool Source #

(>) :: TokSymbol -> TokSymbol -> Bool Source #

(>=) :: TokSymbol -> TokSymbol -> Bool Source #

max :: TokSymbol -> TokSymbol -> TokSymbol Source #

min :: TokSymbol -> TokSymbol -> TokSymbol Source #

data Token Source #

Token with position.

Constructors

PT Posn Tok |
Err Posn |

#### Instances

Instances details

Show Token Source # |
Instance details Defined in Language.Lustre.LexLustre Methods showsPrec :: Int -> Token -> ShowS Source # show :: Token -> String Source # showList :: [Token] -> ShowS Source #
Eq Token Source # |
Instance details Defined in Language.Lustre.LexLustre Methods (==) :: Token -> Token -> Bool Source # (/=) :: Token -> Token -> Bool Source #
Ord Token Source # |
Instance details Defined in Language.Lustre.LexLustre Methods compare :: Token -> Token -> Ordering Source # (<) :: Token -> Token -> Bool Source # (<=) :: Token -> Token -> Bool Source # (>) :: Token -> Token -> Bool Source # (>=) :: Token -> Token -> Bool Source # max :: Token -> Token -> Token Source # min :: Token -> Token -> Token Source #

printPosn :: Posn -> String Source #

Pretty print a position.

tokenPos :: [Token] -> String Source #

Pretty print the position of the first token in the list.

tokenPosn :: Token -> Posn Source #

Get the position of a token.

tokenLineCol :: Token -> (Int, Int) Source #

Get line and column of a token.

posLineCol :: Posn -> (Int, Int) Source #

Get line and column of a position.

mkPosToken :: Token -> ((Int, Int), String) Source #

Convert a token into "position token" form.

tokenText :: Token -> String Source #

Convert a token to its text.

prToken :: Token -> String Source #

Convert a token to a string.

data BTree Source #

Finite map from text to token organized as binary search tree.

Constructors

N | Nil (leaf).
B String Tok BTree BTree | Binary node.

#### Instances

Instances details

Show BTree Source # |
Instance details Defined in Language.Lustre.LexLustre Methods showsPrec :: Int -> BTree -> ShowS Source # show :: BTree -> String Source # showList :: [BTree] -> ShowS Source #

eitherResIdent :: (String -> Tok) -> String -> Tok Source #

Convert potential keyword into token or use fallback conversion.

resWords :: BTree Source #

The keywords and symbols of the language organized as binary search tree.

unescapeInitTail :: String -> String Source #

Unquote string literal.

data Posn Source #

Constructors

Pn !Int !Int !Int |

#### Instances

Instances details

Show Posn Source # |
Instance details Defined in Language.Lustre.LexLustre Methods showsPrec :: Int -> Posn -> ShowS Source # show :: Posn -> String Source # showList :: [Posn] -> ShowS Source #
Eq Posn Source # |
Instance details Defined in Language.Lustre.LexLustre Methods (==) :: Posn -> Posn -> Bool Source # (/=) :: Posn -> Posn -> Bool Source #
Ord Posn Source # |
Instance details Defined in Language.Lustre.LexLustre Methods compare :: Posn -> Posn -> Ordering Source # (<) :: Posn -> Posn -> Bool Source # (<=) :: Posn -> Posn -> Bool Source # (>) :: Posn -> Posn -> Bool Source # (>=) :: Posn -> Posn -> Bool Source # max :: Posn -> Posn -> Posn Source # min :: Posn -> Posn -> Posn Source #

alexStartPos :: Posn Source #

alexMove :: Posn -> Char -> Posn Source #

type Byte = Word8 Source #

type AlexInput = (Posn, Char, [Byte], String) Source #

tokens :: String -> [Token] Source #

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

alexInputPrevChar :: AlexInput -> Char Source #

utf8Encode :: Char -> [Word8] Source #

Encode a Haskell String to a list of Word8 values, in UTF8 format.