Migratjng Overture to a difgerent IDE Peter W. V. Tran-Jørgensen, Tomas Kulik
Contributjon • VDM-Mode for Emacs − Syntax highlightjng − Syntax validatjon − REPL − VDM Templates − Pretuy printjng − Packages accepted into MELPA Peter W. V. Tran-Jørgensen, Tomas Kulik 2
The need Eclipse usage is falling Pointed at 16 th Overture workshop Emacs package as a case study Peter W. V. Tran-Jørgensen, Tomas Kulik 3
Why Emacs? • Popular text editor • Ofuen used as IDE • Massively extensible • Use of third party packages • Less than 400 LoC Peter W. V. Tran-Jørgensen, Tomas Kulik 4
Enabling Emacs packages prog-mode − Syntax highlightjng and indentatjon rules comint-mode − REPL (interactjve shell) fmycheck − Syntax checking framework yasnippet − Template expansion system prettjfy-symbols-mode − Replacement of ASCII characters with Unicode Peter W. V. Tran-Jørgensen, Tomas Kulik 5
Syntax highlightjng Peter W. V. Tran-Jørgensen, Tomas Kulik 6
Syntax highlighting vdm-mode derived from prog-mode − Keyword, type, value highlighting − Pretty printing of characters − Characters saved as ASCII representation − Detection of VDM dialect Comparable to Overture Peter W. V. Tran-Jørgensen, Tomas Kulik 7
Syntax validatjon Peter W. V. Tran-Jørgensen, Tomas Kulik 8
Syntax validation Based on flycheck − Errors − Warnings − In margin and echo area − Interactive list of errors − Errors as pop ups Peter W. V. Tran-Jørgensen, Tomas Kulik 9
The REPL Peter W. V. Tran-Jørgensen, Tomas Kulik 10
The REPL vdm-comint based on comint − Run VDM in REPL-like fashion − Send parts of the model directly to the REPL − Load files associated with current VDM project Peter W. V. Tran-Jørgensen, Tomas Kulik 11
VDM templates Peter W. V. Tran-Jørgensen, Tomas Kulik 12
VDM templates vdm-snippets based on yasnippet − Generation of skeleton of VDM syntax − Function template expansion − Operation template expansion − Module template expansion − Class template expansion Generate and fill in placeholders Peter W. V. Tran-Jørgensen, Tomas Kulik 13
What did it take? Surprisingly little: Peter W. V. Tran-Jørgensen, Tomas Kulik 14
How does it compare? Peter W. V. Tran-Jørgensen, Tomas Kulik 15
Conclusion and future plans Basic VDM features in few LoC − Syntax highlighting (145) − Syntax validation (32) − REPL (102) − Template expansion (13) Much more work required to reach full IDE Language Server Protocol (LSP) − Increase uptake of Overture Peter W. V. Tran-Jørgensen, Tomas Kulik 16
Where to find? Github: https://github.com/peterwvj/vdm-mode Peter W. V. Tran-Jørgensen, Tomas Kulik 17
Recommend
More recommend