SlideShare a Scribd company logo
Ring Documentation, Release 1.5.3
x = 1 / 0
catch
see "catching error" + nl
}
Output:
if statement..
one
for loop..
12345678910
switch...
one
try catch...
catching error
62.11 Using ‘put’ and ‘get’ as ‘see’ and ‘give’
We can replace the ‘see’ keyword with the ‘put’ keyword.
Also we can replacew the ‘give’ keyword with the ‘get’ keyword.
Example:
put "Hello World" + nl
put "Enter Your Name ? " Get Name
Put "Hello " + Name
62.12 Using ‘case’ as ‘on’ in switch statements
We can replace the ‘on’ keyword with ‘case’ keyword in the switch statement.
Example (1) :
for x=1 to 10
switch x
case 1 put "one" + nl
case 2 put "two" + nl
case 3 put "thre" + nl
else put "else" + nl
end
end
Example (2) :
for x=1 to 10 {
switch x {
case 1 put "one" + nl
case 2 put "two" + nl
case 3 put "thre" + nl
else put "else" + nl
}
}
62.11. Using ‘put’ and ‘get’ as ‘see’ and ‘give’ 715
Ring Documentation, Release 1.5.3
62.13 Using ‘def’ as ‘func’ in functions/methods definition
We can use the ‘def’ keyword as the ‘func’ keyword to define functions and methods.
Example:
one() two()
def one put "one" + nl
def two put "two" + nl
62.14 Using braces { } in Packages/Classes/Functions
Example:
load "stdlib.ring"
import mypackage
new myclass {
myfunc()
}
package mypackage
{
class myclass
{
func myfunc
{
print("Hello, World!n")
}
}
}
62.15 Using ‘end’ keyword after Packages/Classes/Functions
Example:
import mypackage
new myclass {
myfunc()
}
package mypackage
class myclass
def myfunc
put "Hello, World!"
end
end
end
62.13. Using ‘def’ as ‘func’ in functions/methods definition 716
Ring Documentation, Release 1.5.3
62.16 Using ‘endpackage’/’endclass’/’endfunc’ keywords after Pack-
ages/Classes/Functions
Example:
import mypackage
new myclass { myfunc() }
package mypackage
class myclass
func myfunc
see "welcome" + nl
endfunc
endclass
endpackage
62.16. Using ‘endpackage’/’endclass’/’endfunc’ keywords after Packages/Classes/Functions 717
CHAPTER
SIXTYTHREE
INTRODUCTION TO THE TYPE HINTS LIBRARY
In this chapter we will learn about the Type Hints Library
63.1 Why Type Hints?
Using this library we can add the type information to the source code which will be very useful for tools like
• Code Editors
• Static-Analysis
Note: Ring is a dynamic language, No type checking will be done by the compiler.
63.2 Example
The next example will use the Type Hints library
load "typehints.ring"
see sum(3,4) + nl ;
see sayHello("Mahmoud");
int func sum(int x,int y) {
return x+y ;
}
string func sayHello(string name) {
return "Hello " + name ;
}
63.3 User Types
The Type Hints library is very powerful and will support user types (Classes) automatically
Example:
load "typehints.ring"
import mypackage
718
Ring Documentation, Release 1.5.3
test() { main([:one,:two,:three]) }
myclass func test() {
see "Testing User Types!" + nl
return new myclass
}
package mypackage {
public class myclass {
public static void func main(list args) {
see "welcome" + nl
see args
}
}
}
63.4 Using Types inside Code
Also you can use the types inside the code (not only the function prototype)
Example:
load "typehints.ring"
int sum = sum(3,4)
string msg = sayHello("Mahmoud")
see "Sum = " + sum + nl + msg + nl
int func sum(int x,int y) {
return x+y ;
}
string func sayHello(string name) {
return "Hello " + name ;
}
63.5 Rules
• To use the types in the function prototype you must use ‘(‘ and ‘)’ around parameters
• To use the types in the function code, You must set the variable value (Assignment).
The next types are defined by the library
# Low Level Types
char
unsigned
signed
int
short
long
float
63.4. Using Types inside Code 719
Ring Documentation, Release 1.5.3
double
void
# High Level Types
string
list
number
object
# Other
public
static
abstract
protected
override
63.5. Rules 720
CHAPTER
SIXTYFOUR
DISTRIBUTING RING APPLICATIONS
In this chapter we will learn about distributing Ring applications.
64.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.
64.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.
721
Ring Documentation, Release 1.5.3
64.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
64.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.
64.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.
64.3. Creating Windows Installer 722
CHAPTER
SIXTYFIVE
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
65.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
===================================================
723
Ring Documentation, Release 1.5.3
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
65.1. Printing Tokens 724

