SlideShare a Scribd company logo
CHAPTER
FIFTYTHREE
DISTRIBUTING RING APPLICATIONS
In this chapter we will learn about distributing Ring applications.
53.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.
53.2 Protecting the Source Code
Step 1:
Execute the next command
ring myapp.ring -go
This will generate one object file (myapp.ringo) from the project files (*.ring)
Step 2:
Rename myapp.ringo to ring.ringo
When you run the executable file (ring.exe) or (myapp.exe) the file ring.ringo will be executed.
520
Ring Documentation, Release 1.2
53.3 Creating Windows Installer
There are many tools that you can use to distribute your application.
Check : nullsoft scriptable install system
URL : http://nsis.sourceforge.net/Main_Page
53.4 Using C/C++ Compiler and Linker
Another method to distribute applications is to use a C/C++ compiler.
Ring can be embedded in C/C++ projects, We can create executable files using a C/C++ compiler by embedding the
Ring language in our project.
Check the “Embedding Ring Language in C/C++ Programs” chapter.
Using this way we will avoid using ring.ring or ring.ringo files.
53.5 Distributing Applications and Games for Mobile
Ring can be embedded in a Qt projects or LibSDL projects to build Mobile applications and Games.
You can build the Qt project or the LibSDL project and get the Android package directly (*.apk)
Check Ring distributions for Mobile development using Qt or LibSDL.
53.3. Creating Windows Installer 521
CHAPTER
FIFTYFOUR
COMMAND LINE OPTIONS
The ring language takes source code file (.ring) or the object file (.ringo) as input to execute, also the language provide
other options like
Option Description
-tokens Print a list of tokens in the source code file
-rules Print grammar rules applied on the tokens
-ic Print the intermediate byte code (before execution)
-icfinal Print the final byte code (after execution)
-cgi Print http response header before error messages
-norun Don’t run the program after compiling
-ins Print instruction operation code before execution
-performance Print clock before and after program execution
-go Generate Object File
-w Display Warnings
54.1 Printing Tokens
Example:
Func Main
See "Hello World" + nl
for x = 1 to 10
see x + nl
next
test()
func test
see "welcome" + nl
o1 = new point { x=10 y=20 z=30 }
see o1
class point x y z
Command:
ring test.ring -tokens -norun
Output:
===================================================
Tokens - Generated by the Scanner
===================================================
522
Ring Documentation, Release 1.2
Keyword : FUNC
Identifier : main
EndLine
Keyword : SEE
Literal : Hello World
Operator : +
Identifier : nl
EndLine
Keyword : FOR
Identifier : x
Operator : =
Number : 1
Keyword : TO
Number : 10
EndLine
Keyword : SEE
Identifier : x
Operator : +
Identifier : nl
EndLine
Keyword : NEXT
EndLine
Identifier : test
Operator : (
Operator : )
EndLine
Keyword : FUNC
Identifier : test
EndLine
Keyword : SEE
Literal : welcome
Operator : +
Identifier : nl
EndLine
Identifier : o1
Operator : =
Keyword : NEW
Identifier : point
Operator : {
Identifier : x
Operator : =
Number : 10
Identifier : y
Operator : =
Number : 20
Identifier : z
Operator : =
Number : 30
Operator : }
EndLine
Keyword : SEE
Identifier : o1
EndLine
Keyword : CLASS
Identifier : point
Identifier : x
Identifier : y
Identifier : z
54.1. Printing Tokens 523
Ring Documentation, Release 1.2
EndLine
===================================================
54.2 Printing Rules
Command:
ring test.ring -rules -norun
Output:
===================================================
Grammar Rules Used by The Parser
===================================================
Rule : Program --> {Statement}
Line 1
Rule : Statement --> 'Func' Identifier [ParaList]
Line 2
Rule : Factor --> Literal
Rule : Range --> Factor
Rule : Term --> Range
Rule : Arithmetic --> Term
Rule : Factor --> Identifier [ {Mixer} | Assignment | PlusPlus | MinusMinus]
Rule : Range --> Factor
Rule : Term --> Range
Rule : Arithmetic --> Term
Rule : Arithmetic --> Arithmetic + Arithmetic
Rule : BitShift --> Arithmetic
Rule : BitAnd --> BitShift
Rule : BitOrXOR --> BitAnd
Rule : Compare --> BitOrXOR
Rule : EqualOrNot --> Compare
Rule : LogicNot -> EqualOrNot
Rule : Expr --> LogicNot
Rule : Statement --> 'See' Expr
Line 3
Rule : Factor --> Number
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 : Factor --> Number
Rule : Range --> Factor
Rule : Term --> Range
Rule : Arithmetic --> Term
Rule : BitShift --> Arithmetic
54.2. Printing Rules 524
Ring Documentation, Release 1.2
Rule : BitAnd --> BitShift
Rule : BitOrXOR --> BitAnd
Rule : Compare --> BitOrXOR
Rule : EqualOrNot --> Compare
Rule : LogicNot -> EqualOrNot
Rule : Expr --> LogicNot
Rule : Statement --> 'For' Identifier '=' Expr to Expr ['step' Expr]
Line 4
Rule : Factor --> Identifier [ {Mixer} | Assignment | PlusPlus | MinusMinus]
Rule : Range --> Factor
Rule : Term --> Range
Rule : Arithmetic --> Term
Rule : Factor --> Identifier [ {Mixer} | Assignment | PlusPlus | MinusMinus]
Rule : Range --> Factor
Rule : Term --> Range
Rule : Arithmetic --> Term
Rule : Arithmetic --> Arithmetic + Arithmetic
Rule : BitShift --> Arithmetic
Rule : BitAnd --> BitShift
Rule : BitOrXOR --> BitAnd
Rule : Compare --> BitOrXOR
Rule : EqualOrNot --> Compare
Rule : LogicNot -> EqualOrNot
Rule : Expr --> LogicNot
Rule : Statement --> 'See' Expr
Line 5
Rule : Next --> 'Next'
Line 6
Rule : Mixer -> '(' [Expr { ',' Expr} ] ')'
Line 8
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 : Statement --> 'Func' Identifier [ParaList]
Line 9
Rule : Factor --> Literal
Rule : Range --> Factor
Rule : Term --> Range
Rule : Arithmetic --> Term
Rule : Factor --> Identifier [ {Mixer} | Assignment | PlusPlus | MinusMinus]
Rule : Range --> Factor
Rule : Term --> Range
Rule : Arithmetic --> Term
Rule : Arithmetic --> Arithmetic + Arithmetic
54.2. Printing Rules 525
Ring Documentation, Release 1.2
Rule : BitShift --> Arithmetic
Rule : BitAnd --> BitShift
Rule : BitOrXOR --> BitAnd
Rule : Compare --> BitOrXOR
Rule : EqualOrNot --> Compare
Rule : LogicNot -> EqualOrNot
Rule : Expr --> LogicNot
Rule : Statement --> 'See' Expr
Line 10
Rule : Factor --> New Identifier {'.' Identifier }
Rule : Mixer --> '{' {Statement} BraceEnd
Rule : Factor --> Number
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 : Assignment -> '=' 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 --> Number
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 : Assignment -> '=' 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
54.2. Printing Rules 526
Ring Documentation, Release 1.2
Rule : Expr --> LogicNot
Rule : Statement --> Expr
Rule : Factor --> Number
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 : Assignment -> '=' 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 : BraceEnd --> '}'
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 : Assignment -> '=' 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
Line 11
Rule : Factor --> Identifier [ {Mixer} | Assignment | PlusPlus | MinusMinus]
Rule : Range --> Factor
Rule : Term --> Range
Rule : Arithmetic --> Term
Rule : BitShift --> Arithmetic
Rule : BitAnd --> BitShift
54.2. Printing Rules 527
Ring Documentation, Release 1.2
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
===================================================
54.3 Printing Intermediate Code
Command:
ring test.ring -ic -norun
Output:
54.3. Printing Intermediate Code 528
Ring Documentation, Release 1.2
===================================================
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
54.3. Printing Intermediate Code 529

