Lexical Conventions |
Active Web |
The source text of a script program is first converted into a sequence of input elements, which are statements, line terminators, comments, or white space. The source text is scanned from left to right.
White space characters are used to improve source text readability and to separate tokens (indivisible lexical units) from each other, but are otherwise insignificant. White space may occur between any two tokens, and may occur within strings (where they are considered significant characters forming part of the literal string value), but cannot appear within any other kind of token.
The following characters are considered to be white space:
\u0009 - Tab
\u000B - Vertical Tab
\u000C - Form Feed
\u0020 - Space
\u00A0 - No-break space
Like white space characters, line terminator characters are used to improve source text readability and to separate tokens (indivisible lexical units) from each other. However, unlike white space characters, line terminators have some influence over the behaviour of the syntactic grammar. In general, line terminators may occur between any two tokens, but there are a few places where they are forbidden by the syntactic grammar. A line terminator cannot occur within any token, not even a string.
The following characters are considered to be line terminators:
\u000A - Line Feed
\u000D - Carriage Return
\u2028 - Line separator
\u2029 - Paragraph separator
Comments can be either single or multi-line. Multi-line comments cannot nest.
Single line comments are identified by the // marker. Because a single-line comment can contain any character except a LineTerminator character, a single-line comment always consists of all characters from the // marker to the end of the line. However, the LineTerminator at the end of the line is not considered to be part of the single-line comment.
Multi-line comments are identified by the start marker of /* and the end marker of */.
Comments behave like white space and are discarded.
The following is a list of words which have a special meaning to the script server and so should not be used as variable names. While script keywords are case sensitive it is not good practice to use these words in another case as this can lead to unnecessary confusion.
boolean |
false |
null |
return |
continue |
for |
org |
this |
break |
function |
parseFloat |
unescape |
continue |
http |
parseInt |
value |
cookies |
if |
queryString |
var |
com |
java |
redirect |
while |
delete |
language |
request |
write |
else |
library |
response |
writeln |
escape |
list |
scriptName |
|
exit |
new |
serverName |
|
Topic ID: 150069