-
Notifications
You must be signed in to change notification settings - Fork 5
/
project.bra
84 lines (84 loc) · 2.05 KB
/
project.bra
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
(project=
new
= N c C K E B K v V f F l r L G
. prog:?B
& str$(!B ".bra"):?N
& X:?C
& put$(str$("Enter name for program [" !N "]:"))
& (get':~|!N):?n
& @( !n
: ( ?B ".bra"
| ?B&str$(!n ".bra"):?n
)
)
& put$(str$("Enter name for class [" !C "]:"))
& (get':~|!C):?c
& out$"Enter description of program (finish with two empty lines):"
& :?K
& 0:?E
& whl
' ( get'(,STR):~:?L
& !K \n !L:?K
& 0:?E
| 1+!E:<2:?E&!K \n:?K
)
& rev$(str$!K):?K
& whl'@(!K:(\n|" "|\t) ?K)
& rev$!K:?K
& str$("{" !n \n𝕌𝕋𝔽-𝟠 (!K:|\n !K) "}\n\n"):?K
& put$(str$!K,!n,NEW,BIN)
& ( G
= L v
. :?L
& out
$ ( str
$ ( "Enter the names of "
!arg
" for class "
!c
". Finish with an empty line."
)
)
& whl
' (get':~:?v&!v !L:?L)
& !L
)
& G$"member variables":?V
& G$methods:?F
&
' ( $c x S
. $c:?x
& (S=new=.)
& whl
' ( !F:%?f ?F
& '(($($f)=.) ()$($S))
: (=?S)
)
& whl
' ( !V:%?v ?V
& '(($($v)=) ()$($S))
: (=?S)
)
& '$($S):(=?!x)
& lst$($c,$n,APP,BIN,WYD)
)
: (=?l)
& l$
&
' ( get'($n,TXT)
& rmv$(str$($B ".bak"))
& ren$($n.str$($B ".bak"))
& put$($K,$n,NEW,BIN)
& lst'($c,$n,APP,BIN,WYD)
& put'(\n,$n,APP,BIN)
& lst'(r,$n,APP,BIN,WYD)
& put$(str$("\nnew'" ()$c ";\n"),$n,APP,BIN)
&
)
: (=?r)
& put$(\n,!n,APP,BIN)
& lst$(r,!n,APP,BIN,WYD)
& put$(str$("\nnew$" !c "&|failure!;\n"),!n,APP,BIN)
& out$done
);
new$project&tbl$(project,-1)&get$!n&put$("Enter !r to re-read" !n \n)&tbl$(n,-1)&;