1 /* Cycript - Remote 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
50 #include "ObjectiveC.hpp"
59 CYDriver::Condition condition_;
61 CYArgument *argument_;
62 CYAssignment *assignment_;
66 CYComprehension *comprehension_;
67 CYCompound *compound_;
68 CYDeclaration *declaration_;
69 CYDeclarations *declarations_;
71 CYExpression *expression_;
74 CYForInitialiser *for_;
75 CYForInInitialiser *forin_;
76 CYFunctionParameter *functionParameter_;
77 CYIdentifier *identifier_;
84 CYProperty *property_;
85 CYPropertyName *propertyName_;
86 CYStatement *statement_;
93 CYClassName *className_;
96 CYMessageParameter *messageParameter_;
97 CYSelectorPart *selector_;
105 int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner);
114 @$.begin.filename = @$.end.filename = &driver.filename_;
124 %parse-param { CYDriver &driver }
125 %lex-param { void *scanner }
129 %token ColonColon "::"
130 %token LeftRight "<>"
131 %token LeftSlashRight "</>"
132 %token PeriodPeriod ".."
140 %token AmpersandAmpersand "&&"
141 %token AmpersandEqual "&="
143 %token CarrotEqual "^="
145 %token EqualEqual "=="
146 %token EqualEqualEqual "==="
147 %token Exclamation "!"
148 %token ExclamationEqual "!="
149 %token ExclamationEqualEqual "!=="
151 %token HyphenEqual "-="
152 %token HyphenHyphen "--"
153 %token HyphenHyphen_ "\n--"
154 %token HyphenRight "->"
156 %token LeftEqual "<="
158 %token LeftLeftEqual "<<="
160 %token PercentEqual "%="
163 %token PipeEqual "|="
166 %token PlusEqual "+="
168 %token PlusPlus_ "\n++"
170 %token RightEqual ">="
171 %token RightRight ">>"
172 %token RightRightEqual ">>="
173 %token RightRightRight ">>>"
174 %token RightRightRightEqual ">>>="
176 %token SlashEqual "/="
178 %token StarEqual "*="
188 %token CloseParen ")"
191 %token CloseBrace "}"
193 %token OpenBracket "["
194 %token CloseBracket "]"
196 %token AtClass "@class"
197 %token AtSelector "@selector"
200 %token <false_> False "false"
201 %token <null_> Null "null"
202 %token <true_> True "true"
204 // ES3/ES5/WIE/JSC Reserved
205 %token <word_> Break "break"
206 %token <word_> Case "case"
207 %token <word_> Catch "catch"
208 %token <word_> Continue "continue"
209 %token <word_> Default "default"
210 %token <word_> Delete "delete"
211 %token <word_> Do "do"
212 %token <word_> Else "else"
213 %token <word_> Finally "finally"
214 %token <word_> For "for"
215 %token <word_> Function "function"
216 %token <word_> If "if"
217 %token <word_> In "in"
218 %token <word_> InstanceOf "instanceof"
219 %token <word_> New "new"
220 %token <word_> Return "return"
221 %token <word_> Switch "switch"
222 %token <this_> This "this"
223 %token <word_> Throw "throw"
224 %token <word_> Try "try"
225 %token <word_> TypeOf "typeof"
226 %token <word_> Var "var"
227 %token <word_> Void "void"
228 %token <word_> While "while"
229 %token <word_> With "with"
231 // ES3/IE6 Future, ES5/JSC Reserved
232 %token <word_> Debugger "debugger"
234 // ES3/ES5/IE6 Future, JSC Reserved
235 %token <word_> Const "const"
237 // ES3/ES5/IE6/JSC Future
238 %token <word_> Class "class"
239 %token <word_> Enum "enum"
240 %token <word_> Export "export"
241 %token <word_> Extends "extends"
242 %token <word_> Import "import"
243 %token <word_> Super "super"
245 // ES3 Future, ES5 Strict Future
246 %token <identifier_> Implements "implements"
247 %token <identifier_> Interface "interface"
248 %token <identifier_> Package "package"
249 %token <identifier_> Private "private"
250 %token <identifier_> Protected "protected"
251 %token <identifier_> Public "public"
252 %token <identifier_> Static "static"
255 %token <identifier_> Abstract "abstract"
256 %token <identifier_> Boolean "boolean"
257 %token <identifier_> Byte "byte"
258 %token <identifier_> Char "char"
259 %token <identifier_> Double "double"
260 %token <identifier_> Final "final"
261 %token <identifier_> Float "float"
262 %token <identifier_> Goto "goto"
263 %token <identifier_> Int "int"
264 %token <identifier_> Long "long"
265 %token <identifier_> Native "native"
266 %token <identifier_> Short "short"
267 %token <identifier_> Synchronized "synchronized"
268 %token <identifier_> Throws "throws"
269 %token <identifier_> Transient "transient"
270 %token <identifier_> Volatile "volatile"
273 %token <identifier_> Let "let"
274 %token <identifier_> Yield "yield"
277 %token <identifier_> Each "each"
279 %token <identifier_> Identifier_
280 %token <number_> NumericLiteral
281 %token <string_> StringLiteral
282 %token <literal_> RegularExpressionLiteral
284 %type <expression_> AdditiveExpression
285 %type <expression_> AdditiveExpressionNoBF
286 %type <argument_> ArgumentList
287 %type <argument_> ArgumentList_
288 %type <argument_> ArgumentListOpt
289 %type <argument_> Arguments
290 %type <literal_> ArrayLiteral
291 %type <expression_> AssigneeExpression
292 %type <expression_> AssigneeExpression_
293 %type <expression_> AssigneeExpressionNoBF
294 %type <expression_> AssignmentExpression
295 %type <assignment_> AssignmentExpression_
296 %type <expression_> AssignmentExpressionNoBF
297 %type <expression_> AssignmentExpressionNoIn
298 %type <expression_> BitwiseANDExpression
299 %type <expression_> BitwiseANDExpressionNoBF
300 %type <expression_> BitwiseANDExpressionNoIn
301 %type <statement_> Block
302 %type <statement_> Block_
303 %type <boolean_> BooleanLiteral
304 %type <expression_> BitwiseORExpression
305 %type <expression_> BitwiseORExpressionNoBF
306 %type <expression_> BitwiseORExpressionNoIn
307 %type <expression_> BitwiseXORExpression
308 %type <expression_> BitwiseXORExpressionNoBF
309 %type <expression_> BitwiseXORExpressionNoIn
310 %type <statement_> BreakStatement
311 %type <expression_> CallExpression
312 %type <expression_> CallExpressionNoBF
313 %type <clause_> CaseBlock
314 %type <clause_> CaseClause
315 %type <clause_> CaseClausesOpt
316 %type <catch_> CatchOpt
317 %type <comprehension_> ComprehensionList
318 %type <comprehension_> ComprehensionListOpt
319 %type <expression_> ConditionalExpression
320 %type <expression_> ConditionalExpressionNoBF
321 %type <expression_> ConditionalExpressionNoIn
322 %type <statement_> ContinueStatement
323 %type <clause_> DefaultClause
324 %type <statement_> DoWhileStatement
325 %type <expression_> Element
326 %type <expression_> ElementOpt
327 %type <element_> ElementList
328 %type <element_> ElementListOpt
329 %type <statement_> ElseStatementOpt
330 %type <statement_> EmptyStatement
331 %type <expression_> EqualityExpression
332 %type <expression_> EqualityExpressionNoBF
333 %type <expression_> EqualityExpressionNoIn
334 %type <expression_> Expression
335 %type <expression_> ExpressionOpt
336 %type <compound_> Expression_
337 %type <expression_> ExpressionNoBF
338 %type <expression_> ExpressionNoIn
339 %type <compound_> ExpressionNoIn_
340 %type <expression_> ExpressionNoInOpt
341 %type <statement_> ExpressionStatement
342 %type <finally_> FinallyOpt
343 %type <comprehension_> ForComprehension
344 %type <statement_> ForStatement
345 %type <for_> ForStatementInitialiser
346 %type <statement_> ForInStatement
347 %type <forin_> ForInStatementInitialiser
348 %type <functionParameter_> FormalParameterList
349 %type <functionParameter_> FormalParameterList_
350 %type <statement_> FunctionBody
351 %type <statement_> FunctionDeclaration
352 %type <expression_> FunctionExpression
353 %type <identifier_> Identifier
354 %type <identifier_> IdentifierOpt
355 %type <comprehension_> IfComprehension
356 %type <statement_> IfStatement
357 %type <expression_> Initialiser
358 %type <expression_> InitialiserOpt
359 %type <expression_> InitialiserNoIn
360 %type <expression_> InitialiserNoInOpt
361 %type <statement_> IterationStatement
362 %type <statement_> LabelledStatement
363 %type <expression_> LeftHandSideExpression
364 %type <expression_> LeftHandSideExpressionNoBF
365 //%type <statement_> LetStatement
366 %type <literal_> Literal
367 %type <expression_> LogicalANDExpression
368 %type <expression_> LogicalANDExpressionNoBF
369 %type <expression_> LogicalANDExpressionNoIn
370 %type <expression_> LogicalORExpression
371 %type <expression_> LogicalORExpressionNoBF
372 %type <expression_> LogicalORExpressionNoIn
373 %type <member_> MemberAccess
374 %type <expression_> MemberExpression
375 %type <expression_> MemberExpression_
376 %type <expression_> MemberExpressionNoBF
377 %type <expression_> MultiplicativeExpression
378 %type <expression_> MultiplicativeExpressionNoBF
379 %type <expression_> NewExpression
380 %type <expression_> NewExpression_
381 %type <expression_> NewExpressionNoBF
382 %type <null_> NullLiteral
383 %type <literal_> ObjectLiteral
384 %type <expression_> PostfixExpression
385 %type <expression_> PostfixExpressionNoBF
386 %type <expression_> PrimaryExpression
387 %type <expression_> PrimaryExpression_
388 %type <expression_> PrimaryExpressionNoBF
389 %type <statement_> Program
390 %type <propertyName_> PropertyName
391 %type <property_> PropertyNameAndValueList
392 %type <property_> PropertyNameAndValueList_
393 %type <property_> PropertyNameAndValueListOpt
394 %type <literal_> RegularExpressionLiteral_
395 %type <condition_> RegularExpressionToken
396 %type <expression_> RelationalExpression
397 %type <infix_> RelationalExpression_
398 %type <expression_> RelationalExpressionNoBF
399 %type <expression_> RelationalExpressionNoIn
400 %type <infix_> RelationalExpressionNoIn_
401 %type <statement_> ReturnStatement
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_> UnaryExpression
414 %type <expression_> UnaryExpression_
415 %type <expression_> UnaryExpressionNoBF
416 %type <declaration_> VariableDeclaration
417 %type <declaration_> VariableDeclarationNoIn
418 %type <declarations_> VariableDeclarationList
419 %type <declarations_> VariableDeclarationList_
420 %type <declarations_> VariableDeclarationListNoIn
421 %type <declarations_> VariableDeclarationListNoIn_
422 %type <statement_> VariableStatement
423 %type <statement_> WhileStatement
424 %type <statement_> WithStatement
427 %type <statement_> CategoryStatement
428 %type <expression_> ClassExpression
429 %type <statement_> ClassStatement
430 %type <expression_> ClassSuperOpt
431 %type <field_> ClassFieldList
432 %type <message_> ClassMessageDeclaration
433 %type <message_> ClassMessageDeclarationListOpt
434 %type <className_> ClassName
435 %type <className_> ClassNameOpt
436 %type <expression_> MessageExpression
437 %type <messageParameter_> MessageParameter
438 %type <messageParameter_> MessageParameters
439 %type <messageParameter_> MessageParameterList
440 %type <messageParameter_> MessageParameterListOpt
441 %type <bool_> MessageScope
442 %type <argument_> SelectorCall
443 %type <argument_> SelectorCall_
444 %type <selector_> SelectorExpression
445 %type <selector_> SelectorExpression_
446 %type <selector_> SelectorExpressionOpt
447 %type <argument_> SelectorList
448 %type <expression_> TypeOpt
449 %type <argument_> VariadicCall
451 %type <word_> WordOpt
456 %left "<<" ">>" ">>>"
457 %left "<" ">" "<=" ">=" "instanceof" "in"
458 %left "==" "!=" "===" "!=="
465 %right "=" "*=" "/=" "%=" "+=" "-=" "<<=" ">>=" ">>>=" "&=" "^=" "|="
475 : { driver.Warning(yylloc, "warning, automatic semi-colon insertion required"); }
485 | error { yyerrok; driver.errors_.pop_back(); } StrictSemi
490 | error { if (yychar != 0 && yychar != cy::parser::token::CloseBrace && !yylval.newline_) YYABORT; else { yyerrok; driver.errors_.pop_back(); } } StrictSemi
510 : Identifier { $$ = $1; }
511 | "break" NewLineOpt { $$ = $1; }
512 | "case" { $$ = $1; }
513 | "catch" { $$ = $1; }
514 | "class" { $$ = $1; }
515 | "const" { $$ = $1; }
516 | "continue" NewLineOpt { $$ = $1; }
517 | "debugger" { $$ = $1; }
518 | "default" { $$ = $1; }
519 | "delete" { $$ = $1; }
521 | "else" { $$ = $1; }
522 | "enum" { $$ = $1; }
523 | "export" { $$ = $1; }
524 | "extends" { $$ = $1; }
525 | "false" { $$ = $1; }
526 | "finally" { $$ = $1; }
528 | "function" { $$ = $1; }
530 | "import" { $$ = $1; }
531 /* XXX: | "in" { $$ = $1; } */
532 /* XXX: | "instanceof" { $$ = $1; } */
534 | "null" { $$ = $1; }
535 | "return" NewLineOpt { $$ = $1; }
536 | "super" { $$ = $1; }
537 | "switch" { $$ = $1; }
538 | "this" { $$ = $1; }
539 | "throw" NewLineOpt { $$ = $1; }
540 | "true" { $$ = $1; }
542 | "typeof" { $$ = $1; }
544 | "void" { $$ = $1; }
545 | "while" { $$ = $1; }
546 | "with" { $$ = $1; }
551 : Identifier_ { $$ = $1; }
553 | "implements" { $$ = $1; }
554 | "interface" { $$ = $1; }
555 | "package" { $$ = $1; }
556 | "private" { $$ = $1; }
557 | "protected" { $$ = $1; }
558 | "public" { $$ = $1; }
559 | "static" { $$ = $1; }
561 | "abstract" { $$ = $1; }
562 | "boolean" { $$ = $1; }
563 | "byte" { $$ = $1; }
564 | "char" { $$ = $1; }
565 | "double" { $$ = $1; }
566 | "final" { $$ = $1; }
567 | "float" { $$ = $1; }
568 | "goto" { $$ = $1; }
570 | "long" { $$ = $1; }
571 | "native" { $$ = $1; }
572 | "short" { $$ = $1; }
573 | "synchronized" { $$ = $1; }
574 | "throws" { $$ = $1; }
575 | "transient" { $$ = $1; }
576 | "volatile" { $$ = $1; }
579 | "yield" { $$ = $1; }
581 | "each" { $$ = $1; }
585 : Identifier { $$ = $1; }
589 RegularExpressionToken
590 : "/" { $$ = CYDriver::RegExpSlash; }
591 | "/=" { $$ = CYDriver::RegExpSlashEqual; }
593 | "/>" { $$ = CYDriver::RegExpSlashRight; }
597 RegularExpressionLiteral_
598 : RegularExpressionToken { driver.SetCondition($1); } RegularExpressionLiteral { $$ = $3; }
602 : NullLiteral { $$ = $1; }
603 | BooleanLiteral { $$ = $1; }
604 | NumericLiteral { $$ = $1; }
605 | StringLiteral { $$ = $1; }
606 | RegularExpressionLiteral_ { $$ = $1; }
610 : "null" { $$ = $1; }
614 : "true" { $$ = $1; }
615 | "false" { $$ = $1; }
618 /* 11.1 Primary Expressions {{{ */
620 : "this" { $$ = $1; }
621 | Identifier { $$ = new(driver.pool_) CYVariable($1); }
622 | Literal { $$ = $1; }
623 | ArrayLiteral { $$ = $1; }
624 | "(" Expression ")" { $$ = $2; }
628 : ObjectLiteral { $$ = $1; }
629 | PrimaryExpression_ { $$ = $1; }
632 PrimaryExpressionNoBF
633 : PrimaryExpression_ { $$ = $1; }
636 /* 11.1.4 Array Initialiser {{{ */
638 : "[" ElementListOpt "]" { $$ = new(driver.pool_) CYArray($2); }
642 : AssignmentExpression { $$ = $1; }
646 : Element { $$ = $1; }
651 : ElementList { $$ = $1; }
656 : ElementOpt "," ElementListOpt { $$ = new(driver.pool_) CYElement($1, $3); }
657 | Element { $$ = new(driver.pool_) CYElement($1, NULL); }
660 /* 11.1.5 Object Initialiser {{{ */
662 : "{" PropertyNameAndValueListOpt "}" { $$ = new(driver.pool_) CYObject($2); }
665 PropertyNameAndValueList_
666 : "," PropertyNameAndValueList { $$ = $2; }
670 PropertyNameAndValueListOpt
671 : PropertyNameAndValueList { $$ = $1; }
675 PropertyNameAndValueList
676 : PropertyName ":" AssignmentExpression PropertyNameAndValueList_ { $$ = new(driver.pool_) CYProperty($1, $3, $4); }
680 : Identifier { $$ = $1; }
681 | StringLiteral { $$ = $1; }
682 | NumericLiteral { $$ = $1; }
686 /* 11.2 Left-Hand-Side Expressions {{{ */
688 : "new" MemberExpression Arguments { $$ = new(driver.pool_) CYNew($2, $3); }
692 : "[" Expression "]" { $$ = new(driver.pool_) CYDirectMember(NULL, $2); }
693 | "." Identifier { $$ = new(driver.pool_) CYDirectMember(NULL, new(driver.pool_) CYString($2)); }
697 : PrimaryExpression { $$ = $1; }
698 | FunctionExpression { $$ = $1; }
699 | MemberExpression MemberAccess { $2->SetLeft($1); $$ = $2; }
700 | MemberExpression_ { $$ = $1; }
704 : PrimaryExpressionNoBF { $$ = $1; }
705 | MemberExpressionNoBF MemberAccess { $2->SetLeft($1); $$ = $2; }
706 | MemberExpression_ { $$ = $1; }
710 : "new" NewExpression { $$ = new(driver.pool_) CYNew($2, NULL); }
714 : MemberExpression { $$ = $1; }
715 | NewExpression_ { $$ = $1; }
719 : MemberExpressionNoBF { $$ = $1; }
720 | NewExpression_ { $$ = $1; }
724 : MemberExpression Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
725 | CallExpression Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
726 | CallExpression MemberAccess { $2->SetLeft($1); $$ = $2; }
730 : MemberExpressionNoBF Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
731 | CallExpressionNoBF Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
732 | CallExpressionNoBF MemberAccess { $2->SetLeft($1); $$ = $2; }
736 : "," ArgumentList { $$ = $2; }
741 : ArgumentList { $$ = $1; }
746 : AssignmentExpression ArgumentList_ { $$ = new(driver.pool_) CYArgument(NULL, $1, $2); }
750 : "(" ArgumentListOpt ")" { $$ = $2; }
753 LeftHandSideExpression
754 : NewExpression { $$ = $1; }
755 | CallExpression { $$ = $1; }
758 LeftHandSideExpressionNoBF
759 : NewExpressionNoBF { $$ = $1; }
760 | CallExpressionNoBF { $$ = $1; }
763 /* 11.3 Postfix Expressions {{{ */
765 : AssigneeExpression { $$ = $1; }
766 | LeftHandSideExpression "++" { $$ = new(driver.pool_) CYPostIncrement($1); }
767 | LeftHandSideExpression "--" { $$ = new(driver.pool_) CYPostDecrement($1); }
770 PostfixExpressionNoBF
771 : AssigneeExpressionNoBF { $$ = $1; }
772 | LeftHandSideExpressionNoBF "++" { $$ = new(driver.pool_) CYPostIncrement($1); }
773 | LeftHandSideExpressionNoBF "--" { $$ = new(driver.pool_) CYPostDecrement($1); }
776 /* 11.4 Unary Operators {{{ */
778 : "delete" UnaryExpression { $$ = new(driver.pool_) CYDelete($2); }
779 | "void" UnaryExpression { $$ = new(driver.pool_) CYVoid($2); }
780 | "typeof" UnaryExpression { $$ = new(driver.pool_) CYTypeOf($2); }
781 | "++" UnaryExpression { $$ = new(driver.pool_) CYPreIncrement($2); }
782 | "\n++" UnaryExpression { $$ = new(driver.pool_) CYPreIncrement($2); }
783 | "--" UnaryExpression { $$ = new(driver.pool_) CYPreDecrement($2); }
784 | "\n--" UnaryExpression { $$ = new(driver.pool_) CYPreDecrement($2); }
785 | "+" UnaryExpression { $$ = new(driver.pool_) CYAffirm($2); }
786 | "-" UnaryExpression { $$ = new(driver.pool_) CYNegate($2); }
787 | "~" UnaryExpression { $$ = new(driver.pool_) CYBitwiseNot($2); }
788 | "!" UnaryExpression { $$ = new(driver.pool_) CYLogicalNot($2); }
792 : PostfixExpression { $$ = $1; }
793 | UnaryExpression_ { $$ = $1; }
797 : PostfixExpressionNoBF { $$ = $1; }
798 | UnaryExpression_ { $$ = $1; }
801 /* 11.5 Multiplicative Operators {{{ */
802 MultiplicativeExpression
803 : UnaryExpression { $$ = $1; }
804 | MultiplicativeExpression "*" UnaryExpression { $$ = new(driver.pool_) CYMultiply($1, $3); }
805 | MultiplicativeExpression "/" UnaryExpression { $$ = new(driver.pool_) CYDivide($1, $3); }
806 | MultiplicativeExpression "%" UnaryExpression { $$ = new(driver.pool_) CYModulus($1, $3); }
809 MultiplicativeExpressionNoBF
810 : UnaryExpressionNoBF { $$ = $1; }
811 | MultiplicativeExpressionNoBF "*" UnaryExpression { $$ = new(driver.pool_) CYMultiply($1, $3); }
812 | MultiplicativeExpressionNoBF "/" UnaryExpression { $$ = new(driver.pool_) CYDivide($1, $3); }
813 | MultiplicativeExpressionNoBF "%" UnaryExpression { $$ = new(driver.pool_) CYModulus($1, $3); }
816 /* 11.6 Additive Operators {{{ */
818 : MultiplicativeExpression { $$ = $1; }
819 | AdditiveExpression "+" MultiplicativeExpression { $$ = new(driver.pool_) CYAdd($1, $3); }
820 | AdditiveExpression "-" MultiplicativeExpression { $$ = new(driver.pool_) CYSubtract($1, $3); }
823 AdditiveExpressionNoBF
824 : MultiplicativeExpressionNoBF { $$ = $1; }
825 | AdditiveExpressionNoBF "+" MultiplicativeExpression { $$ = new(driver.pool_) CYAdd($1, $3); }
826 | AdditiveExpressionNoBF "-" MultiplicativeExpression { $$ = new(driver.pool_) CYSubtract($1, $3); }
829 /* 11.7 Bitwise Shift Operators {{{ */
831 : AdditiveExpression { $$ = $1; }
832 | ShiftExpression "<<" AdditiveExpression { $$ = new(driver.pool_) CYShiftLeft($1, $3); }
833 | ShiftExpression ">>" AdditiveExpression { $$ = new(driver.pool_) CYShiftRightSigned($1, $3); }
834 | ShiftExpression ">>>" AdditiveExpression { $$ = new(driver.pool_) CYShiftRightUnsigned($1, $3); }
838 : AdditiveExpressionNoBF { $$ = $1; }
839 | ShiftExpressionNoBF "<<" AdditiveExpression { $$ = new(driver.pool_) CYShiftLeft($1, $3); }
840 | ShiftExpressionNoBF ">>" AdditiveExpression { $$ = new(driver.pool_) CYShiftRightSigned($1, $3); }
841 | ShiftExpressionNoBF ">>>" AdditiveExpression { $$ = new(driver.pool_) CYShiftRightUnsigned($1, $3); }
844 /* 11.8 Relational Operators {{{ */
845 RelationalExpressionNoIn_
846 : "<" ShiftExpression { $$ = new(driver.pool_) CYLess(NULL, $2); }
847 | ">" ShiftExpression { $$ = new(driver.pool_) CYGreater(NULL, $2); }
848 | "<=" ShiftExpression { $$ = new(driver.pool_) CYLessOrEqual(NULL, $2); }
849 | ">=" ShiftExpression { $$ = new(driver.pool_) CYGreaterOrEqual(NULL, $2); }
850 | "instanceof" ShiftExpression { $$ = new(driver.pool_) CYInstanceOf(NULL, $2); }
853 RelationalExpression_
854 : RelationalExpressionNoIn_ { $$ = $1; }
855 | "in" ShiftExpression { $$ = new(driver.pool_) CYIn(NULL, $2); }
859 : ShiftExpression { $$ = $1; }
860 | RelationalExpression RelationalExpression_ { $2->SetLeft($1); $$ = $2; }
863 RelationalExpressionNoIn
864 : ShiftExpression { $$ = $1; }
865 | RelationalExpressionNoIn RelationalExpressionNoIn_ { $2->SetLeft($1); $$ = $2; }
868 RelationalExpressionNoBF
869 : ShiftExpressionNoBF { $$ = $1; }
870 | RelationalExpressionNoBF RelationalExpression_ { $2->SetLeft($1); $$ = $2; }
873 /* 11.9 Equality Operators {{{ */
875 : RelationalExpression { $$ = $1; }
876 | EqualityExpression "==" RelationalExpression { $$ = new(driver.pool_) CYEqual($1, $3); }
877 | EqualityExpression "!=" RelationalExpression { $$ = new(driver.pool_) CYNotEqual($1, $3); }
878 | EqualityExpression "===" RelationalExpression { $$ = new(driver.pool_) CYIdentical($1, $3); }
879 | EqualityExpression "!==" RelationalExpression { $$ = new(driver.pool_) CYNotIdentical($1, $3); }
882 EqualityExpressionNoIn
883 : RelationalExpressionNoIn { $$ = $1; }
884 | EqualityExpressionNoIn "==" RelationalExpressionNoIn { $$ = new(driver.pool_) CYEqual($1, $3); }
885 | EqualityExpressionNoIn "!=" RelationalExpressionNoIn { $$ = new(driver.pool_) CYNotEqual($1, $3); }
886 | EqualityExpressionNoIn "===" RelationalExpressionNoIn { $$ = new(driver.pool_) CYIdentical($1, $3); }
887 | EqualityExpressionNoIn "!==" RelationalExpressionNoIn { $$ = new(driver.pool_) CYNotIdentical($1, $3); }
890 EqualityExpressionNoBF
891 : RelationalExpressionNoBF { $$ = $1; }
892 | EqualityExpressionNoBF "==" RelationalExpression { $$ = new(driver.pool_) CYEqual($1, $3); }
893 | EqualityExpressionNoBF "!=" RelationalExpression { $$ = new(driver.pool_) CYNotEqual($1, $3); }
894 | EqualityExpressionNoBF "===" RelationalExpression { $$ = new(driver.pool_) CYIdentical($1, $3); }
895 | EqualityExpressionNoBF "!==" RelationalExpression { $$ = new(driver.pool_) CYNotIdentical($1, $3); }
898 /* 11.10 Binary Bitwise Operators {{{ */
900 : EqualityExpression { $$ = $1; }
901 | BitwiseANDExpression "&" EqualityExpression { $$ = new(driver.pool_) CYBitwiseAnd($1, $3); }
904 BitwiseANDExpressionNoIn
905 : EqualityExpressionNoIn { $$ = $1; }
906 | BitwiseANDExpressionNoIn "&" EqualityExpressionNoIn { $$ = new(driver.pool_) CYBitwiseAnd($1, $3); }
909 BitwiseANDExpressionNoBF
910 : EqualityExpressionNoBF { $$ = $1; }
911 | BitwiseANDExpressionNoBF "&" EqualityExpression { $$ = new(driver.pool_) CYBitwiseAnd($1, $3); }
915 : BitwiseANDExpression { $$ = $1; }
916 | BitwiseXORExpression "^" BitwiseANDExpression { $$ = new(driver.pool_) CYBitwiseXOr($1, $3); }
919 BitwiseXORExpressionNoIn
920 : BitwiseANDExpressionNoIn { $$ = $1; }
921 | BitwiseXORExpressionNoIn "^" BitwiseANDExpressionNoIn { $$ = new(driver.pool_) CYBitwiseXOr($1, $3); }
924 BitwiseXORExpressionNoBF
925 : BitwiseANDExpressionNoBF { $$ = $1; }
926 | BitwiseXORExpressionNoBF "^" BitwiseANDExpression { $$ = new(driver.pool_) CYBitwiseXOr($1, $3); }
930 : BitwiseXORExpression { $$ = $1; }
931 | BitwiseORExpression "|" BitwiseXORExpression { $$ = new(driver.pool_) CYBitwiseOr($1, $3); }
934 BitwiseORExpressionNoIn
935 : BitwiseXORExpressionNoIn { $$ = $1; }
936 | BitwiseORExpressionNoIn "|" BitwiseXORExpressionNoIn { $$ = new(driver.pool_) CYBitwiseOr($1, $3); }
939 BitwiseORExpressionNoBF
940 : BitwiseXORExpressionNoBF { $$ = $1; }
941 | BitwiseORExpressionNoBF "|" BitwiseXORExpression { $$ = new(driver.pool_) CYBitwiseOr($1, $3); }
944 /* 11.11 Binary Logical Operators {{{ */
946 : BitwiseORExpression { $$ = $1; }
947 | LogicalANDExpression "&&" BitwiseORExpression { $$ = new(driver.pool_) CYLogicalAnd($1, $3); }
950 LogicalANDExpressionNoIn
951 : BitwiseORExpressionNoIn { $$ = $1; }
952 | LogicalANDExpressionNoIn "&&" BitwiseORExpressionNoIn { $$ = new(driver.pool_) CYLogicalAnd($1, $3); }
955 LogicalANDExpressionNoBF
956 : BitwiseORExpressionNoBF { $$ = $1; }
957 | LogicalANDExpressionNoBF "&&" BitwiseORExpression { $$ = new(driver.pool_) CYLogicalAnd($1, $3); }
961 : LogicalANDExpression { $$ = $1; }
962 | LogicalORExpression "||" LogicalANDExpression { $$ = new(driver.pool_) CYLogicalOr($1, $3); }
965 LogicalORExpressionNoIn
966 : LogicalANDExpressionNoIn { $$ = $1; }
967 | LogicalORExpressionNoIn "||" LogicalANDExpressionNoIn { $$ = new(driver.pool_) CYLogicalOr($1, $3); }
970 LogicalORExpressionNoBF
971 : LogicalANDExpressionNoBF { $$ = $1; }
972 | LogicalORExpressionNoBF "||" LogicalANDExpression { $$ = new(driver.pool_) CYLogicalOr($1, $3); }
975 /* 11.12 Conditional Operator ( ? : ) {{{ */
976 ConditionalExpression
977 : LogicalORExpression { $$ = $1; }
978 | LogicalORExpression "?" AssignmentExpression ":" AssignmentExpression { $$ = new(driver.pool_) CYCondition($1, $3, $5); }
981 ConditionalExpressionNoIn
982 : LogicalORExpressionNoIn { $$ = $1; }
983 | LogicalORExpressionNoIn "?" AssignmentExpression ":" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYCondition($1, $3, $5); }
986 ConditionalExpressionNoBF
987 : LogicalORExpressionNoBF { $$ = $1; }
988 | LogicalORExpressionNoBF "?" AssignmentExpression ":" AssignmentExpression { $$ = new(driver.pool_) CYCondition($1, $3, $5); }
991 /* 11.13 Assignment Operators {{{ */
992 AssignmentExpression_
993 : "=" AssignmentExpression { $$ = new(driver.pool_) CYAssign(NULL, $2); }
994 | "*=" AssignmentExpression { $$ = new(driver.pool_) CYMultiplyAssign(NULL, $2); }
995 | "/=" AssignmentExpression { $$ = new(driver.pool_) CYDivideAssign(NULL, $2); }
996 | "%=" AssignmentExpression { $$ = new(driver.pool_) CYModulusAssign(NULL, $2); }
997 | "+=" AssignmentExpression { $$ = new(driver.pool_) CYAddAssign(NULL, $2); }
998 | "-=" AssignmentExpression { $$ = new(driver.pool_) CYSubtractAssign(NULL, $2); }
999 | "<<=" AssignmentExpression { $$ = new(driver.pool_) CYShiftLeftAssign(NULL, $2); }
1000 | ">>=" AssignmentExpression { $$ = new(driver.pool_) CYShiftRightSignedAssign(NULL, $2); }
1001 | ">>>=" AssignmentExpression { $$ = new(driver.pool_) CYShiftRightUnsignedAssign(NULL, $2); }
1002 | "&=" AssignmentExpression { $$ = new(driver.pool_) CYBitwiseAndAssign(NULL, $2); }
1003 | "^=" AssignmentExpression { $$ = new(driver.pool_) CYBitwiseXOrAssign(NULL, $2); }
1004 | "|=" AssignmentExpression { $$ = new(driver.pool_) CYBitwiseOrAssign(NULL, $2); }
1008 : LeftHandSideExpression { $$ = $1; }
1009 | AssigneeExpression_ { $$ = $1; }
1012 AssigneeExpressionNoBF
1013 : LeftHandSideExpressionNoBF { $$ = $1; }
1014 | AssigneeExpression_ { $$ = $1; }
1017 AssignmentExpression
1018 : ConditionalExpression { $$ = $1; }
1019 | AssigneeExpression AssignmentExpression_ { $2->SetLeft($1); $$ = $2; }
1022 AssignmentExpressionNoIn
1023 : ConditionalExpressionNoIn { $$ = $1; }
1024 | AssigneeExpression "=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYAssign($1, $3); }
1025 | AssigneeExpression "*=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYMultiplyAssign($1, $3); }
1026 | AssigneeExpression "/=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYDivideAssign($1, $3); }
1027 | AssigneeExpression "%=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYModulusAssign($1, $3); }
1028 | AssigneeExpression "+=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYAddAssign($1, $3); }
1029 | AssigneeExpression "-=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYSubtractAssign($1, $3); }
1030 | AssigneeExpression "<<=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYShiftLeftAssign($1, $3); }
1031 | AssigneeExpression ">>=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYShiftRightSignedAssign($1, $3); }
1032 | AssigneeExpression ">>>=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYShiftRightUnsignedAssign($1, $3); }
1033 | AssigneeExpression "&=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYBitwiseAndAssign($1, $3); }
1034 | AssigneeExpression "^=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYBitwiseXOrAssign($1, $3); }
1035 | AssigneeExpression "|=" AssignmentExpressionNoIn { $$ = new(driver.pool_) CYBitwiseOrAssign($1, $3); }
1038 AssignmentExpressionNoBF
1039 : ConditionalExpressionNoBF { $$ = $1; }
1040 | AssigneeExpressionNoBF AssignmentExpression_ { $2->SetLeft($1); $$ = $2; }
1043 /* 11.14 Comma Operator {{{ */
1045 : "," Expression { $$ = new(driver.pool_) CYCompound($2); }
1050 : "," ExpressionNoIn { $$ = new(driver.pool_) CYCompound($2); }
1055 : Expression { $$ = $1; }
1060 : ExpressionNoIn { $$ = $1; }
1065 : AssignmentExpression Expression_ { if ($2) { $2->AddPrev($1); $$ = $2; } else $$ = $1; }
1069 : AssignmentExpressionNoIn ExpressionNoIn_ { if ($2) { $2->AddPrev($1); $$ = $2; } else $$ = $1; }
1073 : AssignmentExpressionNoBF Expression_ { if ($2) { $2->AddPrev($1); $$ = $2; } else $$ = $1; }
1077 /* 12 Statements {{{ */
1079 : Block { $$ = $1; }
1080 | VariableStatement { $$ = $1; }
1081 | EmptyStatement { $$ = $1; }
1082 | ExpressionStatement { $$ = $1; }
1083 | IfStatement { $$ = $1; }
1084 | IterationStatement { $$ = $1; }
1085 | ContinueStatement { $$ = $1; }
1086 | BreakStatement { $$ = $1; }
1087 | ReturnStatement { $$ = $1; }
1088 | WithStatement { $$ = $1; }
1089 | LabelledStatement { $$ = $1; }
1090 | SwitchStatement { $$ = $1; }
1091 | ThrowStatement { $$ = $1; }
1092 | TryStatement { $$ = $1; }
1096 : Statement_ { $$ = $1; }
1099 /* 12.1 Block {{{ */
1101 : "{" StatementListOpt "}" { $$ = $2; }
1105 : Block_ { if ($1) $$ = new(driver.pool_) CYBlock($1); else $$ = new(driver.pool_) CYEmpty(); }
1109 : Statement StatementListOpt { $1->SetNext($2); $$ = $1; }
1113 : StatementList { $$ = $1; }
1117 /* 12.2 Variable Statement {{{ */
1119 : "var" VariableDeclarationList Terminator { $$ = new(driver.pool_) CYVar($2); }
1122 VariableDeclarationList_
1123 : "," VariableDeclarationList { $$ = $2; }
1127 VariableDeclarationListNoIn_
1128 : "," VariableDeclarationListNoIn { $$ = $2; }
1132 VariableDeclarationList
1133 : VariableDeclaration VariableDeclarationList_ { $$ = new(driver.pool_) CYDeclarations($1, $2); }
1136 VariableDeclarationListNoIn
1137 : VariableDeclarationNoIn VariableDeclarationListNoIn_ { $$ = new(driver.pool_) CYDeclarations($1, $2); }
1141 : Identifier InitialiserOpt { $$ = new(driver.pool_) CYDeclaration($1, $2); }
1144 VariableDeclarationNoIn
1145 : Identifier InitialiserNoInOpt { $$ = new(driver.pool_) CYDeclaration($1, $2); }
1149 : Initialiser { $$ = $1; }
1154 : InitialiserNoIn { $$ = $1; }
1159 : "=" AssignmentExpression { $$ = $2; }
1163 : "=" AssignmentExpressionNoIn { $$ = $2; }
1166 /* 12.3 Empty Statement {{{ */
1168 : ";" { $$ = new(driver.pool_) CYEmpty(); }
1171 /* 12.4 Expression Statement {{{ */
1173 : ExpressionNoBF Terminator { $$ = new(driver.pool_) CYExpress($1); }
1176 /* 12.5 The if Statement {{{ */
1178 : "else" Statement { $$ = $2; }
1179 | %prec "if" { $$ = NULL; }
1183 : "if" "(" Expression ")" Statement ElseStatementOpt { $$ = new(driver.pool_) CYIf($3, $5, $6); }
1187 /* 12.6 Iteration Statements {{{ */
1189 : DoWhileStatement { $$ = $1; }
1190 | WhileStatement { $$ = $1; }
1191 | ForStatement { $$ = $1; }
1192 | ForInStatement { $$ = $1; }
1195 /* 12.6.1 The do-while Statement {{{ */
1197 : "do" Statement "while" "(" Expression ")" TerminatorOpt { $$ = new(driver.pool_) CYDoWhile($5, $2); }
1200 /* 12.6.2 The while Statement {{{ */
1202 : "while" "(" Expression ")" Statement { $$ = new(driver.pool_) CYWhile($3, $5); }
1205 /* 12.6.3 The for Statement {{{ */
1207 : "for" "(" ForStatementInitialiser ";" ExpressionOpt ";" ExpressionOpt ")" Statement { $$ = new(driver.pool_) CYFor($3, $5, $7, $9); }
1210 ForStatementInitialiser
1211 : ExpressionNoInOpt { $$ = $1; }
1212 | "var" VariableDeclarationListNoIn { $$ = $2; }
1215 /* 12.6.4 The for-in Statement {{{ */
1217 : "for" "(" ForInStatementInitialiser "in" Expression ")" Statement { $$ = new(driver.pool_) CYForIn($3, $5, $7); }
1220 ForInStatementInitialiser
1221 : LeftHandSideExpression { $$ = $1; }
1222 | "var" VariableDeclarationNoIn { $$ = $2; }
1226 /* 12.7 The continue Statement {{{ */
1228 : "continue" IdentifierOpt Terminator { $$ = new(driver.pool_) CYContinue($2); }
1231 /* 12.8 The break Statement {{{ */
1233 : "break" IdentifierOpt Terminator { $$ = new(driver.pool_) CYBreak($2); }
1236 /* 12.9 The return Statement {{{ */
1238 : "return" ExpressionOpt Terminator { $$ = new(driver.pool_) CYReturn($2); }
1241 /* 12.10 The with Statement {{{ */
1243 : "with" "(" Expression ")" Statement { $$ = new(driver.pool_) CYWith($3, $5); }
1247 /* 12.11 The switch Statement {{{ */
1249 : "switch" "(" Expression ")" CaseBlock { $$ = new(driver.pool_) CYSwitch($3, $5); }
1253 : "{" CaseClausesOpt "}" { $$ = $2; }
1257 : CaseClause CaseClausesOpt { $1->SetNext($2); $$ = $1; }
1258 | DefaultClause CaseClausesOpt { $1->SetNext($2); $$ = $1; }
1263 : "case" Expression ":" StatementListOpt { $$ = new(driver.pool_) CYClause($2, $4); }
1267 : "default" ":" StatementListOpt { $$ = new(driver.pool_) CYClause(NULL, $3); }
1270 /* 12.12 Labelled Statements {{{ */
1272 : Identifier ":" Statement { $$ = new(driver.pool_) CYLabel($1, $3); }
1275 /* 12.13 The throw Statement {{{ */
1277 : "throw" Expression Terminator { $$ = new(driver.pool_) CYThrow($2); }
1280 /* 12.14 The try Statement {{{ */
1282 : "try" Block_ CatchOpt FinallyOpt { $$ = new(driver.pool_) CYTry($2, $3, $4); }
1286 : "catch" "(" Identifier ")" Block_ { $$ = new(driver.pool_) CYCatch($3, $5); }
1291 : "finally" Block_ { $$ = new(driver.pool_) CYFinally($2); }
1296 /* 13 Function Definition {{{ */
1298 : "function" Identifier "(" FormalParameterList ")" "{" FunctionBody "}" { $$ = new(driver.pool_) CYFunctionStatement($2, $4, $7); }
1302 : "function" IdentifierOpt "(" FormalParameterList ")" "{" FunctionBody "}" { $$ = new(driver.pool_) CYFunctionExpression($2, $4, $7); }
1305 FormalParameterList_
1306 : "," FormalParameterList { $$ = $2; }
1311 : Identifier FormalParameterList_ { $$ = new(driver.pool_) CYFunctionParameter($1, $2); }
1316 : SourceElements { $$ = $1; }
1319 /* 14 Program {{{ */
1321 : SourceElements { driver.program_ = new(driver.pool_) CYProgram($1); }
1325 : SourceElement SourceElements { $1->SetNext($2); $$ = $1; }
1330 : Statement_ { $$ = $1; }
1331 | FunctionDeclaration { $$ = $1; }
1336 /* Cycript (Objective-C): @class Declaration {{{ */
1338 : ":" MemberExpressionNoBF { $$ = $2; }
1343 : "{" "}" { $$ = NULL; }
1347 : "+" { $$ = false; }
1348 | "-" { $$ = true; }
1352 : "(" Expression ")" { $$ = $2; }
1357 : Word ":" TypeOpt Identifier { $$ = new(driver.pool_) CYMessageParameter($1, $3, $4); }
1360 MessageParameterListOpt
1361 : MessageParameterList { $$ = $1; }
1365 MessageParameterList
1366 : MessageParameter MessageParameterListOpt { $1->SetNext($2); $$ = $1; }
1370 : MessageParameterList { $$ = $1; }
1371 | Word { $$ = new(driver.pool_) CYMessageParameter($1, NULL, NULL); }
1374 ClassMessageDeclaration
1375 : MessageScope TypeOpt MessageParameters "{" FunctionBody "}" { $$ = new(driver.pool_) CYMessage($1, $2, $3, $5); }
1378 ClassMessageDeclarationListOpt
1379 : ClassMessageDeclarationListOpt ClassMessageDeclaration { $2->SetNext($1); $$ = $2; }
1384 : Identifier { $$ = $1; }
1385 | "(" AssignmentExpression ")" { $$ = $2; }
1389 : ClassName { $$ = $1; }
1394 : "@class" ClassNameOpt ClassSuperOpt ClassFieldList ClassMessageDeclarationListOpt "@end" { $$ = new(driver.pool_) CYClassExpression($2, $3, $4, $5); }
1398 : "@class" ClassName ClassSuperOpt ClassFieldList ClassMessageDeclarationListOpt "@end" { $$ = new(driver.pool_) CYClassStatement($2, $3, $4, $5); }
1402 : "@class" ClassName ClassMessageDeclarationListOpt "@end" { $$ = new(driver.pool_) CYCategory($2, $3); }
1406 : ClassExpression { $$ = $1; }
1410 : ClassStatement { $$ = $1; }
1411 | CategoryStatement { $$ = $1; }
1414 /* Cycript (Objective-C): Send Message {{{ */
1416 : "," AssignmentExpression VariadicCall { $$ = new(driver.pool_) CYArgument(NULL, $2, $3); }
1421 : SelectorCall { $$ = $1; }
1422 | VariadicCall { $$ = $1; }
1426 : WordOpt ":" AssignmentExpression SelectorCall_ { $$ = new(driver.pool_) CYArgument($1 ?: new(driver.pool_) CYBlank(), $3, $4); }
1430 : SelectorCall { $$ = $1; }
1431 | Word { $$ = new(driver.pool_) CYArgument($1, NULL); }
1435 : "[" AssignmentExpression SelectorList "]" { $$ = new(driver.pool_) CYSendDirect($2, $3); }
1436 | "[" "super" SelectorList "]" { $$ = new(driver.pool_) CYSendSuper($3); }
1439 SelectorExpressionOpt
1440 : SelectorExpression_ { $$ = $1; }
1445 : WordOpt ":" SelectorExpressionOpt { $$ = new(driver.pool_) CYSelectorPart($1, true, $3); }
1449 : SelectorExpression_ { $$ = $1; }
1450 | Word { $$ = new(driver.pool_) CYSelectorPart($1, false, NULL); }
1454 : MessageExpression { $$ = $1; }
1455 | "@selector" "(" SelectorExpression ")" { $$ = new(driver.pool_) CYSelector($3); }
1461 /* Cycript (C): Pointer Indirection/Addressing {{{ */
1463 : "*" UnaryExpression { $$ = new(driver.pool_) CYIndirect($2); }
1467 : "&" UnaryExpression { $$ = new(driver.pool_) CYAddressOf($2); }
1471 : "->" "[" Expression "]" { $$ = new(driver.pool_) CYIndirectMember(NULL, $3); }
1472 | "->" Identifier { $$ = new(driver.pool_) CYIndirectMember(NULL, new(driver.pool_) CYString($2)); }
1478 /* 8.3 XML Initialiser Input Elements {{{ */
1485 /* 11.1 Primary Expressions {{{ */
1487 : PropertyIdentifier
1489 | XMLListInitialiser
1493 : AttributeIdentifier
1494 | QualifiedIdentifier
1495 | WildcardIdentifier
1498 /* 11.1.1 Attribute Identifiers {{{ */
1500 : "@" PropertySelector
1501 | "@" QualifiedIdentifier
1502 | "@" "[" Expression "]"
1507 | WildcardIdentifier
1510 /* 11.1.2 Qualified Identifiers {{{ */
1512 : PropertySelector "::" PropertySelector
1513 | PropertySelector "::" "[" Expression "]"
1516 /* 11.1.3 Wildcard Identifiers {{{ */
1521 /* 11.1.4 XML Initialiser {{{ */
1528 : "<" XMLTagContent XMLWhitespaceOpt "/>"
1529 | "<" XMLTagContent XMLWhitespace ">" XMLElementContentOpt "</" XMLTagName XMLWhitespaceOpt ">"
1533 : XMLTagName XMLAttributesOpt
1537 : "{" Expression "}"
1542 : XMLWhitespace "{" Expression "}"
1543 | XMLAttributeOpt XMLAttributes
1552 : XMLWhitespace XMLName XMLWhitespaceOpt "=" XMLWhitespaceOpt "{" Expression "}"
1553 | XMLWhitespace XMLName XMLWhitespaceOpt "=" XMLWhitespaceOpt XMLAttributeValue
1562 : "{" Expression "}" XMLElementContentOpt
1563 | XMLMarkup XMLElementContentOpt
1564 | XMLText XMLElementContentOpt
1565 | XMLElement XMLElementContentOpt
1568 XMLElementContentOpt
1573 /* 11.1.5 XMLList Initialiser {{{ */
1575 : "<>" XMLElementContent "</>"
1580 /* ECMAScript5: Object Literal Trailing Comma {{{ */
1581 PropertyNameAndValueList_
1582 : "," { $$ = NULL; }
1585 /* JavaScript 1.7: Array Comprehensions {{{ */
1587 : "if" "(" Expression ")" { $$ = new(driver.pool_) CYIfComprehension($3); }
1591 : "for" "(" Identifier "in" Expression ")" { $$ = new(driver.pool_) CYForInComprehension($3, $5); }
1592 | "for" "each" "(" Identifier "in" Expression ")" { $$ = new(driver.pool_) CYForEachInComprehension($4, $6); }
1595 ComprehensionListOpt
1596 : ComprehensionList { $$ = $1; }
1597 | IfComprehension { $$ = $1; }
1602 : ForComprehension ComprehensionListOpt { $1->SetNext($2); $$ = $1; }
1606 : "[" AssignmentExpression ComprehensionList "]" { $$ = new(driver.pool_) CYArrayComprehension($2, $3); }
1609 /* JavaScript 1.7: for each {{{ */
1611 : "for" "each" "(" ForInStatementInitialiser "in" Expression ")" Statement { $$ = new(driver.pool_) CYForEachIn($4, $6, $8); }
1614 /* JavaScript 1.7: let Statements {{{ *//*
1616 : "let" "(" VariableDeclarationList ")" Block_ { $$ = new(driver.pool_) CYLet($3, $5); }
1623 /* JavaScript FTW: Function Statements {{{ */
1625 : FunctionDeclaration { driver.Warning(yylloc, "warning, FunctionDeclaration is a SourceElement, not a Statement"); } { $$ = $1; }