More Related Content

PDF
The Ring programming language version 1.5.4 book - Part 75 of 185
PDF
The Ring programming language version 1.3 book - Part 7 of 88
PDF
The Ring programming language version 1.10 book - Part 102 of 212
PDF
The Ring programming language version 1.6 book - Part 77 of 189
PDF
The Ring programming language version 1.6 book - Part 7 of 189
PDF
The Ring programming language version 1.7 book - Part 7 of 196
PDF
Spock Testing Framework - The Next Generation
PDF
.NET Multithreading and File I/O
The Ring programming language version 1.5.4 book - Part 75 of 185
The Ring programming language version 1.3 book - Part 7 of 88
The Ring programming language version 1.10 book - Part 102 of 212
The Ring programming language version 1.6 book - Part 77 of 189
The Ring programming language version 1.6 book - Part 7 of 189
The Ring programming language version 1.7 book - Part 7 of 196
Spock Testing Framework - The Next Generation
.NET Multithreading and File I/O

What's hot (20)

PPTX
Smarter Testing with Spock
PDF
Spock framework
PPTX
Unit Testing with Foq
PPTX
Ian 2014.10.24 weekly report
PDF
The Ring programming language version 1.5.3 book - Part 189 of 194
PPTX
Smarter Testing With Spock
DOCX
Java programming lab_manual_by_rohit_jaiswar
PDF
Advanced Java Practical File
PDF
Grails/Groovyによる開発事例紹介
PDF
Spock Framework
PDF
Java Concurrency Idioms
PDF
The Ring programming language version 1.7 book - Part 92 of 196
PDF
Java Lab Manual
PDF
The Ring programming language version 1.10 book - Part 59 of 212
PDF
The Ring programming language version 1.7 book - Part 91 of 196
PDF
The Ring programming language version 1.5.2 book - Part 72 of 181
PPT
JDBC Core Concept
PPS
CS101- Introduction to Computing- Lecture 26
PPT
POLITEKNIK MALAYSIA
PDF
The Ring programming language version 1.9 book - Part 99 of 210
Smarter Testing with Spock
Spock framework
Unit Testing with Foq
Ian 2014.10.24 weekly report
The Ring programming language version 1.5.3 book - Part 189 of 194
Smarter Testing With Spock
Java programming lab_manual_by_rohit_jaiswar
Advanced Java Practical File
Grails/Groovyによる開発事例紹介
Spock Framework
Java Concurrency Idioms
The Ring programming language version 1.7 book - Part 92 of 196
Java Lab Manual
The Ring programming language version 1.10 book - Part 59 of 212
The Ring programming language version 1.7 book - Part 91 of 196
The Ring programming language version 1.5.2 book - Part 72 of 181
JDBC Core Concept
CS101- Introduction to Computing- Lecture 26
POLITEKNIK MALAYSIA
The Ring programming language version 1.9 book - Part 99 of 210
Ad

Similar to The Ring programming language version 1.5.3 book - Part 85 of 184 (20)

