comparison TL1/test/t4.tl1 @ 180:c3145f913f3d default tip

possible features
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 04 May 2019 11:17:42 +0900
parents 4d83154d2a78
children
comparison
equal deleted inserted replaced
179:41d578d28d8c 180:c3145f913f3d
2 FUNC SEARCH 2 FUNC SEARCH
3 %--- MAIN --- 3 %--- MAIN ---
4 VAR DICT,BUF 4 VAR DICT,BUF
5 ARRAY TEND[2] 5 ARRAY TEND[2]
6 BEGIN 6 BEGIN
7 POSITION(DICT,TEND) 7 DICT := OPENM((INT($2,0))
8 DICT := OPENM($2,0)
9 WRITE(DICT:ASCII(0)) 8 WRITE(DICT:ASCII(0))
10 WRITE(DICT:ASCII(30),ASCII(-'P'),"ROC") 9 WRITE(DICT:ASCII(30),ASCII(-'P'),"ROC")
11 WRITE(DICT:ASCII(31),ASCII(-'F'),"UNC") 10 WRITE(DICT:ASCII(31),ASCII(-'F'),"UNC")
12 WRITE(DICT:ASCII(33),ASCII(-'V'),"AR",CRLF) 11 WRITE(DICT:ASCII(33),ASCII(-'V'),"AR",CRLF)
13 POSITION(DICT,TEND) 12 TEND := POSITION(DICT)
14 BUF := OPENM($2,0) 13 BUF := OPENM(INT($2,0))
15 WRITE(BUF:"FUNC",ASCII(0)) 14 WRITE(BUF:"FUNC",ASCII(0))
16 WRITE(0:SEARCH(BUF),CRLF) 15 WRITE(0:SEARCH(BUF),CRLF)
17 SEEK(BUF,0) 16 SEEK(BUF,INT(0))
18 WRITE(BUF:"NONAME",ASCII(0)) 17 WRITE(BUF:"NONAME",ASCII(0))
19 WRITE(0:SEARCH(BUF),CRLF) 18 WRITE(0:SEARCH(BUF),CRLF)
20 END 19 END
21 20
22 SEARCH(BUF) 21 SEARCH(BUF)
23 VAR VAL,K,C 22 VAR VAL,K,C
24 ARRAY BEND 23 ARRAY BEND
25 BEGIN 24 BEGIN
26 VAL := SEEK(DICT,TEND) 25 VAL := SEEK(DICT,TEND)
27 POSITION(BUF,BEND) 26 BEND:=POSITION(BUF)
28 WHILE VAL#0 DO [ 27 WHILE VAL#0 DO [
29 C:=SEEKR(BUF,-1) 28 C:=SEEKR(BUF,-1)
30 K:=SEEKR(DICT,-1) 29 K:=SEEKR(DICT,-1)
31 IF K.LT.0 THEN [ 30 IF K.LT.0 THEN [
32 IF C=-K THEN 31 IF C=-K THEN