July 2000 Draft
JavaScript 2.0
Formal Description
Parser Grammar
|
Friday, May 26, 2000
This LALR(1) grammar describes the syntax of the JavaScript 2.0 proposal. The starting nonterminal is Program. See also the description of the grammar notation.
This document is also available as a Word 98 rtf file.
General tokens: Identifier Number RegularExpression String VirtualSemicolon
Punctuation tokens: !
!=
!==
%
%=
&
&&
&&=
&=
(
)
*
*=
+
++
+=
,
-
--
-=
.
...
/
/=
:
::
;
<
<<
<<=
<=
=
==
===
>
>=
>>
>>=
>>>
>>>=
?
@
[
]
^
^=
^^
^^=
{
|
|=
||
||=
}
~
Future punctuation tokens: #
->
Reserved words: break
case
catch
class
const
continue
default
delete
do
else
eval
export
extends
false
final
finally
for
function
if
implements
import
in
instanceof
interface
new
null
package
private
public
return
static
super
switch
this
throw
true
try
typeof
var
volatile
while
with
Future reserved words: abstract
debugger
enum
goto
native
protected
synchronized
throws
transient
Non-reserved words: attribute
constructor
get
language
namespace
set
use
null
true
false
public
this
++
--
delete
PostfixExpressiontypeof
UnaryExpressioneval
UnaryExpression++
PostfixExpression--
PostfixExpression+
UnaryExpression-
UnaryExpression~
UnaryExpression!
UnaryExpression;
;
;
if
ParenthesizedExpression StatementabbrevNoShortIf else
StatementabbrevNoShortIfpackage
[no line break] AnnotatedDefinitionThe last two AnnotatedDefinition productions together have the same effect as AnnotatedDefinition Attributes Definition except that the latter would make the grammar non-LR(1).
default
=
Waldemar Horwat Last modified Friday, May 26, 2000 |