SlideShare a Scribd company logo
1 of 10
Download to read offline
Ring Documentation, Release 1.7
Rule : BitOrXOR --> BitAnd
Rule : Compare --> BitOrXOR
Rule : EqualOrNot --> Compare
Rule : LogicNot -> EqualOrNot
Rule : Expr --> LogicNot
Rule : Statement --> 'See' Expr
Line 13
Rule : Statement --> 'Class' Identifier
Rule : Factor --> Identifier [ {Mixer} | Assignment | PlusPlus | MinusMinus]
Rule : Range --> Factor
Rule : Term --> Range
Rule : Arithmetic --> Term
Rule : BitShift --> Arithmetic
Rule : BitAnd --> BitShift
Rule : BitOrXOR --> BitAnd
Rule : Compare --> BitOrXOR
Rule : EqualOrNot --> Compare
Rule : LogicNot -> EqualOrNot
Rule : Expr --> LogicNot
Rule : Statement --> Expr
Rule : Factor --> Identifier [ {Mixer} | Assignment | PlusPlus | MinusMinus]
Rule : Range --> Factor
Rule : Term --> Range
Rule : Arithmetic --> Term
Rule : BitShift --> Arithmetic
Rule : BitAnd --> BitShift
Rule : BitOrXOR --> BitAnd
Rule : Compare --> BitOrXOR
Rule : EqualOrNot --> Compare
Rule : LogicNot -> EqualOrNot
Rule : Expr --> LogicNot
Rule : Statement --> Expr
Rule : Factor --> Identifier [ {Mixer} | Assignment | PlusPlus | MinusMinus]
Rule : Range --> Factor
Rule : Term --> Range
Rule : Arithmetic --> Term
Rule : BitShift --> Arithmetic
Rule : BitAnd --> BitShift
Rule : BitOrXOR --> BitAnd
Rule : Compare --> BitOrXOR
Rule : EqualOrNot --> Compare
Rule : LogicNot -> EqualOrNot
Rule : Expr --> LogicNot
Rule : Statement --> Expr
===================================================
67.3 Printing Intermediate Code
Command:
ring test.ring -ic -norun
Output:
67.3. Printing Intermediate Code 772
Ring Documentation, Release 1.7
===================================================
Byte Code - Before Execution by the VM
===================================================
PC OPCode Data
1 ReturnNull
2 Func main
3 NewLine 2
4 FuncExE
5 PushC Hello World
6 LoadA nl 0
7 PushV
8 SUM 0
9 Print
10 NewLine 3
11 ExitMark 29 28
12 LoadAFirst x
13 PushN 1.000000
14 BeforeEqual 0
15 Assignment
16 PushN 1.000000
17 StepNumber
18 JumpVarLENum x 10.000000 29
19 NewLine 4
20 FuncExE
21 LoadA x 0
22 PushV
23 LoadA nl 0
24 PushV
25 SUM 0
26 Print
27 NewLine 5
28 IncJump x 18
29 POPExitMark
30 POPStep
31 NewLine 6
32 LoadFunc test
33 Call 0
34 NoOperation
35 NewLine 8
36 PushV
37 FreeStack
38 ReturnNull
39 Func test
40 NewLine 9
41 FuncExE
42 PushC welcome
43 LoadA nl 0
44 PushV
45 SUM 0
46 Print
47 NewLine 10
48 LoadA o1 0
49 AssignmentPointer
50 New point
51 SetScope
52 PushV
67.3. Printing Intermediate Code 773
Ring Documentation, Release 1.7
53 BraceStart
54 LoadA x 0 58
55 AssignmentPointer
56 PushN 10.000000
57 BeforeEqual 0
58 Assignment 0 0
59 FreeStack
60 LoadA y 0 64
61 AssignmentPointer
62 PushN 20.000000
63 BeforeEqual 0
64 Assignment 0 0
65 FreeStack
66 LoadA z 0 70
67 AssignmentPointer
68 PushN 30.000000
69 BeforeEqual 0
70 Assignment 0 0
71 FreeStack
72 LoadFunc ismethod
73 LoadA self 0
74 PushV
75 PushC braceend
76 Call
77 NoOperation
78 PushV
79 JumpZ 85
80 LoadFunc braceend
81 Call
82 NoOperation
83 PushV
84 FreeStack
85 BraceEnd
86 FreeStack
87 NewLine 11
88 FuncExE
89 LoadA o1 0
90 PushV
91 Print
92 NewLine 13
93 ReturnNull
94 Class point 006E8BC0
95 NewLabel
96 LoadA x 0
97 PushV
98 FreeStack
99 LoadA y 0
100 PushV
101 FreeStack
102 LoadA z 0
103 PushV
104 FreeStack
105 ReturnNull
===================================================
67.3. Printing Intermediate Code 774
Ring Documentation, Release 1.7
67.4 Printing Final Intermediate Code
Command:
ring test.ring -icfinal
Output:
Hello World
1
2
3
4
5
6
7
8
9
10
welcome
x: 10.000000
y: 20.000000
z: 30.000000
===================================================
Byte Code - After Execution by the VM
===================================================
PC OPCode Data
1 ReturnNull
2 Func main
3 NewLine 2
4 FuncExE
5 PushC Hello World
6 PushP 007D3670 0
7 PushV
8 SUM 0
9 Print
10 NewLine 3
11 ExitMark 29 28
12 LoadAFirst x
13 PushN 1.000000
14 BeforeEqual 0
15 Assignment
16 PushN 1.000000
17 StepNumber
18 JumpVarLPLENum x 10.000000 29
19 NewLine 4
20 FuncExE
21 PushPLocal x 0
22 PushV
23 PushP 007D3670 0
24 PushV
25 SUM 0
26 Print
27 NewLine 5
67.4. Printing Final Intermediate Code 775
Ring Documentation, Release 1.7
28 IncLPJump x 18
29 POPExitMark
30 POPStep
31 NewLine 6
32 LoadFuncP test
33 Call 0
34 NoOperation
35 NewLine 8
36 PushV
37 FreeStack
38 ReturnNull
39 Func test
40 NewLine 9
41 FuncExE
42 PushC welcome
43 PushP 007D3670 0
44 PushV
45 SUM 0
46 Print
47 NewLine 10
48 PushPLocal o1 0
49 AssignmentPointer
50 New point
51 SetScope
52 PushV
53 BraceStart
54 LoadA x 0 58
55 AssignmentPointer
56 PushN 10.000000
57 BeforeEqual 0
58 SetProperty 0 106
59 FreeStack
60 LoadA y 0 64
61 AssignmentPointer
62 PushN 20.000000
63 BeforeEqual 0
64 SetProperty 0 141
65 FreeStack
66 LoadA z 0 70
67 AssignmentPointer
68 PushN 30.000000
69 BeforeEqual 0
70 SetProperty 0 176
71 FreeStack
72 LoadFunc ismethod
73 LoadA self 0
74 PushV
75 PushC braceend
76 Call
77 NoOperation
78 PushV
79 JumpZ 85
80 LoadFunc braceend
81 Call
82 NoOperation
83 PushV
84 FreeStack
85 BraceEnd
67.4. Printing Final Intermediate Code 776
Ring Documentation, Release 1.7
86 FreeStack
87 NewLine 11
88 FuncExE
89 PushPLocal o1 0
90 PushV
91 Print
92 NewLine 13
93 ReturnNull
94 Class point 007D8470
95 NewLabel
96 LoadA x 0
97 PushV
98 FreeStack
99 LoadA y 0
100 PushV
101 FreeStack
102 LoadA z 0
103 PushV
104 FreeStack
105 ReturnNull
106 LoadFunc ismethod
107 LoadA ring_gettemp_var 0
108 PushV
109 PushC setx
110 Call 0
111 NoOperation
112 PushV
113 JumpZ 132
114 NewLine 2
115 LoadA ring_gettemp_var 0
116 LoadMethod setx
117 LoadA ring_settemp_var 0
118 PushV
119 Call 0 1
120 AfterCallMethod
121 PushV
122 FreeStack
123 NewLine 3
124 LoadA ring_tempflag_var 0 128
125 AssignmentPointer
126 PushN 0.000000
127 BeforeEqual 0
128 Assignment 0 0
129 FreeStack
130 NewLine 4
131 Jump 140
132 NewLine 5
133 PushP 007D37D8 0 137
134 AssignmentPointer
135 PushN 1.000000
136 BeforeEqual 0
137 Assignment 0 0
138 FreeStack
139 NewLine 6
140 Return
141 LoadFunc ismethod
142 LoadA ring_gettemp_var 0
143 PushV
67.4. Printing Final Intermediate Code 777
Ring Documentation, Release 1.7
144 PushC sety
145 Call 0
146 NoOperation
147 PushV
148 JumpZ 167
149 NewLine 2
150 LoadA ring_gettemp_var 0
151 LoadMethod sety
152 LoadA ring_settemp_var 0
153 PushV
154 Call 0 1
155 AfterCallMethod
156 PushV
157 FreeStack
158 NewLine 3
159 LoadA ring_tempflag_var 0 163
160 AssignmentPointer
161 PushN 0.000000
162 BeforeEqual 0
163 Assignment 0 0
164 FreeStack
165 NewLine 4
166 Jump 175
167 NewLine 5
168 PushP 007D37D8 0 172
169 AssignmentPointer
170 PushN 1.000000
171 BeforeEqual 0
172 Assignment 0 0
173 FreeStack
174 NewLine 6
175 Return
176 LoadFunc ismethod
177 LoadA ring_gettemp_var 0
178 PushV
179 PushC setz
180 Call 0
181 NoOperation
182 PushV
183 JumpZ 202
184 NewLine 2
185 LoadA ring_gettemp_var 0
186 LoadMethod setz
187 LoadA ring_settemp_var 0
188 PushV
189 Call 0 1
190 AfterCallMethod
191 PushV
192 FreeStack
193 NewLine 3
194 LoadA ring_tempflag_var 0 198
195 AssignmentPointer
196 PushN 0.000000
197 BeforeEqual 0
198 Assignment 0 0
199 FreeStack
200 NewLine 4
201 Jump 210
67.4. Printing Final Intermediate Code 778
Ring Documentation, Release 1.7
202 NewLine 5
203 PushP 007D37D8 0 207
204 AssignmentPointer
205 PushN 1.000000
206 BeforeEqual 0
207 Assignment 0 0
208 FreeStack
209 NewLine 6
210 Return
===================================================
67.5 CGI Support
Command:
ring test.ring -cgi
67.6 No Run
Command:
ring test.ring -norun
67.7 Printing Instruction Operation Code
Command:
ring test.ring -ins
Output:
===================================================
Operation : ReturnNull
PC : 1
Line Number : 1 , File test.ring
SP (After) : 0 - FuncSP : 0
LineNumber 1
===================================================
.....
.....
.....
Tip: Output removed from the previous example because it’s very large!
67.8 Performance
Command:
67.5. CGI Support 779
Ring Documentation, Release 1.7
ring test.ring -performance
Output:
===================================================
Date : 2015/09/15 Time : 15:56:17
Clock : 0
===================================================
Hello World
1
2
3
4
5
6
7
8
9
10
welcome
x: 10.000000
y: 20.000000
z: 30.000000
===================================================
Date : 2015/09/15 Time : 15:56:17
Clock : 0
===================================================
67.9 Generate Object File
You can generate object file (.ringo) from your source code file (.ring) using -go option
Tip: You will get one object file to use for distributing/running your application which may contains one or many
ring source files that you can keep or distribute based on the application (commercial or open source).
Command:
ring test.ring -go
To run the compiled object file
ring test.ringo
67.9. Generate Object File 780
CHAPTER
SIXTYEIGHT
DISTRIBUTING RING APPLICATIONS
In this chapter we will learn about distributing Ring applications.
The next method is old and was used in Ring 1.5 and previous versions!
Starting from Ring 1.6 we have a nice tool called Ring2EXE
Using Ring2EXE we can distribute applications quickly for Windows, Linux and macOS
Check the Ring2EXE chapter for more information!
68.1 Distributing Applications for Microsoft Windows
Step 1:
Copy c:ringbin folder to be for example c:myapp
Step 2:
Rename c:myappring.exe to c:myappmyapp.exe
Step 3:
Create a file c:myappring.ring
And write
Load "myapp.ring"
When you run myapp.exe the file ring.ring will be executed automatically
So your file myapp.ring will be called and executed
Or just rename myapp.ring to ring.ring
It’s a fast way to distribute applications.
68.2 Protecting the Source Code
Step 1:
Execute the next command
ring myapp.ring -go
781