PDF
The Ring programming language version 1.8 book - Part 82 of 202
PDF
The Ring programming language version 1.5.1 book - Part 71 of 180
PDF
The Ring programming language version 1.6 book - Part 79 of 189
PDF
The Ring programming language version 1.10 book - Part 7 of 212
PDF
The Ring programming language version 1.9 book - Part 86 of 210
PDF
The Ring programming language version 1.6 book - Part 16 of 189
PDF
The Ring programming language version 1.10 book - Part 90 of 212
PDF
The Ring programming language version 1.5.1 book - Part 13 of 180
PDF
The Ring programming language version 1.7 book - Part 17 of 196
PDF
The Ring programming language version 1.5.2 book - Part 14 of 181
PDF
The Ring programming language version 1.5.1 book - Part 5 of 180
PDF
The Ring programming language version 1.5.2 book - Part 6 of 181
PDF
The Ring programming language version 1.5.4 book - Part 6 of 185
PDF
The Ring programming language version 1.5.3 book - Part 6 of 184
PDF
The Ring programming language version 1.8 book - Part 7 of 202
PDF
The Ring programming language version 1.5 book - Part 3 of 31
PDF
The Ring programming language version 1.9 book - Part 7 of 210
PDF
The Ring programming language version 1.2 book - Part 7 of 84
PDF
The Ring programming language version 1.2 book - Part 4 of 84
PDF
The Ring programming language version 1.5.2 book - Part 178 of 181
The Ring programming language version 1.8 book - Part 82 of 202
The Ring programming language version 1.5.1 book - Part 71 of 180
The Ring programming language version 1.6 book - Part 79 of 189
The Ring programming language version 1.10 book - Part 7 of 212
The Ring programming language version 1.9 book - Part 86 of 210
The Ring programming language version 1.6 book - Part 16 of 189
The Ring programming language version 1.10 book - Part 90 of 212
The Ring programming language version 1.5.1 book - Part 13 of 180
The Ring programming language version 1.7 book - Part 17 of 196
The Ring programming language version 1.5.2 book - Part 14 of 181
The Ring programming language version 1.5.1 book - Part 5 of 180
The Ring programming language version 1.5.2 book - Part 6 of 181
The Ring programming language version 1.5.4 book - Part 6 of 185
The Ring programming language version 1.5.3 book - Part 6 of 184
The Ring programming language version 1.8 book - Part 7 of 202
The Ring programming language version 1.5 book - Part 3 of 31
The Ring programming language version 1.9 book - Part 7 of 210
The Ring programming language version 1.2 book - Part 7 of 84
The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.5.2 book - Part 178 of 181
Ad

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)

PPTX
Spectroscopy.pptx food analysis technology
PDF
Machine learning based COVID-19 study performance prediction
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Encapsulation theory and applications.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
KodekX | Application Modernization Development
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Cloud computing and distributed systems.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Approach and Philosophy of On baking technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPT
Teaching material agriculture food technology
Spectroscopy.pptx food analysis technology
Machine learning based COVID-19 study performance prediction
MYSQL Presentation for SQL database connectivity
Encapsulation theory and applications.pdf
Programs and apps: productivity, graphics, security and other tools
NewMind AI Weekly Chronicles - August'25 Week I
KodekX | Application Modernization Development
20250228 LYD VKU AI Blended-Learning.pptx
Encapsulation_ Review paper, used for researhc scholars
Cloud computing and distributed systems.
Advanced methodologies resolving dimensionality complications for autism neur...
Digital-Transformation-Roadmap-for-Companies.pptx
The AUB Centre for AI in Media Proposal.docx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Per capita expenditure prediction using model stacking based on satellite ima...
Approach and Philosophy of On baking technology
Network Security Unit 5.pdf for BCA BBA.
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Teaching material agriculture food technology

