-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
135 lines (107 loc) · 4.12 KB
/
README
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
Copyright Tomoki Imai.
The License is MIT License.
Programming PRPR requires following software.
Ruby.
Racc.(if you build own PRPR)
Python.
How to use.
move progprpr dir.
prpr need indents like python.
$ ./prpr <file>.
Like ruby,you can use stdin.
syntax.
you can use following mathmatic syntax.
-------------------------------------------------------------------------------
a + b.
-> return a plus b.
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
a - b.
-> return a minus b.
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
a * b.
-> return a multiple b
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
a / b.
-> return a divide b.
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
a mod b.
-> return remainder of "a divide b".
-------------------------------------------------------------------------------
-calc remainder.
-ex. 5 mod 4 is 1.
4.5 mod 3 is 1.5.
-in some other programming language,
mod is %.
-------------------------------------------------------------------------------
a ^ b.
-> return a power b.
-------------------------------------------------------------------------------
-cal power.
-ex. 5^3 means 5*5*5.
-in some other programming language,
^ is **.
-------------------------------------------------------------------------------
a is b.
-> return true if a=b.false if a not = b.
-------------------------------------------------------------------------------
-ex,5is5 return true.
4 is 3 return false.
-in some other programming language,
"is" is ==.
In prpr,there is no difference intger and float.
It means,there is only float.
Prpr also have strings.
-------------------------------------------------------------------------------
"String".
-> return "String".
-------------------------------------------------------------------------------
-In prpr,no high function for strings.
-Because,prpr is for mathmatics.
-but,I'm planning to add some functions.
-------------------------------------------------------------------------------
print a.
->output value a to stdout.
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
a = b.
make a b.
-------------------------------------------------------------------------------
In prpr,there is "for" and "if".
for "initialize expression" to "condition expression" do:
<-->expressions
At first,"init exp" will be evaled.
while "condition expression" returned false,
eval expressions again and again.
if syntax.
-------------------------------------------------------------------------------
if "condition exp" then:
<-->expressions
-------------------------------------------------------------------------------
If "condition exp" returned true,expressions will be evaled.
if syntax can have else.
-------------------------------------------------------------------------------
if "condition exp" then:
<-->true expressions
else:
<-->false expressions
-------------------------------------------------------------------------------
If "condition exp" returned true,true expressions will be evaled.
if "condition exp" returned false,false expressions will be evaled.
Label System.
label system is the way to insert function.
-------------------------------------------------------------------------------
label "String" to:
<-->expressions
-------------------------------------------------------------------------------
and
-------------------------------------------------------------------------------
goto "String"
-------------------------------------------------------------------------------
These are pair.
goto "String" insert expressions.
See test.bas