April 2002 Draft
JavaScript 2.0
Formal Description
Lexical Semantics
|
Thursday, February 7, 2002
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 98 rtf file.
The start symbols are:
NextInputElementunit 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.
«TAB»
| «VT»
| «FF»
| «SP»
| «u00A0»
«u2000»
| «u2001»
| «u2002»
| «u2003»
| «u2004»
| «u2005»
| «u2006»
| «u2007»
«u2008»
| «u2009»
| «u200A»
| «u200B»
«u3000»
_
}] IdentifierName\
}] WhiteSpace InputElementdiv]
= Lex[InputElementdiv];abstract
”, “as
”, “break
”,
“case
”, “catch
”, “class
”,
“const
”, “continue
”, “debugger
”,
“default
”, “delete
”, “do
”,
“else
”, “enum
”, “export
”,
“extends
”, “false
”, “final
”,
“finally
”, “for
”, “function
”,
“goto
”, “if
”, “implements
”,
“import
”, “in
”, “instanceof
”,
“interface
”, “is
”, “namespace
”,
“native
”, “new
”, “null
”,
“package
”, “private
”, “protected
”,
“public
”, “return
”, “static
”,
“super
”, “switch
”, “synchronized
”,
“this
”, “throw
”, “throws
”,
“transient
”, “true
”, “try
”,
“typeof
”, “use
”, “var
”,
“volatile
”, “while
”, “with
”];!
!
=
!
=
=
%
%
=
&
&
&
&
&
=
&
=
(
)
*
*
=
+
+
+
+
=
,
-
-
-
-
=
.
.
.
.
:
:
:
;
<
<
<
<
<
=
<
=
=
=
=
=
=
=
>
>
=
>
>
>
>
=
>
>
>
>
>
>
=
?
[
]
^
^
=
^
^
^
^
=
{
|
|
=
|
|
|
|
=
}
~
.
Fraction.
Fraction]
= LexNumber[DecimalIntegerLiteral] + LexNumber[Fraction];
Waldemar Horwat Last modified Thursday, February 7, 2002 |