Get started with the JavaScript language / PDF


Get started with the JavaScript language / PDF











Get started with the JavaScript language / PDF








Sample of the PDF document 







1.1 Versions and Implementations
JavaScript version 1.0 was implemented in Netscape Navigator 2.0 and Netscape LiveWire 1.0. This specification describes JavaScript version 1.1, which was implemented in Netscape Navigator 3.0. This specification describes the language, and not the specific features of any particular implementation.

Although JavaScript was originally implemented as a scripting language supplement to HTML in Netscape Navigator and LiveWire, this specification does not prescribe any particular application; the language itself is flexible and apt for many applications.


1.2 Grammar Notation
Terminal symbols are shown in fixed width font in the productions of the lexical and syntactic grammars, and throughout this specification whenever thetext is directly referring to such a terminal symbol. These are to appear in a program exactly as written.


Nonterminal symbols are shown in italic fixed width font. The definition of a nonterminal is introduced by the name of the nonterminal followed by a colon. One or more alternative right-hand sides for the nonterminal
then follow on succeeding lines. For example, the syntactic definition: IfThenStatement:

if ( Expression ) Statement states that the nonterminal IfThenStatement represents the token if, followed
by a left parenthesis token, followed by an Expression, followed by a right parenthesis token, followed by a Statement. As another example, the syntactic definition:
ArgumentList:
Argument
ArgumentList , Argument


states that an ArgumentList may represent either a single Argument or an ArgumentList, followed by a comma, followed by an Argument. This definition of ArgumentList is recursive, that is to say, it is defined in terms of itself.

The result is that an ArgumentList may contain any positive number of arguments.

Such recursive definitions of nonterminals are common.
The subscripted suffix opt, which may appear after a terminal or nonterminal, indicates an optional symbol. The alternative containing the optional symbol actually specifies two right-hand sides, one that omits the optional element and one that includes it. So, for example:


ReturnStatement:
return Expressionopt
is an abbreviation for:
ReturnStatement:
return
return Expression
When the words "one of" follow the colon in a grammar definition, they signify
that each of the terminal symbols or tokens on the following line or lines is an
alternative definition. For example:
OctalDigit: one of
0 1 2 3 4 5 6 7
which is a convenient abbreviation for:
ZeroToThree:
0
1


The right-hand side of a lexical production may indicate that certain expansions are not permitted by using the phrase "but not" and then naming the excluded expansions, as in the productions for Identifier:.........










Download Get started with the JavaScript language / PDF











Get started with the JavaScript language / PDF








0 commentaires: