SlideShare uma empresa Scribd logo
1 de 10
Baixar para ler offline
Ring Documentation, Release 1.10
• exit
• for
• from
• func
• get
• give
• if
• import
• in
• load
• loadsyntax
• loop
• new
• next
• not
• off
• ok
• on
• or
• other
• package
• private
• put
• return
• see
• step
• switch
• to
• try
• while
• endfunc
• endclass
• endpackage
88.1. Language Keywords 988
Ring Documentation, Release 1.10
88.2 Language Functions
Functions Count : 208
acos() add() addattribute() adddays()
addmethod() ascii() asin() assert()
atan() atan2() attributes() binarysearch()
bytes2double() bytes2float() bytes2int() callgc()
ceil() cfunctions() char() chdir()
classes() classname() clearerr() clock()
clockspersecond() closelib() copy() cos()
cosh() currentdir() date() dec()
decimals() del() diffdays() dir()
double2bytes() eval() exefilename() exefolder()
exp() fabs() fclose() feof()
ferror() fexists() fflush() fgetc()
fgetpos() fgets() filename() find()
float2bytes() floor() fopen() fputc()
fputs() fread() freopen() fseek()
fsetpos() ftell() functions() fwrite()
getattribute() getchar() globals() hex()
hex2str() input() insert() int2bytes()
intvalue() isalnum() isalpha() isandroid()
isattribute() iscfunction() isclass() iscntrl()
isdigit() isfreebsd() isfunction() isglobal()
isgraph() islinux() islist() islocal()
islower() ismacosx() ismethod() ismsdos()
isnull() isnumber() isobject() ispackage()
ispackageclass() ispointer() isprint() isprivateattribut
isprivatemethod() ispunct() isspace() isstring()
isunix() isupper() iswindows() iswindows64()
isxdigit() left() len() lines()
list() list2str() loadlib() locals()
log() log10() lower() max()
mergemethods() methods() min() murmur3hash()
nullpointer() number() object2pointer() objectid()
packageclasses() packagename() packages() perror()
pointer2object() pow() prevfilename() ptrcmp()
raise() random() read() remove()
rename() reverse() rewind() right()
ring_give() ring_see() ring_state_delete() ring_state_findva
ring_state_init() ring_state_main() ring_state_mainfile() ring_state_new()
ring_state_newvar() ring_state_runcode() ring_state_runfile() ring_state_runobj
ring_state_setvar() ringvm_callfunc() ringvm_calllist() ringvm_cfunctions
ringvm_classeslist() ringvm_evalinscope() ringvm_fileslist() ringvm_functionsl
ringvm_give() ringvm_hideerrormsg() ringvm_info() ringvm_memorylist
ringvm_packageslist() ringvm_passerror() ringvm_scopescount() ringvm_see()
ringvm_settrace() ringvm_tracedata() ringvm_traceevent() ringvm_tracefunc(
setattribute() shutdown() sin() sinh()
sort() space() sqrt() srandom()
str2hex() str2hexcstyle() str2list() strcmp()
string() substr() swap() sysget()
system() tan() tanh() tempfile()
tempname() time() timelist() trim()
type() ungetc() unsigned() upper()
varptr() version() windowsnl() write()
88.2. Language Functions 989
Ring Documentation, Release 1.10
88.3 Compiler Errors
• Error (C1) : Error in parameters list, expected identifier
• Error (C2) : Error in class name
• Error (C3) : Unclosed control strucutre, ‘ok’ is missing
• Error (C4) : Unclosed control strucutre, ‘end’ is missing
• Error (C5) : Unclosed control strucutre, next is missing
• Error (C6) : Error in function name
• Error (C7) : Error in list items
• Error (C8) : Parentheses ‘)’ is missing
• Error (C9) : Brackets ‘]’ is missing
• Error (C10) : Error in parent class name
• Error (C11) : Error in expression operator
• Error (C12) : No class definition
• Error (C13) : Error in variable name
• Error (C14) : Try/Catch miss the Catch keyword!
• Error (C15) : Try/Catch miss the Done keyword!
• Error (C16) : Error in Switch statement expression!
• Error (C17) : Switch statement without OFF
• Error (C18) : Missing closing brace for the block opened!
• Error (C19) : Numeric Overflow!
• Error (C20) : Error in package name
• Error (C21) : Unclosed control strucutre, ‘again’ is missing
• Error (C22) : Function redefinition, function is already defined!
• Error (C23) : Using ‘(‘ after number!
• Error (C24) : The parent class name is identical to the subclass name
• Error (C25) : Trying to access the self reference after the object name
• Error (C26) : Class redefinition, class is already defined!
88.4 Runtime Errors
• Error (R1) : Cann’t divide by zero !
• Error (R2) : Array Access (Index out of range) !
• Error (R3) : Calling Function without definition !
• Error (R4) : Stack Overflow !
• Error (R5) : Can’t access the list item, Object is not list !
• Error (R6) : Variable is required
88.3. Compiler Errors 990
Ring Documentation, Release 1.10
• Error (R7) : Can’t assign to a string letter more than one character
• Error (R8) : Variable is not a string
• Error (R9) : Using exit command outside loops
• Error (R10) : Using exit command with number outside the range
• Error (R11) : Error in class name, class not found!
• Error (R12) : Error in property name, property not found!
• Error (R13) : Object is required
• Error (R14) : Calling Method without definition !
• Error (R15) : Error in parent class name, class not found!
• Error (R16) : Using braces to access unknown object !
• Error (R17) : Error, using ‘Super’ without parent class!
• Error (R18) : Numeric Overflow!
• Error (R19) : Calling function with less number of parameters!
• Error (R20) : Calling function with extra number of parameters!
• Error (R21) : Using operator with values of incorrect type
• Error (R22) : Using loop command outside loops
• Error (R23) : Using loop command with number outside the range
• Error (R24) : Using uninitialized variable
• Error (R25) : Error in package name, Package not found!
• Error (R26) : Calling private method from outside the class
• Error (R27) : Using private attribute from outside the class
• Error (R28) : Using bad data type as step value
• Error (R29) : Using bad data type in for loop
• Error (R30) : Parent class name is identical to child class name
• Error (R31) : Trying to destory the object using the self reference
• Error (R32) : The CALL command expect a variable contains string!
• Error (R33) : Bad decimals number (correct range >= 0 and <=14) !
• Error (R34) : Variable is required for the assignment operation
• Error (R35) : Can’t create/open the file!
• Error (R36) : The column number is not correct! It’s greater than the number of columns in the list
• Error (R37) : Sorry, The command is not supported in this context
• Error (R38) : Runtime Error in loading the dynamic library!
• Error (R39) : Error occurred creating unique filename
88.4. Runtime Errors 991
Ring Documentation, Release 1.10
88.5 Environment Errors
• Error (E1) : Caught SegFault
• Error (E2) : Out of Memory
• Error (E3) : Deleting scope while no scope!
• Error (E4) : Long VM Instruction!
88.6 Language Grammar
Program —> {statement}
Statement —> ‘package’ <Identifier> { ‘.’ <Identifier> } [’{‘ {statement} ‘}’] [’end’|’endpackage’]
Statement —> ‘class’ <Identifier> [ ‘from’|’:’|’<’ <Identifier> ] [’{‘ {statement} ‘}’][’end’|’endclass’]
Statement —> ‘func’|’def’ <Identifier> [ParaList] [’{‘ {statement} ‘}’][’end’|’endfunc’]
Statement —> ‘import’ <Identifier> { ‘.’ <Identifier> }
Statement —> ‘private’
Statement —> ‘load’ [’package’] <Literal>
Statement —> ‘loadsyntax’ <Literal>
Statement —> ‘changeringkeyword’ <OldKeyword> <NewKeyword>
Statement —> ‘changeringoperator’ <OldOperator> <NewOperator>
Statement —> ‘see’|’put’ <Expr>
Statement —> ‘give’|’get’ <Identifier>
Statement —> ‘if’ <Expr> [’{‘] {statement} [ {‘but’|’elseif’ <Expr> {Statement} } ] [’else’ {Statement} ]
‘ok’|’end’|’}’
Statement —> ‘Switch’ <Expr> [’{‘] { ‘on’|’case’ <Expr> {statement} } [’other’ {Statement} ] ‘off’|’end’|’}’
Statement —> ‘for’ <Identifier> ‘=’ <Expr> ‘to’ <Expr> [ ‘step’ <Expr> ] [’{‘] {Statement} ‘next’|’end’|’}’
Statement —> ‘for’ <Identifier> ‘in’ <Expr> [ ‘step’ <Expr> ] [’{‘] {statement} ‘next’|’end’|’}’
Statement —> ‘while’ <Expr> [’{‘] {statement} ‘end’|’}’
Statement —> ‘do’ {statement} ‘again’ <Expr>
Statement —> ‘try’ {statement} [’{‘] ‘catch’ {statement} ‘done’|’end’|’}’
Statement —> ‘return’ <Expr>
Statement —> ‘bye’
Statement —> ‘exit’
Statement —> ‘loop’
Statement —> <Expr>
Statement —> epslion
ParaList —> epslion
ParaList —> [’(‘] <Identifier> [{ ‘,’ <Identifier> }] [’)’]
88.5. Environment Errors 992
Ring Documentation, Release 1.10
Expr —> <LogicNot> [{ ‘and’|’or’ <LogicNot> }]
LogicNot –> [’not’] <EqualOrNot>
EqualOrNot –> [ ‘=’|’!=’ ] <Compare>
Compare —> <BitOrXor> [ { ‘<’ | ‘>’ | ‘<=’ | ‘>=’ <BitOrXor> } ]
BitOrXor —> <BitAnd> [ { ‘|’ | ‘^’ <BitAnd> } ]
BitAnd —> <BitShift> [ { ‘&’ <BitShift> } ]
BitShift —> <Arithmetic> [ { ‘<<’ | ‘>>’ <Arithmetic> } ]
Arithmetic —> <Term> [ { ‘+’ | ‘-‘ <Term> } ]
Term —> <Range> [ { ‘*’ | ‘/’ | ‘%’ <Range> } ]
Range —> <Factor> [ ‘:’ <Factor> ]
Factor —> <Identifier> [ {Mixer} ] [ ‘=’ <Expr> ]
Factor —> <Number>
Factor —> <Literal>
Factor —> ‘:’ <Identifier>
Factor —> ‘-‘ <Factor>
Factor —> ‘(‘ <Expr> ‘)’
Factor —> <List>
Factor —> ‘new’ <Identifier>
Factor —> <AnonymousFunction>
Factor —> ‘call’ <identifier> { ‘.’ <Identifier> } ‘(‘ <Parameters> ‘)’
List —> ‘[’ [ <Expr> { ‘,’ <Expr> } ] ‘]’
Mixer —> { ‘.’ <Identifier> }
Mixer —> ‘[’ <Expr> ‘]’
Mixer —> ‘(‘ [ <Expr> [ { ‘,’ <Expr> }] ] ‘)’
Mixer —> ‘{‘ {Statement} ‘}’
AnonymousFunction —> ‘func’|’def’| [<ParaList>] ‘{‘ {Statement} ‘}’
88.7 Virtual Machine (VM) Instructions
Definitions :-
• VM : Virtual Machine
• Stack : VM Stack
• IR : Instruction Register
• PC : Program Counter
• VP : Variable Pointer
• Stack[nSize] : Last Item in the Stack (Last In - First Out)
88.7. Virtual Machine (VM) Instructions 993
Ring Documentation, Release 1.10
• VV : Variable Value (We have a Pointer to a variable, And we access this variable value)
(Stack and Variables)
Operation Description
• ICO_PUSHC
Add string from the IR to the stack
• ICO_PUSHN
Add number from the IR to the stack
• ICO_PUSHV
Replace VP in the stack[nSize] with the variable value
• ICO_LOADADDRESS
Read variable name from the IR, push VP to the stack
• ICO_ASSIGNMENT
Stack[nSize-1] VV = Stack[nSize] VV , POP
Stack[nSize]
• ICO_INC
Increment Number in Stack[nSize] by 1
• ICO_LOADAPUSHV
The same as ICO_LOADADDRESS then ICO_PUSHV
• ICO_NEWLINE
Store new line number (debug info)
• ICO_FREESTACK
Remove all items from the stack , nSize = 0
• ICO_FILENAME
Store the source code file name (debug info)
• ICO_FREELOADASCOPE
Free the Scope List of the current Expression
(Jump)
Operation Description
• ICO_JUMP
Set PC to new value from the IR
• ICO_JUMPZERO
If Stack[nSize] is a number = 0 then Set PC to new value
from the IR
• ICO_JUMPFOR
End of for loop
• ICO_JUMPONE
If Stack[nSize] is a number = 1 then Set PC to new value
from the IR
• ICO_JUMPZERO2
As ICO_JUMPZERO but add 1 to the stack (required
for many ‘AND’ conditions)
• ICO_JUMPONE2
As ICO_JUMPONE but add 1 to the stack (required for
many ‘OR’ conditions)
(Compare)
88.7. Virtual Machine (VM) Instructions 994
Ring Documentation, Release 1.10
Operation Description
• ICO_LESSEQUAL
If stack[nSize-1] <= stack[nSize] , POP stack[nSize], set
Stack[nSize-1] = 1 else set Stack[nSize-1] = 0
• ICO_EQUAL
If stack[nSize-1] = stack[nSize] , POP stack[nSize], set
Stack[nSize-1] = 1 else set Stack[nSize-1] = 0
• ICO_LESS
If stack[nSize-1] < stack[nSize] , POP stack[nSize], set
Stack[nSize-1] = 1 else set Stack[nSize-1] = 0
• ICO_GREATER
If stack[nSize-1] > stack[nSize] , POP stack[nSize], set
Stack[nSize-1] = 1 else set Stack[nSize-1] = 0
• ICO_GREATEREQUAL
If stack[nSize-1] >= stack[nSize] , POP stack[nSize], set
Stack[nSize-1] = 1 else set Stack[nSize-1] = 0
• ICO_NOTEQUAL
If stack[nSize-1] != stack[nSize] , POP stack[nSize], set
Stack[nSize-1] = 1 else set Stack[nSize-1] = 0
(Math)
Operation Description
• ICO_SUM
Stack[nSize-1] = Stack[nSize-1] + Stack[nSize] , POP
stack[nSize]
• ICO_SUB
Stack[nSize-1] = Stack[nSize-1] - Stack[nSize] , POP
stack[nSize]
• ICO_MUL
Stack[nSize-1] = Stack[nSize-1] * Stack[nSize] , POP
stack[nSize]
• ICO_DIV
Stack[nSize-1] = Stack[nSize-1] / Stack[nSize] , POP
stack[nSize]
• ICO_MOD
Stack[nSize-1] = Stack[nSize-1] % Stack[nSize] , POP
stack[nSize]
• ICO_NEG
Stack[nSize] = - Stack[nSize-1]
• ICO_PLUSPLUS
Stack[nSize] = Stack[nSize] + 1
• ICO_MINUSMINUS
Stack[nSize] = Stack[nSize] - 1
(Logic)
Operation Description
• ICO_AND
Stack[nSize-1] = Stack[nSize-1] && Stack[nSize] ,
POP stack[nSize]
• ICO_OR
Stack[nSize-1] = Stack[nSize-1] || Stack[nSize] , POP
stack[nSize]
• ICO_NOT
Stack[nSize] = ! Stack[nSize]
(Lists)
88.7. Virtual Machine (VM) Instructions 995
Ring Documentation, Release 1.10
Operation Description
• ICO_LISTSTART
Start New List in Temp. Memory
• ICO_LISTITEM
Add List Item
• ICO_LISTEND
End List
• ICO_LOADINDEXADDRESS
Stack[nSize-1] = Stack[nSize-1] VV [ Stack[nSize] ] ,
POP stack[nSize]
(Functions)
Operation Description
• ICO_LOADFUNC
Find function
• ICO_CALL
Call function
• ICO_RETURN
Return from function
• ICO_RETNULL
Return NULl from function
• ICO_RETFROMEVAL
Return after eval()
• ICO_RETITEMREF
Return the list item reference - not the value
• ICO_NEWFUNC
Start new function
• ICO_BLOCKFLAG
Flag to determine where to jump later (after
ICO_RETURN)
• ICO_FUNCEXE
Start executing function
• ICO_ENDFUNCEXE
End function execution
• ICO_ANONYMOUS
Anonymous function
(User Interface)
Operation Description
• ICO_PRINT
Print value to the standard output
• ICO_GIVE
Get input from the keyboard
(End Program/Loop)
88.7. Virtual Machine (VM) Instructions 996
Ring Documentation, Release 1.10
Operation Description
• ICO_BYE
End execution of VM
• ICO_EXITMARK
Place to exit to from a loop
• ICO_POPEXITMARK
Remove exit mark
• ICO_EXIT
Break from one loop or more
• ICO_LOOP
Continue to next loop
(For Better Performance)
Operation Description
• ICO_PUSHP
Push pointer to the stack
• ICO_INCP
Increment variable value using pointer
• ICO_PUSHPV
Push value of variable using variable pointer
• ICO_INCJUMP
Increment then jump
• ICO_INCPJUMP
Increment using pointer then jump
• ICO_JUMPVARLENUM
Jump if variable value is <= numeric value
• ICO_JUMPVARPLENUM
Jump if variable value (using pointer) <= numeric value
• ICO_LOADFUNCP
Push function pointer
• ICO_PUSHPLOCAL
Push pointer to local variable
• ICO_INCLPJUMP
Increment value using pointer to local variable then
jump
• ICO_JUMPVARLPLENUM
Jump if the variable value (using pointer) <= numeric
value
• ICO_INCPJUMPSTEP1
Increment value using variable pointer then jump (for
loop step = 1)
• ICO_JUMPVARPLENUMSTEP1
Increment value using variable pointer then jump (for
loop step = 1)
(Try-Catch-Done)
88.7. Virtual Machine (VM) Instructions 997

Mais conteúdo relacionado

Mais procurados

Nik Graf - Get started with Reason and ReasonReact
Nik Graf - Get started with Reason and ReasonReactNik Graf - Get started with Reason and ReasonReact
Nik Graf - Get started with Reason and ReasonReact
OdessaJS Conf
 

Mais procurados (20)

つくってあそぼ Kotlin DSL ~拡張編~
つくってあそぼ Kotlin DSL ~拡張編~つくってあそぼ Kotlin DSL ~拡張編~
つくってあそぼ Kotlin DSL ~拡張編~
 
つくってあそぼ Kotlin DSL 第2版
つくってあそぼ Kotlin DSL 第2版つくってあそぼ Kotlin DSL 第2版
つくってあそぼ Kotlin DSL 第2版
 
Nik Graf - Get started with Reason and ReasonReact
Nik Graf - Get started with Reason and ReasonReactNik Graf - Get started with Reason and ReasonReact
Nik Graf - Get started with Reason and ReasonReact
 
To be Continued - multithreading with Project Loom and Kotlin's Coroutines
To be Continued - multithreading with Project Loom and Kotlin's CoroutinesTo be Continued - multithreading with Project Loom and Kotlin's Coroutines
To be Continued - multithreading with Project Loom and Kotlin's Coroutines
 
Perl basics for Pentesters
Perl basics for PentestersPerl basics for Pentesters
Perl basics for Pentesters
 
Schemaless Solr and the Solr Schema REST API
Schemaless Solr and the Solr Schema REST APISchemaless Solr and the Solr Schema REST API
Schemaless Solr and the Solr Schema REST API
 
The Ring programming language version 1.5.2 book - Part 44 of 181
The Ring programming language version 1.5.2 book - Part 44 of 181The Ring programming language version 1.5.2 book - Part 44 of 181
The Ring programming language version 1.5.2 book - Part 44 of 181
 
Unsung Heroes of PHP
Unsung Heroes of PHPUnsung Heroes of PHP
Unsung Heroes of PHP
 
Практическое применения Akka Streams
Практическое применения Akka StreamsПрактическое применения Akka Streams
Практическое применения Akka Streams
 
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
 
Ciąg dalszy nastąpi - o wielowątkowości, Projekcie Loom i kotlinowych Korutynach
Ciąg dalszy nastąpi - o wielowątkowości, Projekcie Loom i kotlinowych KorutynachCiąg dalszy nastąpi - o wielowątkowości, Projekcie Loom i kotlinowych Korutynach
Ciąg dalszy nastąpi - o wielowątkowości, Projekcie Loom i kotlinowych Korutynach
 
Scala 生态圈 (scala ecosystem)
Scala 生态圈 (scala ecosystem)Scala 生态圈 (scala ecosystem)
Scala 生态圈 (scala ecosystem)
 
Introduction to Clean Code
Introduction to Clean CodeIntroduction to Clean Code
Introduction to Clean Code
 
Mcs011 solved assignment by divya singh
Mcs011 solved assignment by divya singhMcs011 solved assignment by divya singh
Mcs011 solved assignment by divya singh
 
MySQLConf2009: Taking ActiveRecord to the Next Level
MySQLConf2009: Taking ActiveRecord to the Next LevelMySQLConf2009: Taking ActiveRecord to the Next Level
MySQLConf2009: Taking ActiveRecord to the Next Level
 
jQuery introduction
jQuery introductionjQuery introduction
jQuery introduction
 
Introduction to Functional Programming with Scala
Introduction to Functional Programming with ScalaIntroduction to Functional Programming with Scala
Introduction to Functional Programming with Scala
 
Introduction to type classes in 30 min
Introduction to type classes in 30 minIntroduction to type classes in 30 min
Introduction to type classes in 30 min
 
Introduction to type classes
Introduction to type classesIntroduction to type classes
Introduction to type classes
 
CREATE INDEX … USING VODKA. VODKA CONNECTING INDEXES, Олег Бартунов, Александ...
CREATE INDEX … USING VODKA. VODKA CONNECTING INDEXES, Олег Бартунов, Александ...CREATE INDEX … USING VODKA. VODKA CONNECTING INDEXES, Олег Бартунов, Александ...
CREATE INDEX … USING VODKA. VODKA CONNECTING INDEXES, Олег Бартунов, Александ...
 

Semelhante a The Ring programming language version 1.10 book - Part 103 of 212

appengine java night #1
appengine java night #1appengine java night #1
appengine java night #1
Shinichi Ogawa
 
Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)
mircodotta
 

Semelhante a The Ring programming language version 1.10 book - Part 103 of 212 (20)

The Ring programming language version 1.5.1 book - Part 176 of 180
The Ring programming language version 1.5.1 book - Part 176 of 180 The Ring programming language version 1.5.1 book - Part 176 of 180
The Ring programming language version 1.5.1 book - Part 176 of 180
 
The Ring programming language version 1.2 book - Part 80 of 84
The Ring programming language version 1.2 book - Part 80 of 84The Ring programming language version 1.2 book - Part 80 of 84
The Ring programming language version 1.2 book - Part 80 of 84
 
The Ring programming language version 1.9 book - Part 101 of 210
The Ring programming language version 1.9 book - Part 101 of 210The Ring programming language version 1.9 book - Part 101 of 210
The Ring programming language version 1.9 book - Part 101 of 210
 
The Ring programming language version 1.6 book - Part 185 of 189
The Ring programming language version 1.6 book - Part 185 of 189The Ring programming language version 1.6 book - Part 185 of 189
The Ring programming language version 1.6 book - Part 185 of 189
 
Command Liner with Scala
Command Liner with ScalaCommand Liner with Scala
Command Liner with Scala
 
appengine java night #1
appengine java night #1appengine java night #1
appengine java night #1
 
Internationalizing CakePHP Applications
Internationalizing CakePHP ApplicationsInternationalizing CakePHP Applications
Internationalizing CakePHP Applications
 
