diff options
| author | bringert <bringert@cs.chalmers.se> | 2007-03-26 13:12:04 +0000 |
|---|---|---|
| committer | bringert <bringert@cs.chalmers.se> | 2007-03-26 13:12:04 +0000 |
| commit | 5faf418f4e0022c6b1a74a7ff0c3530219a8bf44 (patch) | |
| tree | 8423771a689bd2ac98c86f748f1c476572247496 /src | |
| parent | 48b8a1345ad599cc95b03b27864da366fca23671 (diff) | |
Fixed SISR bug.
Diffstat (limited to 'src')
| -rw-r--r-- | src/GF/Speech/TransformCFG.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/GF/Speech/TransformCFG.hs b/src/GF/Speech/TransformCFG.hs index 6a66bc5f0..33ef9771d 100644 --- a/src/GF/Speech/TransformCFG.hs +++ b/src/GF/Speech/TransformCFG.hs @@ -49,7 +49,7 @@ data CFTerm = CFObj Fun [CFTerm] -- ^ an abstract syntax function with arguments | CFAbs Int CFTerm -- ^ A lambda abstraction. The Int is the variable id. | CFApp CFTerm CFTerm -- ^ Application - | CFRes Int -- ^ The result of the n:th non-terminal + | CFRes Int -- ^ The result of the n:th (0-based) non-terminal | CFVar Int -- ^ A lambda-bound variable | CFMeta String -- ^ A metavariable deriving (Eq,Ord,Show) @@ -175,7 +175,9 @@ removeLeftRecursion start gr shiftTerm :: CFTerm -> CFTerm shiftTerm (CFObj f ts) = CFObj f (map shiftTerm ts) shiftTerm (CFRes 0) = CFVar 1 + shiftTerm (CFRes n) = CFRes (n-1) shiftTerm t = t + -- note: the rest don't occur in the original grammar cats = allCats gr rules = ungroupProds gr |
