grammar-combinators-0.2.7: A parsing library of context-free grammar combinators.

Safe HaskellNone

Text.GrammarCombinators.Utils.CalcFirst

Documentation

data FirstSet t Source

Constructors

FS 

Fields

firstSet :: Set t
 
canBeEmpty :: Bool
 
canBeEOI :: Bool
 

Instances

Show t => Show (FirstSet t) 

data FSCalculator phi r t rr v Source

Instances

(LiftableProductionRule (FSCalculator phi r t rr), Token t) => EpsProductionRule (FSCalculator phi r t rr) 
(ProductionRule (FSCalculator phi r t rr), Token t) => LiftableProductionRule (FSCalculator phi r t rr) 
Token t => ProductionRule (FSCalculator phi r t rr) 
Token t => TokenProductionRule (FSCalculator phi r t rr) t 
(ProductionRule (FSCalculator phi r t rr), LiftableProductionRule (FSCalculator phi r t rr), RecProductionRule (FSCalculator phi r t rr) phi r, Token t, EqFam phi) => LoopProductionRule (FSCalculator phi r t rr) phi r 
(Token t, EqFam phi) => RecProductionRule (FSCalculator phi r t rr) phi r 

type FirstSetGrammar phi r t rr = forall ix. phi ix -> FSCalculator phi r t rr (rr ix)Source

calcFS :: FSCalculator phi r t rr v -> FirstSetGrammar phi r t rr -> FirstSet tSource

calcFirst :: (Domain phi, Token t) => GExtendedContextFreeGrammar phi t r rr -> phi ix -> FirstSet tSource