Quick swift tour
Quick swift tourQuick swift tour
Quick swift tour
 
Introduction to Swift 2
Introduction to Swift 2Introduction to Swift 2
Introduction to Swift 2
 
Swift, functional programming, and the future of Objective-C
Swift, functional programming, and the future of Objective-CSwift, functional programming, and the future of Objective-C
Swift, functional programming, and the future of Objective-C
 
pa-pe-pi-po-pure Python Text Processing
pa-pe-pi-po-pure Python Text Processingpa-pe-pi-po-pure Python Text Processing
pa-pe-pi-po-pure Python Text Processing
 
The Ring programming language version 1.4.1 book - Part 13 of 31
The Ring programming language version 1.4.1 book - Part 13 of 31The Ring programming language version 1.4.1 book - Part 13 of 31
The Ring programming language version 1.4.1 book - Part 13 of 31
 
Solr @ Etsy - Apache Lucene Eurocon
Solr @ Etsy - Apache Lucene EuroconSolr @ Etsy - Apache Lucene Eurocon
Solr @ Etsy - Apache Lucene Eurocon
 
Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)
 
Obtain better data accuracy using reference tables
Obtain better data accuracy using reference tablesObtain better data accuracy using reference tables
Obtain better data accuracy using reference tables
 
Python3
Python3Python3
Python3
 
The Ring programming language version 1.5.1 book - Part 43 of 180
The Ring programming language version 1.5.1 book - Part 43 of 180The Ring programming language version 1.5.1 book - Part 43 of 180
The Ring programming language version 1.5.1 book - Part 43 of 180
 
Algorithm and Programming (Introduction of dev pascal, data type, value, and ...
Algorithm and Programming (Introduction of dev pascal, data type, value, and ...Algorithm and Programming (Introduction of dev pascal, data type, value, and ...
Algorithm and Programming (Introduction of dev pascal, data type, value, and ...
 
Beyond java8
Beyond java8Beyond java8
Beyond java8
 
Software Craftsmanship - 2
Software Craftsmanship - 2Software Craftsmanship - 2
Software Craftsmanship - 2
 

Mais de Mahmoud Samir Fayed

Mais de 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
 

Último

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
+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
 

Último (20)

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
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
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 🔝✔️✔️
 
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
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
+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...
 
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
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
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...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
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
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 

The Ring programming language version 1.10 book - Part 103 of 212

  • 1. Ring Documentation, Release 1.10 • exit • for • from • func • get • give • if • import • in • load • loadsyntax • loop • new • next • not • off • ok • on • or • other • package • private • put • return • see • step • switch • to • try • while • endfunc • endclass • endpackage 88.1. Language Keywords 988
  • 2. Ring Documentation, Release 1.10 88.2 Language Functions Functions Count : 208 acos() add() addattribute() adddays() addmethod() ascii() asin() assert() atan() atan2() attributes() binarysearch() bytes2double() bytes2float() bytes2int() callgc() ceil() cfunctions() char() chdir() classes() classname() clearerr() clock() clockspersecond() closelib() copy() cos() cosh() currentdir() date() dec() decimals() del() diffdays() dir() double2bytes() eval() exefilename() exefolder() exp() fabs() fclose() feof() ferror() fexists() fflush() fgetc() fgetpos() fgets() filename() find() float2bytes() floor() fopen() fputc() fputs() fread() freopen() fseek() fsetpos() ftell() functions() fwrite() getattribute() getchar() globals() hex() hex2str() input() insert() int2bytes() intvalue() isalnum() isalpha() isandroid() isattribute() iscfunction() isclass() iscntrl() isdigit() isfreebsd() isfunction() isglobal() isgraph() islinux() islist() islocal() islower() ismacosx() ismethod() ismsdos() isnull() isnumber() isobject() ispackage() ispackageclass() ispointer() isprint() isprivateattribut isprivatemethod() ispunct() isspace() isstring() isunix() isupper() iswindows() iswindows64() isxdigit() left() len() lines() list() list2str() loadlib() locals() log() log10() lower() max() mergemethods() methods() min() murmur3hash() nullpointer() number() object2pointer() objectid() packageclasses() packagename() packages() perror() pointer2object() pow() prevfilename() ptrcmp() raise() random() read() remove() rename() reverse() rewind() right() ring_give() ring_see() ring_state_delete() ring_state_findva ring_state_init() ring_state_main() ring_state_mainfile() ring_state_new() ring_state_newvar() ring_state_runcode() ring_state_runfile() ring_state_runobj ring_state_setvar() ringvm_callfunc() ringvm_calllist() ringvm_cfunctions ringvm_classeslist() ringvm_evalinscope() ringvm_fileslist() ringvm_functionsl ringvm_give() ringvm_hideerrormsg() ringvm_info() ringvm_memorylist ringvm_packageslist() ringvm_passerror() ringvm_scopescount() ringvm_see() ringvm_settrace() ringvm_tracedata() ringvm_traceevent() ringvm_tracefunc( setattribute() shutdown() sin() sinh() sort() space() sqrt() srandom() str2hex() str2hexcstyle() str2list() strcmp() string() substr() swap() sysget() system() tan() tanh() tempfile() tempname() time() timelist() trim() type() ungetc() unsigned() upper() varptr() version() windowsnl() write() 88.2. Language Functions 989
  • 3. Ring Documentation, Release 1.10 88.3 Compiler Errors • Error (C1) : Error in parameters list, expected identifier • Error (C2) : Error in class name • Error (C3) : Unclosed control strucutre, ‘ok’ is missing • Error (C4) : Unclosed control strucutre, ‘end’ is missing • Error (C5) : Unclosed control strucutre, next is missing • Error (C6) : Error in function name • Error (C7) : Error in list items • Error (C8) : Parentheses ‘)’ is missing • Error (C9) : Brackets ‘]’ is missing • Error (C10) : Error in parent class name • Error (C11) : Error in expression operator • Error (C12) : No class definition • Error (C13) : Error in variable name • Error (C14) : Try/Catch miss the Catch keyword! • Error (C15) : Try/Catch miss the Done keyword! • Error (C16) : Error in Switch statement expression! • Error (C17) : Switch statement without OFF • Error (C18) : Missing closing brace for the block opened! • Error (C19) : Numeric Overflow! • Error (C20) : Error in package name • Error (C21) : Unclosed control strucutre, ‘again’ is missing • Error (C22) : Function redefinition, function is already defined! • Error (C23) : Using ‘(‘ after number! • Error (C24) : The parent class name is identical to the subclass name • Error (C25) : Trying to access the self reference after the object name • Error (C26) : Class redefinition, class is already defined! 88.4 Runtime Errors • Error (R1) : Cann’t divide by zero ! • Error (R2) : Array Access (Index out of range) ! • Error (R3) : Calling Function without definition ! • Error (R4) : Stack Overflow ! • Error (R5) : Can’t access the list item, Object is not list ! • Error (R6) : Variable is required 88.3. Compiler Errors 990
  • 4. Ring Documentation, Release 1.10 • Error (R7) : Can’t assign to a string letter more than one character • Error (R8) : Variable is not a string • Error (R9) : Using exit command outside loops • Error (R10) : Using exit command with number outside the range • Error (R11) : Error in class name, class not found! • Error (R12) : Error in property name, property not found! • Error (R13) : Object is required • Error (R14) : Calling Method without definition ! • Error (R15) : Error in parent class name, class not found! • Error (R16) : Using braces to access unknown object ! • Error (R17) : Error, using ‘Super’ without parent class! • Error (R18) : Numeric Overflow! • Error (R19) : Calling function with less number of parameters! • Error (R20) : Calling function with extra number of parameters! • Error (R21) : Using operator with values of incorrect type • Error (R22) : Using loop command outside loops • Error (R23) : Using loop command with number outside the range • Error (R24) : Using uninitialized variable • Error (R25) : Error in package name, Package not found! • Error (R26) : Calling private method from outside the class • Error (R27) : Using private attribute from outside the class • Error (R28) : Using bad data type as step value • Error (R29) : Using bad data type in for loop • Error (R30) : Parent class name is identical to child class name • Error (R31) : Trying to destory the object using the self reference • Error (R32) : The CALL command expect a variable contains string! • Error (R33) : Bad decimals number (correct range >= 0 and <=14) ! • Error (R34) : Variable is required for the assignment operation • Error (R35) : Can’t create/open the file! • Error (R36) : The column number is not correct! It’s greater than the number of columns in the list • Error (R37) : Sorry, The command is not supported in this context • Error (R38) : Runtime Error in loading the dynamic library! • Error (R39) : Error occurred creating unique filename 88.4. Runtime Errors 991
  • 5. Ring Documentation, Release 1.10 88.5 Environment Errors • Error (E1) : Caught SegFault • Error (E2) : Out of Memory • Error (E3) : Deleting scope while no scope! • Error (E4) : Long VM Instruction! 88.6 Language Grammar Program —> {statement} Statement —> ‘package’ <Identifier> { ‘.’ <Identifier> } [’{‘ {statement} ‘}’] [’end’|’endpackage’] Statement —> ‘class’ <Identifier> [ ‘from’|’:’|’<’ <Identifier> ] [’{‘ {statement} ‘}’][’end’|’endclass’] Statement —> ‘func’|’def’ <Identifier> [ParaList] [’{‘ {statement} ‘}’][’end’|’endfunc’] Statement —> ‘import’ <Identifier> { ‘.’ <Identifier> } Statement —> ‘private’ Statement —> ‘load’ [’package’] <Literal> Statement —> ‘loadsyntax’ <Literal> Statement —> ‘changeringkeyword’ <OldKeyword> <NewKeyword> Statement —> ‘changeringoperator’ <OldOperator> <NewOperator> Statement —> ‘see’|’put’ <Expr> Statement —> ‘give’|’get’ <Identifier> Statement —> ‘if’ <Expr> [’{‘] {statement} [ {‘but’|’elseif’ <Expr> {Statement} } ] [’else’ {Statement} ] ‘ok’|’end’|’}’ Statement —> ‘Switch’ <Expr> [’{‘] { ‘on’|’case’ <Expr> {statement} } [’other’ {Statement} ] ‘off’|’end’|’}’ Statement —> ‘for’ <Identifier> ‘=’ <Expr> ‘to’ <Expr> [ ‘step’ <Expr> ] [’{‘] {Statement} ‘next’|’end’|’}’ Statement —> ‘for’ <Identifier> ‘in’ <Expr> [ ‘step’ <Expr> ] [’{‘] {statement} ‘next’|’end’|’}’ Statement —> ‘while’ <Expr> [’{‘] {statement} ‘end’|’}’ Statement —> ‘do’ {statement} ‘again’ <Expr> Statement —> ‘try’ {statement} [’{‘] ‘catch’ {statement} ‘done’|’end’|’}’ Statement —> ‘return’ <Expr> Statement —> ‘bye’ Statement —> ‘exit’ Statement —> ‘loop’ Statement —> <Expr> Statement —> epslion ParaList —> epslion ParaList —> [’(‘] <Identifier> [{ ‘,’ <Identifier> }] [’)’] 88.5. Environment Errors 992
  • 6. Ring Documentation, Release 1.10 Expr —> <LogicNot> [{ ‘and’|’or’ <LogicNot> }] LogicNot –> [’not’] <EqualOrNot> EqualOrNot –> [ ‘=’|’!=’ ] <Compare> Compare —> <BitOrXor> [ { ‘<’ | ‘>’ | ‘<=’ | ‘>=’ <BitOrXor> } ] BitOrXor —> <BitAnd> [ { ‘|’ | ‘^’ <BitAnd> } ] BitAnd —> <BitShift> [ { ‘&’ <BitShift> } ] BitShift —> <Arithmetic> [ { ‘<<’ | ‘>>’ <Arithmetic> } ] Arithmetic —> <Term> [ { ‘+’ | ‘-‘ <Term> } ] Term —> <Range> [ { ‘*’ | ‘/’ | ‘%’ <Range> } ] Range —> <Factor> [ ‘:’ <Factor> ] Factor —> <Identifier> [ {Mixer} ] [ ‘=’ <Expr> ] Factor —> <Number> Factor —> <Literal> Factor —> ‘:’ <Identifier> Factor —> ‘-‘ <Factor> Factor —> ‘(‘ <Expr> ‘)’ Factor —> <List> Factor —> ‘new’ <Identifier> Factor —> <AnonymousFunction> Factor —> ‘call’ <identifier> { ‘.’ <Identifier> } ‘(‘ <Parameters> ‘)’ List —> ‘[’ [ <Expr> { ‘,’ <Expr> } ] ‘]’ Mixer —> { ‘.’ <Identifier> } Mixer —> ‘[’ <Expr> ‘]’ Mixer —> ‘(‘ [ <Expr> [ { ‘,’ <Expr> }] ] ‘)’ Mixer —> ‘{‘ {Statement} ‘}’ AnonymousFunction —> ‘func’|’def’| [<ParaList>] ‘{‘ {Statement} ‘}’ 88.7 Virtual Machine (VM) Instructions Definitions :- • VM : Virtual Machine • Stack : VM Stack • IR : Instruction Register • PC : Program Counter • VP : Variable Pointer • Stack[nSize] : Last Item in the Stack (Last In - First Out) 88.7. Virtual Machine (VM) Instructions 993
  • 7. Ring Documentation, Release 1.10 • VV : Variable Value (We have a Pointer to a variable, And we access this variable value) (Stack and Variables) Operation Description • ICO_PUSHC Add string from the IR to the stack • ICO_PUSHN Add number from the IR to the stack • ICO_PUSHV Replace VP in the stack[nSize] with the variable value • ICO_LOADADDRESS Read variable name from the IR, push VP to the stack • ICO_ASSIGNMENT Stack[nSize-1] VV = Stack[nSize] VV , POP Stack[nSize] • ICO_INC Increment Number in Stack[nSize] by 1 • ICO_LOADAPUSHV The same as ICO_LOADADDRESS then ICO_PUSHV • ICO_NEWLINE Store new line number (debug info) • ICO_FREESTACK Remove all items from the stack , nSize = 0 • ICO_FILENAME Store the source code file name (debug info) • ICO_FREELOADASCOPE Free the Scope List of the current Expression (Jump) Operation Description • ICO_JUMP Set PC to new value from the IR • ICO_JUMPZERO If Stack[nSize] is a number = 0 then Set PC to new value from the IR • ICO_JUMPFOR End of for loop • ICO_JUMPONE If Stack[nSize] is a number = 1 then Set PC to new value from the IR • ICO_JUMPZERO2 As ICO_JUMPZERO but add 1 to the stack (required for many ‘AND’ conditions) • ICO_JUMPONE2 As ICO_JUMPONE but add 1 to the stack (required for many ‘OR’ conditions) (Compare) 88.7. Virtual Machine (VM) Instructions 994
  • 8. Ring Documentation, Release 1.10 Operation Description • ICO_LESSEQUAL If stack[nSize-1] <= stack[nSize] , POP stack[nSize], set Stack[nSize-1] = 1 else set Stack[nSize-1] = 0 • ICO_EQUAL If stack[nSize-1] = stack[nSize] , POP stack[nSize], set Stack[nSize-1] = 1 else set Stack[nSize-1] = 0 • ICO_LESS If stack[nSize-1] < stack[nSize] , POP stack[nSize], set Stack[nSize-1] = 1 else set Stack[nSize-1] = 0 • ICO_GREATER If stack[nSize-1] > stack[nSize] , POP stack[nSize], set Stack[nSize-1] = 1 else set Stack[nSize-1] = 0 • ICO_GREATEREQUAL If stack[nSize-1] >= stack[nSize] , POP stack[nSize], set Stack[nSize-1] = 1 else set Stack[nSize-1] = 0 • ICO_NOTEQUAL If stack[nSize-1] != stack[nSize] , POP stack[nSize], set Stack[nSize-1] = 1 else set Stack[nSize-1] = 0 (Math) Operation Description • ICO_SUM Stack[nSize-1] = Stack[nSize-1] + Stack[nSize] , POP stack[nSize] • ICO_SUB Stack[nSize-1] = Stack[nSize-1] - Stack[nSize] , POP stack[nSize] • ICO_MUL Stack[nSize-1] = Stack[nSize-1] * Stack[nSize] , POP stack[nSize] • ICO_DIV Stack[nSize-1] = Stack[nSize-1] / Stack[nSize] , POP stack[nSize] • ICO_MOD Stack[nSize-1] = Stack[nSize-1] % Stack[nSize] , POP stack[nSize] • ICO_NEG Stack[nSize] = - Stack[nSize-1] • ICO_PLUSPLUS Stack[nSize] = Stack[nSize] + 1 • ICO_MINUSMINUS Stack[nSize] = Stack[nSize] - 1 (Logic) Operation Description • ICO_AND Stack[nSize-1] = Stack[nSize-1] && Stack[nSize] , POP stack[nSize] • ICO_OR Stack[nSize-1] = Stack[nSize-1] || Stack[nSize] , POP stack[nSize] • ICO_NOT Stack[nSize] = ! Stack[nSize] (Lists) 88.7. Virtual Machine (VM) Instructions 995
  • 9. Ring Documentation, Release 1.10 Operation Description • ICO_LISTSTART Start New List in Temp. Memory • ICO_LISTITEM Add List Item • ICO_LISTEND End List • ICO_LOADINDEXADDRESS Stack[nSize-1] = Stack[nSize-1] VV [ Stack[nSize] ] , POP stack[nSize] (Functions) Operation Description • ICO_LOADFUNC Find function • ICO_CALL Call function • ICO_RETURN Return from function • ICO_RETNULL Return NULl from function • ICO_RETFROMEVAL Return after eval() • ICO_RETITEMREF Return the list item reference - not the value • ICO_NEWFUNC Start new function • ICO_BLOCKFLAG Flag to determine where to jump later (after ICO_RETURN) • ICO_FUNCEXE Start executing function • ICO_ENDFUNCEXE End function execution • ICO_ANONYMOUS Anonymous function (User Interface) Operation Description • ICO_PRINT Print value to the standard output • ICO_GIVE Get input from the keyboard (End Program/Loop) 88.7. Virtual Machine (VM) Instructions 996
  • 10. Ring Documentation, Release 1.10 Operation Description • ICO_BYE End execution of VM • ICO_EXITMARK Place to exit to from a loop • ICO_POPEXITMARK Remove exit mark • ICO_EXIT Break from one loop or more • ICO_LOOP Continue to next loop (For Better Performance) Operation Description • ICO_PUSHP Push pointer to the stack • ICO_INCP Increment variable value using pointer • ICO_PUSHPV Push value of variable using variable pointer • ICO_INCJUMP Increment then jump • ICO_INCPJUMP Increment using pointer then jump • ICO_JUMPVARLENUM Jump if variable value is <= numeric value • ICO_JUMPVARPLENUM Jump if variable value (using pointer) <= numeric value • ICO_LOADFUNCP Push function pointer • ICO_PUSHPLOCAL Push pointer to local variable • ICO_INCLPJUMP Increment value using pointer to local variable then jump • ICO_JUMPVARLPLENUM Jump if the variable value (using pointer) <= numeric value • ICO_INCPJUMPSTEP1 Increment value using variable pointer then jump (for loop step = 1) • ICO_JUMPVARPLENUMSTEP1 Increment value using variable pointer then jump (for loop step = 1) (Try-Catch-Done) 88.7. Virtual Machine (VM) Instructions 997