Attempting to import file "lu.fisch.structorizer.gui.Menu.java" reveals the severe risk of a stack overflow during the diagram building phase.
It is due to the awkwardness of recursively processing left-recursive reduction rules. Particularly class bodies and statements blocks are prone to calamity. Though most these sequences hardly exceed some 20 elements, some may have dangerous sizes as the followong example snippets from a test log corroborate:
Doing block of type 148 with length 372
Doing block of type 236 with length 360
Doing block of type 236 with length 117
The solution is to convert the reduction tree into a reduction stack first and then to process its element reductions sequentially in a loop.
Attempting to import file "lu.fisch.structorizer.gui.Menu.java" reveals the severe risk of a stack overflow during the diagram building phase. It is due to the awkwardness of recursively processing left-recursive reduction rules. Particularly class bodies and statements blocks are prone to calamity. Though most these sequences hardly exceed some 20 elements, some may have dangerous sizes as the followong example snippets from a test log corroborate:
The solution is to convert the reduction tree into a reduction stack first and then to process its element reductions sequentially in a loop.