forked from GitHub/gf-core
started a graphviz visualization for the LR(0) automaton
This commit is contained in:
@@ -48,6 +48,7 @@ exportPGF opts fmt pgf =
|
||||
FmtSLF -> single "slf" slfPrinter
|
||||
FmtRegExp -> single "rexp" regexpPrinter
|
||||
FmtFA -> single "dot" slfGraphvizPrinter
|
||||
FmtLR -> single "dot" (\_ -> graphvizLRAutomaton)
|
||||
where
|
||||
name = fromMaybe (abstractName pgf) (flag optName opts)
|
||||
|
||||
@@ -58,4 +59,3 @@ exportPGF opts fmt pgf =
|
||||
|
||||
single :: String -> (PGF -> Concr -> String) -> [(FilePath,String)]
|
||||
single ext pr = [(concreteName cnc <.> ext, pr pgf cnc) | cnc <- Map.elems (languages pgf)]
|
||||
|
||||
|
||||
@@ -106,6 +106,7 @@ data OutputFormat = FmtPGFPretty
|
||||
| FmtSLF
|
||||
| FmtRegExp
|
||||
| FmtFA
|
||||
| FmtLR
|
||||
deriving (Eq,Ord)
|
||||
|
||||
data SISRFormat =
|
||||
@@ -490,7 +491,8 @@ outputFormatsExpl =
|
||||
(("vxml", FmtVoiceXML),"Voice XML based on abstract syntax"),
|
||||
(("slf", FmtSLF),"SLF speech recognition format"),
|
||||
(("regexp", FmtRegExp),"regular expression"),
|
||||
(("fa", FmtFA),"finite automaton in graphviz format")
|
||||
(("fa", FmtFA),"finite automaton in graphviz format"),
|
||||
(("lr", FmtLR),"LR(0) automaton for PMCFG in graphviz format")
|
||||
]
|
||||
|
||||
instance Show OutputFormat where
|
||||
|
||||
Reference in New Issue
Block a user