platinum-parsing-0.1.0.0: General Framework for compiler development.

Copyright(c) 2017 Patrick Champion
Licensesee LICENSE file
Maintainerchlablak@gmail.com
Stabilityprovisional
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

PP.Builder

Contents

Description

 

Synopsis

(LA)LR

type LrTable = Map (Int, Rule) LrAction Source #

All LR parsers have the same table format

action :: LrTable -> Int -> Rule -> LrAction Source #

Get a LrAction from a LrTable (Rule version)

action' :: LrTable -> Int -> [OToken] -> LrAction Source #

Get a LrAction from a LrTable (OToken version)

data LrAction Source #

LR actions for a LR parser

type LrCollection item = Vector (LrSet item) Source #

LR items set collection

type LrSet item = Set item Source #

LR items set

class Ord item => LrBuilder item where Source #

LR parser common functions

Minimal complete definition

collection, table

Methods

collection :: RuleSet -> FirstSet -> LrCollection item Source #

Build the items set collection

table :: LrCollection item -> Either [String] LrTable Source #

Build the parsing table

Instances

LrBuilder Lr1Item Source #

LrBuilder instance for Lr1Item Dragon Book (2nd edition, fr), page 239, algorithm 4.53

LrBuilder LalrItem Source #

LrBuilder instance for LalrItem

NFA

type NfaGraph = Gr NfaNode NfaSymbol Source #

Nondeterministic finite automaton (NFA)

class NfaBuilder from where Source #

NFA builders

Minimal complete definition

buildNfa, buildNfa'

Methods

buildNfa :: from -> NfaGraph Source #

buildNfa' :: String -> from -> NfaGraph Source #

DFA

type DfaGraph = Gr DfaNode DfaSymbol Source #

Deterministic finite automaton (DFA)

class DfaBuilder from where Source #

DFA builders

Minimal complete definition

buildDfa

Methods

buildDfa :: from -> DfaGraph Source #

Orphan instances

Binary item => Binary (LrCollection item) Source # 

Methods

put :: LrCollection item -> Put #

get :: Get (LrCollection item) #

putList :: [LrCollection item] -> Put #