Development of a Programming Environment and Interpreter for LOOP - - PowerPoint PPT Presentation
Development of a Programming Environment and Interpreter for LOOP - - PowerPoint PPT Presentation
Development of a Programming Environment and Interpreter for LOOP and WHILE Michael Gebhard 22.01.2019 Goals LOOP and WHILE Interpreter IDE Plugin Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 2 LOOP Syntax
Goals
LOOP and WHILE Interpreter IDE Plugin
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 2
LOOP Syntax
program:
instruction ;
instruction:
variable := variable + 1 LOOP variable DO program ENDDO
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 3
LOOP Semantics
state s : Var → N instruction i : state → state sequencing instruction ◦ instruction Instructions:
X := 0 X := Y X := Y + 1 LOOP X DO P ENDDO
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 4
LOOP Language
LOOP X DO X := X + 1 ENDDO; Y := X
f (x) = 2x Primitive Recursive
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 5
WHILE Syntax
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 6
WHILE Semantics
state s : Var → N instruction i : state ⇀ state sequencing instruction ◦ instruction New Instruction:
WHILE X != 0 DO P ENDDO
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 7
WHILE Language
X := 0; X := X + 1; WHILE X != 0 DO ENDDO
µ-Recursive
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 8
Extended Language
main.lw
#LOOP #IMPORT math.lw in: y
- ut: x
x := double(y)
math.lw
def double in: i0
- ut: o0
- 0 := 2 * i0
enddef
Basic Arithmetics Comparison Variable Declarations Macros Imports Language Flag
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 9
Execution Environment
Parsing Execution
Macros
Debugging
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 10
Parsing
- ut: o0
- 0 := 5;
loop o0 do
- 0 := o0 * 2
enddo
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 11
Execution
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 12
Execution
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 13
Execution
- ut: o0
- 0 := mac(5);
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 14
Debugging
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 15
Debugging
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 16
Debugging
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 17
IDE: Intellij
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 18
IDE: Intellij
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 19
IDE: Intellij
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 20
IDE: Intellij
Michael Gebhard IDE and Interpreter for LOOP and WHILE (22.01.2019) 21