More Related Content

Similar to The Ring programming language version 1.7 book - Part 81 of 196

The Ring programming language version 1.3 book - Part 59 of 88
The Ring programming language version 1.3 book - Part 59 of 88The Ring programming language version 1.3 book - Part 59 of 88
The Ring programming language version 1.3 book - Part 59 of 88Mahmoud Samir Fayed
 
The Ring programming language version 1.2 book - Part 56 of 84
The Ring programming language version 1.2 book - Part 56 of 84The Ring programming language version 1.2 book - Part 56 of 84
The Ring programming language version 1.2 book - Part 56 of 84Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 73 of 180
The Ring programming language version 1.5.1 book - Part 73 of 180The Ring programming language version 1.5.1 book - Part 73 of 180
The Ring programming language version 1.5.1 book - Part 73 of 180Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 79 of 189
The Ring programming language version 1.6 book - Part 79 of 189The Ring programming language version 1.6 book - Part 79 of 189
The Ring programming language version 1.6 book - Part 79 of 189Mahmoud Samir Fayed
 
Irregular sequence counter
Irregular sequence counterIrregular sequence counter
Irregular sequence counterAbdullah Shiam
 
The Ring programming language version 1.5.3 book - Part 86 of 184
The Ring programming language version 1.5.3 book - Part 86 of 184The Ring programming language version 1.5.3 book - Part 86 of 184
The Ring programming language version 1.5.3 book - Part 86 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.4.1 book - Part 21 of 31
The Ring programming language version 1.4.1 book - Part 21 of 31The Ring programming language version 1.4.1 book - Part 21 of 31
The Ring programming language version 1.4.1 book - Part 21 of 31Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 58 of 88
The Ring programming language version 1.3 book - Part 58 of 88The Ring programming language version 1.3 book - Part 58 of 88
The Ring programming language version 1.3 book - Part 58 of 88Mahmoud Samir Fayed
 