More Related Content

PDF
The Ring programming language version 1.5.1 book - Part 72 of 180
PDF
The Ring programming language version 1.10 book - Part 88 of 212
PDF
The Ring programming language version 1.5.2 book - Part 73 of 181
PDF
The Ring programming language version 1.7 book - Part 80 of 196
PDF
The Ring programming language version 1.9 book - Part 87 of 210
PDF
The Ring programming language version 1.5 book - Part 13 of 31
PDF
ERC20 Token Contract
PDF
Rustlabs Quick Start
The Ring programming language version 1.5.1 book - Part 72 of 180
The Ring programming language version 1.10 book - Part 88 of 212
The Ring programming language version 1.5.2 book - Part 73 of 181
The Ring programming language version 1.7 book - Part 80 of 196
The Ring programming language version 1.9 book - Part 87 of 210
The Ring programming language version 1.5 book - Part 13 of 31
ERC20 Token Contract
Rustlabs Quick Start

What's hot (20)

PDF
The Ring programming language version 1.8 book - Part 83 of 202
PPT
Lec2&3_DataStructure
PDF
C++ L05-Functions
PDF
C++ L03-Control Structure
PDF
C++ L07-Struct
PDF
Recursion to iteration automation.
PPT
Csphtp1 21
DOC
Ds 2 cycle
PDF
c programming
PDF
Optimizer features in recent releases of other databases
ODP
Very basic functional design patterns
PPTX
Games, AI, and Research - Part 2 Training (FightingICE AI Programming)
PDF
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
PPTX
Cs1123 8 functions
PDF
Using histograms to get better performance
PDF
C++ L08-Classes Part1
PDF
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5 b...
PDF
Query Optimizer in MariaDB 10.4
PDF
Optimizer Trace Walkthrough
The Ring programming language version 1.8 book - Part 83 of 202
Lec2&3_DataStructure
C++ L05-Functions
C++ L03-Control Structure
C++ L07-Struct
Recursion to iteration automation.
Csphtp1 21
Ds 2 cycle
c programming
Optimizer features in recent releases of other databases
Very basic functional design patterns
Games, AI, and Research - Part 2 Training (FightingICE AI Programming)
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
Cs1123 8 functions
Using histograms to get better performance
C++ L08-Classes Part1
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5 b...
Query Optimizer in MariaDB 10.4
Optimizer Trace Walkthrough
Ad

