Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 730 Bytes

File metadata and controls

15 lines (11 loc) · 730 Bytes

Parser Generator Backend: DOT

This backend outputs a parser as a DOT document, for looking at the state machine while working on a grammar. See parser generator backends for the other backends.

A node is a state, labelled with its index and its kernel items, each with a marking how far the parse has come in the production. An edge is a transition, labelled with the symbol it is taken on: solid for a shift on a terminal, dashed for a goto on a nonterminal. Reductions and their lookaheads are not in the graph.

Render it with Graphviz:

golr parser --frontend golr --frontend-file-path calculator.golr --backend dot --backend-file-path parser.dot
dot -Tsvg parser.dot -o parser.svg