Add option to pause Spoofax parsing/analysis during Eclipse session
For large files, sometimes Spoofax’s parsing/analysing(?) can bring performance problems, in particular during typing when the code is in a syntactically or semantically invalid state. It would be helpful to have a “Pause Spoofax” button (and/or keyboard shortcut) that suspends Spoofax. Then I could pause spoofax, type an addition to the code, and then resume spoofax after I’ve completed the new code and it’s syntactically valid again. It would also be useful when rearranging a source file with lots of copy/pasting.
Submitted on 18 July 2014 at 15:48
Issue Log
You could open the file in a different editor temporarily to make these changes. But these performance problems should be solved, can you identify the cases that have bad performance?
When editing large object-language files, there would be a lag when typing new lines of code. After a few minutes this would slow to a crawl and I would need to restart Eclipse. Saving the file also became a VERY time consuming operation.
Neil: it would be useful to understand what causes the performance problem. Can you test after turning off all analyses? If the performance remains, it is likely to be an ambiguity in your syntax. How large are the source files you are testing with?
How do I turn off the analyses? (This is essentially the capability I was requesting.)
I don’t know how large the files I was originally encountering the problem in were, but I’ve just created a test file of 1800 lines (of which half is whitespace and comments) and cut and paste is suffering performance issues.
Turn off analyses by commenting out the import of any name and type analysis you do.
Can you paste here all the lines of code from the grammar that involve
LAYOUT
?
(Note: this is using Spoofax stable.)
include/CBS.def:
lexical syntax
[\ \t\n\r] -> LAYOUT "//" ~[\n\r]* [\n\r] -> LAYOUT
context-free restrictions
LAYOUT? -/- [\ \t\n\r] LAYOUT? -/- [\/] . [\/]
include/CBS-permissive.def:
context-free syntax
WATER -> LAYOUT {cons("WATER")}
lexical syntax
[\ \t\n\r] -> LAYOUT "//" ~[\n\r]* [\n\r] -> LAYOUT
context-free restrictions
LAYOUT? -/- [\ \t\n\r] LAYOUT? -/- [\/] . [\/]
syntax/CBS.sdf:
lexical syntax
[\ \t\n\r] -> LAYOUT "//" ~[\n\r]* [\n\r] -> LAYOUT
context-free restrictions
LAYOUT? -/- [\ \t\n\r] LAYOUT? -/- [\/] . [\/]
syntax/Common.sdf:
lexical syntax
[\ \t\n\r] -> LAYOUT "/*" (~[\*] | CommentChar)* "*/" -> LAYOUT "//" ~[\n\r]* ([\n\r] | EOF) -> LAYOUT
context-free restrictions
LAYOUT? -/- [\ \t\n\r] LAYOUT? -/- [\/].[\/] LAYOUT? -/- [\/].[\*]
Commenting out the analysis seems to eliminate the performance problems.
The
LAYOUT
rules look pretty standard. So, it looks like an issue in name or type analysis. You could turn off only type analysis to see if the problem persists with name binding alone.
Log in to post comments