P. 1
JavaScript Language Specification(ECMA-262)

JavaScript Language Specification(ECMA-262)

|Views: 59|Likes:
Publicado porrayaspnet
http://rayaspnet.blogspot.com/

http://rayaspnet.blogspot.com/

More info:

Published by: rayaspnet on Jun 06, 2011
Direitos Autorais:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

04/06/2012

pdf

text

original

A lexical grammar for ECMAScript is given in clause 7. This grammar has as its terminal symbols characters
(Unicode code units) that conform to the rules for SourceCharacter defined in Clause 6. It defines a set of
productions, starting from the goal symbol InputElementDiv or InputElementRegExp, that describe how
sequences of such characters are translated into a sequence of input elements.

Input elements other than white space and comments form the terminal symbols for the syntactic grammar for
ECMAScript and are called ECMAScript tokens. These tokens are the reserved words, identifiers, literals, and
punctuators of the ECMAScript language. Moreover, line terminators, although not considered to be tokens,
also become part of the stream of input elements and guide the process of automatic semicolon insertion (7.9).
Simple white space and single-line comments are discarded and do not appear in the stream of input
elements for the syntactic grammar. A MultiLineComment (that is, a comment of the form “/*…*/” regardless
of whether it spans more than one line) is likewise simply discarded if it contains no line terminator; but if a
MultiLineComment contains one or more line terminators, then it is replaced by a single line terminator, which
becomes part of the stream of input elements for the syntactic grammar.

A RegExp grammar for ECMAScript is given in 15.10. This grammar also has as its terminal symbols the
characters as defined by SourceCharacter. It defines a set of productions, starting from the goal symbol Pattern,
that describe how sequences of characters are translated into regular expression patterns.

Productions of the lexical and RegExp grammars are distinguished by having two colons “::” as separating
punctuation. The lexical and RegExp grammars share some productions.

You're Reading a Free Preview

Descarregar
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->