brute force parsing method in RunGFCC

This commit is contained in:
aarne
2006-09-20 15:19:44 +00:00
parent 5ac6f4bd78
commit be200897b8
2 changed files with 13 additions and 0 deletions

View File

@@ -33,6 +33,10 @@ treat grammar s = case words s of
"gr":cat:n:_ -> do
gen <- newStdGen
mapM_ prlins $ take (read n) $ generateRandom gen grammar (CId cat)
"p":cat:ws -> do
case parse grammar (CId cat) ws of
t:_ -> prlins t
_ -> putStrLn "no parse found"
_ -> lins $ readExp s
where
lins t = mapM_ (lin t) $ cncnames grammar