As an heuristics, the SugarJ plugin could use an outdated version of the current file’s grammar to provide a faster user interface.

We need to recompile a SugarJ file to parse it, because the exact contents of the file induce the grammar to use for parsing. To speed up the user interface, we could use the grammar from the last recompilation, approximately as follows:

  1. Spoofax asks SugarJ to parse a file.
  2. SugarJ parses the file with the most recently produced grammar into a preliminary AST.
  3. Spoofax provides editor services based on that preliminary AST.
  4. SugarJ recompiles the file in the background.
  5. After recompilation is finished, SugarJ informs Spoofax of the new, possibly more accurate, AST for the file.
  6. Spoofax updates syntax highlighting and editor services to reflect the more accurate AST

This would speed up the common case that a change in the source file does not significantly change the grammar or editor services.

Submitted by Tillmann Rendel on 10 May 2011 at 19:27

On 19 May 2011 at 11:35 Sebastian Erdweg tagged plugin

On 2 June 2011 at 20:22 Sebastian Erdweg commented:

implemented Tillmann’s proposal.


On 2 June 2011 at 20:22 Sebastian Erdweg closed this issue.

Log in to post comments