ECMAScript 4 Netscape Proposal
Formal Description
Lexical Semantics
|
Monday, June 30, 2003
The lexical semantics describe the actions the lexer takes in order to transform an input stream of Unicode characters into a stream of tokens. For convenience, the lexical grammar is repeated here. See also the description of the semantic notation.
This document is also available as a Word RTF file.
The lexer’s start symbols are:
NextInputElementnum if the
previous input element was a number;
NextInputElementre if the
previous input element was not a number and a /
should be interpreted as a regular expression; and
NextInputElementdiv if the
previous input element was not a number and a /
should be interpreted as a division or division-assignment
operator.
In addition to the above, the start symbol
StringNumericLiteral is used by the syntactic semantics for
string-to-number conversions and the start symbol
StringDecimalLiteral is used by the syntactic semantics for
implementing the parseFloat
function.
«TAB»
| «VT»
| «FF»
| «SP»
| «u00A0»
«u2000»
| «u2001»
| «u2002»
| «u2003»
| «u2004»
| «u2005»
| «u2006»
| «u2007»
«u2008»
| «u2009»
| «u200A»
| «u200B»
«u3000»
\
}] WhiteSpace InputElementdiv]
= Lex[InputElementdiv];abstract
”, “as
”, “break
”,
“case
”, “catch
”, “class
”,
“const
”, “continue
”, “debugger
”,
“default
”, “delete
”, “do
”,
“else
”, “enum
”, “export
”,
“extends
”, “false
”, “finally
”,
“for
”, “function
”, “get
”,
“goto
”, “if
”, “implements
”,
“import
”, “in
”, “instanceof
”,
“interface
”, “is
”, “namespace
”,
“native
”, “new
”, “null
”,
“package
”, “private
”, “protected
”,
“public
”, “return
”, “set
”,
“super
”, “switch
”, “synchronized
”,
“this
”, “throw
”, “throws
”,
“transient
”, “true
”, “try
”,
“typeof
”, “use
”, “var
”,
“volatile
”, “while
”,
“with
”} and
not ContainsEscapes[IdentifierName] then!
!
=
!
=
=
%
%
=
&
&
&
&
&
=
&
=
(
)
*
*
=
+
+
+
+
=
,
-
-
-
-
=
.
.
.
.
:
:
:
;
<
<
<
<
<
=
<
=
=
=
=
=
=
=
>
>
=
>
>
>
>
=
>
>
>
>
>
>
=
?
[
]
^
^
=
^
^
^
^
=
{
|
|
=
|
|
|
|
=
}
~
.
FractionN
a
N
Waldemar Horwat Last modified Monday, June 30, 2003 |