context-free-grammar-0.0.1: Basic algorithms on context-free grammars

Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Cfg.LookaheadSet

Contents

Description

Sets of lookahead symbols.

Synopsis

Documentation

data LookaheadSet t Source

Set of lookahead symbols providing different Monoid semantics than Set. (mappend implements concatenation, not set union.)

Instances

Eq t => Eq (LookaheadSet t) 
Ord t => Ord (LookaheadSet t) 
Show t => Show (LookaheadSet t) 
Ord t => Monoid (LookaheadSet t) 

mkLookaheadSet Source

Arguments

:: Ord t 
=> Bool

true iff it has EOF

-> [t]

terminal symbols

-> LookaheadSet t 

Creates a LookaheadSet

fromList :: Ord t => [AugT t] -> LookaheadSet t Source

Creates a LookaheadSet from a list of augmented terminals.

toSet :: LookaheadSet t -> Set (AugT t) Source

Converts the LookaheadSet to a regular Set

(<>) :: Monoid m => m -> m -> m infixr 6

An infix synonym for mappend.

Since: 4.5.0.0

Set operations

empty :: LookaheadSet t Source

The empty lookahead set.

singleton :: AugT t -> LookaheadSet t Source

Creates a singleton lookahead set.

unions :: Ord t => [LookaheadSet t] -> LookaheadSet t Source

Returns the union of all the lookahead sets.