The Ring programming language version 1.5.3 book - Part 85 of 184

  • 1. Ring Documentation, Release 1.5.3 x = 1 / 0 catch see "catching error" + nl } Output: if statement.. one for loop.. 12345678910 switch... one try catch... catching error 62.11 Using ‘put’ and ‘get’ as ‘see’ and ‘give’ We can replace the ‘see’ keyword with the ‘put’ keyword. Also we can replacew the ‘give’ keyword with the ‘get’ keyword. Example: put "Hello World" + nl put "Enter Your Name ? " Get Name Put "Hello " + Name 62.12 Using ‘case’ as ‘on’ in switch statements We can replace the ‘on’ keyword with ‘case’ keyword in the switch statement. Example (1) : for x=1 to 10 switch x case 1 put "one" + nl case 2 put "two" + nl case 3 put "thre" + nl else put "else" + nl end end Example (2) : for x=1 to 10 { switch x { case 1 put "one" + nl case 2 put "two" + nl case 3 put "thre" + nl else put "else" + nl } } 62.11. Using ‘put’ and ‘get’ as ‘see’ and ‘give’ 715
  • 2. Ring Documentation, Release 1.5.3 62.13 Using ‘def’ as ‘func’ in functions/methods definition We can use the ‘def’ keyword as the ‘func’ keyword to define functions and methods. Example: one() two() def one put "one" + nl def two put "two" + nl 62.14 Using braces { } in Packages/Classes/Functions Example: load "stdlib.ring" import mypackage new myclass { myfunc() } package mypackage { class myclass { func myfunc { print("Hello, World!n") } } } 62.15 Using ‘end’ keyword after Packages/Classes/Functions Example: import mypackage new myclass { myfunc() } package mypackage class myclass def myfunc put "Hello, World!" end end end 62.13. Using ‘def’ as ‘func’ in functions/methods definition 716
  • 3. Ring Documentation, Release 1.5.3 62.16 Using ‘endpackage’/’endclass’/’endfunc’ keywords after Pack- ages/Classes/Functions Example: import mypackage new myclass { myfunc() } package mypackage class myclass func myfunc see "welcome" + nl endfunc endclass endpackage 62.16. Using ‘endpackage’/’endclass’/’endfunc’ keywords after Packages/Classes/Functions 717
  • 4. CHAPTER SIXTYTHREE INTRODUCTION TO THE TYPE HINTS LIBRARY In this chapter we will learn about the Type Hints Library 63.1 Why Type Hints? Using this library we can add the type information to the source code which will be very useful for tools like • Code Editors • Static-Analysis Note: Ring is a dynamic language, No type checking will be done by the compiler. 63.2 Example The next example will use the Type Hints library load "typehints.ring" see sum(3,4) + nl ; see sayHello("Mahmoud"); int func sum(int x,int y) { return x+y ; } string func sayHello(string name) { return "Hello " + name ; } 63.3 User Types The Type Hints library is very powerful and will support user types (Classes) automatically Example: load "typehints.ring" import mypackage 718
  • 5. Ring Documentation, Release 1.5.3 test() { main([:one,:two,:three]) } myclass func test() { see "Testing User Types!" + nl return new myclass } package mypackage { public class myclass { public static void func main(list args) { see "welcome" + nl see args } } } 63.4 Using Types inside Code Also you can use the types inside the code (not only the function prototype) Example: load "typehints.ring" int sum = sum(3,4) string msg = sayHello("Mahmoud") see "Sum = " + sum + nl + msg + nl int func sum(int x,int y) { return x+y ; } string func sayHello(string name) { return "Hello " + name ; } 63.5 Rules • To use the types in the function prototype you must use ‘(‘ and ‘)’ around parameters • To use the types in the function code, You must set the variable value (Assignment). The next types are defined by the library # Low Level Types char unsigned signed int short long float 63.4. Using Types inside Code 719
  • 6. Ring Documentation, Release 1.5.3 double void # High Level Types string list number object # Other public static abstract protected override 63.5. Rules 720
  • 7. CHAPTER SIXTYFOUR DISTRIBUTING RING APPLICATIONS In this chapter we will learn about distributing Ring applications. 64.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. 64.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. 721
  • 8. Ring Documentation, Release 1.5.3 64.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 64.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. 64.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. 64.3. Creating Windows Installer 722
  • 9. CHAPTER SIXTYFIVE 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 65.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 =================================================== 723
  • 10. Ring Documentation, Release 1.5.3 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 65.1. Printing Tokens 724