Migratjng Overture to a difgerent IDE Peter W. V. Tran-Jrgensen, - - PowerPoint PPT Presentation

migratjng overture to a difgerent ide
SMART_READER_LITE
LIVE PREVIEW

Migratjng Overture to a difgerent IDE Peter W. V. Tran-Jrgensen, - - PowerPoint PPT Presentation

Migratjng Overture to a difgerent IDE Peter W. V. Tran-Jrgensen, Tomas Kulik Contributjon VDM-Mode for Emacs Syntax highlightjng Syntax validatjon REPL VDM Templates Pretuy printjng Packages accepted into MELPA Peter


slide-1
SLIDE 1

Migratjng Overture to a difgerent IDE

Peter W. V. Tran-Jørgensen, Tomas Kulik

slide-2
SLIDE 2

Contributjon

  • VDM-Mode for Emacs

− Syntax highlightjng − Syntax validatjon − REPL − VDM Templates − Pretuy printjng − Packages accepted into MELPA

2

Peter W. V. Tran-Jørgensen, Tomas Kulik

slide-3
SLIDE 3

The need

 Eclipse usage is

falling

 Pointed at 16th

Overture workshop

 Emacs package as a

case study

3

Peter W. V. Tran-Jørgensen, Tomas Kulik

slide-4
SLIDE 4

Why Emacs?

  • Popular text editor
  • Ofuen used as IDE
  • Massively extensible
  • Use of third party packages
  • Less than 400 LoC

4

Peter W. V. Tran-Jørgensen, Tomas Kulik

slide-5
SLIDE 5

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

5

Peter W. V. Tran-Jørgensen, Tomas Kulik

slide-6
SLIDE 6

Syntax highlightjng

6

Peter W. V. Tran-Jørgensen, Tomas Kulik

slide-7
SLIDE 7

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

7

Peter W. V. Tran-Jørgensen, Tomas Kulik

slide-8
SLIDE 8

Syntax validatjon

8

Peter W. V. Tran-Jørgensen, Tomas Kulik

slide-9
SLIDE 9

Syntax validation

 Based on flycheck

− Errors − Warnings − In margin and echo area − Interactive list of errors − Errors as pop ups

9

Peter W. V. Tran-Jørgensen, Tomas Kulik

slide-10
SLIDE 10

The REPL

10

Peter W. V. Tran-Jørgensen, Tomas Kulik

slide-11
SLIDE 11

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

11

Peter W. V. Tran-Jørgensen, Tomas Kulik

slide-12
SLIDE 12

VDM templates

12

Peter W. V. Tran-Jørgensen, Tomas Kulik

slide-13
SLIDE 13

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

13

Peter W. V. Tran-Jørgensen, Tomas Kulik

slide-14
SLIDE 14

What did it take?

 Surprisingly little:

14

Peter W. V. Tran-Jørgensen, Tomas Kulik

slide-15
SLIDE 15

How does it compare?

15

Peter W. V. Tran-Jørgensen, Tomas Kulik

slide-16
SLIDE 16

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

16

Peter W. V. Tran-Jørgensen, Tomas Kulik

slide-17
SLIDE 17

Where to find?

 Github:  https://github.com/peterwvj/vdm-mode

17

Peter W. V. Tran-Jørgensen, Tomas Kulik