A.1. Syntax

An ECMAScript program consists of lines of ECMAScript code separated by either a new line or a semicolon. Each line represents a declaration, an assignment, a control-flow statement, or a function call. Each of these lines typically contains, amongst other things, expressions - ECMAScript “phrases” that can be evaluated.

As in most languages, there is a set of reserved words that define atomic language operations and language features. The ECMAScript reserved words are shown in Table A-1.

Table A-1. ECMAScript reserved words
abstractelseintsuper
booleanextendsinterfaceswitch
breakfalselabeledsyncronized
bytefinallongthis
casefinallynativethrow
catchfloatnewthrows
charfornulltransient
classfunctionpackagetrue
constgotoprivatetry
continueifprotectedtypeof
defaultimplementspublicvar
deleteimportreturnvoid
doinshortwhile
doubleinstanceofstaticwith

Both VoiceXML and HTML enclose ECMAScript code within the script element. When encountered by a renderer such as a browser or a VoiceXML interpreter, all ECMAScript lines existing outside of functions are executed in order. This code can reference ECMAScript functions declared within the same script element or within other script elements sharing a common namespace.

VoiceXML provides a hierarchy of namespaces: Session (read-only), Application, Document, Dialog, and Anonymous, as described in 2.4, “VoiceXML variable support. Variables declared in a parent namespace are visible to those in the child namespaces, but not vice versa.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.238.161