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

Text.GrammarCombinators.Utils.CalcFirst

Documentation

data Token t => FirstSet t Source

Constructors

FS 

Fields

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

Instances

Token t => Show (FirstSet t) 

data FSCalculator phi r t rr v Source

Instances

Token t => EpsProductionRule (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 
(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