Bind Peeking - The Endless Tuning Nightmare
Bind Peeking - The Endless Tuning NightmareBind Peeking - The Endless Tuning Nightmare
Bind Peeking - The Endless Tuning NightmareSage Computing Services
 
The Ring programming language version 1.2 book - Part 55 of 84
The Ring programming language version 1.2 book - Part 55 of 84The Ring programming language version 1.2 book - Part 55 of 84
The Ring programming language version 1.2 book - Part 55 of 84Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 72 of 180
The Ring programming language version 1.5.1 book - Part 72 of 180The Ring programming language version 1.5.1 book - Part 72 of 180
The Ring programming language version 1.5.1 book - Part 72 of 180Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 80 of 196
The Ring programming language version 1.7 book - Part 80 of 196The Ring programming language version 1.7 book - Part 80 of 196
The Ring programming language version 1.7 book - Part 80 of 196Mahmoud Samir Fayed
 
Muhammad ariefnugraha 142014066_kode4
Muhammad ariefnugraha 142014066_kode4Muhammad ariefnugraha 142014066_kode4
Muhammad ariefnugraha 142014066_kode4Muhammad Nugraha
 
12c Mini Lesson - Improved Error Handling in PLSQL
12c Mini Lesson - Improved Error Handling in PLSQL12c Mini Lesson - Improved Error Handling in PLSQL
12c Mini Lesson - Improved Error Handling in PLSQLConnor McDonald
 
