Closed athas closed 4 months ago
I ran into this problem before and I think it only happens for "longer" concatenations https://github.com/diku-dk/alpacc/issues/12#issue-2174999957 I am quite sure the problem is my composition table generation is very slow. I think an idea could be to use something like a DFS to find all the compositions instead or something.
Lovely, this now runs in a few seconds. I hope it will scale to much larger lexical syntaxes, because this one is still pretty simple.
I actually forgot to test this lexical syntax, it is better but I thought it would had been much better.
I have thought about it a bit and it should definitely be possible to optimize my code more.
I have tried optimizing it more and it seems like it still scales badly. I think maybe some alternative method of creating the composition table should be thought of.
This CFG makes
alpacc -q 1 -k 3
go into an infinite (or just incredibly slow) loop:The culprit is the productions for
"true"
and"false"
. It's pretty fast without that.