1 /* Cycript - Remove Execution Server and Disassembler
2 * Copyright (C) 2009 Jay Freeman (saurik)
5 /* Modified BSD License {{{ */
7 * Redistribution and use in source and binary
8 * forms, with or without modification, are permitted
9 * provided that the following conditions are met:
11 * 1. Redistributions of source code must retain the
12 * above copyright notice, this list of conditions
13 * and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the
15 * above copyright notice, this list of conditions
16 * and the following disclaimer in the documentation
17 * and/or other materials provided with the
19 * 3. The name of the author may not be used to endorse
20 * or promote products derived from this software
21 * without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS''
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
25 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
34 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
35 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
36 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 #include "Cycript.tab.hh"
42 #define scanner driver.scanner_
43 #define YYSTACKEXPANDABLE 1
55 CYDriver::Condition condition_;
57 CYArgument *argument_;
58 CYAssignment *assignment_;
63 CYClassName *className_;
64 CYComprehension *comprehension_;
65 CYCompound *compound_;
66 CYDeclaration *declaration_;
67 CYDeclarations *declarations_;
69 CYExpression *expression_;
72 CYForInitialiser *for_;
73 CYForInInitialiser *forin_;
74 CYFunctionParameter *functionParameter_;
75 CYIdentifier *identifier_;
80 CYMessageParameter *messageParameter_;
83 CYProperty *property_;
84 CYPropertyName *propertyName_;
85 CYSelectorPart *selector_;
87 CYStatement *statement_;
98 int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner);
107 @$.begin.filename = @$.end.filename = &driver.filename_;
117 %parse-param { CYDriver &driver }
118 %lex-param { void *scanner }
121 %token AmpersandAmpersand "&&"
122 %token AmpersandEqual "&="
124 %token CarrotEqual "^="
126 %token EqualEqual "=="
127 %token EqualEqualEqual "==="
128 %token Exclamation "!"
129 %token ExclamationEqual "!="
130 %token ExclamationEqualEqual "!=="
132 %token HyphenEqual "-="
133 %token HyphenHyphen "--"
134 %token HyphenHyphen_ "\n--"
135 %token HyphenRight "->"
137 %token LeftEqual "<="
139 %token LeftLeftEqual "<<="
141 %token PercentEqual "%="
144 %token PipeEqual "|="
147 %token PlusEqual "+="
149 %token PlusPlus_ "\n++"
151 %token RightEqual ">="
152 %token RightRight ">>"
153 %token RightRightEqual ">>="
154 %token RightRightRight ">>>"
155 %token RightRightRightEqual ">>>="
157 %token SlashEqual "/="
159 %token StarEqual "*="
169 %token CloseParen ")"
172 %token CloseBrace "}"
174 %token OpenBracket "["
175 %token CloseBracket "]"
177 %token AtClass "@class"
178 %token AtSelector "@selector"
181 %token <false_> False "false"
182 %token <null_> Null "null"
183 %token <true_> True "true"
185 // ES3/ES5/WIE/JSC Reserved
186 %token <word_> Break "break"
187 %token <word_> Case "case"
188 %token <word_> Catch "catch"
189 %token <word_> Continue "continue"
190 %token <word_> Default "default"
191 %token <word_> Delete "delete"
192 %token <word_> Do "do"
193 %token <word_> Else "else"
194 %token <word_> Finally "finally"
195 %token <word_> For "for"
196 %token <word_> Function "function"
197 %token <word_> If "if"
198 %token <word_> In "in"
199 %token <word_> InstanceOf "instanceof"
200 %token <word_> New "new"
201 %token <word_> Return "return"
202 %token <word_> Switch "switch"
203 %token <this_> This "this"
204 %token <word_> Throw "throw"
205 %token <word_> Try "try"
206 %token <word_> TypeOf "typeof"
207 %token <word_> Var "var"
208 %token <word_> Void "void"
209 %token <word_> While "while"
210 %token <word_> With "with"
212 // ES3/IE6 Future, ES5/JSC Reserved
213 %token <word_> Debugger "debugger"
215 // ES3/ES5/IE6 Future, JSC Reserved
216 %token <word_> Const "const"
218 // ES3/ES5/IE6/JSC Future
219 %token <word_> Class "class"
220 %token <word_> Enum "enum"
221 %token <word_> Export "export"
222 %token <word_> Extends "extends"
223 %token <word_> Import "import"
224 %token <word_> Super "super"
226 // ES3 Future, ES5 Strict Future
227 %token <identifier_> Implements "implements"
228 %token <identifier_> Interface "interface"
229 %token <identifier_> Package "package"
230 %token <identifier_> Private "private"
231 %token <identifier_> Protected "protected"
232 %token <identifier_> Public "public"
233 %token <identifier_> Static "static"
236 %token <identifier_> Abstract "abstract"
237 %token <identifier_> Boolean "boolean"
238 %token <identifier_> Byte "byte"
239 %token <identifier_> Char "char"
240 %token <identifier_> Double "double"
241 %token <identifier_> Final "final"
242 %token <identifier_> Float "float"
243 %token <identifier_> Goto "goto"
244 %token <identifier_> Int "int"
245 %token <identifier_> Long "long"
246 %token <identifier_> Native "native"
247 %token <identifier_> Short "short"
248 %token <identifier_> Synchronized "synchronized"
249 %token <identifier_> Throws "throws"
250 %token <identifier_> Transient "transient"
251 %token <identifier_> Volatile "volatile"
254 %token <identifier_> Let "let"
255 %token <identifier_> Yield "yield"
258 %token <identifier_> Each "each"
260 %token <identifier_> Identifier_
261 %token <number_> NumericLiteral
262 %token <string_> StringLiteral
263 %token <literal_> RegularExpressionLiteral
265 %type <expression_> AdditiveExpression
266 %type <expression_> AdditiveExpressionNoBF
267 %type <argument_> ArgumentList
268 %type <argument_> ArgumentList_
269 %type <argument_> ArgumentListOpt
270 %type <argument_> Arguments
271 %type <literal_> ArrayLiteral
272 %type <expression_> AssigneeExpression
273 %type <expression_> AssigneeExpression_
274 %type <expression_> AssigneeExpressionNoBF
275 %type <expression_> AssignmentExpression
276 %type <assignment_> AssignmentExpression_
277 %type <expression_> AssignmentExpressionNoBF
278 %type <expression_> AssignmentExpressionNoIn
279 %type <expression_> BitwiseANDExpression
280 %type <expression_> BitwiseANDExpressionNoBF
281 %type <expression_> BitwiseANDExpressionNoIn
282 %type <statement_> Block
283 %type <statement_> Block_
284 %type <boolean_> BooleanLiteral
285 %type <expression_> BitwiseORExpression
286 %type <expression_> BitwiseORExpressionNoBF
287 %type <expression_> BitwiseORExpressionNoIn
288 %type <expression_> BitwiseXORExpression
289 %type <expression_> BitwiseXORExpressionNoBF
290 %type <expression_> BitwiseXORExpressionNoIn
291 %type <statement_> BreakStatement
292 %type <expression_> CallExpression
293 %type <expression_> CallExpressionNoBF
294 %type <clause_> CaseBlock
295 %type <clause_> CaseClause
296 %type <clause_> CaseClausesOpt
297 %type <catch_> CatchOpt
298 %type <statement_> CategoryStatement
299 %type <class_> ClassDefinition
300 %type <message_> ClassMessageDeclaration
301 %type <message_> ClassMessageDeclarationListOpt
302 %type <className_> ClassName
303 %type <className_> ClassNameOpt
304 %type <expression_> ClassSuperOpt
305 %type <field_> ClassFieldList
306 %type <comprehension_> ComprehensionList
307 %type <comprehension_> ComprehensionListOpt
308 %type <expression_> ConditionalExpression
309 %type <expression_> ConditionalExpressionNoBF
310 %type <expression_> ConditionalExpressionNoIn
311 %type <statement_> ContinueStatement
312 %type <clause_> DefaultClause
313 %type <statement_> DoWhileStatement
314 %type <expression_> Element
315 %type <expression_> ElementOpt
316 %type <element_> ElementList
317 %type <element_> ElementListOpt
318 %type <statement_> ElseStatementOpt
319 %type <statement_> EmptyStatement
320 %type <expression_> EqualityExpression
321 %type <expression_> EqualityExpressionNoBF
322 %type <expression_> EqualityExpressionNoIn
323 %type <expression_> Expression
324 %type <expression_> ExpressionOpt
325 %type <compound_> Expression_
326 %type <expression_> ExpressionNoBF
327 %type <expression_> ExpressionNoIn
328 %type <compound_> ExpressionNoIn_
329 %type <expression_> ExpressionNoInOpt
330 %type <statement_> ExpressionStatement
331 %type <statement_> FinallyOpt
332 %type <comprehension_> ForComprehension
333 %type <statement_> ForStatement
334 %type <for_> ForStatementInitialiser
335 %type <statement_> ForInStatement
336 %type <forin_> ForInStatementInitialiser
337 %type <functionParameter_> FormalParameterList
338 %type <functionParameter_> FormalParameterList_
339 %type <source_> FunctionBody
340 %type <source_> FunctionDeclaration
341 %type <expression_> FunctionExpression
342 %type <identifier_> Identifier
343 %type <identifier_> IdentifierOpt
344 %type <comprehension_> IfComprehension
345 %type <statement_> IfStatement
346 %type <expression_> Initialiser
347 %type <expression_> InitialiserOpt
348 %type <expression_> InitialiserNoIn
349 %type <expression_> InitialiserNoInOpt
350 %type <statement_> IterationStatement
351 %type <statement_> LabelledStatement
352 %type <expression_> LeftHandSideExpression
353 %type <expression_> LeftHandSideExpressionNoBF
354 //%type <statement_> LetStatement
355 %type <literal_> Literal
356 %type <expression_> LogicalANDExpression
357 %type <expression_> LogicalANDExpressionNoBF
358 %type <expression_> LogicalANDExpressionNoIn
359 %type <expression_> LogicalORExpression
360 %type <expression_> LogicalORExpressionNoBF
361 %type <expression_> LogicalORExpressionNoIn
362 %type <member_> MemberAccess
363 %type <expression_> MemberExpression
364 %type <expression_> MemberExpression_
365 %type <expression_> MemberExpressionNoBF
366 %type <messageParameter_> MessageParameter
367 %type <messageParameter_> MessageParameters
368 %type <messageParameter_> MessageParameterList
369 %type <messageParameter_> MessageParameterListOpt
370 %type <bool_> MessageScope
371 %type <expression_> MultiplicativeExpression
372 %type <expression_> MultiplicativeExpressionNoBF
373 %type <expression_> NewExpression
374 %type <expression_> NewExpression_
375 %type <expression_> NewExpressionNoBF
376 %type <null_> NullLiteral
377 %type <literal_> ObjectLiteral
378 %type <expression_> PostfixExpression
379 %type <expression_> PostfixExpressionNoBF
380 %type <expression_> PrimaryExpression
381 %type <expression_> PrimaryExpression_
382 %type <expression_> PrimaryExpressionNoBF
383 %type <source_> Program
384 %type <propertyName_> PropertyName
385 %type <property_> PropertyNameAndValueList
386 %type <property_> PropertyNameAndValueList_
387 %type <property_> PropertyNameAndValueListOpt
388 %type <literal_> RegularExpressionLiteral_
389 %type <condition_> RegularExpressionToken
390 %type <expression_> RelationalExpression
391 %type <infix_> RelationalExpression_
392 %type <expression_> RelationalExpressionNoBF
393 %type <expression_> RelationalExpressionNoIn
394 %type <infix_> RelationalExpressionNoIn_
395 %type <statement_> ReturnStatement
396 %type <selector_> SelectorExpression
397 %type <selector_> SelectorExpression_
398 %type <selector_> SelectorExpressionOpt
399 %type <expression_> ShiftExpression
400 %type <expression_> ShiftExpressionNoBF
401 %type <source_> SourceElement
402 %type <source_> SourceElements
403 %type <statement_> Statement
404 %type <statement_> StatementList
405 %type <statement_> StatementListOpt
406 %type <statement_> SwitchStatement
407 %type <statement_> ThrowStatement
408 %type <statement_> TryStatement
409 %type <expression_> TypeOpt
410 %type <expression_> UnaryExpression
411 %type <expression_> UnaryExpression_
412 %type <expression_> UnaryExpressionNoBF
413 %type <declaration_> VariableDeclaration
414 %type <declaration_> VariableDeclarationNoIn
415 %type <declarations_> VariableDeclarationList
416 %type <declarations_> VariableDeclarationList_
417 %type <declarations_> VariableDeclarationListNoIn
418 %type <declarations_> VariableDeclarationListNoIn_
419 %type <statement_> VariableStatement
420 %type <statement_> WhileStatement
421 %type <statement_> WithStatement
423 %type <word_> WordOpt
425 %type <expression_> MessageExpression
426 %type <argument_> SelectorCall
427 %type <argument_> SelectorCall_
428 %type <argument_> SelectorList
429 %type <argument_> VariadicCall
433 %left "<<" ">>" ">>>"
434 %left "<" ">" "<=" ">=" "instanceof" "in"
435 %left "==" "!=" "===" "!=="
442 %right "=" "*=" "/=" "%=" "+=" "-=" "<<=" ">>=" ">>>=" "&=" "^=" "|="
454 | error { yyerrok; driver.errors_.pop_back(); }
460 | error { if (yychar != 0 && yychar != cy::parser::token::CloseBrace && !yylval.newline_) YYABORT; else { yyerrok; driver.errors_.pop_back(); } }
479 : Identifier { $$ = $1; }
480 | "break" NewLineOpt { $$ = $1; }
481 | "case" { $$ = $1; }
482 | "catch" { $$ = $1; }
483 | "class" { $$ = $1; }
484 | "const" { $$ = $1; }
485 | "continue" NewLineOpt { $$ = $1; }
486 | "debugger" { $$ = $1; }
487 | "default" { $$ = $1; }
488 | "delete" { $$ = $1; }
490 | "else" { $$ = $1; }
491 | "enum" { $$ = $1; }
492 | "export" { $$ = $1; }
493 | "extends" { $$ = $1; }
494 | "false" { $$ = $1; }
495 | "finally" { $$ = $1; }
497 | "function" { $$ = $1; }
499 | "import" { $$ = $1; }
500 /* XXX: | "in" { $$ = $1; } */
501 /* XXX: | "instanceof" { $$ = $1; } */
503 | "null" { $$ = $1; }
504 | "return" NewLineOpt { $$ = $1; }
505 | "super" { $$ = $1; }
506 | "switch" { $$ = $1; }
507 | "this" { $$ = $1; }
508 | "throw" NewLineOpt { $$ = $1; }
509 | "true" { $$ = $1; }
511 | "typeof" { $$ = $1; }
513 | "void" { $$ = $1; }
514 | "while" { $$ = $1; }
515 | "with" { $$ = $1; }
519 : Identifier_ { $$ = $1; }
521 | "implements" { $$ = $1; }
522 | "interface" { $$ = $1; }
523 | "package" { $$ = $1; }
524 | "private" { $$ = $1; }
525 | "protected" { $$ = $1; }
526 | "public" { $$ = $1; }
527 | "static" { $$ = $1; }
529 | "abstract" { $$ = $1; }
530 | "boolean" { $$ = $1; }
531 | "byte" { $$ = $1; }
532 | "char" { $$ = $1; }
533 | "double" { $$ = $1; }
534 | "final" { $$ = $1; }
535 | "float" { $$ = $1; }
536 | "goto" { $$ = $1; }
538 | "long" { $$ = $1; }
539 | "native" { $$ = $1; }
540 | "short" { $$ = $1; }
541 | "synchronized" { $$ = $1; }
542 | "throws" { $$ = $1; }
543 | "transient" { $$ = $1; }
544 | "volatile" { $$ = $1; }
547 | "yield" { $$ = $1; }
549 | "each" { $$ = $1; }
553 : Identifier { $$ = $1; }
557 RegularExpressionToken
558 : "/" { $$ = CYDriver::RegExStart; }
559 | "/=" { $$ = CYDriver::RegExRest; }
562 RegularExpressionLiteral_
563 : RegularExpressionToken { driver.SetCondition($1); } RegularExpressionLiteral { $$ = $3; }
567 : NullLiteral { $$ = $1; }
568 | BooleanLiteral { $$ = $1; }
569 | NumericLiteral { $$ = $1; }
570 | StringLiteral { $$ = $1; }
571 | RegularExpressionLiteral_ { $$ = $1; }
575 : "null" { $$ = $1; }
579 : "true" { $$ = $1; }
580 | "false" { $$ = $1; }
583 /* 11.1 Primary Expressions {{{ */
585 : "this" { $$ = $1; }
586 | Identifier { $$ = new(driver.pool_) CYVariable($1); }
587 | Literal { $$ = $1; }
588 | ArrayLiteral { $$ = $1; }
589 | "(" Expression ")" { $$ = $2; }
593 : ObjectLiteral { $$ = $1; }
594 | PrimaryExpression_ { $$ = $1; }
597 PrimaryExpressionNoBF
598 : PrimaryExpression_ { $$ = $1; }
601 /* 11.1.4 Array Initialiser {{{ */
603 : "[" ElementListOpt "]" { $$ = new(driver.pool_) CYArray($2); }
607 : AssignmentExpression { $$ = $1; }
611 : Element { $$ = $1; }
616 : ElementList { $$ = $1; }
621 : ElementOpt "," ElementListOpt { $$ = new(driver.pool_) CYElement($1, $3); }
622 | Element { $$ = new(driver.pool_) CYElement($1, NULL); }
625 /* 11.1.5 Object Initialiser {{{ */
627 : "{" PropertyNameAndValueListOpt "}" { $$ = new(driver.pool_) CYObject($2); }
630 PropertyNameAndValueList_
631 : "," PropertyNameAndValueList { $$ = $2; }
635 PropertyNameAndValueListOpt
636 : PropertyNameAndValueList { $$ = $1; }
640 PropertyNameAndValueList
641 : PropertyName ":" AssignmentExpression PropertyNameAndValueList_ { $$ = new(driver.pool_) CYProperty($1, $3, $4); }
645 : Identifier { $$ = $1; }
646 | StringLiteral { $$ = $1; }
647 | NumericLiteral { $$ = $1; }
651 /* 11.2 Left-Hand-Side Expressions {{{ */
653 : "new" MemberExpression Arguments { $$ = new(driver.pool_) CYNew($2, $3); }
657 : "[" Expression "]" { $$ = new(driver.pool_) CYDirectMember(NULL, $2); }
658 | "." Identifier { $$ = new(driver.pool_) CYDirectMember(NULL, new(driver.pool_) CYString($2)); }
662 : PrimaryExpression { $$ = $1; }
663 | FunctionExpression { $$ = $1; }
664 | MemberExpression MemberAccess { $2->SetLeft($1); $$ = $2; }
665 | MemberExpression_ { $$ = $1; }
669 : PrimaryExpressionNoBF { $$ = $1; }
670 | MemberExpressionNoBF MemberAccess { $2->SetLeft($1); $$ = $2; }
671 | MemberExpression_ { $$ = $1; }
675 : "new" NewExpression { $$ = new(driver.pool_) CYNew($2, NULL); }
679 : MemberExpression { $$ = $1; }
680 | NewExpression_ { $$ = $1; }
684 : MemberExpressionNoBF { $$ = $1; }
685 | NewExpression_ { $$ = $1; }
689 : MemberExpression Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
690 | CallExpression Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
691 | CallExpression MemberAccess { $2->SetLeft($1); $$ = $2; }
695 : MemberExpressionNoBF Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
696 | CallExpressionNoBF Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
697 | CallExpressionNoBF MemberAccess { $2->SetLeft($1); $$ = $2; }
701 : "," ArgumentList { $$ = $2; }
706 : ArgumentList { $$ = $1; }
711 : AssignmentExpression ArgumentList_ { $$ = new(driver.pool_) CYArgument(NULL, $1, $2); }
715 : "(" ArgumentListOpt ")" { $$ = $2; }
718 LeftHandSideExpression
719 : NewExpression { $$ = $1; }
720 | CallExpression { $$ = $1; }
723 LeftHandSideExpressionNoBF
724 : NewExpressionNoBF { $$ = $1; }
725 | CallExpressionNoBF { $$ = $1; }
728 /* 11.3 Postfix Expressions {{{ */
730 : AssigneeExpression { $$ = $1; }
731 | LeftHandSideExpression "++" { $$ = new(driver.pool_) CYPostIncrement($1); }
732 | LeftHandSideExpression "--" { $$ = new(driver.pool_) CYPostDecrement($1); }
735 PostfixExpressionNoBF
736 : AssigneeExpressionNoBF { $$ = $1; }
737 | LeftHandSideExpressionNoBF "++" { $$ = new(driver.pool_) CYPostIncrement($1); }
738 | LeftHandSideExpressionNoBF "--" { $$ = new(driver.pool_) CYPostDecrement($1); }
741 /* 11.4 Unary Operators {{{ */
743 : "delete" UnaryExpression { $$ = new(driver.pool_) CYDelete($2); }
744 | "void" UnaryExpression { $$ = new(driver.pool_) CYVoid($2); }
745 | "typeof" UnaryExpression { $$ = new(driver.pool_) CYTypeOf($2); }
746 | "++" UnaryExpression { $$ = new(driver.pool_) CYPreIncrement($2); }
747 | "\n++" UnaryExpression { $$ = new(driver.pool_) CYPreIncrement($2); }
748 | "--" UnaryExpression { $$ = new(driver.pool_) CYPreDecrement($2); }
749 | "\n--" UnaryExpression { $$ = new(driver.pool_) CYPreDecrement($2); }
750 | "+" UnaryExpression { $$ = $2; }
751 | "-" UnaryExpression { $$ = new(driver.pool_) CYNegate($2); }
752 | "~" UnaryExpression { $$ = new(driver.pool_) CYBitwiseNot($2); }
753 | "!" UnaryExpression { $$ = new(driver.pool_) CYLogicalNot($2); }
757 : PostfixExpression { $$ = $1; }
758 | UnaryExpression_ { $$ = $1; }
762 : PostfixExpressionNoBF { $$ = $1; }
763 | UnaryExpression_ { $$ = $1; }
766 /* 11.5 Multiplicative Operators {{{ */
767 MultiplicativeExpression
768 : UnaryExpression { $$ = $1; }
769 | MultiplicativeExpression "*" UnaryExpression { $$ = new(driver.pool_) CYMultiply($1, $3); }
770 | MultiplicativeExpression "/" UnaryExpression { $$ = new(driver.pool_) CYDivide($1, $3); }
771 | MultiplicativeExpression "%" UnaryExpression { $$ = new(driver.pool_) CYModulus($1, $3); }
774 MultiplicativeExpressionNoBF
775 : UnaryExpressionNoBF { $$ = $1; }
776 | MultiplicativeExpressionNoBF "*" UnaryExpression { $$ = new(driver.pool_) CYMultiply($1, $3); }
777 | MultiplicativeExpressionNoBF "/" UnaryExpression { $$ = new(driver.pool_) CYDivide($1, $3); }
778 | MultiplicativeExpressionNoBF "%" UnaryExpression { $$ = new(driver.pool_) CYModulus($1, $3); }
781 /* 11.6 Additive Operators {{{ */
783 : MultiplicativeExpression { $$ = $1; }
784 | AdditiveExpression "+" MultiplicativeExpression { $$ = new(driver.pool_) CYAdd($1, $3); }
785 | AdditiveExpression "-" MultiplicativeExpression { $$ = new(driver.pool_) CYSubtract($1, $3); }
788 AdditiveExpressionNoBF
789 : MultiplicativeExpressionNoBF { $$ = $1; }
790 | AdditiveExpressionNoBF "+" MultiplicativeExpression { $$ = new(driver.pool_) CYAdd($1, $3); }
791 | AdditiveExpressionNoBF "-" MultiplicativeExpression { $$ = new(driver.pool_) CYSubtract($1, $3); }
794 /* 11.7 Bitwise Shift Operators {{{ */
796 : AdditiveExpression { $$ = $1; }
797 | ShiftExpression "<<" AdditiveExpression { $$ = new(driver.pool_) CYShiftLeft($1, $3); }
798 | ShiftExpression ">>" AdditiveExpression { $$ = new(driver.pool_) CYShiftRightSigned($1, $3); }
799 | ShiftExpression ">>>" AdditiveExpression { $$ = new(driver.pool_) CYShiftRightUnsigned($1, $3); }
803 : AdditiveExpressionNoBF { $$ = $1; }
804 | ShiftExpressionNoBF "<<" AdditiveExpression { $$ = new(driver.pool_) CYShiftLeft($1, $3); }
805 | ShiftExpressionNoBF ">>" AdditiveExpression { $$ = new(driver.pool_) CYShiftRightSigned($1, $3); }
806 | ShiftExpressionNoBF ">>>" AdditiveExpression { $$ = new(driver.pool_) CYShiftRightUnsigned($1, $3); }
809 /* 11.8 Relational Operators {{{ */
810 RelationalExpressionNoIn_
811 : "<" ShiftExpression { $$ = new(driver.pool_) CYLess(NULL, $2); }
812 | ">" ShiftExpression { $$ = new(driver.pool_) CYGreater(NULL, $2); }
813 | "<=" ShiftExpression { $$ = new(driver.pool_) CYLessOrEqual(NULL, $2); }
814 | ">=" ShiftExpression { $$ = new(driver.pool_) CYGreaterOrEqual(NULL, $2); }
815 | "instanceof" ShiftExpression { $$ = new(driver.pool_) CYInstanceOf(NULL, $2); }
818 RelationalExpression_
819 : RelationalExpressionNoIn_ { $$ = $1; }
820 | "in" ShiftExpression { $$ = new(driver.pool_) CYIn(NULL, $2); }
824 : ShiftExpression { $$ = $1; }
825 | RelationalExpression RelationalExpression_ { $2->SetLeft($1); $$ = $2; }
828 RelationalExpressionNoIn
829 : ShiftExpression { $$ = $1; }
830 | RelationalExpressionNoIn RelationalExpressionNoIn_ { $2->SetLeft($1); $$ = $2; }
833 RelationalExpressionNoBF
834 : ShiftExpressionNoBF { $$ = $1; }
835 | RelationalExpressionNoBF RelationalExpression_ { $2->SetLeft($1); $$ = $2; }
838 /* 11.9 Equality Operators {{{ */
840 : RelationalExpression { $$ = $1; }
841 | EqualityExpression "==" RelationalExpression { $$ = new(driver.pool_) CYEqual($1, $3); }
842 | EqualityExpression "!=" RelationalExpression { $$ = new(driver.pool_) CYNotEqual($1, $3); }
843 | EqualityExpression "===" RelationalExpression { $$ = new(driver.pool_) CYIdentical($1, $3); }
844 | EqualityExpression "!==" RelationalExpression { $$ = new(driver.pool_) CYNotIdentical($1, $3); }
847 EqualityExpressionNoIn
848 : RelationalExpressionNoIn { $$ = $1; }
849 | EqualityExpressionNoIn "==" RelationalExpressionNoIn { $$ = new(driver.pool_) CYEqual($1, $3); }
850 | EqualityExpressionNoIn "!=" RelationalExpressionNoIn { $$ = new(driver.pool_) CYNotEqual($1, $3); }
851 | EqualityExpressionNoIn "===" RelationalExpressionNoIn { $$ = new(driver.pool_) CYIdentical($1, $3); }
852 | EqualityExpressionNoIn "!==" RelationalExpressionNoIn { $$ = new(driver.pool_) CYNotIdentical($1, $3); }
855 EqualityExpressionNoBF
856 : RelationalExpressionNoBF { $$ = $1; }
857 | EqualityExpressionNoBF "==" RelationalExpression { $$ = new(driver.pool_) CYEqual($1, $3); }
858 | EqualityExpressionNoBF "!=" RelationalExpression { $$ = new(driver.pool_) CYNotEqual($1, $3); }
859 | EqualityExpressionNoBF "===" RelationalExpression { $$ = new(driver.pool_) CYIdentical($1, $3); }
860 | EqualityExpressionNoBF "!==" RelationalExpression { $$ = new(driver.pool_) CYNotIdentical($1, $3); }
863 /* 11.10 Binary Bitwise Operators {{{ */
865 : EqualityExpression { $$ = $1; }
866 | BitwiseANDExpression "&" EqualityExpression { $$ = new(driver.pool_) CYBitwiseAnd($1, $3); }
869 BitwiseANDExpressionNoIn
870 : EqualityExpressionNoIn { $$ = $1; }
871 | BitwiseANDExpressionNoIn "&" EqualityExpressionNoIn { $$ = new(driver.pool_) CYBitwiseAnd($1, $3); }
874 BitwiseANDExpressionNoBF
875 : EqualityExpressionNoBF { $$ = $1; }
876 | BitwiseANDExpressionNoBF "&" EqualityExpression { $$ = new(driver.pool_) CYBitwiseAnd($1, $3); }
880 : BitwiseANDExpression { $$ = $1; }
881 | BitwiseXORExpression "^" BitwiseANDExpression { $$ = new(driver.pool_) CYBitwiseXOr($1, $3); }
884 BitwiseXORExpressionNoIn
885 : BitwiseANDExpressionNoIn { $$ = $1; }
886 | BitwiseXORExpressionNoIn "^" BitwiseANDExpressionNoIn { $$ = new(driver.pool_) CYBitwiseXOr($1, $3); }
889 BitwiseXORExpressionNoBF
890 : BitwiseANDExpressionNoBF { $$ = $1; }
891 | BitwiseXORExpressionNoBF "^" BitwiseANDExpression { $$ = new(driver.pool_) CYBitwiseXOr($1, $3); }
895 : BitwiseXORExpression { $$ = $1; }
896 | BitwiseORExpression "|" BitwiseXORExpression { $$ = new(driver.pool_) CYBitwiseOr($1, $3); }
899 BitwiseORExpressionNoIn
900 : BitwiseXORExpressionNoIn { $$ = $1; }
901 | BitwiseORExpressionNoIn "|" BitwiseXORExpressionNoIn { $$ = new(driver.pool_) CYBitwiseOr($1, $3); }
904 BitwiseORExpressionNoBF
905 : BitwiseXORExpressionNoBF { $$ = $1; }
906 | BitwiseORExpressionNoBF "|" BitwiseXORExpression { $$ = new(driver.pool_) CYBitwiseOr($1, $3); }
909 /* 11.11 Binary Logical Operators {{{ */
911 : BitwiseORExpression { $$ = $1; }
912 | LogicalANDExpression "&&" BitwiseORExpression { $$ = new(driver.pool_) CYLogicalAnd($1, $3); }
915 LogicalANDExpressionNoIn
916 : BitwiseORExpressionNoIn { $$ = $1; }
917 | LogicalANDExpressionNoIn "&&" BitwiseORExpressionNoIn { $$ = new(driver.pool_) CYLogicalAnd($1, $3); }
920 LogicalANDExpressionNoBF
921 : BitwiseORExpressionNoBF { $$ = $1; }
922 | LogicalANDExpressionNoBF "&&" BitwiseORExpression { $$ = new(driver.pool_) CYLogicalAnd($1, $3); }
926 : LogicalANDExpression { $$ = $1; }
927 | LogicalORExpression "||" LogicalANDExpression { $$ = new(driver.pool_) CYLogicalOr($1, $3); }
930 LogicalORExpressionNoIn
931 : LogicalANDExpressionNoIn { $$ = $1; }
932 | LogicalORExpressionNoIn "||" LogicalANDExpressionNoIn { $$ = new(driver.pool_) CYLogicalOr($1, $3); }
935 LogicalORExpressionNoBF
936 : LogicalANDExpressionNoBF { $$ = $1; }
937 | LogicalORExpressionNoBF "||" LogicalANDExpression { $$ = new(driver.pool_) CYLogicalOr($1, $3); }
940 /* 11.12 Conditional Operator ( ? : ) {{{ */
941 ConditionalExpression
942 : LogicalORExpression { $$ = $1; }
943 | LogicalORExpression "?" AssignmentExpression ":" AssignmentExpression { $$ = new(driver.pool_) CYCondition($1, $3, $5); }
946 ConditionalExpressionNoIn
947 : LogicalORExpressionNoIn { $$ = $1; }
948 | LogicalORExpressionNoIn "?" AssignmentExpression ":" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYCondition($1, $3, $5); }
951 ConditionalExpressionNoBF
952 : LogicalORExpressionNoBF { $$ = $1; }
953 | LogicalORExpressionNoBF "?" AssignmentExpression ":" AssignmentExpression { $$ = new(driver.pool_) CYCondition($1, $3, $5); }
956 /* 11.13 Assignment Operators {{{ */
957 AssignmentExpression_
958 : "=" AssignmentExpression { $$ = new(driver.pool_) CYAssign(NULL, $2); }
959 | "*=" AssignmentExpression { $$ = new(driver.pool_) CYMultiplyAssign(NULL, $2); }
960 | "/=" AssignmentExpression { $$ = new(driver.pool_) CYDivideAssign(NULL, $2); }
961 | "%=" AssignmentExpression { $$ = new(driver.pool_) CYModulusAssign(NULL, $2); }
962 | "+=" AssignmentExpression { $$ = new(driver.pool_) CYAddAssign(NULL, $2); }
963 | "-=" AssignmentExpression { $$ = new(driver.pool_) CYSubtractAssign(NULL, $2); }
964 | "<<=" AssignmentExpression { $$ = new(driver.pool_) CYShiftLeftAssign(NULL, $2); }
965 | ">>=" AssignmentExpression { $$ = new(driver.pool_) CYShiftRightSignedAssign(NULL, $2); }
966 | ">>>=" AssignmentExpression { $$ = new(driver.pool_) CYShiftRightUnsignedAssign(NULL, $2); }
967 | "&=" AssignmentExpression { $$ = new(driver.pool_) CYBitwiseAndAssign(NULL, $2); }
968 | "^=" AssignmentExpression { $$ = new(driver.pool_) CYBitwiseXOrAssign(NULL, $2); }
969 | "|=" AssignmentExpression { $$ = new(driver.pool_) CYBitwiseOrAssign(NULL, $2); }
973 : LeftHandSideExpression { $$ = $1; }
974 | AssigneeExpression_ { $$ = $1; }
977 AssigneeExpressionNoBF
978 : LeftHandSideExpressionNoBF { $$ = $1; }
979 | AssigneeExpression_ { $$ = $1; }
983 : ConditionalExpression { $$ = $1; }
984 | AssigneeExpression AssignmentExpression_ { $2->SetLeft($1); $$ = $2; }
987 AssignmentExpressionNoIn
988 : ConditionalExpressionNoIn { $$ = $1; }
989 | AssigneeExpression "=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYAssign($1, $3); }
990 | AssigneeExpression "*=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYMultiplyAssign($1, $3); }
991 | AssigneeExpression "/=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYDivideAssign($1, $3); }
992 | AssigneeExpression "%=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYModulusAssign($1, $3); }
993 | AssigneeExpression "+=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYAddAssign($1, $3); }
994 | AssigneeExpression "-=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYSubtractAssign($1, $3); }
995 | AssigneeExpression "<<=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYShiftLeftAssign($1, $3); }
996 | AssigneeExpression ">>=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYShiftRightSignedAssign($1, $3); }
997 | AssigneeExpression ">>>=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYShiftRightUnsignedAssign($1, $3); }
998 | AssigneeExpression "&=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYBitwiseAndAssign($1, $3); }
999 | AssigneeExpression "^=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYBitwiseXOrAssign($1, $3); }
1000 | AssigneeExpression "|=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYBitwiseOrAssign($1, $3); }
1003 AssignmentExpressionNoBF
1004 : ConditionalExpressionNoBF { $$ = $1; }
1005 | AssigneeExpressionNoBF AssignmentExpression_ { $2->SetLeft($1); $$ = $2; }
1008 /* 11.14 Comma Operator {{{ */
1010 : "," Expression { $$ = new(driver.pool_) CYCompound($2); }
1015 : "," ExpressionNoIn { $$ = new(driver.pool_) CYCompound($2); }
1020 : Expression { $$ = $1; }
1025 : ExpressionNoIn { $$ = $1; }
1030 : AssignmentExpression Expression_ { if ($2) { $2->AddPrev($1); $$ = $2; } else $$ = $1; }
1034 : AssignmentExpressionNoIn ExpressionNoIn_ { if ($2) { $2->AddPrev($1); $$ = $2; } else $$ = $1; }
1038 : AssignmentExpressionNoBF Expression_ { if ($2) { $2->AddPrev($1); $$ = $2; } else $$ = $1; }
1042 /* 12 Statements {{{ */
1044 : Block { $$ = $1; }
1045 | VariableStatement { $$ = $1; }
1046 | EmptyStatement { $$ = $1; }
1047 | ExpressionStatement { $$ = $1; }
1048 | IfStatement { $$ = $1; }
1049 | IterationStatement { $$ = $1; }
1050 | ContinueStatement { $$ = $1; }
1051 | BreakStatement { $$ = $1; }
1052 | ReturnStatement { $$ = $1; }
1053 | WithStatement { $$ = $1; }
1054 | LabelledStatement { $$ = $1; }
1055 | SwitchStatement { $$ = $1; }
1056 | ThrowStatement { $$ = $1; }
1057 | TryStatement { $$ = $1; }
1060 /* 12.1 Block {{{ */
1062 : "{" StatementListOpt "}" { $$ = $2; }
1066 : Block_ { if ($1) $$ = new(driver.pool_) CYBlock($1); else $$ = new(driver.pool_) CYEmpty(); }
1070 : Statement StatementListOpt { $1->SetNext($2); $$ = $1; }
1074 : StatementList { $$ = $1; }
1078 /* 12.2 Variable Statement {{{ */
1080 : "var" VariableDeclarationList Terminator { $$ = new(driver.pool_) CYVar($2); }
1083 VariableDeclarationList_
1084 : "," VariableDeclarationList { $$ = $2; }
1088 VariableDeclarationListNoIn_
1089 : "," VariableDeclarationListNoIn { $$ = $2; }
1093 VariableDeclarationList
1094 : VariableDeclaration VariableDeclarationList_ { $$ = new(driver.pool_) CYDeclarations($1, $2); }
1097 VariableDeclarationListNoIn
1098 : VariableDeclarationNoIn VariableDeclarationListNoIn_ { $$ = new(driver.pool_) CYDeclarations($1, $2); }
1102 : Identifier InitialiserOpt { $$ = new(driver.pool_) CYDeclaration($1, $2); }
1105 VariableDeclarationNoIn
1106 : Identifier InitialiserNoInOpt { $$ = new(driver.pool_) CYDeclaration($1, $2); }
1110 : Initialiser { $$ = $1; }
1115 : InitialiserNoIn { $$ = $1; }
1120 : "=" AssignmentExpression { $$ = $2; }
1124 : "=" AssignmentExpressionNoIn { $$ = $2; }
1127 /* 12.3 Empty Statement {{{ */
1129 : ";" { $$ = new(driver.pool_) CYEmpty(); }
1132 /* 12.4 Expression Statement {{{ */
1134 : ExpressionNoBF Terminator { $$ = new(driver.pool_) CYExpress($1); }
1137 /* 12.5 The if Statement {{{ */
1139 : "else" Statement { $$ = $2; }
1140 | %prec "if" { $$ = NULL; }
1144 : "if" "(" Expression ")" Statement ElseStatementOpt { $$ = new(driver.pool_) CYIf($3, $5, $6); }
1148 /* 12.6 Iteration Statements {{{ */
1150 : DoWhileStatement { $$ = $1; }
1151 | WhileStatement { $$ = $1; }
1152 | ForStatement { $$ = $1; }
1153 | ForInStatement { $$ = $1; }
1156 /* 12.6.1 The do-while Statement {{{ */
1158 : "do" Statement "while" "(" Expression ")" TerminatorOpt { $$ = new(driver.pool_) CYDoWhile($5, $2); }
1161 /* 12.6.2 The while Statement {{{ */
1163 : "while" "(" Expression ")" Statement { $$ = new(driver.pool_) CYWhile($3, $5); }
1166 /* 12.6.3 The for Statement {{{ */
1168 : "for" "(" ForStatementInitialiser ";" ExpressionOpt ";" ExpressionOpt ")" Statement { $$ = new(driver.pool_) CYFor($3, $5, $7, $9); }
1171 ForStatementInitialiser
1172 : ExpressionNoInOpt { $$ = $1; }
1173 | "var" VariableDeclarationListNoIn { $$ = $2; }
1176 /* 12.6.4 The for-in Statement {{{ */
1178 : "for" "(" ForInStatementInitialiser "in" Expression ")" Statement { $$ = new(driver.pool_) CYForIn($3, $5, $7); }
1181 ForInStatementInitialiser
1182 : LeftHandSideExpression { $$ = $1; }
1183 | "var" VariableDeclarationNoIn { $$ = $2; }
1187 /* 12.7 The continue Statement {{{ */
1189 : "continue" IdentifierOpt Terminator { $$ = new(driver.pool_) CYContinue($2); }
1192 /* 12.8 The break Statement {{{ */
1194 : "break" IdentifierOpt Terminator { $$ = new(driver.pool_) CYBreak($2); }
1197 /* 12.9 The return Statement {{{ */
1199 : "return" ExpressionOpt Terminator { $$ = new(driver.pool_) CYReturn($2); }
1202 /* 12.10 The with Statement {{{ */
1204 : "with" "(" Expression ")" Statement { $$ = new(driver.pool_) CYWith($3, $5); }
1208 /* 12.11 The switch Statement {{{ */
1210 : "switch" "(" Expression ")" CaseBlock { $$ = new(driver.pool_) CYSwitch($3, $5); }
1214 : "{" CaseClausesOpt "}" { $$ = $2; }
1218 : CaseClause CaseClausesOpt { $1->SetNext($2); $$ = $1; }
1219 | DefaultClause CaseClausesOpt { $1->SetNext($2); $$ = $1; }
1224 : "case" Expression ":" StatementListOpt { $$ = new(driver.pool_) CYClause($2, $4); }
1228 : "default" ":" StatementListOpt { $$ = new(driver.pool_) CYClause(NULL, $3); }
1231 /* 12.12 Labelled Statements {{{ */
1233 : Identifier ":" Statement { $3->AddLabel($1); $$ = $3; }
1236 /* 12.13 The throw Statement {{{ */
1238 : "throw" Expression Terminator { $$ = new(driver.pool_) CYThrow($2); }
1241 /* 12.14 The try Statement {{{ */
1243 : "try" Block_ CatchOpt FinallyOpt { $$ = new(driver.pool_) CYTry($2, $3, $4); }
1247 : "catch" "(" Identifier ")" Block_ { $$ = new(driver.pool_) CYCatch($3, $5); }
1252 : "finally" Block_ { $$ = $2; }
1257 /* 13 Function Definition {{{ */
1259 : "function" Identifier "(" FormalParameterList ")" "{" FunctionBody "}" { $$ = new(driver.pool_) CYFunction($2, $4, $7); }
1263 : "function" IdentifierOpt "(" FormalParameterList ")" "{" FunctionBody "}" { $$ = new(driver.pool_) CYLambda($2, $4, $7); }
1266 FormalParameterList_
1267 : "," FormalParameterList { $$ = $2; }
1272 : Identifier FormalParameterList_ { $$ = new(driver.pool_) CYFunctionParameter($1, $2); }
1277 : SourceElements { $$ = $1; }
1280 /* 14 Program {{{ */
1282 : SourceElements { driver.source_ = $1; }
1286 : SourceElement SourceElements { $1->SetNext($2); $$ = $1; }
1291 : Statement { $$ = $1; }
1292 | FunctionDeclaration { $$ = $1; }
1296 /* Cycript: @class Declaration {{{ */
1298 : ":" MemberExpressionNoBF { $$ = $2; }
1303 : "{" "}" { $$ = NULL; }
1307 : "+" { $$ = false; }
1308 | "-" { $$ = true; }
1312 : "(" Expression ")" { $$ = $2; }
1317 : Word ":" TypeOpt Identifier { $$ = new(driver.pool_) CYMessageParameter($1, $3, $4); }
1320 MessageParameterListOpt
1321 : MessageParameterList { $$ = $1; }
1325 MessageParameterList
1326 : MessageParameter MessageParameterListOpt { $1->SetNext($2); $$ = $1; }
1330 : MessageParameterList { $$ = $1; }
1331 | Word { $$ = new(driver.pool_) CYMessageParameter($1, NULL, NULL); }
1334 ClassMessageDeclaration
1335 : MessageScope TypeOpt MessageParameters "{" FunctionBody "}" { $$ = new(driver.pool_) CYMessage($1, $2, $3, $5); }
1338 ClassMessageDeclarationListOpt
1339 : ClassMessageDeclarationListOpt ClassMessageDeclaration { $2->SetNext($1); $$ = $2; }
1344 : Identifier { $$ = $1; }
1345 | "(" AssignmentExpression ")" { $$ = $2; }
1349 : ClassName { $$ = $1; }
1354 : "@class" ClassNameOpt ClassSuperOpt ClassFieldList ClassMessageDeclarationListOpt "@end" { $$ = new(driver.pool_) CYClass($2, $3, $4, $5); }
1358 : "@class" ClassName ClassMessageDeclarationListOpt "@end" { $$ = new(driver.pool_) CYCategory($2, $3); }
1362 : ClassDefinition { $$ = $1; }
1366 : ClassDefinition { $$ = $1; }
1367 | CategoryStatement { $$ = $1; }
1370 /* Cycript: Send Message {{{ */
1372 : "," AssignmentExpression VariadicCall { $$ = new(driver.pool_) CYArgument(NULL, $2, $3); }
1377 : SelectorCall { $$ = $1; }
1378 | VariadicCall { $$ = $1; }
1382 : WordOpt ":" AssignmentExpression SelectorCall_ { $$ = new(driver.pool_) CYArgument($1 ?: new(driver.pool_) CYBlank(), $3, $4); }
1386 : SelectorCall { $$ = $1; }
1387 | Word { $$ = new(driver.pool_) CYArgument($1, NULL); }
1391 : "[" AssignmentExpression SelectorList "]" { $$ = new(driver.pool_) CYSend($2, $3); }
1394 SelectorExpressionOpt
1395 : SelectorExpression_ { $$ = $1; }
1400 : WordOpt ":" SelectorExpressionOpt { $$ = new(driver.pool_) CYSelectorPart($1, true, $3); }
1404 : SelectorExpression_ { $$ = $1; }
1405 | Word { $$ = new(driver.pool_) CYSelectorPart($1, false, NULL); }
1409 : MessageExpression { $$ = $1; }
1410 | "@selector" "(" SelectorExpression ")" { $$ = new(driver.pool_) CYSelector($3); }
1413 /* Cycript: Pointer Indirection/Addressing {{{ */
1415 : "*" UnaryExpression { $$ = new(driver.pool_) CYIndirect($2); }
1419 : "&" UnaryExpression { $$ = new(driver.pool_) CYAddressOf($2); }
1423 : "->" Identifier { $$ = new(driver.pool_) CYIndirectMember(NULL, new(driver.pool_) CYString($2)); }
1426 /* ECMAScript5: Object Literal Trailing Comma {{{ */
1427 PropertyNameAndValueList_
1428 : "," { $$ = NULL; }
1431 /* JavaScript 1.7: Array Comprehensions {{{ */
1433 : "if" "(" Expression ")" { $$ = new(driver.pool_) CYIfComprehension($3); }
1437 : "for" "(" Identifier "in" Expression ")" { $$ = new(driver.pool_) CYForInComprehension($3, $5); }
1438 | "for" "each" "(" Identifier "in" Expression ")" { $$ = new(driver.pool_) CYForEachInComprehension($4, $6); }
1441 ComprehensionListOpt
1442 : ComprehensionList { $$ = $1; }
1443 | IfComprehension { $$ = $1; }
1448 : ForComprehension ComprehensionListOpt { $1->SetNext($2); $$ = $1; }
1452 : "[" AssignmentExpression ComprehensionList "]" { $$ = new(driver.pool_) CYArrayComprehension($2, $3); }
1455 /* JavaScript 1.7: for each {{{ */
1457 : "for" "each" "(" ForInStatementInitialiser "in" Expression ")" Statement { $$ = new(driver.pool_) CYForEachIn($4, $6, $8); }
1460 /* JavaScript 1.7: Let Statements {{{ *//*
1462 : "let" "(" VariableDeclarationList ")" Block_ { $$ = new(driver.pool_) CYLet($3, $5); }