Closed djrieger closed 9 years ago
Cannot reproduce. Terminates at my computer (commit 08abcd3). Has a long runtime, though (something like 10 minutes? Didn't time it). The program currently seems to have quadratic runtime in the nesting depth. Created issue #6 (feature request for more efficient ast printer) as result.
Alright, didn't leave it running that long. Trying again and not interrupting it prematurely resulted in what looks like correct output, after 18 minutes of running.
Wofür braucht das denn 18 Minuten? Am 15.11.2014 14:46 schrieb "David Rieger" notifications@github.com:
Alright, didn't leave it running that long. Trying again and not interrupting it prematurely resulted in what looks like correct output, after 18 minutes of running.
— Reply to this email directly or view it on GitHub https://github.com/djrieger/mjplusplus/issues/5#issuecomment-63172851.
No idea.
See #6. Generating indentation string every time. The fill-constructor of string seems to be linear in the number of chars. This summed up for all levels is quadratic... The result file of the printing contains 96 MB...
When running mj++ without --print-ast, the compiler returns with exit code 0. When run with --print-ast, it never terminates. Debugging revealed that IfStatement.toString() is calling Block.toString() which again calls IfStatement.toString() and this never terminates.
My attempts at debugging showed that both functions are apparently called 10000 times, which would match the 10000 if's in the test case. This happens quite fast, but then the program is stuck.
Here is an excerpt from my backtrace:
Trying again yields these indent values: