Home > AngelScript Overview



AngelScript

This is a short overview documentation for the AngelScript scripting language inside SimplexNumerica.

AngelScript is a scripting language with a syntax that's very similar to C++. It is a strictly typed language with many of the types being the same as in C++. This part of the documentation will explain some concepts of how to use AngelScript in general, but a basic knowledge of the language will be needed to understand all of the concepts.

Please have a look to the AngelScript web page at:  www.AngelCode.com/AngelScript
AngelScript is made by Andreas Jönsson

Please navigate to the content:


I. Globals

II. Statements

III. Expressions

IV. Data Types

V. Object Handles

VI. Script Classes

VII. Operator Precedence
In expressions, the operator with the highest precedence is always computed first.

Unary operators

Unary operators have the higher precedence than other operators, and between unary operators the operator closest to the actual value has the highest precedence. Post-operators have higher precedence than pre-operators.

This list shows the available unary operators.

:: scope resolution operator
[] indexing operator
++ -- post increment and decrement
. member access
++ -- pre increment and decrement
not ! logical not
+ - unary positive and negative
~ bitwise complement
@ handle of

Binary and ternary operators

This list shows the dual and ternary operator precedence in decreasing order.

* / % multiply, divide, and modulo
+ - add and subtract
<< >> >>> left shift, right shift, and arithmetic right shift
& bitwise and
^ bitwise xor
| bitwise or
<= < >= > comparison
== != is !is xor ^^ equality, identity, and logical exclusive or
and && logical and
or || logical or
?: condition
= += -= *= /= = &=
|= ^= <<= >>= >>>=
assignment and compound assignments

IX. Reserved Keywords and Tokens
These are the keywords that are reserved by the language, i.e. they can't be used by any script defined identifiers. Remember that the host application may reserve additional keywords that are specific to that application.

and
bool
break
case
cast
class
const
continue
default
do
double
else
enum
false
float
for
from*
if
import
in
inout
int
interface
int8
int16
int32
int64
is
not
null
or
out
return
super*
switch
this*
true
typedef
uint
uint8
uint16
uint32
uint64
void
while
xor

* Not really a reserved keyword, but is recognized by the compiler as a built-in keyword.

These are the non-alphabetical tokens that are also used in the language syntax.

*
/
%
+
-
<=
<
>=
>
(
)
==
!=
?
:
=
+=
-=
=
/=
=
++
--
&
,
{
}
;
|
^
~
<<
>>
>>>
&=
|=
^=
<<=
>>=
>>>=
.
&&
||
!
[
]
^^
@ 
!is
::

Other than the above tokens there are also numerical, string, identifier, and comment tokens.

123456789
123.123e123
123.123e123f
0x1234FEDC
'abc'
"abc"
"""heredoc"""
_Abc123
//
/*
*/

The characters space (32), tab (9), carriage return (13), line feed (10), and the UTF8 byte-order-mark (U+FEFF) are all recognized as whitespace.


Back to index
SimplexNumerica © Dipl.-Phys.-Ing. Ralf Wirtz - www.SimplexNumerica.com