Viewers also liked (20)

PDF
The Ring programming language version 1.2 book - Part 76 of 84
PDF
The Ring programming language version 1.2 book - Part 57 of 84
PDF
The Ring programming language version 1.2 book - Part 58 of 84
PDF
The Ring programming language version 1.2 book - Part 54 of 84
PDF
The Ring programming language version 1.2 book - Part 59 of 84
PDF
The Ring programming language version 1.2 book - Part 52 of 84
PDF
The Ring programming language version 1.2 book - Part 53 of 84
PDF
The Ring programming language version 1.2 book - Part 75 of 84
PDF
The Ring programming language version 1.2 book - Part 56 of 84
PDF
The Ring programming language version 1.2 book - Part 50 of 84
PDF
The Ring programming language version 1.2 book - Part 73 of 84
PDF
The Ring programming language version 1.2 book - Part 74 of 84
PDF
The Ring programming language version 1.2 book - Part 71 of 84
PDF
The Ring programming language version 1.2 book - Part 70 of 84
PDF
The Ring programming language version 1.2 book - Part 72 of 84
PDF
The Ring programming language version 1.2 book - Part 63 of 84
PDF
The Ring programming language version 1.2 book - Part 62 of 84
PDF
The Ring programming language version 1.2 book - Part 60 of 84
PDF
The Ring programming language version 1.2 book - Part 61 of 84
PDF
The Ring programming language version 1.2 book - Part 78 of 84
The Ring programming language version 1.2 book - Part 76 of 84
The Ring programming language version 1.2 book - Part 57 of 84
The Ring programming language version 1.2 book - Part 58 of 84
The Ring programming language version 1.2 book - Part 54 of 84
The Ring programming language version 1.2 book - Part 59 of 84
The Ring programming language version 1.2 book - Part 52 of 84
The Ring programming language version 1.2 book - Part 53 of 84
The Ring programming language version 1.2 book - Part 75 of 84
The Ring programming language version 1.2 book - Part 56 of 84
The Ring programming language version 1.2 book - Part 50 of 84
The Ring programming language version 1.2 book - Part 73 of 84
The Ring programming language version 1.2 book - Part 74 of 84
The Ring programming language version 1.2 book - Part 71 of 84
The Ring programming language version 1.2 book - Part 70 of 84
The Ring programming language version 1.2 book - Part 72 of 84
The Ring programming language version 1.2 book - Part 63 of 84
The Ring programming language version 1.2 book - Part 62 of 84
The Ring programming language version 1.2 book - Part 60 of 84
The Ring programming language version 1.2 book - Part 61 of 84
The Ring programming language version 1.2 book - Part 78 of 84
Ad

