|
JavaScript 2.0
Formal Description
Parser Grammar
|
Tuesday, February 15, 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
extends false
final finally
for function
if in
instanceof new
null package
private public
return super
switch this
throw true
try typeof
var while
with
Future reserved words: abstract
debugger enum
export goto
implements import
interface
native protected
synchronized
throws transient
volatile
Non-reserved words: get
language set
nulltruefalsethissuper++--delete PostfixExpressiontypeof UnaryExpressioneval UnaryExpression++ PostfixExpression-- PostfixExpression+ UnaryExpression- UnaryExpression~ UnaryExpression! UnaryExpression;;;;;;if ParenthesizedExpression StatementabbrevNoShortIf else StatementabbrevNoShortIfget [no line break] Attributesset [no line break] Attributeslanguage [no line break] AttributesThe third through sixth Attributes productions are merely the result of manually inlining the Identifier rule inside Attributes Identifier [no line break] Attributes. Without manually inlining the Identifier rule here the grammar would not be LR(1).
get [no line break] Identifierset [no line break] Identifiernew [no line break] Identifiernew...;;get LanguageIdsRestset LanguageIdsRestlanguage LanguageIdsRestThe first through fourth LanguageIds productions are merely the result of manually inlining the Identifier rule inside LanguageIds Identifier LanguageIdsRest. Without manually inlining the Identifier rule here the grammar would not be LR(1).
|
Waldemar Horwat Last modified Tuesday, February 15, 2000 |