uuagc-bootstrap

KennedyWarren

Synopsis

Documentation

toGVVertex :: Bool -> Vertex -> ST s PP_Doc

Pretty print a vertex in GraphViz format

toGVEdge :: Edge -> ST s PP_Doc

Pretty print an edge in GraphViz format

toGVNontDependencyInfo :: NontDependencyInformationM s -> ST s PP_Doc

Pretty print a NontDependencyInformation in GraphViz format

toGVProdDependencyGraph :: ProdDependencyGraphM s -> ST s PP_Doc

Pretty print a ProdDependencyGraph in GraphViz format

newtype VGNode

Constructors

VGNode Int 

Instances

newtype VGEdge

Constructors

VGEdge Int 

Instances

newtype VGProd

Constructors

VGProd (VGEdge, Int) 

Instances

type VG s a = ErrorT String (StateT (VGState s) (ST s)) a

runVG :: VG s a -> ST s a

Run the VG monad in the ST monad

insertInitialNode :: NontDependencyInformationM s -> VG s VGNode

Insert an initial node for this nonterminal into the visit graph

createPending :: VGNode -> Set Identifier -> Set Identifier -> VG s VGEdge

Create a pending edge from this node with a set of inherited and synthesized attributes

selectPending :: VG s VGEdge

Return an arbitrary pending edge of which the from node is ready

getInherited :: VGEdge -> VG s (Set Identifier)

Get the inherited attributes of an edge

getSynthesized :: VGEdge -> VG s (Set Identifier)

Get the synthesized attributes of an edge

markFinal :: VGEdge -> VG s ()

Mark an edge as final

getProductions :: VGEdge -> VG s [VGProd]

Get all productions for an edge

onMarkedDepGraph :: (ProdDependencyGraphM s -> ST s a) -> VGProd -> VG s a

Execute a function on the dependency graph for this production

isDepGraphVertexFinal :: VGProd -> Vertex -> VG s Bool

Check whether this vertex has been marked as final

setDepGraphVerticesFinal :: VGProd -> [Vertex] -> VG s ()

Mark these vertices final in this production

addChildVisit :: VGProd -> Identifier -> VGEdge -> VG s VisitStep

Add a child visit to this production and return the step for the execution plan

addVisitStep :: VGProd -> VisitStep -> VG s ()

Add a step to the execution plan of this visit

getChildState :: VGProd -> Identifier -> VG s VGNode

Get the state of a child in a certain production

repeatM :: VG s () -> VG s ()

Repeat action untill mzero is encountered

vgInST :: ST s a -> VG s a

Execute a ST action inside the VG monad

vgCreatePendingEdge :: VGNode -> VGNode -> Set Identifier -> Set Identifier -> VG s VGEdge

Create a new pending edge

vgDepGraphVertexFinal :: VGNode -> Int -> Vertex -> VG s Bool

Check whether a vertex is marked final on this node in this production

vgFindInitial :: Identifier -> VG s VGNode

Find the initial node for a nonterminal

imLookup :: Int -> IntMap a -> a

Always succeeding IntMap lookup

traceVG :: String -> VG s ()

Trace inside the vg monad

groupSortBy :: (a -> a -> Ordering) -> [a] -> [[a]]

groupBy that groups all equal (according to the function) elements instead of consequtive equal elements

type ChildVisits = [(Vertex, Int)]

foldChildVisits :: VGProd -> (ChildVisits, Int) -> Vertex -> VG s (ChildVisits, Int)

Helper function for folding over child visits

findChildVisits :: VGProd -> Vertex -> ChildVisits -> VG s (ChildVisits, Int)

Recursively find all visits to childs

correctInhChilds :: VGProd -> ChildVisits -> VG s ChildVisits

Correct inherited child visits after foldChildVisits

extraChildSyn :: VGProd -> ChildVisits -> VG s ChildVisits

Synthesized attributes that can also be evaluated

isReadyVertex :: VGProd -> ChildVisits -> Vertex -> VG s (Maybe Int)

Check if a vertex can be marked final in this step (and is not final yet) and return the visit num

isChildSyn :: Vertex -> Bool

Check if this vertex is a synthesized attribute of a child

isChildInh :: Vertex -> Bool

Check if this vertex is an inherited attribute of a child

isChildAttr :: Vertex -> Bool

Check if this vertex is an attribute of a child

createLhsInh :: Identifier -> Vertex

Create lhs.inh vertex

createLhsSyn :: Identifier -> Vertex

Create lhs.inh vertex

exploreGraph :: (VGNode -> Set VGEdge -> Set VGEdge -> a -> VG s a) -> VGNode -> a -> VG s a