Subsections
Terminal Atom Syntax
To express the syntax of terminal atoms, we use the standard
regular expression notation.
Integer Atom
Integers are coded on 64 bits.
The syntax for the integer type is one of the followings:
[0-9]+ decimal base
0x[0-9a-fA-F]+ hexadecimal
0[0-7]+ octal
The domain for the integer type is as follows:
Minimal Value |
Maximal Value |
-9223372036854775808 |
9223372036854775807 |
A few examples:
13940 // integer expressed in the decimal base
0x273f1 // integer expressed in the hexadecimal base
0x273F1 // integer expressed in the hexadecimal base
0100 // integer expressed in the octal base
Float Atom
The syntax for floating point atoms is one of the following regular
expressions:
[0-9]+\.[0-9]+?
[0-9]+?\.[0-9]+
[0-9]+\.[0-9]+?(e|E)[+-]?[0-9]+([fF]|[lL])?
[0-9]+?\.[0-9]+(e|E)[+-]?[0-9]+([fF]|[lL])?
The domain for the float type is as follows:
Minimal Value |
Maximal Value |
4.94065645841246544e-324 |
1.79769313486231570e+308 |
A few examples:
1.
1.23
.3
0.3039
1e+10
2.e+112
1.2e-100
.234e-200
.234e-200f
.234e-200F
String Atom
The syntax for the string type is as follows:
\"([^"]|\\\")*\"
The following escape sequences are interpreted:
Escape Sequence
|
Name
|
ASCII Name
|
\a |
alert |
BEL |
\b |
backspace |
BS |
\f |
form feed |
FF |
\n |
newline |
NL (LF) |
\r |
carriage return |
CR |
\t |
horizontal tab |
HT |
\v |
vertical tab |
VT |
\\ |
backslash |
\ |
\" |
double quote |
" |
\' |
single quote |
' |
\ooo |
octal number |
\ooo |
A few examples:
"hello"
"hello \"world\""
"this is a multi-lines\ntext\n"
"this text contains escape sequences: \007\v\f\n''
Char Atom
The syntax for the char type is one of the followings:
'ascii character'
'\[0-7+]'
'\(x|X)[0-9a-fA-F+]'
'\a'
'\b'
'\f'
'\n'
'\r'
'\t'
'\v'
A few examples:
'a'
'b'
'\n'
'\a'
'\007'
'\x50'
'\x5F'
Boolean Atom
The syntax for a boolean atom is one of the followings:
true
false
Identifier Atom
The syntax for an identifier atom is as follows:
[a-zA-Z\$_#][a-zA-Z\$_0-9#]*
This means that an identifier must start whith a letter, a ``_'',
a ``$'' or a ``#'' which may be followed by letters, digits,
``_'', ``$'' and ``#'' characters.
For instance, the following words are some valid identifiers:
a
alpha
beta1
alpha_beta
$a
oql$maxint
oql#2
$
#
_1
Note that identifiers beginning by oql$ or oql# are
reserved for special used by the interpreter.
Oid Atom
The syntax for an oid is as following:
[0-9]+:[0-9]+:[0-9]+:oid
Note that oid atoms are not typed directly by the user, but are produced
by the database via the OQL interpreter.
The following words are some syntaxically valid atom oids:
123.2.33373:oid
82727272.1.292828282:oid
Object Atom
The syntax for an atom object is as following:
[0-9a-fA-F]+:obj
Note that object atoms are not typed directly by the user, but are produced
by OQL interpreter.
The following words are some syntaxically valid atom objects:
38383:obj
ea954:obj
Null Atom
The null atom denotes an unitialized value. Its type depends on the context.
It can denote a unitialized integer, float, char, string or oid.
The syntax for a null atom is one of the followings:
null
NULL
Nil Atom
The nil atom denotes the empty atom.
The syntax for a nil atom is as follows:
nil
EyeDB manual