SlideShare a Scribd company logo
1 of 10
Download to read offline
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

What's hot

Cs1123 8 functions
Cs1123 8 functionsCs1123 8 functions
Cs1123 8 functions
TAlha MAlik
 

What's hot (20)

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

Viewers also liked

Viewers also liked (20)

The Ring programming language version 1.2 book - Part 76 of 84
The Ring programming language version 1.2 book - Part 76 of 84The Ring programming language version 1.2 book - Part 76 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 57 of 84The Ring programming language version 1.2 book - Part 57 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 58 of 84The Ring programming language version 1.2 book - Part 58 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 54 of 84The Ring programming language version 1.2 book - Part 54 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 59 of 84The Ring programming language version 1.2 book - Part 59 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 52 of 84The Ring programming language version 1.2 book - Part 52 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 53 of 84The Ring programming language version 1.2 book - Part 53 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 75 of 84The Ring programming language version 1.2 book - Part 75 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 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.2 book - Part 50 of 84
The Ring programming language version 1.2 book - Part 50 of 84The Ring programming language version 1.2 book - Part 50 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 73 of 84The Ring programming language version 1.2 book - Part 73 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 74 of 84The Ring programming language version 1.2 book - Part 74 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 71 of 84The Ring programming language version 1.2 book - Part 71 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 70 of 84The Ring programming language version 1.2 book - Part 70 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 72 of 84The Ring programming language version 1.2 book - Part 72 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 63 of 84The Ring programming language version 1.2 book - Part 63 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 62 of 84The Ring programming language version 1.2 book - Part 62 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 60 of 84The Ring programming language version 1.2 book - Part 60 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 61 of 84The Ring programming language version 1.2 book - Part 61 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
The Ring programming language version 1.2 book - Part 78 of 84The Ring programming language version 1.2 book - Part 78 of 84
The Ring programming language version 1.2 book - Part 78 of 84
 

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

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

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
 
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
 
The Ring programming language version 1.5.4 book - Part 76 of 185
The Ring programming language version 1.5.4 book - Part 76 of 185The Ring programming language version 1.5.4 book - Part 76 of 185
The Ring programming language version 1.5.4 book - Part 76 of 185
 
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.4 book - Part 21 of 30
The Ring programming language version 1.4 book - Part 21 of 30The Ring programming language version 1.4 book - Part 21 of 30
The Ring programming language version 1.4 book - Part 21 of 30
 
Art and Science Come Together When Mastering Relevance Ranking - Tom Burgmans...
Art and Science Come Together When Mastering Relevance Ranking - Tom Burgmans...Art and Science Come Together When Mastering Relevance Ranking - Tom Burgmans...
Art and Science Come Together When Mastering Relevance Ranking - Tom Burgmans...
 
Introduction to-mongo db-execution-plan-optimizer-final
Introduction to-mongo db-execution-plan-optimizer-finalIntroduction to-mongo db-execution-plan-optimizer-final
Introduction to-mongo db-execution-plan-optimizer-final
 
Introduction to Mongodb execution plan and optimizer
Introduction to Mongodb execution plan and optimizerIntroduction to Mongodb execution plan and optimizer
Introduction to Mongodb execution plan and optimizer
 
The Ring programming language version 1.5.2 book - Part 74 of 181
The Ring programming language version 1.5.2 book - Part 74 of 181The Ring programming language version 1.5.2 book - Part 74 of 181
The Ring programming language version 1.5.2 book - Part 74 of 181
 
The Ring programming language version 1.5.2 book - Part 75 of 181
The Ring programming language version 1.5.2 book - Part 75 of 181The Ring programming language version 1.5.2 book - Part 75 of 181
The Ring programming language version 1.5.2 book - Part 75 of 181
 
The Ring programming language version 1.9 book - Part 91 of 210
The Ring programming language version 1.9 book - Part 91 of 210The Ring programming language version 1.9 book - Part 91 of 210
The Ring programming language version 1.9 book - Part 91 of 210
 
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
 
Nagios Conference 2013 - Troy Lea - Leveraging and Understanding Performance ...
Nagios Conference 2013 - Troy Lea - Leveraging and Understanding Performance ...Nagios Conference 2013 - Troy Lea - Leveraging and Understanding Performance ...
Nagios Conference 2013 - Troy Lea - Leveraging and Understanding Performance ...
 
The Ring programming language version 1.5.1 book - Part 25 of 180
The Ring programming language version 1.5.1 book - Part 25 of 180The Ring programming language version 1.5.1 book - Part 25 of 180
The Ring programming language version 1.5.1 book - Part 25 of 180
 
Building l10n Payroll Structures from the Ground up
Building l10n Payroll Structures from the Ground upBuilding l10n Payroll Structures from the Ground up
Building l10n Payroll Structures from the Ground up
 
Proposed ISO/IEC 29150 ASN.1 Schema Corrections
Proposed ISO/IEC 29150 ASN.1 Schema CorrectionsProposed ISO/IEC 29150 ASN.1 Schema Corrections
Proposed ISO/IEC 29150 ASN.1 Schema Corrections
 
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
 
Beyond php - it's not (just) about the code
Beyond php - it's not (just) about the codeBeyond php - it's not (just) about the code
Beyond php - it's not (just) about the code
 
The Ring programming language version 1.5.4 book - Part 78 of 185
The Ring programming language version 1.5.4 book - Part 78 of 185The Ring programming language version 1.5.4 book - Part 78 of 185
The Ring programming language version 1.5.4 book - Part 78 of 185
 

More from Mahmoud 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

The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Recently uploaded (20)

%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

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