Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type IVar = (String, Int)
- type UserDef = TokenCat
- type SymEnv = KeywordEnv
- type KeywordEnv = [(String, String)]
- type SymMap = Map SymKey String
- data SymKey
- getVars :: [Cat] -> [IVar]
- numVars :: [Either Cat a] -> [Either (Cat, Doc) a]
- fixCoercions :: [(Cat, [Rule])] -> [(Cat, [Rule])]
- varName :: String -> String
- showNum :: Int -> String
- firstLowerCase :: String -> String
Documentation
type SymEnv = KeywordEnv Source #
A symbol-mapping environment.
type KeywordEnv = [(String, String)] Source #
Map keywords to their token name.
type SymMap = Map SymKey String Source #
Map keywords and user-defined token types to their token name.
getVars :: [Cat] -> [IVar] Source #
Converts a list of categories into their types to be used as instance variables. If a category appears only once, it is given the number 0, if it appears more than once, its occurrences are numbered from 1. ex:
>>>
getVars [Cat "A", Cat "B", Cat "A"]
[("A",1),("B",0),("A",2)]
firstLowerCase :: String -> String Source #