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_;
62 CYClassName *className_;
63 CYComprehension *comprehension_;
64 CYCompound *compound_;
65 CYDeclaration *declaration_;
66 CYDeclarations *declarations_;
68 CYExpression *expression_;
72 CYForInitialiser *for_;
73 CYForInInitialiser *forin_;
74 CYFunctionParameter *functionParameter_;
75 CYIdentifier *identifier_;
80 CYMessageParameter *messageParameter_;
84 CYProperty *property_;
85 CYPropertyName *propertyName_;
86 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 }
123 %token AmpersandAmpersand "&&"
124 %token AmpersandEqual "&="
126 %token CarrotEqual "^="
128 %token EqualEqual "=="
129 %token EqualEqualEqual "==="
130 %token Exclamation "!"
131 %token ExclamationEqual "!="
132 %token ExclamationEqualEqual "!=="
134 %token HyphenEqual "-="
135 %token HyphenHyphen "--"
136 %token HyphenHyphen_ "\n--"
137 %token HyphenRight "->"
139 %token LeftEqual "<="
141 %token LeftLeftEqual "<<="
143 %token PercentEqual "%="
146 %token PipeEqual "|="
149 %token PlusEqual "+="
151 %token PlusPlus_ "\n++"
153 %token RightEqual ">="
154 %token RightRight ">>"
155 %token RightRightEqual ">>="
156 %token RightRightRight ">>>"
157 %token RightRightRightEqual ">>>="
159 %token SlashEqual "/="
161 %token StarEqual "*="
171 %token CloseParen ")"
174 %token CloseBrace "}"
176 %token OpenBracket "["
177 %token CloseBracket "]"
179 %token AtClass "@class"
180 %token AtSelector "@selector"
183 %token <false_> False "false"
184 %token <null_> Null "null"
185 %token <true_> True "true"
187 // ES3/ES5/WIE/JSC Reserved
188 %token <word_> Break "break"
189 %token <word_> Case "case"
190 %token <word_> Catch "catch"
191 %token <word_> Continue "continue"
192 %token <word_> Default "default"
193 %token <word_> Delete "delete"
194 %token <word_> Do "do"
195 %token <word_> Else "else"
196 %token <word_> Finally "finally"
197 %token <word_> For "for"
198 %token <word_> Function "function"
199 %token <word_> If "if"
200 %token <word_> In "in"
201 %token <word_> InstanceOf "instanceof"
202 %token <word_> New "new"
203 %token <word_> Return "return"
204 %token <word_> Switch "switch"
205 %token <this_> This "this"
206 %token <word_> Throw "throw"
207 %token <word_> Try "try"
208 %token <word_> TypeOf "typeof"
209 %token <word_> Var "var"
210 %token <word_> Void "void"
211 %token <word_> While "while"
212 %token <word_> With "with"
214 // ES3/IE6 Future, ES5/JSC Reserved
215 %token <word_> Debugger "debugger"
217 // ES3/ES5/IE6 Future, JSC Reserved
218 %token <word_> Const "const"
220 // ES3/ES5/IE6/JSC Future
221 %token <word_> Class "class"
222 %token <word_> Enum "enum"
223 %token <word_> Export "export"
224 %token <word_> Extends "extends"
225 %token <word_> Import "import"
226 %token <word_> Super "super"
228 // ES3 Future, ES5 Strict Future
229 %token <identifier_> Implements "implements"
230 %token <identifier_> Interface "interface"
231 %token <identifier_> Package "package"
232 %token <identifier_> Private "private"
233 %token <identifier_> Protected "protected"
234 %token <identifier_> Public "public"
235 %token <identifier_> Static "static"
238 %token <identifier_> Abstract "abstract"
239 %token <identifier_> Boolean "boolean"
240 %token <identifier_> Byte "byte"
241 %token <identifier_> Char "char"
242 %token <identifier_> Double "double"
243 %token <identifier_> Final "final"
244 %token <identifier_> Float "float"
245 %token <identifier_> Goto "goto"
246 %token <identifier_> Int "int"
247 %token <identifier_> Long "long"
248 %token <identifier_> Native "native"
249 %token <identifier_> Short "short"
250 %token <identifier_> Synchronized "synchronized"
251 %token <identifier_> Throws "throws"
252 %token <identifier_> Transient "transient"
253 %token <identifier_> Volatile "volatile"
256 %token <identifier_> Let "let"
257 %token <identifier_> Yield "yield"
260 %token <identifier_> Each "each"
262 %token <identifier_> Identifier_
263 %token <number_> NumericLiteral
264 %token <string_> StringLiteral
265 %token <literal_> RegularExpressionLiteral
267 %type <expression_> AdditiveExpression
268 %type <expression_> AdditiveExpressionNoBF
269 %type <argument_> ArgumentList
270 %type <argument_> ArgumentList_
271 %type <argument_> ArgumentListOpt
272 %type <argument_> Arguments
273 %type <literal_> ArrayLiteral
274 %type <expression_> AssigneeExpression
275 %type <expression_> AssigneeExpression_
276 %type <expression_> AssigneeExpressionNoBF
277 %type <expression_> AssignmentExpression
278 %type <assignment_> AssignmentExpression_
279 %type <expression_> AssignmentExpressionNoBF
280 %type <expression_> AssignmentExpressionNoIn
281 %type <expression_> BitwiseANDExpression
282 %type <expression_> BitwiseANDExpressionNoBF
283 %type <expression_> BitwiseANDExpressionNoIn
284 %type <statement_> Block
285 %type <statement_> Block_
286 %type <boolean_> BooleanLiteral
287 %type <expression_> BitwiseORExpression
288 %type <expression_> BitwiseORExpressionNoBF
289 %type <expression_> BitwiseORExpressionNoIn
290 %type <expression_> BitwiseXORExpression
291 %type <expression_> BitwiseXORExpressionNoBF
292 %type <expression_> BitwiseXORExpressionNoIn
293 %type <statement_> BreakStatement
294 %type <expression_> CallExpression
295 %type <expression_> CallExpressionNoBF
296 %type <clause_> CaseBlock
297 %type <clause_> CaseClause
298 %type <clause_> CaseClausesOpt
299 %type <catch_> CatchOpt
300 %type <statement_> CategoryStatement
301 %type <expression_> ClassExpression
302 %type <message_> ClassMessageDeclaration
303 %type <message_> ClassMessageDeclarationListOpt
304 %type <className_> ClassName
305 %type <className_> ClassNameOpt
306 %type <statement_> ClassStatement
307 %type <expression_> ClassSuperOpt
308 %type <field_> ClassFieldList
309 %type <comprehension_> ComprehensionList
310 %type <comprehension_> ComprehensionListOpt
311 %type <expression_> ConditionalExpression
312 %type <expression_> ConditionalExpressionNoBF
313 %type <expression_> ConditionalExpressionNoIn
314 %type <statement_> ContinueStatement
315 %type <clause_> DefaultClause
316 %type <statement_> DoWhileStatement
317 %type <expression_> Element
318 %type <expression_> ElementOpt
319 %type <element_> ElementList
320 %type <element_> ElementListOpt
321 %type <statement_> ElseStatementOpt
322 %type <statement_> EmptyStatement
323 %type <expression_> EqualityExpression
324 %type <expression_> EqualityExpressionNoBF
325 %type <expression_> EqualityExpressionNoIn
326 %type <expression_> Expression
327 %type <expression_> ExpressionOpt
328 %type <compound_> Expression_
329 %type <expression_> ExpressionNoBF
330 %type <expression_> ExpressionNoIn
331 %type <compound_> ExpressionNoIn_
332 %type <expression_> ExpressionNoInOpt
333 %type <statement_> ExpressionStatement
334 %type <finally_> FinallyOpt
335 %type <comprehension_> ForComprehension
336 %type <statement_> ForStatement
337 %type <for_> ForStatementInitialiser
338 %type <statement_> ForInStatement
339 %type <forin_> ForInStatementInitialiser
340 %type <functionParameter_> FormalParameterList
341 %type <functionParameter_> FormalParameterList_
342 %type <statement_> FunctionBody
343 %type <statement_> FunctionDeclaration
344 %type <expression_> FunctionExpression
345 %type <identifier_> Identifier
346 %type <identifier_> IdentifierOpt
347 %type <comprehension_> IfComprehension
348 %type <statement_> IfStatement
349 %type <expression_> Initialiser
350 %type <expression_> InitialiserOpt
351 %type <expression_> InitialiserNoIn
352 %type <expression_> InitialiserNoInOpt
353 %type <statement_> IterationStatement
354 %type <statement_> LabelledStatement
355 %type <expression_> LeftHandSideExpression
356 %type <expression_> LeftHandSideExpressionNoBF
357 //%type <statement_> LetStatement
358 %type <literal_> Literal
359 %type <expression_> LogicalANDExpression
360 %type <expression_> LogicalANDExpressionNoBF
361 %type <expression_> LogicalANDExpressionNoIn
362 %type <expression_> LogicalORExpression
363 %type <expression_> LogicalORExpressionNoBF
364 %type <expression_> LogicalORExpressionNoIn
365 %type <member_> MemberAccess
366 %type <expression_> MemberExpression
367 %type <expression_> MemberExpression_
368 %type <expression_> MemberExpressionNoBF
369 %type <messageParameter_> MessageParameter
370 %type <messageParameter_> MessageParameters
371 %type <messageParameter_> MessageParameterList
372 %type <messageParameter_> MessageParameterListOpt
373 %type <bool_> MessageScope
374 %type <expression_> MultiplicativeExpression
375 %type <expression_> MultiplicativeExpressionNoBF
376 %type <expression_> NewExpression
377 %type <expression_> NewExpression_
378 %type <expression_> NewExpressionNoBF
379 %type <null_> NullLiteral
380 %type <literal_> ObjectLiteral
381 %type <expression_> PostfixExpression
382 %type <expression_> PostfixExpressionNoBF
383 %type <expression_> PrimaryExpression
384 %type <expression_> PrimaryExpression_
385 %type <expression_> PrimaryExpressionNoBF
386 %type <statement_> Program
387 %type <propertyName_> PropertyName
388 %type <property_> PropertyNameAndValueList
389 %type <property_> PropertyNameAndValueList_
390 %type <property_> PropertyNameAndValueListOpt
391 %type <literal_> RegularExpressionLiteral_
392 %type <condition_> RegularExpressionToken
393 %type <expression_> RelationalExpression
394 %type <infix_> RelationalExpression_
395 %type <expression_> RelationalExpressionNoBF
396 %type <expression_> RelationalExpressionNoIn
397 %type <infix_> RelationalExpressionNoIn_
398 %type <statement_> ReturnStatement
399 %type <selector_> SelectorExpression
400 %type <selector_> SelectorExpression_
401 %type <selector_> SelectorExpressionOpt
402 %type <expression_> ShiftExpression
403 %type <expression_> ShiftExpressionNoBF
404 %type <statement_> SourceElement
405 %type <statement_> SourceElements
406 %type <statement_> Statement
407 %type <statement_> Statement_
408 %type <statement_> StatementList
409 %type <statement_> StatementListOpt
410 %type <statement_> SwitchStatement
411 %type <statement_> ThrowStatement
412 %type <statement_> TryStatement
413 %type <expression_> TypeOpt
414 %type <expression_> UnaryExpression
415 %type <expression_> UnaryExpression_
416 %type <expression_> UnaryExpressionNoBF
417 %type <declaration_> VariableDeclaration
418 %type <declaration_> VariableDeclarationNoIn
419 %type <declarations_> VariableDeclarationList
420 %type <declarations_> VariableDeclarationList_
421 %type <declarations_> VariableDeclarationListNoIn
422 %type <declarations_> VariableDeclarationListNoIn_
423 %type <statement_> VariableStatement
424 %type <statement_> WhileStatement
425 %type <statement_> WithStatement
427 %type <word_> WordOpt
429 %type <expression_> MessageExpression
430 %type <argument_> SelectorCall
431 %type <argument_> SelectorCall_
432 %type <argument_> SelectorList
433 %type <argument_> VariadicCall
437 %left "<<" ">>" ">>>"
438 %left "<" ">" "<=" ">=" "instanceof" "in"
439 %left "==" "!=" "===" "!=="
446 %right "=" "*=" "/=" "%=" "+=" "-=" "<<=" ">>=" ">>>=" "&=" "^=" "|="
456 : { driver.Warning(yylloc, "warning, automatic semi-colon insertion required"); }
466 | error { yyerrok; driver.errors_.pop_back(); } StrictSemi
471 | error { if (yychar != 0 && yychar != cy::parser::token::CloseBrace && !yylval.newline_) YYABORT; else { yyerrok; driver.errors_.pop_back(); } } StrictSemi
490 : Identifier { $$ = $1; }
491 | "break" NewLineOpt { $$ = $1; }
492 | "case" { $$ = $1; }
493 | "catch" { $$ = $1; }
494 | "class" { $$ = $1; }
495 | "const" { $$ = $1; }
496 | "continue" NewLineOpt { $$ = $1; }
497 | "debugger" { $$ = $1; }
498 | "default" { $$ = $1; }
499 | "delete" { $$ = $1; }
501 | "else" { $$ = $1; }
502 | "enum" { $$ = $1; }
503 | "export" { $$ = $1; }
504 | "extends" { $$ = $1; }
505 | "false" { $$ = $1; }
506 | "finally" { $$ = $1; }
508 | "function" { $$ = $1; }
510 | "import" { $$ = $1; }
511 /* XXX: | "in" { $$ = $1; } */
512 /* XXX: | "instanceof" { $$ = $1; } */
514 | "null" { $$ = $1; }
515 | "return" NewLineOpt { $$ = $1; }
516 | "super" { $$ = $1; }
517 | "switch" { $$ = $1; }
518 | "this" { $$ = $1; }
519 | "throw" NewLineOpt { $$ = $1; }
520 | "true" { $$ = $1; }
522 | "typeof" { $$ = $1; }
524 | "void" { $$ = $1; }
525 | "while" { $$ = $1; }
526 | "with" { $$ = $1; }
530 : Identifier_ { $$ = $1; }
532 | "implements" { $$ = $1; }
533 | "interface" { $$ = $1; }
534 | "package" { $$ = $1; }
535 | "private" { $$ = $1; }
536 | "protected" { $$ = $1; }
537 | "public" { $$ = $1; }
538 | "static" { $$ = $1; }
540 | "abstract" { $$ = $1; }
541 | "boolean" { $$ = $1; }
542 | "byte" { $$ = $1; }
543 | "char" { $$ = $1; }
544 | "double" { $$ = $1; }
545 | "final" { $$ = $1; }
546 | "float" { $$ = $1; }
547 | "goto" { $$ = $1; }
549 | "long" { $$ = $1; }
550 | "native" { $$ = $1; }
551 | "short" { $$ = $1; }
552 | "synchronized" { $$ = $1; }
553 | "throws" { $$ = $1; }
554 | "transient" { $$ = $1; }
555 | "volatile" { $$ = $1; }
558 | "yield" { $$ = $1; }
560 | "each" { $$ = $1; }
564 : Identifier { $$ = $1; }
568 RegularExpressionToken
569 : "/" { $$ = CYDriver::RegExStart; }
570 | "/=" { $$ = CYDriver::RegExRest; }
573 RegularExpressionLiteral_
574 : RegularExpressionToken { driver.SetCondition($1); } RegularExpressionLiteral { $$ = $3; }
578 : NullLiteral { $$ = $1; }
579 | BooleanLiteral { $$ = $1; }
580 | NumericLiteral { $$ = $1; }
581 | StringLiteral { $$ = $1; }
582 | RegularExpressionLiteral_ { $$ = $1; }
586 : "null" { $$ = $1; }
590 : "true" { $$ = $1; }
591 | "false" { $$ = $1; }
594 /* 11.1 Primary Expressions {{{ */
596 : "this" { $$ = $1; }
597 | Identifier { $$ = new(driver.pool_) CYVariable($1); }
598 | Literal { $$ = $1; }
599 | ArrayLiteral { $$ = $1; }
600 | "(" Expression ")" { $$ = $2; }
604 : ObjectLiteral { $$ = $1; }
605 | PrimaryExpression_ { $$ = $1; }
608 PrimaryExpressionNoBF
609 : PrimaryExpression_ { $$ = $1; }
612 /* 11.1.4 Array Initialiser {{{ */
614 : "[" ElementListOpt "]" { $$ = new(driver.pool_) CYArray($2); }
618 : AssignmentExpression { $$ = $1; }
622 : Element { $$ = $1; }
627 : ElementList { $$ = $1; }
632 : ElementOpt "," ElementListOpt { $$ = new(driver.pool_) CYElement($1, $3); }
633 | Element { $$ = new(driver.pool_) CYElement($1, NULL); }
636 /* 11.1.5 Object Initialiser {{{ */
638 : "{" PropertyNameAndValueListOpt "}" { $$ = new(driver.pool_) CYObject($2); }
641 PropertyNameAndValueList_
642 : "," PropertyNameAndValueList { $$ = $2; }
646 PropertyNameAndValueListOpt
647 : PropertyNameAndValueList { $$ = $1; }
651 PropertyNameAndValueList
652 : PropertyName ":" AssignmentExpression PropertyNameAndValueList_ { $$ = new(driver.pool_) CYProperty($1, $3, $4); }
656 : Identifier { $$ = $1; }
657 | StringLiteral { $$ = $1; }
658 | NumericLiteral { $$ = $1; }
662 /* 11.2 Left-Hand-Side Expressions {{{ */
664 : "new" MemberExpression Arguments { $$ = new(driver.pool_) CYNew($2, $3); }
668 : "[" Expression "]" { $$ = new(driver.pool_) CYDirectMember(NULL, $2); }
669 | "." Identifier { $$ = new(driver.pool_) CYDirectMember(NULL, new(driver.pool_) CYString($2)); }
673 : PrimaryExpression { $$ = $1; }
674 | FunctionExpression { $$ = $1; }
675 | MemberExpression MemberAccess { $2->SetLeft($1); $$ = $2; }
676 | MemberExpression_ { $$ = $1; }
680 : PrimaryExpressionNoBF { $$ = $1; }
681 | MemberExpressionNoBF MemberAccess { $2->SetLeft($1); $$ = $2; }
682 | MemberExpression_ { $$ = $1; }
686 : "new" NewExpression { $$ = new(driver.pool_) CYNew($2, NULL); }
690 : MemberExpression { $$ = $1; }
691 | NewExpression_ { $$ = $1; }
695 : MemberExpressionNoBF { $$ = $1; }
696 | NewExpression_ { $$ = $1; }
700 : MemberExpression Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
701 | CallExpression Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
702 | CallExpression MemberAccess { $2->SetLeft($1); $$ = $2; }
706 : MemberExpressionNoBF Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
707 | CallExpressionNoBF Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
708 | CallExpressionNoBF MemberAccess { $2->SetLeft($1); $$ = $2; }
712 : "," ArgumentList { $$ = $2; }
717 : ArgumentList { $$ = $1; }
722 : AssignmentExpression ArgumentList_ { $$ = new(driver.pool_) CYArgument(NULL, $1, $2); }
726 : "(" ArgumentListOpt ")" { $$ = $2; }
729 LeftHandSideExpression
730 : NewExpression { $$ = $1; }
731 | CallExpression { $$ = $1; }
734 LeftHandSideExpressionNoBF
735 : NewExpressionNoBF { $$ = $1; }
736 | CallExpressionNoBF { $$ = $1; }
739 /* 11.3 Postfix Expressions {{{ */
741 : AssigneeExpression { $$ = $1; }
742 | LeftHandSideExpression "++" { $$ = new(driver.pool_) CYPostIncrement($1); }
743 | LeftHandSideExpression "--" { $$ = new(driver.pool_) CYPostDecrement($1); }
746 PostfixExpressionNoBF
747 : AssigneeExpressionNoBF { $$ = $1; }
748 | LeftHandSideExpressionNoBF "++" { $$ = new(driver.pool_) CYPostIncrement($1); }
749 | LeftHandSideExpressionNoBF "--" { $$ = new(driver.pool_) CYPostDecrement($1); }
752 /* 11.4 Unary Operators {{{ */
754 : "delete" UnaryExpression { $$ = new(driver.pool_) CYDelete($2); }
755 | "void" UnaryExpression { $$ = new(driver.pool_) CYVoid($2); }
756 | "typeof" UnaryExpression { $$ = new(driver.pool_) CYTypeOf($2); }
757 | "++" UnaryExpression { $$ = new(driver.pool_) CYPreIncrement($2); }
758 | "\n++" UnaryExpression { $$ = new(driver.pool_) CYPreIncrement($2); }
759 | "--" UnaryExpression { $$ = new(driver.pool_) CYPreDecrement($2); }
760 | "\n--" UnaryExpression { $$ = new(driver.pool_) CYPreDecrement($2); }
761 | "+" UnaryExpression { $$ = new(driver.pool_) CYAffirm($2); }
762 | "-" UnaryExpression { $$ = new(driver.pool_) CYNegate($2); }
763 | "~" UnaryExpression { $$ = new(driver.pool_) CYBitwiseNot($2); }
764 | "!" UnaryExpression { $$ = new(driver.pool_) CYLogicalNot($2); }
768 : PostfixExpression { $$ = $1; }
769 | UnaryExpression_ { $$ = $1; }
773 : PostfixExpressionNoBF { $$ = $1; }
774 | UnaryExpression_ { $$ = $1; }
777 /* 11.5 Multiplicative Operators {{{ */
778 MultiplicativeExpression
779 : UnaryExpression { $$ = $1; }
780 | MultiplicativeExpression "*" UnaryExpression { $$ = new(driver.pool_) CYMultiply($1, $3); }
781 | MultiplicativeExpression "/" UnaryExpression { $$ = new(driver.pool_) CYDivide($1, $3); }
782 | MultiplicativeExpression "%" UnaryExpression { $$ = new(driver.pool_) CYModulus($1, $3); }
785 MultiplicativeExpressionNoBF
786 : UnaryExpressionNoBF { $$ = $1; }
787 | MultiplicativeExpressionNoBF "*" UnaryExpression { $$ = new(driver.pool_) CYMultiply($1, $3); }
788 | MultiplicativeExpressionNoBF "/" UnaryExpression { $$ = new(driver.pool_) CYDivide($1, $3); }
789 | MultiplicativeExpressionNoBF "%" UnaryExpression { $$ = new(driver.pool_) CYModulus($1, $3); }
792 /* 11.6 Additive Operators {{{ */
794 : MultiplicativeExpression { $$ = $1; }
795 | AdditiveExpression "+" MultiplicativeExpression { $$ = new(driver.pool_) CYAdd($1, $3); }
796 | AdditiveExpression "-" MultiplicativeExpression { $$ = new(driver.pool_) CYSubtract($1, $3); }
799 AdditiveExpressionNoBF
800 : MultiplicativeExpressionNoBF { $$ = $1; }
801 | AdditiveExpressionNoBF "+" MultiplicativeExpression { $$ = new(driver.pool_) CYAdd($1, $3); }
802 | AdditiveExpressionNoBF "-" MultiplicativeExpression { $$ = new(driver.pool_) CYSubtract($1, $3); }
805 /* 11.7 Bitwise Shift Operators {{{ */
807 : AdditiveExpression { $$ = $1; }
808 | ShiftExpression "<<" AdditiveExpression { $$ = new(driver.pool_) CYShiftLeft($1, $3); }
809 | ShiftExpression ">>" AdditiveExpression { $$ = new(driver.pool_) CYShiftRightSigned($1, $3); }
810 | ShiftExpression ">>>" AdditiveExpression { $$ = new(driver.pool_) CYShiftRightUnsigned($1, $3); }
814 : AdditiveExpressionNoBF { $$ = $1; }
815 | ShiftExpressionNoBF "<<" AdditiveExpression { $$ = new(driver.pool_) CYShiftLeft($1, $3); }
816 | ShiftExpressionNoBF ">>" AdditiveExpression { $$ = new(driver.pool_) CYShiftRightSigned($1, $3); }
817 | ShiftExpressionNoBF ">>>" AdditiveExpression { $$ = new(driver.pool_) CYShiftRightUnsigned($1, $3); }
820 /* 11.8 Relational Operators {{{ */
821 RelationalExpressionNoIn_
822 : "<" ShiftExpression { $$ = new(driver.pool_) CYLess(NULL, $2); }
823 | ">" ShiftExpression { $$ = new(driver.pool_) CYGreater(NULL, $2); }
824 | "<=" ShiftExpression { $$ = new(driver.pool_) CYLessOrEqual(NULL, $2); }
825 | ">=" ShiftExpression { $$ = new(driver.pool_) CYGreaterOrEqual(NULL, $2); }
826 | "instanceof" ShiftExpression { $$ = new(driver.pool_) CYInstanceOf(NULL, $2); }
829 RelationalExpression_
830 : RelationalExpressionNoIn_ { $$ = $1; }
831 | "in" ShiftExpression { $$ = new(driver.pool_) CYIn(NULL, $2); }
835 : ShiftExpression { $$ = $1; }
836 | RelationalExpression RelationalExpression_ { $2->SetLeft($1); $$ = $2; }
839 RelationalExpressionNoIn
840 : ShiftExpression { $$ = $1; }
841 | RelationalExpressionNoIn RelationalExpressionNoIn_ { $2->SetLeft($1); $$ = $2; }
844 RelationalExpressionNoBF
845 : ShiftExpressionNoBF { $$ = $1; }
846 | RelationalExpressionNoBF RelationalExpression_ { $2->SetLeft($1); $$ = $2; }
849 /* 11.9 Equality Operators {{{ */
851 : RelationalExpression { $$ = $1; }
852 | EqualityExpression "==" RelationalExpression { $$ = new(driver.pool_) CYEqual($1, $3); }
853 | EqualityExpression "!=" RelationalExpression { $$ = new(driver.pool_) CYNotEqual($1, $3); }
854 | EqualityExpression "===" RelationalExpression { $$ = new(driver.pool_) CYIdentical($1, $3); }
855 | EqualityExpression "!==" RelationalExpression { $$ = new(driver.pool_) CYNotIdentical($1, $3); }
858 EqualityExpressionNoIn
859 : RelationalExpressionNoIn { $$ = $1; }
860 | EqualityExpressionNoIn "==" RelationalExpressionNoIn { $$ = new(driver.pool_) CYEqual($1, $3); }
861 | EqualityExpressionNoIn "!=" RelationalExpressionNoIn { $$ = new(driver.pool_) CYNotEqual($1, $3); }
862 | EqualityExpressionNoIn "===" RelationalExpressionNoIn { $$ = new(driver.pool_) CYIdentical($1, $3); }
863 | EqualityExpressionNoIn "!==" RelationalExpressionNoIn { $$ = new(driver.pool_) CYNotIdentical($1, $3); }
866 EqualityExpressionNoBF
867 : RelationalExpressionNoBF { $$ = $1; }
868 | EqualityExpressionNoBF "==" RelationalExpression { $$ = new(driver.pool_) CYEqual($1, $3); }
869 | EqualityExpressionNoBF "!=" RelationalExpression { $$ = new(driver.pool_) CYNotEqual($1, $3); }
870 | EqualityExpressionNoBF "===" RelationalExpression { $$ = new(driver.pool_) CYIdentical($1, $3); }
871 | EqualityExpressionNoBF "!==" RelationalExpression { $$ = new(driver.pool_) CYNotIdentical($1, $3); }
874 /* 11.10 Binary Bitwise Operators {{{ */
876 : EqualityExpression { $$ = $1; }
877 | BitwiseANDExpression "&" EqualityExpression { $$ = new(driver.pool_) CYBitwiseAnd($1, $3); }
880 BitwiseANDExpressionNoIn
881 : EqualityExpressionNoIn { $$ = $1; }
882 | BitwiseANDExpressionNoIn "&" EqualityExpressionNoIn { $$ = new(driver.pool_) CYBitwiseAnd($1, $3); }
885 BitwiseANDExpressionNoBF
886 : EqualityExpressionNoBF { $$ = $1; }
887 | BitwiseANDExpressionNoBF "&" EqualityExpression { $$ = new(driver.pool_) CYBitwiseAnd($1, $3); }
891 : BitwiseANDExpression { $$ = $1; }
892 | BitwiseXORExpression "^" BitwiseANDExpression { $$ = new(driver.pool_) CYBitwiseXOr($1, $3); }
895 BitwiseXORExpressionNoIn
896 : BitwiseANDExpressionNoIn { $$ = $1; }
897 | BitwiseXORExpressionNoIn "^" BitwiseANDExpressionNoIn { $$ = new(driver.pool_) CYBitwiseXOr($1, $3); }
900 BitwiseXORExpressionNoBF
901 : BitwiseANDExpressionNoBF { $$ = $1; }
902 | BitwiseXORExpressionNoBF "^" BitwiseANDExpression { $$ = new(driver.pool_) CYBitwiseXOr($1, $3); }
906 : BitwiseXORExpression { $$ = $1; }
907 | BitwiseORExpression "|" BitwiseXORExpression { $$ = new(driver.pool_) CYBitwiseOr($1, $3); }
910 BitwiseORExpressionNoIn
911 : BitwiseXORExpressionNoIn { $$ = $1; }
912 | BitwiseORExpressionNoIn "|" BitwiseXORExpressionNoIn { $$ = new(driver.pool_) CYBitwiseOr($1, $3); }
915 BitwiseORExpressionNoBF
916 : BitwiseXORExpressionNoBF { $$ = $1; }
917 | BitwiseORExpressionNoBF "|" BitwiseXORExpression { $$ = new(driver.pool_) CYBitwiseOr($1, $3); }
920 /* 11.11 Binary Logical Operators {{{ */
922 : BitwiseORExpression { $$ = $1; }
923 | LogicalANDExpression "&&" BitwiseORExpression { $$ = new(driver.pool_) CYLogicalAnd($1, $3); }
926 LogicalANDExpressionNoIn
927 : BitwiseORExpressionNoIn { $$ = $1; }
928 | LogicalANDExpressionNoIn "&&" BitwiseORExpressionNoIn { $$ = new(driver.pool_) CYLogicalAnd($1, $3); }
931 LogicalANDExpressionNoBF
932 : BitwiseORExpressionNoBF { $$ = $1; }
933 | LogicalANDExpressionNoBF "&&" BitwiseORExpression { $$ = new(driver.pool_) CYLogicalAnd($1, $3); }
937 : LogicalANDExpression { $$ = $1; }
938 | LogicalORExpression "||" LogicalANDExpression { $$ = new(driver.pool_) CYLogicalOr($1, $3); }
941 LogicalORExpressionNoIn
942 : LogicalANDExpressionNoIn { $$ = $1; }
943 | LogicalORExpressionNoIn "||" LogicalANDExpressionNoIn { $$ = new(driver.pool_) CYLogicalOr($1, $3); }
946 LogicalORExpressionNoBF
947 : LogicalANDExpressionNoBF { $$ = $1; }
948 | LogicalORExpressionNoBF "||" LogicalANDExpression { $$ = new(driver.pool_) CYLogicalOr($1, $3); }
951 /* 11.12 Conditional Operator ( ? : ) {{{ */
952 ConditionalExpression
953 : LogicalORExpression { $$ = $1; }
954 | LogicalORExpression "?" AssignmentExpression ":" AssignmentExpression { $$ = new(driver.pool_) CYCondition($1, $3, $5); }
957 ConditionalExpressionNoIn
958 : LogicalORExpressionNoIn { $$ = $1; }
959 | LogicalORExpressionNoIn "?" AssignmentExpression ":" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYCondition($1, $3, $5); }
962 ConditionalExpressionNoBF
963 : LogicalORExpressionNoBF { $$ = $1; }
964 | LogicalORExpressionNoBF "?" AssignmentExpression ":" AssignmentExpression { $$ = new(driver.pool_) CYCondition($1, $3, $5); }
967 /* 11.13 Assignment Operators {{{ */
968 AssignmentExpression_
969 : "=" AssignmentExpression { $$ = new(driver.pool_) CYAssign(NULL, $2); }
970 | "*=" AssignmentExpression { $$ = new(driver.pool_) CYMultiplyAssign(NULL, $2); }
971 | "/=" AssignmentExpression { $$ = new(driver.pool_) CYDivideAssign(NULL, $2); }
972 | "%=" AssignmentExpression { $$ = new(driver.pool_) CYModulusAssign(NULL, $2); }
973 | "+=" AssignmentExpression { $$ = new(driver.pool_) CYAddAssign(NULL, $2); }
974 | "-=" AssignmentExpression { $$ = new(driver.pool_) CYSubtractAssign(NULL, $2); }
975 | "<<=" AssignmentExpression { $$ = new(driver.pool_) CYShiftLeftAssign(NULL, $2); }
976 | ">>=" AssignmentExpression { $$ = new(driver.pool_) CYShiftRightSignedAssign(NULL, $2); }
977 | ">>>=" AssignmentExpression { $$ = new(driver.pool_) CYShiftRightUnsignedAssign(NULL, $2); }
978 | "&=" AssignmentExpression { $$ = new(driver.pool_) CYBitwiseAndAssign(NULL, $2); }
979 | "^=" AssignmentExpression { $$ = new(driver.pool_) CYBitwiseXOrAssign(NULL, $2); }
980 | "|=" AssignmentExpression { $$ = new(driver.pool_) CYBitwiseOrAssign(NULL, $2); }
984 : LeftHandSideExpression { $$ = $1; }
985 | AssigneeExpression_ { $$ = $1; }
988 AssigneeExpressionNoBF
989 : LeftHandSideExpressionNoBF { $$ = $1; }
990 | AssigneeExpression_ { $$ = $1; }
994 : ConditionalExpression { $$ = $1; }
995 | AssigneeExpression AssignmentExpression_ { $2->SetLeft($1); $$ = $2; }
998 AssignmentExpressionNoIn
999 : ConditionalExpressionNoIn { $$ = $1; }
1000 | AssigneeExpression "=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYAssign($1, $3); }
1001 | AssigneeExpression "*=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYMultiplyAssign($1, $3); }
1002 | AssigneeExpression "/=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYDivideAssign($1, $3); }
1003 | AssigneeExpression "%=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYModulusAssign($1, $3); }
1004 | AssigneeExpression "+=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYAddAssign($1, $3); }
1005 | AssigneeExpression "-=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYSubtractAssign($1, $3); }
1006 | AssigneeExpression "<<=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYShiftLeftAssign($1, $3); }
1007 | AssigneeExpression ">>=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYShiftRightSignedAssign($1, $3); }
1008 | AssigneeExpression ">>>=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYShiftRightUnsignedAssign($1, $3); }
1009 | AssigneeExpression "&=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYBitwiseAndAssign($1, $3); }
1010 | AssigneeExpression "^=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYBitwiseXOrAssign($1, $3); }
1011 | AssigneeExpression "|=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYBitwiseOrAssign($1, $3); }
1014 AssignmentExpressionNoBF
1015 : ConditionalExpressionNoBF { $$ = $1; }
1016 | AssigneeExpressionNoBF AssignmentExpression_ { $2->SetLeft($1); $$ = $2; }
1019 /* 11.14 Comma Operator {{{ */
1021 : "," Expression { $$ = new(driver.pool_) CYCompound($2); }
1026 : "," ExpressionNoIn { $$ = new(driver.pool_) CYCompound($2); }
1031 : Expression { $$ = $1; }
1036 : ExpressionNoIn { $$ = $1; }
1041 : AssignmentExpression Expression_ { if ($2) { $2->AddPrev($1); $$ = $2; } else $$ = $1; }
1045 : AssignmentExpressionNoIn ExpressionNoIn_ { if ($2) { $2->AddPrev($1); $$ = $2; } else $$ = $1; }
1049 : AssignmentExpressionNoBF Expression_ { if ($2) { $2->AddPrev($1); $$ = $2; } else $$ = $1; }
1053 /* 12 Statements {{{ */
1055 : Block { $$ = $1; }
1056 | VariableStatement { $$ = $1; }
1057 | EmptyStatement { $$ = $1; }
1058 | ExpressionStatement { $$ = $1; }
1059 | IfStatement { $$ = $1; }
1060 | IterationStatement { $$ = $1; }
1061 | ContinueStatement { $$ = $1; }
1062 | BreakStatement { $$ = $1; }
1063 | ReturnStatement { $$ = $1; }
1064 | WithStatement { $$ = $1; }
1065 | LabelledStatement { $$ = $1; }
1066 | SwitchStatement { $$ = $1; }
1067 | ThrowStatement { $$ = $1; }
1068 | TryStatement { $$ = $1; }
1072 : Statement_ { $$ = $1; }
1075 /* 12.1 Block {{{ */
1077 : "{" StatementListOpt "}" { $$ = $2; }
1081 : Block_ { if ($1) $$ = new(driver.pool_) CYBlock($1); else $$ = new(driver.pool_) CYEmpty(); }
1085 : Statement StatementListOpt { $1->SetNext($2); $$ = $1; }
1089 : StatementList { $$ = $1; }
1093 /* 12.2 Variable Statement {{{ */
1095 : "var" VariableDeclarationList Terminator { $$ = new(driver.pool_) CYVar($2); }
1098 VariableDeclarationList_
1099 : "," VariableDeclarationList { $$ = $2; }
1103 VariableDeclarationListNoIn_
1104 : "," VariableDeclarationListNoIn { $$ = $2; }
1108 VariableDeclarationList
1109 : VariableDeclaration VariableDeclarationList_ { $$ = new(driver.pool_) CYDeclarations($1, $2); }
1112 VariableDeclarationListNoIn
1113 : VariableDeclarationNoIn VariableDeclarationListNoIn_ { $$ = new(driver.pool_) CYDeclarations($1, $2); }
1117 : Identifier InitialiserOpt { $$ = new(driver.pool_) CYDeclaration($1, $2); }
1120 VariableDeclarationNoIn
1121 : Identifier InitialiserNoInOpt { $$ = new(driver.pool_) CYDeclaration($1, $2); }
1125 : Initialiser { $$ = $1; }
1130 : InitialiserNoIn { $$ = $1; }
1135 : "=" AssignmentExpression { $$ = $2; }
1139 : "=" AssignmentExpressionNoIn { $$ = $2; }
1142 /* 12.3 Empty Statement {{{ */
1144 : ";" { $$ = new(driver.pool_) CYEmpty(); }
1147 /* 12.4 Expression Statement {{{ */
1149 : ExpressionNoBF Terminator { $$ = new(driver.pool_) CYExpress($1); }
1152 /* 12.5 The if Statement {{{ */
1154 : "else" Statement { $$ = $2; }
1155 | %prec "if" { $$ = NULL; }
1159 : "if" "(" Expression ")" Statement ElseStatementOpt { $$ = new(driver.pool_) CYIf($3, $5, $6); }
1163 /* 12.6 Iteration Statements {{{ */
1165 : DoWhileStatement { $$ = $1; }
1166 | WhileStatement { $$ = $1; }
1167 | ForStatement { $$ = $1; }
1168 | ForInStatement { $$ = $1; }
1171 /* 12.6.1 The do-while Statement {{{ */
1173 : "do" Statement "while" "(" Expression ")" TerminatorOpt { $$ = new(driver.pool_) CYDoWhile($5, $2); }
1176 /* 12.6.2 The while Statement {{{ */
1178 : "while" "(" Expression ")" Statement { $$ = new(driver.pool_) CYWhile($3, $5); }
1181 /* 12.6.3 The for Statement {{{ */
1183 : "for" "(" ForStatementInitialiser ";" ExpressionOpt ";" ExpressionOpt ")" Statement { $$ = new(driver.pool_) CYFor($3, $5, $7, $9); }
1186 ForStatementInitialiser
1187 : ExpressionNoInOpt { $$ = $1; }
1188 | "var" VariableDeclarationListNoIn { $$ = $2; }
1191 /* 12.6.4 The for-in Statement {{{ */
1193 : "for" "(" ForInStatementInitialiser "in" Expression ")" Statement { $$ = new(driver.pool_) CYForIn($3, $5, $7); }
1196 ForInStatementInitialiser
1197 : LeftHandSideExpression { $$ = $1; }
1198 | "var" VariableDeclarationNoIn { $$ = $2; }
1202 /* 12.7 The continue Statement {{{ */
1204 : "continue" IdentifierOpt Terminator { $$ = new(driver.pool_) CYContinue($2); }
1207 /* 12.8 The break Statement {{{ */
1209 : "break" IdentifierOpt Terminator { $$ = new(driver.pool_) CYBreak($2); }
1212 /* 12.9 The return Statement {{{ */
1214 : "return" ExpressionOpt Terminator { $$ = new(driver.pool_) CYReturn($2); }
1217 /* 12.10 The with Statement {{{ */
1219 : "with" "(" Expression ")" Statement { $$ = new(driver.pool_) CYWith($3, $5); }
1223 /* 12.11 The switch Statement {{{ */
1225 : "switch" "(" Expression ")" CaseBlock { $$ = new(driver.pool_) CYSwitch($3, $5); }
1229 : "{" CaseClausesOpt "}" { $$ = $2; }
1233 : CaseClause CaseClausesOpt { $1->SetNext($2); $$ = $1; }
1234 | DefaultClause CaseClausesOpt { $1->SetNext($2); $$ = $1; }
1239 : "case" Expression ":" StatementListOpt { $$ = new(driver.pool_) CYClause($2, $4); }
1243 : "default" ":" StatementListOpt { $$ = new(driver.pool_) CYClause(NULL, $3); }
1246 /* 12.12 Labelled Statements {{{ */
1248 : Identifier ":" Statement { $$ = new(driver.pool_) CYLabel($1, $3); }
1251 /* 12.13 The throw Statement {{{ */
1253 : "throw" Expression Terminator { $$ = new(driver.pool_) CYThrow($2); }
1256 /* 12.14 The try Statement {{{ */
1258 : "try" Block_ CatchOpt FinallyOpt { $$ = new(driver.pool_) CYTry($2, $3, $4); }
1262 : "catch" "(" Identifier ")" Block_ { $$ = new(driver.pool_) CYCatch($3, $5); }
1267 : "finally" Block_ { $$ = new(driver.pool_) CYFinally($2); }
1272 /* 13 Function Definition {{{ */
1274 : "function" Identifier "(" FormalParameterList ")" "{" FunctionBody "}" { $$ = new(driver.pool_) CYFunctionStatement($2, $4, $7); }
1278 : "function" IdentifierOpt "(" FormalParameterList ")" "{" FunctionBody "}" { $$ = new(driver.pool_) CYFunctionExpression($2, $4, $7); }
1281 FormalParameterList_
1282 : "," FormalParameterList { $$ = $2; }
1287 : Identifier FormalParameterList_ { $$ = new(driver.pool_) CYFunctionParameter($1, $2); }
1292 : SourceElements { $$ = $1; }
1295 /* 14 Program {{{ */
1297 : SourceElements { driver.program_ = new(driver.pool_) CYProgram($1); }
1301 : SourceElement SourceElements { $1->SetNext($2); $$ = $1; }
1306 : Statement_ { $$ = $1; }
1307 | FunctionDeclaration { $$ = $1; }
1311 /* Cycript: @class Declaration {{{ */
1313 : ":" MemberExpressionNoBF { $$ = $2; }
1318 : "{" "}" { $$ = NULL; }
1322 : "+" { $$ = false; }
1323 | "-" { $$ = true; }
1327 : "(" Expression ")" { $$ = $2; }
1332 : Word ":" TypeOpt Identifier { $$ = new(driver.pool_) CYMessageParameter($1, $3, $4); }
1335 MessageParameterListOpt
1336 : MessageParameterList { $$ = $1; }
1340 MessageParameterList
1341 : MessageParameter MessageParameterListOpt { $1->SetNext($2); $$ = $1; }
1345 : MessageParameterList { $$ = $1; }
1346 | Word { $$ = new(driver.pool_) CYMessageParameter($1, NULL, NULL); }
1349 ClassMessageDeclaration
1350 : MessageScope TypeOpt MessageParameters "{" FunctionBody "}" { $$ = new(driver.pool_) CYMessage($1, $2, $3, $5); }
1353 ClassMessageDeclarationListOpt
1354 : ClassMessageDeclarationListOpt ClassMessageDeclaration { $2->SetNext($1); $$ = $2; }
1359 : Identifier { $$ = $1; }
1360 | "(" AssignmentExpression ")" { $$ = $2; }
1364 : ClassName { $$ = $1; }
1369 : "@class" ClassNameOpt ClassSuperOpt ClassFieldList ClassMessageDeclarationListOpt "@end" { $$ = new(driver.pool_) CYClassExpression($2, $3, $4, $5); }
1373 : "@class" ClassName ClassSuperOpt ClassFieldList ClassMessageDeclarationListOpt "@end" { $$ = new(driver.pool_) CYClassStatement($2, $3, $4, $5); }
1377 : "@class" ClassName ClassMessageDeclarationListOpt "@end" { $$ = new(driver.pool_) CYCategory($2, $3); }
1381 : ClassExpression { $$ = $1; }
1385 : ClassStatement { $$ = $1; }
1386 | CategoryStatement { $$ = $1; }
1389 /* Cycript: Send Message {{{ */
1391 : "," AssignmentExpression VariadicCall { $$ = new(driver.pool_) CYArgument(NULL, $2, $3); }
1396 : SelectorCall { $$ = $1; }
1397 | VariadicCall { $$ = $1; }
1401 : WordOpt ":" AssignmentExpression SelectorCall_ { $$ = new(driver.pool_) CYArgument($1 ?: new(driver.pool_) CYBlank(), $3, $4); }
1405 : SelectorCall { $$ = $1; }
1406 | Word { $$ = new(driver.pool_) CYArgument($1, NULL); }
1410 : "[" AssignmentExpression SelectorList "]" { $$ = new(driver.pool_) CYSend($2, $3); }
1413 SelectorExpressionOpt
1414 : SelectorExpression_ { $$ = $1; }
1419 : WordOpt ":" SelectorExpressionOpt { $$ = new(driver.pool_) CYSelectorPart($1, true, $3); }
1423 : SelectorExpression_ { $$ = $1; }
1424 | Word { $$ = new(driver.pool_) CYSelectorPart($1, false, NULL); }
1428 : MessageExpression { $$ = $1; }
1429 | "@selector" "(" SelectorExpression ")" { $$ = new(driver.pool_) CYSelector($3); }
1432 /* Cycript: Pointer Indirection/Addressing {{{ */
1434 : "*" UnaryExpression { $$ = new(driver.pool_) CYIndirect($2); }
1438 : "&" UnaryExpression { $$ = new(driver.pool_) CYAddressOf($2); }
1442 : "->" "[" Expression "]" { $$ = new(driver.pool_) CYIndirectMember(NULL, $3); }
1443 | "->" Identifier { $$ = new(driver.pool_) CYIndirectMember(NULL, new(driver.pool_) CYString($2)); }
1446 /* ECMAScript5: Object Literal Trailing Comma {{{ */
1447 PropertyNameAndValueList_
1448 : "," { $$ = NULL; }
1451 /* JavaScript 1.7: Array Comprehensions {{{ */
1453 : "if" "(" Expression ")" { $$ = new(driver.pool_) CYIfComprehension($3); }
1457 : "for" "(" Identifier "in" Expression ")" { $$ = new(driver.pool_) CYForInComprehension($3, $5); }
1458 | "for" "each" "(" Identifier "in" Expression ")" { $$ = new(driver.pool_) CYForEachInComprehension($4, $6); }
1461 ComprehensionListOpt
1462 : ComprehensionList { $$ = $1; }
1463 | IfComprehension { $$ = $1; }
1468 : ForComprehension ComprehensionListOpt { $1->SetNext($2); $$ = $1; }
1472 : "[" AssignmentExpression ComprehensionList "]" { $$ = new(driver.pool_) CYArrayComprehension($2, $3); }
1475 /* JavaScript 1.7: for each {{{ */
1477 : "for" "each" "(" ForInStatementInitialiser "in" Expression ")" Statement { $$ = new(driver.pool_) CYForEachIn($4, $6, $8); }
1480 /* JavaScript 1.7: let Statements {{{ *//*
1482 : "let" "(" VariableDeclarationList ")" Block_ { $$ = new(driver.pool_) CYLet($3, $5); }
1489 /* JavaScript FTW: Function Statements {{{ */
1491 : FunctionDeclaration { driver.Warning(yylloc, "warning, FunctionDeclaration is a SourceElement, not a Statement"); } { $$ = $1; }