summaryrefslogtreecommitdiff
path: root/system/base/unknown/src/elan
blob: 744003d744a15e304c6aac66ce4b7f31339bd949 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
 
PACKET local manager part 2 DEFINES            (* Autor: J.Liedtke *)
                                               (* Stand: 29.04.80  *)
  list ,
  file names :
 
 
FILE VAR list file ;
TEXT VAR file name, status text;
 
PROC list :
 
  list file := sequential file (output) ;
  headline (list file, "list") ;
  list (list file) ;
  show (list file) ;
  close
 
ENDPROC list ;
 
PROC list (FILE VAR f) :
 
  begin list ;
  putline (f, "") ;
  REP
    get list entry (file name, status text) ;
    IF file name = ""
      THEN LEAVE list
    FI ;
    out (f, status text + "  """ ) ;
    out (f, file name) ;
    out (f, """") ;
    line (f)
  PER
 
ENDPROC list ;
 
PROC file names (FILE VAR f) :
 
  begin list ;
  REP
    get list entry (file name, status text) ;
    IF file name = ""
      THEN LEAVE file names
    FI ;
    putline (f, file name)
  PER
 
ENDPROC file names ;

ENDPACKET local manager part 2 ;
 
 
PACKET elan DEFINES                               (*Autor: J.Liedtke *)
                                                  (*Stand: 01.05.82  *)
    do ,
    run ,
    run again ,
    insert ,
    prot ,
    prot off ,
    check on ,
    check off :
 
 
LET newinit option = FALSE ,
    ins = TRUE ,
    no ins = FALSE ,
    lst = TRUE ,
    no lst = FALSE ,
    compiler dump option = FALSE ,
    sys option = TRUE ,
    stop at first error = TRUE ,
    multiple error analysis = FALSE ,
    sermon = TRUE ,
    no sermon = FALSE ,

    run again mode = 0 ,
    compile file mode = 1 ,
    compile line mode = 2 ,

    error message = 4 ;

BOOL VAR list option := FALSE ,
         check option := TRUE ,
         errors occurred ;

INT VAR run again mod nr := 0 ;
DATASPACE VAR ds ;

FILE VAR error file, source file ;
 
 
PROC do (TEXT CONST command) :

  INT VAR dummy mod ;
  run again mod nr := 0 ;
  errors occurred := FALSE ;
  elan (compile line mode, ds, command, dummy mod,
        newinit option, no ins, compiler dump option, no lst, sys option,
        check option, stop at first error, no sermon) ;
  IF errors occurred
    THEN forget (ds) ;
         errorstop ("")
  FI
 
ENDPROC do ;
 
 
PROC run (TEXT CONST file name) : 
 
  last param (file name) ;
  run elan (file name, no ins)
 
END PROC run;
 
PROC run :
 
  run (last param)
 
ENDPROC run ;
 
PROC run again :
 
  IF run again mod nr > 0
    THEN INT VAR mod := run again mod nr ;
         elan (run again mode, ds, "", run again mod nr,
               newinit option, no ins, compiler dump option, no lst, 
               sys option, check option, stop at first error, no sermon)
    ELSE errorstop ("run again impossible")
  FI
 
ENDPROC run again ;
 
PROC insert (TEXT CONST file name) : 
 
  last param (file name) ;
  run elan (file name, ins)
 
ENDPROC insert ;
 
PROC insert :
 
  insert (last param)
 
ENDPROC insert ;
 
PROC run elan (TEXT CONST file name, BOOL CONST insert option) :

  IF exists (file name)
    THEN compile and execute
    ELSE errorstop ("file does not exist")
  FI .

compile and execute :
  disable stop ;
  errors occurred := FALSE ;
  elan (compile file mode, old (file name, 1002), "" , run again mod nr,
        newinit option, insert option, compiler dump option, list option,
        sys option, check option, multiple error analysis, sermon) ;
 
  IF errors occurred
    THEN ignore halt during compiling ;
         errors occurred := FALSE ;
         enable stop ;
         source file := sequential file (modify, file name) ;
         modify (error file) ;
         edit (error file, source file) ;
         forget (ds)
  FI .

ignore halt during compiling :
  IF is error
    THEN put error ;
         clear error ;
         pause (5)
  FI .

ENDPROC run elan ;

PROC elan (INT CONST mode, DATASPACE CONST source, TEXT CONST line, 
           INT VAR start module number,
           BOOL CONST newinit, ins, dump, lst, sys, rt check, error1, ser) :
  EXTERNAL 256
ENDPROC elan ;

PROC out text (TEXT CONST text, INT CONST out type) :

  INTERNAL 257 ;
  out (text) ;
  IF out type = error message 
    THEN access error file ;
         out (error file, text)
  FI .
 
access error file :
  IF NOT errors occurred
    THEN open error file
  FI .

ENDPROC out text ;

PROC out line (INT CONST out type) :

  INTERNAL 258 ;
  out (""13""10"") ;
  IF out type = error message
    THEN access error file ;
         line (error file)
  FI .

access error file :
  IF NOT errors occurred
    THEN open error file
  FI .

ENDPROC out line ;

PROC open error file :

  errors occurred := TRUE ;
  forget (ds) ;
  ds := nilspace ;
  error file := sequential file (output, ds) ;
  headline (error file, "errors")

ENDPROC open error file ;

PROC prot :
  list option := TRUE
ENDPROC prot ;
 
PROC prot off :
  list option := FALSE
ENDPROC prot off ;
 
PROC check on :
  check option := TRUE
ENDPROC check on ;
 
PROC check off :
  check option := FALSE
ENDPROC check off ;
 
ENDPACKET elan ;