1
0
forked from GitHub/gf-core

Added semantic interpretation tag printing to the *bnf grammar printers.

This commit is contained in:
bjorn
2008-09-26 12:57:20 +00:00
parent 2f3b7d1c55
commit b0dde31f00
4 changed files with 36 additions and 11 deletions

View File

@@ -133,6 +133,7 @@ symbolsRE (RESymbol x) = [x]
prRE :: (a -> String) -> RE a -> String
prRE = prRE' 0
prRE' :: Int -> (a -> String) -> RE a -> String
prRE' _ _ (REUnion []) = "<NULL>"
prRE' n f (REUnion xs) = p n 1 (concat (intersperse " | " (map (prRE' 1 f) xs)))
prRE' n f (REConcat xs) = p n 2 (unwords (map (prRE' 2 f) xs))