mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-12 09:01:16 +00:00
801 lines
48 KiB
HTML
801 lines
48 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>JavaScript 2.0 Grammar</TITLE>
|
|
<LINK rel="stylesheet" href="styles.css">
|
|
</HEAD>
|
|
|
|
<BODY>
|
|
<H2>Expressions</H2>
|
|
|
|
<H3>Primary Expressions</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">PrimaryExpression</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <CODE class="terminal-keyword">this</CODE></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">null</CODE></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">true</CODE></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">false</CODE></DIV>
|
|
<DIV class="grammar-rhs">| <SPAN class="terminal">Number</SPAN></DIV>
|
|
<DIV class="grammar-rhs">| <SPAN class="terminal">String</SPAN></DIV>
|
|
<DIV class="grammar-rhs">| <SPAN class="terminal">Identifier</SPAN></DIV>
|
|
<DIV class="grammar-rhs">| <SPAN class="terminal">RegularExpression</SPAN></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">(</CODE> <VAR
|
|
class="nonterminal">Expression</VAR> <CODE class="terminal-keyword">)</CODE></DIV>
|
|
</DIV>
|
|
<H3>Left-Side Expressions</H3>
|
|
|
|
<DIV class="grammar-argument"><VAR class="nonterminal"><SPAN class="nonterminal-argument"><SPAN
|
|
class="symbol">c</SPAN></SPAN></VAR> <SPAN class="symbol">Î</SPAN> {<VAR
|
|
class="nonterminal"><SPAN class="nonterminal-attribute">allowCalls</SPAN></VAR>, <VAR
|
|
class="nonterminal"><SPAN class="nonterminal-attribute">noCalls</SPAN></VAR>}</DIV>
|
|
<DIV class="grammar-argument"><VAR class="nonterminal"><SPAN class="nonterminal-argument"><SPAN
|
|
class="symbol">a</SPAN></SPAN></VAR> <SPAN class="symbol">Î</SPAN> {<VAR
|
|
class="nonterminal"><SPAN class="nonterminal-attribute">allowIn</SPAN></VAR>, <VAR
|
|
class="nonterminal"><SPAN class="nonterminal-attribute">noIn</SPAN></VAR>}</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">MemberExpression<SUP><SPAN
|
|
class="nonterminal-attribute">noCalls</SPAN></SUP></VAR> <SPAN class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">PrimaryExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">MemberExpression<SUP><SPAN
|
|
class="nonterminal-attribute">noCalls</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">[</CODE> <VAR class="nonterminal">Expression</VAR> <CODE
|
|
class="terminal-keyword">]</CODE></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">MemberExpression<SUP><SPAN
|
|
class="nonterminal-attribute">noCalls</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">.</CODE> <SPAN class="terminal">Identifier</SPAN></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">new</CODE> <VAR
|
|
class="nonterminal">MemberExpression<SUP><SPAN
|
|
class="nonterminal-attribute">noCalls</SPAN></SUP></VAR> <VAR
|
|
class="nonterminal">Arguments</VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">MemberExpression<SUP><SPAN
|
|
class="nonterminal-attribute">allowCalls</SPAN></SUP></VAR> <SPAN class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">MemberExpression<SUP><SPAN
|
|
class="nonterminal-attribute">noCalls</SPAN></SUP></VAR> <VAR
|
|
class="nonterminal">Arguments</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">MemberExpression<SUP><SPAN
|
|
class="nonterminal-attribute">allowCalls</SPAN></SUP></VAR> <VAR
|
|
class="nonterminal">Arguments</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">MemberExpression<SUP><SPAN
|
|
class="nonterminal-attribute">allowCalls</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">[</CODE> <VAR class="nonterminal">Expression</VAR> <CODE
|
|
class="terminal-keyword">]</CODE></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">MemberExpression<SUP><SPAN
|
|
class="nonterminal-attribute">allowCalls</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">.</CODE> <SPAN class="terminal">Identifier</SPAN></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">NewExpression</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">MemberExpression<SUP><SPAN
|
|
class="nonterminal-attribute">noCalls</SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">new</CODE> <VAR
|
|
class="nonterminal">NewExpression</VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">Arguments</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <CODE class="terminal-keyword">(</CODE> <CODE
|
|
class="terminal-keyword">)</CODE></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">(</CODE> <VAR
|
|
class="nonterminal">ArgumentList</VAR> <CODE class="terminal-keyword">)</CODE></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">ArgumentList</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">AssignmentExpression<SUP><SPAN
|
|
class="nonterminal-attribute">allowIn</SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">ArgumentList</VAR> <CODE
|
|
class="terminal-keyword">,</CODE> <VAR class="nonterminal">AssignmentExpression<SUP><SPAN
|
|
class="nonterminal-attribute">allowIn</SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">LeftSideExpression</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">NewExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">MemberExpression<SUP><SPAN
|
|
class="nonterminal-attribute">allowCalls</SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<H3>Postfix Expressions</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">PostfixExpression</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">LeftSideExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">LeftSideExpression</VAR> <CODE
|
|
class="terminal-keyword">++</CODE></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">LeftSideExpression</VAR> <CODE
|
|
class="terminal-keyword">--</CODE></DIV>
|
|
</DIV>
|
|
<H3>Unary Operators</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">UnaryExpression</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">PostfixExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">delete</CODE> <VAR
|
|
class="nonterminal">LeftSideExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">void</CODE> <VAR
|
|
class="nonterminal">UnaryExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">typeof</CODE> <VAR
|
|
class="nonterminal">UnaryExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">++</CODE> <VAR
|
|
class="nonterminal">LeftSideExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">--</CODE> <VAR
|
|
class="nonterminal">LeftSideExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">+</CODE> <VAR
|
|
class="nonterminal">UnaryExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">-</CODE> <VAR
|
|
class="nonterminal">UnaryExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">~</CODE> <VAR
|
|
class="nonterminal">UnaryExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">!</CODE> <VAR
|
|
class="nonterminal">UnaryExpression</VAR></DIV>
|
|
</DIV>
|
|
<H3>Multiplicative Operators</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">MultiplicativeExpression</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">UnaryExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR
|
|
class="nonterminal">MultiplicativeExpression</VAR> <CODE
|
|
class="terminal-keyword">*</CODE> <VAR class="nonterminal">UnaryExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR
|
|
class="nonterminal">MultiplicativeExpression</VAR> <CODE
|
|
class="terminal-keyword">/</CODE> <VAR class="nonterminal">UnaryExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR
|
|
class="nonterminal">MultiplicativeExpression</VAR> <CODE
|
|
class="terminal-keyword">%</CODE> <VAR class="nonterminal">UnaryExpression</VAR></DIV>
|
|
</DIV>
|
|
<H3>Additive Operators</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">AdditiveExpression</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR
|
|
class="nonterminal">MultiplicativeExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">AdditiveExpression</VAR> <CODE
|
|
class="terminal-keyword">+</CODE> <VAR class="nonterminal">MultiplicativeExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">AdditiveExpression</VAR> <CODE
|
|
class="terminal-keyword">-</CODE> <VAR class="nonterminal">MultiplicativeExpression</VAR></DIV>
|
|
</DIV>
|
|
<H3>Bitwise Shift Operators</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">ShiftExpression</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">AdditiveExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">ShiftExpression</VAR> <CODE
|
|
class="terminal-keyword"><<</CODE> <VAR
|
|
class="nonterminal">AdditiveExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">ShiftExpression</VAR> <CODE
|
|
class="terminal-keyword">>></CODE> <VAR
|
|
class="nonterminal">AdditiveExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">ShiftExpression</VAR> <CODE
|
|
class="terminal-keyword">>>></CODE> <VAR
|
|
class="nonterminal">AdditiveExpression</VAR></DIV>
|
|
</DIV>
|
|
<H3>Relational Operators</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">RelationalExpression<SUP><SPAN
|
|
class="nonterminal-attribute">allowIn</SPAN></SUP></VAR> <SPAN class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">ShiftExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">RelationalExpression<SUP><SPAN
|
|
class="nonterminal-attribute">allowIn</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword"><</CODE> <VAR class="nonterminal">ShiftExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">RelationalExpression<SUP><SPAN
|
|
class="nonterminal-attribute">allowIn</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">></CODE> <VAR class="nonterminal">ShiftExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">RelationalExpression<SUP><SPAN
|
|
class="nonterminal-attribute">allowIn</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword"><=</CODE> <VAR class="nonterminal">ShiftExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">RelationalExpression<SUP><SPAN
|
|
class="nonterminal-attribute">allowIn</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">>=</CODE> <VAR class="nonterminal">ShiftExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">RelationalExpression<SUP><SPAN
|
|
class="nonterminal-attribute">allowIn</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">instanceof</CODE> <VAR class="nonterminal">ShiftExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">RelationalExpression<SUP><SPAN
|
|
class="nonterminal-attribute">allowIn</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">in</CODE> <VAR class="nonterminal">ShiftExpression</VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">RelationalExpression<SUP><SPAN
|
|
class="nonterminal-attribute">noIn</SPAN></SUP></VAR> <SPAN class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">ShiftExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">RelationalExpression<SUP><SPAN
|
|
class="nonterminal-attribute">noIn</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword"><</CODE> <VAR class="nonterminal">ShiftExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">RelationalExpression<SUP><SPAN
|
|
class="nonterminal-attribute">noIn</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">></CODE> <VAR class="nonterminal">ShiftExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">RelationalExpression<SUP><SPAN
|
|
class="nonterminal-attribute">noIn</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword"><=</CODE> <VAR class="nonterminal">ShiftExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">RelationalExpression<SUP><SPAN
|
|
class="nonterminal-attribute">noIn</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">>=</CODE> <VAR class="nonterminal">ShiftExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">RelationalExpression<SUP><SPAN
|
|
class="nonterminal-attribute">noIn</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">instanceof</CODE> <VAR class="nonterminal">ShiftExpression</VAR></DIV>
|
|
</DIV>
|
|
<H3>Equality Operators</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">EqualityExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">RelationalExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">EqualityExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">==</CODE> <VAR class="nonterminal">RelationalExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">EqualityExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">!=</CODE> <VAR class="nonterminal">RelationalExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">EqualityExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">===</CODE> <VAR class="nonterminal">RelationalExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">EqualityExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">!==</CODE> <VAR class="nonterminal">RelationalExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<H3>Binary Bitwise Operators</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">BitwiseAndExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">EqualityExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">BitwiseAndExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">&</CODE> <VAR class="nonterminal">EqualityExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">BitwiseXorExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">BitwiseAndExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">BitwiseXorExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">^</CODE> <VAR class="nonterminal">BitwiseAndExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">BitwiseOrExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">BitwiseXorExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">BitwiseOrExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">|</CODE> <VAR class="nonterminal">BitwiseXorExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<H3>Binary Logical Operators</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">LogicalAndExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">BitwiseOrExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">LogicalAndExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">&&</CODE> <VAR
|
|
class="nonterminal">BitwiseOrExpression<SUP><SPAN class="nonterminal-argument"><SPAN
|
|
class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">LogicalOrExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">LogicalAndExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">LogicalOrExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">||</CODE> <VAR class="nonterminal">LogicalAndExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<H3>Conditional Operator</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">ConditionalExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">LogicalOrExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">LogicalOrExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">?</CODE> <VAR class="nonterminal">AssignmentExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">:</CODE> <VAR class="nonterminal">AssignmentExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<H3>Assignment Operators</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">AssignmentExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR
|
|
class="nonterminal">ConditionalExpression<SUP><SPAN class="nonterminal-argument"><SPAN
|
|
class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">LeftSideExpression</VAR> <CODE
|
|
class="terminal-keyword">=</CODE> <VAR class="nonterminal">AssignmentExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">LeftSideExpression</VAR> <VAR
|
|
class="nonterminal">CompoundAssignment</VAR> <VAR
|
|
class="nonterminal">AssignmentExpression<SUP><SPAN class="nonterminal-argument"><SPAN
|
|
class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">CompoundAssignment</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <CODE class="terminal-keyword">*=</CODE></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">/=</CODE></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">%=</CODE></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">+=</CODE></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">-=</CODE></DIV>
|
|
</DIV>
|
|
<H3>Expressions</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">CommaExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN> <VAR class="nonterminal">AssignmentExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">Expression</VAR> <SPAN
|
|
class="symbol">Þ</SPAN> <VAR class="nonterminal">CommaExpression<SUP><SPAN
|
|
class="nonterminal-attribute">allowIn</SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">OptionalExpression</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">Expression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| «empty»</DIV>
|
|
</DIV>
|
|
<H2>Statements</H2>
|
|
|
|
<DIV class="grammar-argument"><VAR class="nonterminal"><SPAN class="nonterminal-argument"><SPAN
|
|
class="symbol">w</SPAN></SPAN></VAR> <SPAN class="symbol">Î</SPAN> {<VAR
|
|
class="nonterminal"><SPAN class="nonterminal-attribute">abbrev</SPAN></VAR>, <VAR
|
|
class="nonterminal"><SPAN class="nonterminal-attribute">abbrevNonEmpty</SPAN></VAR>, <VAR
|
|
class="nonterminal"><SPAN class="nonterminal-attribute">abbrevNoShortIf</SPAN></VAR>, <VAR
|
|
class="nonterminal"><SPAN class="nonterminal-attribute">full</SPAN></VAR>}</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">w</SPAN></SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">BlocklikeStatement</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR
|
|
class="nonterminal">UnterminatedStatement</VAR> <CODE class="terminal-keyword">;</CODE></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">NonuniformStatement<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">w</SPAN></SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">IfStatement<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">w</SPAN></SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">WhileStatement<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">w</SPAN></SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">ForStatement<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">w</SPAN></SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">LabeledStatement<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">w</SPAN></SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">NonuniformStatement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrev</SPAN></SUP></VAR> <SPAN class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR
|
|
class="nonterminal">EmptyStatement</VAR> <CODE class="terminal-keyword">;</CODE></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">EmptyStatement</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">UnterminatedStatement</VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">NonuniformStatement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrevNonEmpty</SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR
|
|
class="nonterminal">EmptyStatement</VAR> <CODE class="terminal-keyword">;</CODE></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">UnterminatedStatement</VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">NonuniformStatement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrevNoShortIf</SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR
|
|
class="nonterminal">EmptyStatement</VAR> <CODE class="terminal-keyword">;</CODE></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">UnterminatedStatement</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">EmptyStatement</VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">NonuniformStatement<SUP><SPAN
|
|
class="nonterminal-attribute">full</SPAN></SUP></VAR> <SPAN class="symbol">Þ</SPAN> <VAR
|
|
class="nonterminal">EmptyStatement</VAR> <CODE class="terminal-keyword">;</CODE></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">BlocklikeStatement</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">Block</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">SwitchStatement</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">TryStatement</VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">UnterminatedStatement</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">VariableStatement</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">ExpressionStatement</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">DoStatement</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">ContinueStatement</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">BreakStatement</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">ReturnStatement</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">ThrowStatement</VAR></DIV>
|
|
</DIV>
|
|
<H3>Block</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">Block</VAR> <SPAN
|
|
class="symbol">Þ</SPAN> <CODE class="terminal-keyword">{</CODE> <VAR
|
|
class="nonterminal">BlockStatements</VAR> <CODE class="terminal-keyword">}</CODE></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">BlockStatements</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrev</SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR
|
|
class="nonterminal">BlockStatementsPrefix</VAR> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrevNonEmpty</SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">BlockStatementsPrefix</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-attribute">full</SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR
|
|
class="nonterminal">BlockStatementsPrefix</VAR> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-attribute">full</SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<H3>Variable Statement</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">VariableStatement</VAR> <SPAN
|
|
class="symbol">Þ</SPAN> <CODE class="terminal-keyword">var</CODE> <VAR
|
|
class="nonterminal">VariableDeclarationList<SUP><SPAN
|
|
class="nonterminal-attribute">allowIn</SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">VariableDeclarationList<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">VariableDeclaration<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">VariableDeclarationList<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">,</CODE> <VAR class="nonterminal">VariableDeclaration<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">VariableDeclaration<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <SPAN class="terminal">Identifier</SPAN></DIV>
|
|
<DIV class="grammar-rhs">| <SPAN class="terminal">Identifier</SPAN> <CODE
|
|
class="terminal-keyword">=</CODE> <VAR class="nonterminal">AssignmentExpression<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">a</SPAN></SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<H3>Empty Statement</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">EmptyStatement</VAR> <SPAN
|
|
class="symbol">Þ</SPAN> «empty»</DIV>
|
|
</DIV>
|
|
<H3>Expression Statement</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">ExpressionStatement</VAR> <SPAN
|
|
class="symbol">Þ</SPAN> <VAR class="nonterminal">Expression</VAR></DIV>
|
|
</DIV>
|
|
<H3>If Statement</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">IfStatement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrev</SPAN></SUP></VAR> <SPAN class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <CODE class="terminal-keyword">if</CODE> <CODE
|
|
class="terminal-keyword">(</CODE> <VAR class="nonterminal">Expression</VAR> <CODE
|
|
class="terminal-keyword">)</CODE> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrev</SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">if</CODE> <CODE
|
|
class="terminal-keyword">(</CODE> <VAR class="nonterminal">Expression</VAR> <CODE
|
|
class="terminal-keyword">)</CODE> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrevNoShortIf</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">else</CODE> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrev</SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">IfStatement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrevNonEmpty</SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <CODE class="terminal-keyword">if</CODE> <CODE
|
|
class="terminal-keyword">(</CODE> <VAR class="nonterminal">Expression</VAR> <CODE
|
|
class="terminal-keyword">)</CODE> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrevNonEmpty</SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">if</CODE> <CODE
|
|
class="terminal-keyword">(</CODE> <VAR class="nonterminal">Expression</VAR> <CODE
|
|
class="terminal-keyword">)</CODE> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrevNoShortIf</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">else</CODE> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrevNonEmpty</SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">IfStatement<SUP><SPAN
|
|
class="nonterminal-attribute">full</SPAN></SUP></VAR> <SPAN class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <CODE class="terminal-keyword">if</CODE> <CODE
|
|
class="terminal-keyword">(</CODE> <VAR class="nonterminal">Expression</VAR> <CODE
|
|
class="terminal-keyword">)</CODE> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-attribute">full</SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">if</CODE> <CODE
|
|
class="terminal-keyword">(</CODE> <VAR class="nonterminal">Expression</VAR> <CODE
|
|
class="terminal-keyword">)</CODE> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrevNoShortIf</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">else</CODE> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-attribute">full</SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">IfStatement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrevNoShortIf</SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN> <CODE class="terminal-keyword">if</CODE> <CODE
|
|
class="terminal-keyword">(</CODE> <VAR class="nonterminal">Expression</VAR> <CODE
|
|
class="terminal-keyword">)</CODE> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrevNoShortIf</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">else</CODE> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrevNoShortIf</SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<H3>Do-While Statement</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">DoStatement</VAR> <SPAN
|
|
class="symbol">Þ</SPAN> <CODE class="terminal-keyword">do</CODE> <VAR
|
|
class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrevNonEmpty</SPAN></SUP></VAR> <CODE
|
|
class="terminal-keyword">while</CODE> <CODE class="terminal-keyword">(</CODE> <VAR
|
|
class="nonterminal">Expression</VAR> <CODE class="terminal-keyword">)</CODE></DIV>
|
|
</DIV>
|
|
<H3>While Statement</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">WhileStatement<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">w</SPAN></SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN> <CODE class="terminal-keyword">while</CODE> <CODE
|
|
class="terminal-keyword">(</CODE> <VAR class="nonterminal">Expression</VAR> <CODE
|
|
class="terminal-keyword">)</CODE> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">w</SPAN></SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<H3>For Statements</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">ForStatement<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">w</SPAN></SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <CODE class="terminal-keyword">for</CODE> <CODE
|
|
class="terminal-keyword">(</CODE> <VAR class="nonterminal">ForInitializer</VAR> <CODE
|
|
class="terminal-keyword">;</CODE> <VAR class="nonterminal">OptionalExpression</VAR> <CODE
|
|
class="terminal-keyword">;</CODE> <VAR class="nonterminal">OptionalExpression</VAR> <CODE
|
|
class="terminal-keyword">)</CODE> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">w</SPAN></SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">for</CODE> <CODE
|
|
class="terminal-keyword">(</CODE> <VAR class="nonterminal">ForInBinding</VAR> <CODE
|
|
class="terminal-keyword">in</CODE> <VAR class="nonterminal">Expression</VAR> <CODE
|
|
class="terminal-keyword">)</CODE> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">w</SPAN></SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">ForInitializer</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> «empty»</DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">CommaExpression<SUP><SPAN
|
|
class="nonterminal-attribute">noIn</SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">var</CODE> <VAR
|
|
class="nonterminal">VariableDeclarationList<SUP><SPAN
|
|
class="nonterminal-attribute">noIn</SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">ForInBinding</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">LeftSideExpression</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">var</CODE> <VAR
|
|
class="nonterminal">VariableDeclaration<SUP><SPAN
|
|
class="nonterminal-attribute">noIn</SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<H3>Continue and Break Statements</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">ContinueStatement</VAR> <SPAN
|
|
class="symbol">Þ</SPAN> <CODE class="terminal-keyword">continue</CODE> <VAR
|
|
class="nonterminal">OptionalLabel</VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">BreakStatement</VAR> <SPAN
|
|
class="symbol">Þ</SPAN> <CODE class="terminal-keyword">break</CODE> <VAR
|
|
class="nonterminal">OptionalLabel</VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">OptionalLabel</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> «empty»</DIV>
|
|
<DIV class="grammar-rhs">| <SPAN class="terminal">Identifier</SPAN></DIV>
|
|
</DIV>
|
|
<H3>Labeled Statements</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">LabeledStatement<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">w</SPAN></SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN> <SPAN class="terminal">Identifier</SPAN> <CODE
|
|
class="terminal-keyword">:</CODE> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">w</SPAN></SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<H3>Return Statement</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">ReturnStatement</VAR> <SPAN
|
|
class="symbol">Þ</SPAN> <CODE class="terminal-keyword">return</CODE> <VAR
|
|
class="nonterminal">OptionalExpression</VAR></DIV>
|
|
</DIV>
|
|
<H3>Switch Statement</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">SwitchStatement</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <CODE class="terminal-keyword">switch</CODE> <CODE
|
|
class="terminal-keyword">(</CODE> <VAR class="nonterminal">Expression</VAR> <CODE
|
|
class="terminal-keyword">)</CODE> <CODE class="terminal-keyword">{</CODE> <CODE
|
|
class="terminal-keyword">}</CODE></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">switch</CODE> <CODE
|
|
class="terminal-keyword">(</CODE> <VAR class="nonterminal">Expression</VAR> <CODE
|
|
class="terminal-keyword">)</CODE> <CODE class="terminal-keyword">{</CODE> <VAR
|
|
class="nonterminal">CaseGroups</VAR> <VAR class="nonterminal">LastCaseGroup</VAR> <CODE
|
|
class="terminal-keyword">}</CODE></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">CaseGroups</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> «empty»</DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">CaseGroups</VAR> <VAR
|
|
class="nonterminal">CaseGroup</VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">CaseGroup</VAR> <SPAN
|
|
class="symbol">Þ</SPAN> <VAR class="nonterminal">CaseGuards</VAR> <VAR
|
|
class="nonterminal">BlockStatementsPrefix</VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">LastCaseGroup</VAR> <SPAN
|
|
class="symbol">Þ</SPAN> <VAR class="nonterminal">CaseGuards</VAR> <VAR
|
|
class="nonterminal">BlockStatements</VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">CaseGuards</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">CaseGuard</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">CaseGuards</VAR> <VAR
|
|
class="nonterminal">CaseGuard</VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">CaseGuard</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <CODE class="terminal-keyword">case</CODE> <VAR
|
|
class="nonterminal">Expression</VAR> <CODE class="terminal-keyword">:</CODE></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">default</CODE> <CODE
|
|
class="terminal-keyword">:</CODE></DIV>
|
|
</DIV>
|
|
<H3>Throw Statement</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">ThrowStatement</VAR> <SPAN
|
|
class="symbol">Þ</SPAN> <CODE class="terminal-keyword">throw</CODE> <VAR
|
|
class="nonterminal">Expression</VAR></DIV>
|
|
</DIV>
|
|
<H3>Try Statement</H3>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">TryStatement</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <CODE class="terminal-keyword">try</CODE> <VAR
|
|
class="nonterminal">Block</VAR> <VAR class="nonterminal">CatchClauses</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">try</CODE> <VAR
|
|
class="nonterminal">Block</VAR> <VAR class="nonterminal">FinallyClause</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <CODE class="terminal-keyword">try</CODE> <VAR
|
|
class="nonterminal">Block</VAR> <VAR class="nonterminal">CatchClauses</VAR> <VAR
|
|
class="nonterminal">FinallyClause</VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">CatchClauses</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">CatchClause</VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">CatchClauses</VAR> <VAR
|
|
class="nonterminal">CatchClause</VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">CatchClause</VAR> <SPAN
|
|
class="symbol">Þ</SPAN> <CODE class="terminal-keyword">catch</CODE> <CODE
|
|
class="terminal-keyword">(</CODE> <SPAN class="terminal">Identifier</SPAN> <CODE
|
|
class="terminal-keyword">)</CODE> <VAR class="nonterminal">Block</VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">FinallyClause</VAR> <SPAN
|
|
class="symbol">Þ</SPAN> <CODE class="terminal-keyword">finally</CODE> <VAR
|
|
class="nonterminal">Block</VAR></DIV>
|
|
</DIV>
|
|
<H2>Functions</H2>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">FunctionDeclaration</VAR> <SPAN
|
|
class="symbol">Þ</SPAN> <CODE class="terminal-keyword">function</CODE> <SPAN
|
|
class="terminal">Identifier</SPAN> <CODE class="terminal-keyword">(</CODE> <VAR
|
|
class="nonterminal">FormalParameters</VAR> <CODE class="terminal-keyword">)</CODE> <CODE
|
|
class="terminal-keyword">{</CODE> <VAR class="nonterminal">FunctionStatements</VAR> <CODE
|
|
class="terminal-keyword">}</CODE></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">FormalParameters</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> «empty»</DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">FormalParametersPrefix</VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">FormalParametersPrefix</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <SPAN class="terminal">Identifier</SPAN></DIV>
|
|
<DIV class="grammar-rhs">| <VAR
|
|
class="nonterminal">FormalParametersPrefix</VAR> <CODE
|
|
class="terminal-keyword">,</CODE> <SPAN class="terminal">Identifier</SPAN></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">FunctionStatements</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">FunctionStatement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrev</SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR
|
|
class="nonterminal">FunctionStatementsPrefix</VAR> <VAR
|
|
class="nonterminal">FunctionStatement<SUP><SPAN
|
|
class="nonterminal-attribute">abbrevNonEmpty</SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">FunctionStatementsPrefix</VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">FunctionStatement<SUP><SPAN
|
|
class="nonterminal-attribute">full</SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR
|
|
class="nonterminal">FunctionStatementsPrefix</VAR> <VAR
|
|
class="nonterminal">FunctionStatement<SUP><SPAN
|
|
class="nonterminal-attribute">full</SPAN></SUP></VAR></DIV>
|
|
</DIV>
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">FunctionStatement<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">w</SPAN></SPAN></SUP></VAR> <SPAN
|
|
class="symbol">Þ</SPAN></DIV>
|
|
<DIV class="grammar-rhs"> <VAR class="nonterminal">Statement<SUP><SPAN
|
|
class="nonterminal-argument"><SPAN class="symbol">w</SPAN></SPAN></SUP></VAR></DIV>
|
|
<DIV class="grammar-rhs">| <VAR class="nonterminal">FunctionDeclaration</VAR></DIV>
|
|
</DIV>
|
|
<H2>Programs</H2>
|
|
|
|
<DIV class="grammar-rule">
|
|
<DIV class="grammar-lhs"><VAR class="nonterminal">Program</VAR> <SPAN
|
|
class="symbol">Þ</SPAN> <VAR class="nonterminal">FunctionStatements</VAR></DIV>
|
|
</DIV>
|
|
</BODY>
|
|
</HTML>
|