happy-arbitrary
Safe HaskellNone
LanguageHaskell2010

Language.Happy.Grammar

Description

The rules of a Happy grammar, with parameterised rules like List(p) instantiated for every argument they're used with.

Synopsis

Documentation

type Production = [Sym] Source #

The symbols on the right of a rule, in order.

type Rules = Map Sym [Production] Source #

The productions of every nonterminal that the start symbol reaches.

data Sym Source #

A use of a rule or token, with its arguments: List(Identifier).

Constructors

Sym Text [Sym] 

Instances

Instances details
Show Sym Source # 
Instance details

Defined in Language.Happy.Ast

Methods

showsPrec :: Int -> Sym -> ShowS #

show :: Sym -> String #

showList :: [Sym] -> ShowS #

Eq Sym Source # 
Instance details

Defined in Language.Happy.Ast

Methods

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

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

Ord Sym Source # 
Instance details

Defined in Language.Happy.Ast

Methods

compare :: Sym -> Sym -> Ordering #

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

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

(>) :: Sym -> Sym -> Bool #

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

max :: Sym -> Sym -> Sym #

min :: Sym -> Sym -> Sym #

extractTokens :: (Text -> token) -> Node (Lexeme Text) -> Map Text token Source #

Makes every token from the code of its %token pattern.

fromAst :: Text -> Node (Lexeme Text) -> Rules Source #

Returns the rules of a parsed Happy file that the start rule reaches.