Download Language development case study (Pdf, 133 pages)

Transcript
ii CONTENTS
6
5.5.1 Data manipulation instructions and address modes
5.5.2 Control manipulation instructions
5.6 Using an assembler to program MVM
5.7 mvmsim { a simulator for MVM byte codes
5.7.1 Using mvmsim
5.7.2 The mvmsim input le format
5.7.3 Running a simulation
5.7.4 Implementing mvmsim
38
39
39
40
40
41
41
42
{ an assembler for MVM
A rst example
6.1.1 Assembler output
6.1.2 Using the assembler and the simulator together
Assembler syntax reference
6.2.1 Line oriented and free format languages
6.2.2 Lexical elements
6.2.3 Expressions
6.2.4 Instructions and addressing modes
6.2.5 Directives
Implementing mvmasm
6.3.1 Multiple pass parsers
6.3.2 The EOLN scanner primitive
The mvmasm grammar
6.4.1 Directives for setting up the parser
6.4.2 The MVM denition header
6.4.3 The main mvmasm grammar
6.4.4 The expression evaluator
mvmasm auxiliary functions
47
47
48
49
50
50
51
51
51
53
54
54
56
56
56
56
60
61
62
mvmasm
6.1
6.2
6.3
6.4
6.5
7 A single pass compiler for miniloop
7.1 miniloop features
7.1.1 The begin end block (compound statement)
7.1.2 The while loop
7.2 Arranging data and code in memory
7.3 Compiling declarations
7.4 Compiling arithmetic expressions
7.5 Compiling print statements
7.6 Compiling if statements
7.7 Compiling while loops
7.8 Typical compiler output
7.9 Implementing miniloop
7.9.1 A grammar for miniloop
7.9.2 miniloop auxiliary functions
67
67
68
69
69
70
71
71
72
73
73
74
74
74