happy-lib-2.1.7: Happy is a parser generator for Haskell implemented using this library

Safe Haskell | None
Language | Haskell98

Happy.Frontend.AbsSyn

Synopsis

- data BookendedAbsSyn = BookendedAbsSyn (Maybe String) (Maybe String) (AbsSyn String) (Maybe String)
- data AbsSyn e = AbsSyn [Directive String] [Rule e]
- data Directive a
  - = TokenType String
  - | TokenSpec [(a, TokenSpec)]
  - | TokenName String (Maybe String) Bool
  - | TokenLexer String String
  - | TokenImportedIdentity
  - | TokenMonad String String String String
  - | TokenNonassoc [String]
  - | TokenRight [String]
  - | TokenLeft [String]
  - | TokenExpect Int
  - | TokenError String (Maybe String)
  - | TokenErrorExpected
  - | TokenErrorHandlerType String
  - | TokenAttributetype String
  - | TokenAttribute String String
- getTokenType :: [Directive t] -> String
- getTokenSpec :: [Directive t] -> [(t, TokenSpec)]
- getParserNames :: [Directive t] -> [Directive t]
- getLexer :: [Directive t] -> Maybe (String, String)
- getImportedIdentity :: [Directive t] -> Bool
- getMonad :: [Directive t] -> (Bool, String, String, String, String)
- data ErrorHandlerInfo
  - = DefaultErrorHandler
  - | CustomErrorHandler String
  - | ResumptiveErrorHandler String String
- getError :: [Directive t] -> ErrorHandlerInfo
- getPrios :: [Directive t] -> [Directive t]
- getPrioNames :: Directive t -> [String]
- getExpect :: [Directive t] -> Maybe Int
- getErrorExpectedMode :: Eq t => [Directive t] -> ErrorExpectedMode
- getAttributes :: [Directive t] -> [(String, String)]
- getAttributetype :: [Directive t] -> Maybe String
- getAttributeGrammarExtras :: [Directive t] -> Maybe AttributeGrammarExtras
- parseTokenSpec :: String -> TokenSpec
- data Rule e = Rule String [String] [Prod e] (Maybe String)
- data Prod e = Prod [Term] e Int Prec
- data Term = App String [Term]
- data Prec
  - = PrecNone
  - | PrecShift
  - | PrecId String
- data TokenSpec
  - = TokenFixed String
  - | TokenWithValue ExpressionWithHole

# Documentation

data BookendedAbsSyn Source #

Constructors

BookendedAbsSyn (Maybe String) (Maybe String) (AbsSyn String) (Maybe String) |

data AbsSyn e Source #

Constructors

AbsSyn [Directive String] [Rule e] |

data Directive a Source #

Constructors

TokenType String |
TokenSpec [(a, TokenSpec)] |
TokenName String (Maybe String) Bool |
TokenLexer String String |
TokenImportedIdentity |
TokenMonad String String String String |
TokenNonassoc [String] |
TokenRight [String] |
TokenLeft [String] |
TokenExpect Int |
TokenError String (Maybe String) |
TokenErrorExpected |
TokenErrorHandlerType String |
TokenAttributetype String |
TokenAttribute String String |

#### Instances

Instances details

Show a => Show (Directive a) Source # |
Instance details Defined in Happy.Frontend.AbsSyn Methods showsPrec :: Int -> Directive a -> ShowS Source # show :: Directive a -> String Source # showList :: [Directive a] -> ShowS Source #
Eq a => Eq (Directive a) Source # |
Instance details Defined in Happy.Frontend.AbsSyn Methods (==) :: Directive a -> Directive a -> Bool Source # (/=) :: Directive a -> Directive a -> Bool Source #

getTokenType :: [Directive t] -> String Source #

getTokenSpec :: [Directive t] -> [(t, TokenSpec)] Source #

getParserNames :: [Directive t] -> [Directive t] Source #

getLexer :: [Directive t] -> Maybe (String, String) Source #

getImportedIdentity :: [Directive t] -> Bool Source #

getMonad :: [Directive t] -> (Bool, String, String, String, String) Source #

data ErrorHandlerInfo #

Constructors

DefaultErrorHandler |
CustomErrorHandler String |
ResumptiveErrorHandler String String |

getError :: [Directive t] -> ErrorHandlerInfo Source #

getPrios :: [Directive t] -> [Directive t] Source #

getPrioNames :: Directive t -> [String] Source #

getExpect :: [Directive t] -> Maybe Int Source #

getErrorExpectedMode :: Eq t => [Directive t] -> ErrorExpectedMode Source #

getAttributes :: [Directive t] -> [(String, String)] Source #

getAttributetype :: [Directive t] -> Maybe String Source #

getAttributeGrammarExtras :: [Directive t] -> Maybe AttributeGrammarExtras Source #

parseTokenSpec :: String -> TokenSpec Source #

Parse a token spec.

The first occurence of `$$` indicates an expression in which the `$$` will be substituted for the actual lexed token. `$$` in string or char literals ('".."' and '\'.'') however does not count.

data Rule e Source #

Constructors

Rule String [String] [Prod e] (Maybe String) |

data Prod e Source #

Constructors

Prod [Term] e Int Prec |

data Term Source #

Constructors

App String [Term] |

data Prec Source #

Constructors

PrecNone |
PrecShift |
PrecId String |

#### Instances

Instances details

Show Prec Source # |
Instance details Defined in Happy.Frontend.AbsSyn Methods showsPrec :: Int -> Prec -> ShowS Source # show :: Prec -> String Source # showList :: [Prec] -> ShowS Source #

data TokenSpec #

Constructors

TokenFixed String |
TokenWithValue ExpressionWithHole |

#### Instances

Instances details

Show TokenSpec |
Instance details Defined in Happy.Grammar Methods showsPrec :: Int -> TokenSpec -> ShowS Source # show :: TokenSpec -> String Source # showList :: [TokenSpec] -> ShowS Source #
Eq TokenSpec |
Instance details Defined in Happy.Grammar Methods (==) :: TokenSpec -> TokenSpec -> Bool Source # (/=) :: TokenSpec -> TokenSpec -> Bool Source #