Keywords
Any programming language has its own set of reserved words (keywords)
that cannot be used as identifiers. For instance, the keyword ``if''
cannot be used as a variable in a C program.
OQL also has its own set of keywords.
But OQL is one part among others in
the information system: for instance, there are an Object Model,
an Object Definition Language (ODL) and Language bindings.
The Object Model does not introduce
any keyword, while ODL has its own set of keywords which are different
from the OQL keywords. For instance, a class can include an
attribute whose name is ``if'' as it is not a ODL keyword.
If one wants to access this attribute in OQL, using for instance
the path expression ``x.if'', we will get a syntax error.
This is not acceptable.
We introduce in OQL (and in ODL) a way to neutralize any keyword:
the token ``@'' used as a prefix keyword neutralizes
the keyword and makes it a valid identifier. For instance, ``x.@if'',
denotes the attribute ``if'' of the instance ``x''.
More generaly, ``@identifier'' denotes the identifier
``identifier'' whether ``identifier'' is a keyword or not.
OQL introduces the following keywords:
add |
all |
append |
array |
as |
asc |
bag |
bodyof |
break |
by |
char |
classof |
contents |
define |
delete |
desc |
distinct |
do |
element |
else |
empty |
eval |
except |
exists |
false |
float |
for |
from |
function |
group |
having |
ident |
if |
import |
in |
int |
intersect |
is |
isset |
like |
list |
mod |
new |
nil |
not |
oid |
order |
pop |
print |
push |
refof |
return |
scopeof |
select |
set |
string |
struct |
structof |
suppress |
then |
throw |
to |
true |
typeof |
union |
unset |
unval |
valof |
where |
while |
EyeDB manual