Arduino programming 101
Arduino programming 101Arduino programming 101
Arduino programming 101visual28
 
Counter Wars (JEEConf 2016)
Counter Wars (JEEConf 2016)Counter Wars (JEEConf 2016)
Counter Wars (JEEConf 2016)Alexey Fyodorov
 
The Ring programming language version 1.5.3 book - Part 88 of 184
The Ring programming language version 1.5.3 book - Part 88 of 184The Ring programming language version 1.5.3 book - Part 88 of 184
The Ring programming language version 1.5.3 book - Part 88 of 184Mahmoud Samir Fayed
 
Iterative control structures, looping, types of loops, loop working
Iterative control structures, looping, types of loops, loop workingIterative control structures, looping, types of loops, loop working
Iterative control structures, looping, types of loops, loop workingNeeru Mittal
 
The Ring programming language version 1.6 book - Part 78 of 189
The Ring programming language version 1.6 book - Part 78 of 189The Ring programming language version 1.6 book - Part 78 of 189
The Ring programming language version 1.6 book - Part 78 of 189Mahmoud Samir Fayed
 

Similar to The Ring programming language version 1.7 book - Part 81 of 196 (20)

The Ring programming language version 1.3 book - Part 59 of 88
The Ring programming language version 1.3 book - Part 59 of 88The Ring programming language version 1.3 book - Part 59 of 88
The Ring programming language version 1.3 book - Part 59 of 88
 
