Safe Haskell | None |
---|---|
Language | Haskell2010 |
Symantics to handle Prefix
, Postfix
or Infix
operators,
of different Precedence
s and possibly with left and/or right Associativity
.
- class (Gram_Terminal g, Gram_Rule g, Gram_Alt g, Gram_Try g, Gram_App g, Gram_AltApp g, Gram_CF g) => Gram_Op g where
- data Error_Fixity = Error_Fixity_Infix_not_combinable Infix Infix
- data OpTree a
- insertUnifix :: (Unifix, a -> a) -> OpTree a -> OpTree a
- insertInfix :: OpTree a -> (Infix, a -> a -> a) -> Either Error_Fixity (OpTree a) -> Either Error_Fixity (OpTree a)
- evalOpTree :: OpTree a -> a
- gram_operators :: (Gram_Op g, Gram_RuleEBNF g) => [CF g ()]
Class Gram_Op
class (Gram_Terminal g, Gram_Rule g, Gram_Alt g, Gram_Try g, Gram_App g, Gram_AltApp g, Gram_CF g) => Gram_Op g where Source #
Symantics for operators.
Type Error_Fixity
data Error_Fixity Source #
Type OpTree
Tree of operators.
Useful to recombine operators according to their Precedence
.
insertInfix :: OpTree a -> (Infix, a -> a -> a) -> Either Error_Fixity (OpTree a) -> Either Error_Fixity (OpTree a) Source #
evalOpTree :: OpTree a -> a Source #
Collapse an OpTree
.
gram_operators :: (Gram_Op g, Gram_RuleEBNF g) => [CF g ()] Source #