Similar to The Ring programming language version 1.2 book - Part 55 of 84 (20)

PDF
The Ring programming language version 1.3 book - Part 58 of 88
PDF
The Ring programming language version 1.5.4 book - Part 76 of 185
PDF
The Ring programming language version 1.6 book - Part 78 of 189
PDF
The Ring programming language version 1.4.1 book - Part 21 of 31
PDF
The Ring programming language version 1.5.3 book - Part 86 of 184
PDF
The Ring programming language version 1.5.3 book - Part 85 of 184
PDF
The Ring programming language version 1.10 book - Part 27 of 212
PDF
The Ring programming language version 1.6 book - Part 21 of 189
PDF
The Ring programming language version 1.5.4 book - Part 75 of 185
PDF
The Ring programming language version 1.3 book - Part 57 of 88
PDF
The Ring programming language version 1.2 book - Part 9 of 84
PDF
The Ring programming language version 1.5.1 book - Part 17 of 180
PDF
The Ring programming language version 1.5.3 book - Part 19 of 184
PDF
The Ring programming language version 1.9 book - Part 25 of 210
PDF
The Ring programming language version 1.5.2 book - Part 18 of 181
PDF
The Ring programming language version 1.5.4 book - Part 19 of 185
PDF
The Ring programming language version 1.3 book - Part 11 of 88
PDF
The Ring programming language version 1.7 book - Part 22 of 196
PDF
The Ring programming language version 1.8 book - Part 23 of 202
The Ring programming language version 1.3 book - Part 58 of 88
The Ring programming language version 1.5.4 book - Part 76 of 185
The Ring programming language version 1.6 book - Part 78 of 189
The Ring programming language version 1.4.1 book - Part 21 of 31
The Ring programming language version 1.5.3 book - Part 86 of 184
The Ring programming language version 1.5.3 book - Part 85 of 184
The Ring programming language version 1.10 book - Part 27 of 212
The Ring programming language version 1.6 book - Part 21 of 189
The Ring programming language version 1.5.4 book - Part 75 of 185
The Ring programming language version 1.3 book - Part 57 of 88
The Ring programming language version 1.2 book - Part 9 of 84
The Ring programming language version 1.5.1 book - Part 17 of 180
The Ring programming language version 1.5.3 book - Part 19 of 184
The Ring programming language version 1.9 book - Part 25 of 210
The Ring programming language version 1.5.2 book - Part 18 of 181
The Ring programming language version 1.5.4 book - Part 19 of 185
The Ring programming language version 1.3 book - Part 11 of 88
The Ring programming language version 1.7 book - Part 22 of 196
The Ring programming language version 1.8 book - Part 23 of 202

More from Mahmoud Samir Fayed (20)

PDF
The Ring programming language version 1.10 book - Part 212 of 212
PDF
The Ring programming language version 1.10 book - Part 211 of 212
PDF
The Ring programming language version 1.10 book - Part 210 of 212
PDF
The Ring programming language version 1.10 book - Part 208 of 212
PDF
The Ring programming language version 1.10 book - Part 207 of 212
PDF
The Ring programming language version 1.10 book - Part 205 of 212
PDF
The Ring programming language version 1.10 book - Part 206 of 212
PDF
The Ring programming language version 1.10 book - Part 204 of 212
PDF
The Ring programming language version 1.10 book - Part 203 of 212
PDF
The Ring programming language version 1.10 book - Part 202 of 212
PDF
The Ring programming language version 1.10 book - Part 201 of 212
PDF
The Ring programming language version 1.10 book - Part 200 of 212
PDF
The Ring programming language version 1.10 book - Part 199 of 212
PDF
The Ring programming language version 1.10 book - Part 198 of 212
PDF
The Ring programming language version 1.10 book - Part 197 of 212
PDF
The Ring programming language version 1.10 book - Part 196 of 212
PDF
The Ring programming language version 1.10 book - Part 195 of 212
PDF
The Ring programming language version 1.10 book - Part 194 of 212
PDF
The Ring programming language version 1.10 book - Part 193 of 212
PDF
The Ring programming language version 1.10 book - Part 192 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 210 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 205 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 203 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 200 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 197 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 194 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

Recently uploaded (20)

PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Nekopoi APK 2025 free lastest update
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
top salesforce developer skills in 2025.pdf
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
assetexplorer- product-overview - presentation
PPTX
Introduction to Artificial Intelligence
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Computer Software and OS of computer science of grade 11.pptx
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Wondershare Filmora 15 Crack With Activation Key [2025
wealthsignaloriginal-com-DS-text-... (1).pdf
Nekopoi APK 2025 free lastest update
VVF-Customer-Presentation2025-Ver1.9.pptx
top salesforce developer skills in 2025.pdf
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
assetexplorer- product-overview - presentation
Introduction to Artificial Intelligence
Softaken Excel to vCard Converter Software.pdf
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Odoo Companies in India – Driving Business Transformation.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
2025 Textile ERP Trends: SAP, Odoo & Oracle
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Design an Analysis of Algorithms II-SECS-1021-03
Computer Software and OS of computer science of grade 11.pptx

The Ring programming language version 1.2 book - Part 55 of 84

  • 1. CHAPTER FIFTYTHREE DISTRIBUTING RING APPLICATIONS In this chapter we will learn about distributing Ring applications. 53.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. 53.2 Protecting the Source Code Step 1: Execute the next command ring myapp.ring -go This will generate one object file (myapp.ringo) from the project files (*.ring) Step 2: Rename myapp.ringo to ring.ringo When you run the executable file (ring.exe) or (myapp.exe) the file ring.ringo will be executed. 520
  • 2. Ring Documentation, Release 1.2 53.3 Creating Windows Installer There are many tools that you can use to distribute your application. Check : nullsoft scriptable install system URL : http://nsis.sourceforge.net/Main_Page 53.4 Using C/C++ Compiler and Linker Another method to distribute applications is to use a C/C++ compiler. Ring can be embedded in C/C++ projects, We can create executable files using a C/C++ compiler by embedding the Ring language in our project. Check the “Embedding Ring Language in C/C++ Programs” chapter. Using this way we will avoid using ring.ring or ring.ringo files. 53.5 Distributing Applications and Games for Mobile Ring can be embedded in a Qt projects or LibSDL projects to build Mobile applications and Games. You can build the Qt project or the LibSDL project and get the Android package directly (*.apk) Check Ring distributions for Mobile development using Qt or LibSDL. 53.3. Creating Windows Installer 521
  • 3. CHAPTER FIFTYFOUR COMMAND LINE OPTIONS The ring language takes source code file (.ring) or the object file (.ringo) as input to execute, also the language provide other options like Option Description -tokens Print a list of tokens in the source code file -rules Print grammar rules applied on the tokens -ic Print the intermediate byte code (before execution) -icfinal Print the final byte code (after execution) -cgi Print http response header before error messages -norun Don’t run the program after compiling -ins Print instruction operation code before execution -performance Print clock before and after program execution -go Generate Object File -w Display Warnings 54.1 Printing Tokens Example: Func Main See "Hello World" + nl for x = 1 to 10 see x + nl next test() func test see "welcome" + nl o1 = new point { x=10 y=20 z=30 } see o1 class point x y z Command: ring test.ring -tokens -norun Output: =================================================== Tokens - Generated by the Scanner =================================================== 522
  • 4. Ring Documentation, Release 1.2 Keyword : FUNC Identifier : main EndLine Keyword : SEE Literal : Hello World Operator : + Identifier : nl EndLine Keyword : FOR Identifier : x Operator : = Number : 1 Keyword : TO Number : 10 EndLine Keyword : SEE Identifier : x Operator : + Identifier : nl EndLine Keyword : NEXT EndLine Identifier : test Operator : ( Operator : ) EndLine Keyword : FUNC Identifier : test EndLine Keyword : SEE Literal : welcome Operator : + Identifier : nl EndLine Identifier : o1 Operator : = Keyword : NEW Identifier : point Operator : { Identifier : x Operator : = Number : 10 Identifier : y Operator : = Number : 20 Identifier : z Operator : = Number : 30 Operator : } EndLine Keyword : SEE Identifier : o1 EndLine Keyword : CLASS Identifier : point Identifier : x Identifier : y Identifier : z 54.1. Printing Tokens 523
  • 5. Ring Documentation, Release 1.2 EndLine =================================================== 54.2 Printing Rules Command: ring test.ring -rules -norun Output: =================================================== Grammar Rules Used by The Parser =================================================== Rule : Program --> {Statement} Line 1 Rule : Statement --> 'Func' Identifier [ParaList] Line 2 Rule : Factor --> Literal Rule : Range --> Factor Rule : Term --> Range Rule : Arithmetic --> Term Rule : Factor --> Identifier [ {Mixer} | Assignment | PlusPlus | MinusMinus] Rule : Range --> Factor Rule : Term --> Range Rule : Arithmetic --> Term Rule : Arithmetic --> Arithmetic + Arithmetic Rule : BitShift --> Arithmetic Rule : BitAnd --> BitShift Rule : BitOrXOR --> BitAnd Rule : Compare --> BitOrXOR Rule : EqualOrNot --> Compare Rule : LogicNot -> EqualOrNot Rule : Expr --> LogicNot Rule : Statement --> 'See' Expr Line 3 Rule : Factor --> Number 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 : Factor --> Number Rule : Range --> Factor Rule : Term --> Range Rule : Arithmetic --> Term Rule : BitShift --> Arithmetic 54.2. Printing Rules 524
  • 6. Ring Documentation, Release 1.2 Rule : BitAnd --> BitShift Rule : BitOrXOR --> BitAnd Rule : Compare --> BitOrXOR Rule : EqualOrNot --> Compare Rule : LogicNot -> EqualOrNot Rule : Expr --> LogicNot Rule : Statement --> 'For' Identifier '=' Expr to Expr ['step' Expr] Line 4 Rule : Factor --> Identifier [ {Mixer} | Assignment | PlusPlus | MinusMinus] Rule : Range --> Factor Rule : Term --> Range Rule : Arithmetic --> Term Rule : Factor --> Identifier [ {Mixer} | Assignment | PlusPlus | MinusMinus] Rule : Range --> Factor Rule : Term --> Range Rule : Arithmetic --> Term Rule : Arithmetic --> Arithmetic + Arithmetic Rule : BitShift --> Arithmetic Rule : BitAnd --> BitShift Rule : BitOrXOR --> BitAnd Rule : Compare --> BitOrXOR Rule : EqualOrNot --> Compare Rule : LogicNot -> EqualOrNot Rule : Expr --> LogicNot Rule : Statement --> 'See' Expr Line 5 Rule : Next --> 'Next' Line 6 Rule : Mixer -> '(' [Expr { ',' Expr} ] ')' Line 8 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 : Statement --> 'Func' Identifier [ParaList] Line 9 Rule : Factor --> Literal Rule : Range --> Factor Rule : Term --> Range Rule : Arithmetic --> Term Rule : Factor --> Identifier [ {Mixer} | Assignment | PlusPlus | MinusMinus] Rule : Range --> Factor Rule : Term --> Range Rule : Arithmetic --> Term Rule : Arithmetic --> Arithmetic + Arithmetic 54.2. Printing Rules 525
  • 7. Ring Documentation, Release 1.2 Rule : BitShift --> Arithmetic Rule : BitAnd --> BitShift Rule : BitOrXOR --> BitAnd Rule : Compare --> BitOrXOR Rule : EqualOrNot --> Compare Rule : LogicNot -> EqualOrNot Rule : Expr --> LogicNot Rule : Statement --> 'See' Expr Line 10 Rule : Factor --> New Identifier {'.' Identifier } Rule : Mixer --> '{' {Statement} BraceEnd Rule : Factor --> Number 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 : Assignment -> '=' 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 --> Number 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 : Assignment -> '=' 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 54.2. Printing Rules 526
  • 8. Ring Documentation, Release 1.2 Rule : Expr --> LogicNot Rule : Statement --> Expr Rule : Factor --> Number 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 : Assignment -> '=' 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 : BraceEnd --> '}' 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 : Assignment -> '=' 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 Line 11 Rule : Factor --> Identifier [ {Mixer} | Assignment | PlusPlus | MinusMinus] Rule : Range --> Factor Rule : Term --> Range Rule : Arithmetic --> Term Rule : BitShift --> Arithmetic Rule : BitAnd --> BitShift 54.2. Printing Rules 527
  • 9. Ring Documentation, Release 1.2 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 =================================================== 54.3 Printing Intermediate Code Command: ring test.ring -ic -norun Output: 54.3. Printing Intermediate Code 528
  • 10. Ring Documentation, Release 1.2 =================================================== 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 54.3. Printing Intermediate Code 529