The Ring programming language version 1.2 book - Part 56 of 84
The Ring programming language version 1.2 book - Part 56 of 84The Ring programming language version 1.2 book - Part 56 of 84
The Ring programming language version 1.2 book - Part 56 of 84
 
The Ring programming language version 1.5.1 book - Part 73 of 180
The Ring programming language version 1.5.1 book - Part 73 of 180The Ring programming language version 1.5.1 book - Part 73 of 180
The Ring programming language version 1.5.1 book - Part 73 of 180
 
The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185The Ring programming language version 1.5.4 book - Part 77 of 185
The Ring programming language version 1.5.4 book - Part 77 of 185
 
The Ring programming language version 1.6 book - Part 79 of 189
The Ring programming language version 1.6 book - Part 79 of 189The Ring programming language version 1.6 book - Part 79 of 189
The Ring programming language version 1.6 book - Part 79 of 189
 
Irregular sequence counter
Irregular sequence counterIrregular sequence counter
Irregular sequence counter
 
The Ring programming language version 1.5.3 book - Part 86 of 184
The Ring programming language version 1.5.3 book - Part 86 of 184The Ring programming language version 1.5.3 book - Part 86 of 184
The Ring programming language version 1.5.3 book - Part 86 of 184
 
The Ring programming language version 1.4.1 book - Part 21 of 31
The Ring programming language version 1.4.1 book - Part 21 of 31The Ring programming language version 1.4.1 book - Part 21 of 31
The Ring programming language version 1.4.1 book - Part 21 of 31
 
The Ring programming language version 1.3 book - Part 58 of 88
The Ring programming language version 1.3 book - Part 58 of 88The Ring programming language version 1.3 book - Part 58 of 88
The Ring programming language version 1.3 book - Part 58 of 88
 
Bind Peeking - The Endless Tuning Nightmare
Bind Peeking - The Endless Tuning NightmareBind Peeking - The Endless Tuning Nightmare
Bind Peeking - The Endless Tuning Nightmare
 
The Ring programming language version 1.2 book - Part 55 of 84
The Ring programming language version 1.2 book - Part 55 of 84The Ring programming language version 1.2 book - Part 55 of 84
The Ring programming language version 1.2 book - Part 55 of 84
 
The Ring programming language version 1.5.1 book - Part 72 of 180
The Ring programming language version 1.5.1 book - Part 72 of 180The Ring programming language version 1.5.1 book - Part 72 of 180
The Ring programming language version 1.5.1 book - Part 72 of 180
 
The Ring programming language version 1.7 book - Part 80 of 196
The Ring programming language version 1.7 book - Part 80 of 196The Ring programming language version 1.7 book - Part 80 of 196
The Ring programming language version 1.7 book - Part 80 of 196
 
Muhammad ariefnugraha 142014066_kode4
Muhammad ariefnugraha 142014066_kode4Muhammad ariefnugraha 142014066_kode4
Muhammad ariefnugraha 142014066_kode4
 
12c Mini Lesson - Improved Error Handling in PLSQL
12c Mini Lesson - Improved Error Handling in PLSQL12c Mini Lesson - Improved Error Handling in PLSQL
12c Mini Lesson - Improved Error Handling in PLSQL
 
Arduino programming 101
Arduino programming 101Arduino programming 101
Arduino programming 101
 
Counter Wars (JEEConf 2016)
Counter Wars (JEEConf 2016)Counter Wars (JEEConf 2016)
Counter Wars (JEEConf 2016)
 
The Ring programming language version 1.5.3 book - Part 88 of 184
The Ring programming language version 1.5.3 book - Part 88 of 184The Ring programming language version 1.5.3 book - Part 88 of 184
The Ring programming language version 1.5.3 book - Part 88 of 184
 
Iterative control structures, looping, types of loops, loop working
Iterative control structures, looping, types of loops, loop workingIterative control structures, looping, types of loops, loop working
Iterative control structures, looping, types of loops, loop working
 
The Ring programming language version 1.6 book - Part 78 of 189
The Ring programming language version 1.6 book - Part 78 of 189The Ring programming language version 1.6 book - Part 78 of 189
The Ring programming language version 1.6 book - Part 78 of 189
 

More from Mahmoud Samir Fayed

The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212Mahmoud Samir Fayed
 

More from Mahmoud Samir Fayed (20)

The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212
 
The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212
 
The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212
 
The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212
 
The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212
 
The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212
 
The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212
 
The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212
 
The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212
 
The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212
 
The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212
 
The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212
 
The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212
 
The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212
 
The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212
 
The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212
 
The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212
 
The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212
 
The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212
 
The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212
 

Recently uploaded

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 

Recently uploaded (20)

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

The Ring programming language version 1.7 book - Part 81 of 196

  • 1. Ring Documentation, Release 1.7 Rule : BitOrXOR --> BitAnd Rule : Compare --> BitOrXOR Rule : EqualOrNot --> Compare Rule : LogicNot -> EqualOrNot Rule : Expr --> LogicNot Rule : Statement --> 'See' Expr Line 13 Rule : Statement --> 'Class' Identifier Rule : Factor --> Identifier [ {Mixer} | Assignment | PlusPlus | MinusMinus] Rule : Range --> Factor Rule : Term --> Range Rule : Arithmetic --> Term Rule : BitShift --> Arithmetic Rule : BitAnd --> BitShift Rule : BitOrXOR --> BitAnd Rule : Compare --> BitOrXOR Rule : EqualOrNot --> Compare Rule : LogicNot -> EqualOrNot Rule : Expr --> LogicNot Rule : Statement --> Expr Rule : Factor --> Identifier [ {Mixer} | Assignment | PlusPlus | MinusMinus] Rule : Range --> Factor Rule : Term --> Range Rule : Arithmetic --> Term Rule : BitShift --> Arithmetic Rule : BitAnd --> BitShift Rule : BitOrXOR --> BitAnd Rule : Compare --> BitOrXOR Rule : EqualOrNot --> Compare Rule : LogicNot -> EqualOrNot Rule : Expr --> LogicNot Rule : Statement --> Expr Rule : Factor --> Identifier [ {Mixer} | Assignment | PlusPlus | MinusMinus] Rule : Range --> Factor Rule : Term --> Range Rule : Arithmetic --> Term Rule : BitShift --> Arithmetic Rule : BitAnd --> BitShift Rule : BitOrXOR --> BitAnd Rule : Compare --> BitOrXOR Rule : EqualOrNot --> Compare Rule : LogicNot -> EqualOrNot Rule : Expr --> LogicNot Rule : Statement --> Expr =================================================== 67.3 Printing Intermediate Code Command: ring test.ring -ic -norun Output: 67.3. Printing Intermediate Code 772
  • 2. Ring Documentation, Release 1.7 =================================================== Byte Code - Before Execution by the VM =================================================== PC OPCode Data 1 ReturnNull 2 Func main 3 NewLine 2 4 FuncExE 5 PushC Hello World 6 LoadA nl 0 7 PushV 8 SUM 0 9 Print 10 NewLine 3 11 ExitMark 29 28 12 LoadAFirst x 13 PushN 1.000000 14 BeforeEqual 0 15 Assignment 16 PushN 1.000000 17 StepNumber 18 JumpVarLENum x 10.000000 29 19 NewLine 4 20 FuncExE 21 LoadA x 0 22 PushV 23 LoadA nl 0 24 PushV 25 SUM 0 26 Print 27 NewLine 5 28 IncJump x 18 29 POPExitMark 30 POPStep 31 NewLine 6 32 LoadFunc test 33 Call 0 34 NoOperation 35 NewLine 8 36 PushV 37 FreeStack 38 ReturnNull 39 Func test 40 NewLine 9 41 FuncExE 42 PushC welcome 43 LoadA nl 0 44 PushV 45 SUM 0 46 Print 47 NewLine 10 48 LoadA o1 0 49 AssignmentPointer 50 New point 51 SetScope 52 PushV 67.3. Printing Intermediate Code 773
  • 3. Ring Documentation, Release 1.7 53 BraceStart 54 LoadA x 0 58 55 AssignmentPointer 56 PushN 10.000000 57 BeforeEqual 0 58 Assignment 0 0 59 FreeStack 60 LoadA y 0 64 61 AssignmentPointer 62 PushN 20.000000 63 BeforeEqual 0 64 Assignment 0 0 65 FreeStack 66 LoadA z 0 70 67 AssignmentPointer 68 PushN 30.000000 69 BeforeEqual 0 70 Assignment 0 0 71 FreeStack 72 LoadFunc ismethod 73 LoadA self 0 74 PushV 75 PushC braceend 76 Call 77 NoOperation 78 PushV 79 JumpZ 85 80 LoadFunc braceend 81 Call 82 NoOperation 83 PushV 84 FreeStack 85 BraceEnd 86 FreeStack 87 NewLine 11 88 FuncExE 89 LoadA o1 0 90 PushV 91 Print 92 NewLine 13 93 ReturnNull 94 Class point 006E8BC0 95 NewLabel 96 LoadA x 0 97 PushV 98 FreeStack 99 LoadA y 0 100 PushV 101 FreeStack 102 LoadA z 0 103 PushV 104 FreeStack 105 ReturnNull =================================================== 67.3. Printing Intermediate Code 774
  • 4. Ring Documentation, Release 1.7 67.4 Printing Final Intermediate Code Command: ring test.ring -icfinal Output: Hello World 1 2 3 4 5 6 7 8 9 10 welcome x: 10.000000 y: 20.000000 z: 30.000000 =================================================== Byte Code - After Execution by the VM =================================================== PC OPCode Data 1 ReturnNull 2 Func main 3 NewLine 2 4 FuncExE 5 PushC Hello World 6 PushP 007D3670 0 7 PushV 8 SUM 0 9 Print 10 NewLine 3 11 ExitMark 29 28 12 LoadAFirst x 13 PushN 1.000000 14 BeforeEqual 0 15 Assignment 16 PushN 1.000000 17 StepNumber 18 JumpVarLPLENum x 10.000000 29 19 NewLine 4 20 FuncExE 21 PushPLocal x 0 22 PushV 23 PushP 007D3670 0 24 PushV 25 SUM 0 26 Print 27 NewLine 5 67.4. Printing Final Intermediate Code 775
  • 5. Ring Documentation, Release 1.7 28 IncLPJump x 18 29 POPExitMark 30 POPStep 31 NewLine 6 32 LoadFuncP test 33 Call 0 34 NoOperation 35 NewLine 8 36 PushV 37 FreeStack 38 ReturnNull 39 Func test 40 NewLine 9 41 FuncExE 42 PushC welcome 43 PushP 007D3670 0 44 PushV 45 SUM 0 46 Print 47 NewLine 10 48 PushPLocal o1 0 49 AssignmentPointer 50 New point 51 SetScope 52 PushV 53 BraceStart 54 LoadA x 0 58 55 AssignmentPointer 56 PushN 10.000000 57 BeforeEqual 0 58 SetProperty 0 106 59 FreeStack 60 LoadA y 0 64 61 AssignmentPointer 62 PushN 20.000000 63 BeforeEqual 0 64 SetProperty 0 141 65 FreeStack 66 LoadA z 0 70 67 AssignmentPointer 68 PushN 30.000000 69 BeforeEqual 0 70 SetProperty 0 176 71 FreeStack 72 LoadFunc ismethod 73 LoadA self 0 74 PushV 75 PushC braceend 76 Call 77 NoOperation 78 PushV 79 JumpZ 85 80 LoadFunc braceend 81 Call 82 NoOperation 83 PushV 84 FreeStack 85 BraceEnd 67.4. Printing Final Intermediate Code 776
  • 6. Ring Documentation, Release 1.7 86 FreeStack 87 NewLine 11 88 FuncExE 89 PushPLocal o1 0 90 PushV 91 Print 92 NewLine 13 93 ReturnNull 94 Class point 007D8470 95 NewLabel 96 LoadA x 0 97 PushV 98 FreeStack 99 LoadA y 0 100 PushV 101 FreeStack 102 LoadA z 0 103 PushV 104 FreeStack 105 ReturnNull 106 LoadFunc ismethod 107 LoadA ring_gettemp_var 0 108 PushV 109 PushC setx 110 Call 0 111 NoOperation 112 PushV 113 JumpZ 132 114 NewLine 2 115 LoadA ring_gettemp_var 0 116 LoadMethod setx 117 LoadA ring_settemp_var 0 118 PushV 119 Call 0 1 120 AfterCallMethod 121 PushV 122 FreeStack 123 NewLine 3 124 LoadA ring_tempflag_var 0 128 125 AssignmentPointer 126 PushN 0.000000 127 BeforeEqual 0 128 Assignment 0 0 129 FreeStack 130 NewLine 4 131 Jump 140 132 NewLine 5 133 PushP 007D37D8 0 137 134 AssignmentPointer 135 PushN 1.000000 136 BeforeEqual 0 137 Assignment 0 0 138 FreeStack 139 NewLine 6 140 Return 141 LoadFunc ismethod 142 LoadA ring_gettemp_var 0 143 PushV 67.4. Printing Final Intermediate Code 777
  • 7. Ring Documentation, Release 1.7 144 PushC sety 145 Call 0 146 NoOperation 147 PushV 148 JumpZ 167 149 NewLine 2 150 LoadA ring_gettemp_var 0 151 LoadMethod sety 152 LoadA ring_settemp_var 0 153 PushV 154 Call 0 1 155 AfterCallMethod 156 PushV 157 FreeStack 158 NewLine 3 159 LoadA ring_tempflag_var 0 163 160 AssignmentPointer 161 PushN 0.000000 162 BeforeEqual 0 163 Assignment 0 0 164 FreeStack 165 NewLine 4 166 Jump 175 167 NewLine 5 168 PushP 007D37D8 0 172 169 AssignmentPointer 170 PushN 1.000000 171 BeforeEqual 0 172 Assignment 0 0 173 FreeStack 174 NewLine 6 175 Return 176 LoadFunc ismethod 177 LoadA ring_gettemp_var 0 178 PushV 179 PushC setz 180 Call 0 181 NoOperation 182 PushV 183 JumpZ 202 184 NewLine 2 185 LoadA ring_gettemp_var 0 186 LoadMethod setz 187 LoadA ring_settemp_var 0 188 PushV 189 Call 0 1 190 AfterCallMethod 191 PushV 192 FreeStack 193 NewLine 3 194 LoadA ring_tempflag_var 0 198 195 AssignmentPointer 196 PushN 0.000000 197 BeforeEqual 0 198 Assignment 0 0 199 FreeStack 200 NewLine 4 201 Jump 210 67.4. Printing Final Intermediate Code 778
  • 8. Ring Documentation, Release 1.7 202 NewLine 5 203 PushP 007D37D8 0 207 204 AssignmentPointer 205 PushN 1.000000 206 BeforeEqual 0 207 Assignment 0 0 208 FreeStack 209 NewLine 6 210 Return =================================================== 67.5 CGI Support Command: ring test.ring -cgi 67.6 No Run Command: ring test.ring -norun 67.7 Printing Instruction Operation Code Command: ring test.ring -ins Output: =================================================== Operation : ReturnNull PC : 1 Line Number : 1 , File test.ring SP (After) : 0 - FuncSP : 0 LineNumber 1 =================================================== ..... ..... ..... Tip: Output removed from the previous example because it’s very large! 67.8 Performance Command: 67.5. CGI Support 779
  • 9. Ring Documentation, Release 1.7 ring test.ring -performance Output: =================================================== Date : 2015/09/15 Time : 15:56:17 Clock : 0 =================================================== Hello World 1 2 3 4 5 6 7 8 9 10 welcome x: 10.000000 y: 20.000000 z: 30.000000 =================================================== Date : 2015/09/15 Time : 15:56:17 Clock : 0 =================================================== 67.9 Generate Object File You can generate object file (.ringo) from your source code file (.ring) using -go option Tip: You will get one object file to use for distributing/running your application which may contains one or many ring source files that you can keep or distribute based on the application (commercial or open source). Command: ring test.ring -go To run the compiled object file ring test.ringo 67.9. Generate Object File 780
  • 10. CHAPTER SIXTYEIGHT DISTRIBUTING RING APPLICATIONS In this chapter we will learn about distributing Ring applications. The next method is old and was used in Ring 1.5 and previous versions! Starting from Ring 1.6 we have a nice tool called Ring2EXE Using Ring2EXE we can distribute applications quickly for Windows, Linux and macOS Check the Ring2EXE chapter for more information! 68.1 Distributing Applications for Microsoft Windows Step 1: Copy c:ringbin folder to be for example c:myapp Step 2: Rename c:myappring.exe to c:myappmyapp.exe Step 3: Create a file c:myappring.ring And write Load "myapp.ring" When you run myapp.exe the file ring.ring will be executed automatically So your file myapp.ring will be called and executed Or just rename myapp.ring to ring.ring It’s a fast way to distribute applications. 68.2 Protecting the Source Code Step 1: Execute the next command ring myapp.ring -go 781