1 /* Cycript - Optimizing JavaScript Compiler/Runtime
2 * Copyright (C) 2009-2010 Jay Freeman (saurik)
5 /* GNU Lesser General Public License, Version 3 {{{ */
7 * Cycript is free software: you can redistribute it and/or modify it under
8 * the terms of the GNU Lesser General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
12 * Cycript is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 * License for more details.
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with Cycript. If not, see <http://www.gnu.org/licenses/>.
24 @if Bison24 %code top {
25 #define cyscanner driver.scanner_
26 #define YYSTACKEXPANDABLE 1
27 @if Bison23 #define yyerrok (yyerrstatus_ = 0)
30 @if Bison24 %code requires {
32 #define CYNew new($pool)
35 #include "ObjectiveC/Syntax.hpp"
39 #include "E4X/Syntax.hpp"
48 CYDriver::Condition condition_;
50 CYArgument *argument_;
51 CYAssignment *assignment_;
54 cy::Syntax::Catch *catch_;
56 CYComprehension *comprehension_;
57 CYCompound *compound_;
58 CYDeclaration *declaration_;
59 CYDeclarations *declarations_;
61 CYExpression *expression_;
64 CYForInitialiser *for_;
65 CYForInInitialiser *forin_;
66 CYFunctionParameter *functionParameter_;
67 CYIdentifier *identifier_;
74 CYProperty *property_;
75 CYPropertyName *propertyName_;
76 CYRubyProc *rubyProc_;
77 CYStatement *statement_;
84 CYClassName *className_;
87 CYMessageParameter *messageParameter_;
88 CYProtocol *protocol_;
89 CYSelectorPart *selector_;
93 CYAttribute *attribute_;
94 CYPropertyIdentifier *propertyIdentifier_;
95 CYSelector *selector_;
100 #define YYSTYPE YYSTYPE
103 @if Bison24 %code provides {
104 int cylex(YYSTYPE *, cy::location *, void *);
111 @if Bison23 %skeleton "lalr1.cc"
112 @if Bison24 %language "C++"
115 @$.begin.filename = @$.end.filename = &driver.filename_;
126 %parse-param { CYDriver &driver }
127 %lex-param { void *cyscanner }
134 %token XMLAttributeValue
136 %token XMLTagCharacters
142 %token LeftRight "<>"
143 %token LeftSlashRight "</>"
145 %token SlashRight "/>"
146 %token LeftSlash "</"
148 %token ColonColon "::"
149 %token PeriodPeriod ".."
152 @begin E4X ObjectiveC
157 %token AmpersandAmpersand "&&"
158 %token AmpersandEqual "&="
160 %token CarrotEqual "^="
162 %token EqualEqual "=="
163 %token EqualEqualEqual "==="
164 %token EqualRight "=>"
165 %token Exclamation "!"
166 %token ExclamationEqual "!="
167 %token ExclamationEqualEqual "!=="
169 %token HyphenEqual "-="
170 %token HyphenHyphen "--"
171 %token HyphenHyphen_ "\n--"
172 %token HyphenRight "->"
174 %token LeftEqual "<="
176 %token LeftLeftEqual "<<="
178 %token PercentEqual "%="
180 %token PeriodPeriodPeriod "..."
182 %token PipeEqual "|="
185 %token PlusEqual "+="
187 %token PlusPlus_ "\n++"
189 %token RightEqual ">="
190 %token RightRight ">>"
191 %token RightRightEqual ">>="
192 %token RightRightRight ">>>"
193 %token RightRightRightEqual ">>>="
195 %token SlashEqual "/="
197 %token StarEqual "*="
206 %token <comment_> Comment
209 %token CloseParen ")"
212 %token OpenBrace_ "\n{"
213 %token OpenBrace__ ";{"
214 %token CloseBrace "}"
216 %token OpenBracket "["
217 %token CloseBracket "]"
220 %token AtClass "@class"
224 %token AtImplementation "@implementation"
225 %token AtImplementation_ ";@implementation"
226 %token AtImport "@import"
228 %token AtSelector "@selector"
231 %token <false_> False "false"
232 %token <null_> Null "null"
233 %token <true_> True "true"
235 // ES3/ES5/WIE/JSC Reserved
236 %token <word_> Break "break"
237 %token <word_> Case "case"
238 %token <word_> Catch "catch"
239 %token <word_> Continue "continue"
240 %token <word_> Default "default"
241 %token <word_> Delete "delete"
242 %token <word_> Do "do"
243 %token <word_> Else "else"
244 %token <word_> Finally "finally"
245 %token <word_> For "for"
246 %token <word_> Function "function"
247 %token <word_> Function_ ";function"
248 %token <word_> If "if"
249 %token <word_> In "in"
250 %token <word_> In_ "!in"
251 %token <word_> InstanceOf "instanceof"
252 %token <word_> New "new"
253 %token <word_> Return "return"
254 %token <word_> Switch "switch"
255 %token <this_> This "this"
256 %token <word_> Throw "throw"
257 %token <word_> Try "try"
258 %token <word_> TypeOf "typeof"
259 %token <word_> Var "var"
260 %token <word_> Void "void"
261 %token <word_> While "while"
262 %token <word_> With "with"
264 // ES3/IE6 Future, ES5/JSC Reserved
265 %token <word_> Debugger "debugger"
267 // ES3/ES5/IE6 Future, JSC Reserved
268 %token <word_> Const "const"
270 // ES3/ES5/IE6/JSC Future
271 %token <word_> Class "class"
272 %token <word_> Enum "enum"
273 %token <word_> Export "export"
274 %token <word_> Extends "extends"
275 %token <word_> Import "import"
276 %token <word_> Super "super"
278 // ES3 Future, ES5 Strict Future
279 %token <identifier_> Implements "implements"
280 %token <identifier_> Interface "interface"
281 %token <identifier_> Package "package"
282 %token <identifier_> Private "private"
283 %token <identifier_> Protected "protected"
284 %token <identifier_> Public "public"
285 %token <identifier_> Static "static"
288 %token <identifier_> Abstract "abstract"
289 %token <identifier_> Boolean "boolean"
290 %token <identifier_> Byte "byte"
291 %token <identifier_> Char "char"
292 %token <identifier_> Double "double"
293 %token <identifier_> Final "final"
294 %token <identifier_> Float "float"
295 %token <identifier_> Goto "goto"
296 %token <identifier_> Int "int"
297 %token <identifier_> Long "long"
298 %token <identifier_> Native "native"
299 %token <identifier_> Short "short"
300 %token <identifier_> Synchronized "synchronized"
301 %token <identifier_> Throws "throws"
302 %token <identifier_> Transient "transient"
303 %token <identifier_> Volatile "volatile"
306 %token <identifier_> Let "let"
307 %token <identifier_> Yield "yield"
310 %token <identifier_> Each "each"
311 %token <identifier_> Of "of"
315 %token <identifier_> Namespace "namespace"
316 %token <identifier_> XML "xml"
321 %token <identifier_> Identifier_
322 %token <number_> NumericLiteral
323 %token <string_> StringLiteral
324 %token <literal_> RegularExpressionLiteral
326 %type <expression_> AdditiveExpression
327 %type <argument_> ArgumentList_
328 %type <argument_> ArgumentList
329 %type <argument_> ArgumentListOpt
330 %type <argument_> Arguments
331 %type <literal_> ArrayLiteral
332 %type <expression_> ArrowFunction
333 %type <functionParameter_> ArrowParameters
334 %type <expression_> AssignmentExpression
335 %type <identifier_> BindingIdentifier
336 %type <expression_> BitwiseANDExpression
337 %type <statement_> Block_
338 %type <statement_> Block
339 %type <boolean_> BooleanLiteral
340 %type <declaration_> BindingElement
341 %type <expression_> BitwiseORExpression
342 %type <expression_> BitwiseXORExpression
343 %type <statement_> BreakStatement
344 %type <statement_> BreakableStatement
345 %type <expression_> CallExpression_
346 %type <expression_> CallExpression
347 %type <clause_> CaseBlock
348 %type <clause_> CaseClause
349 %type <clause_> CaseClausesOpt
350 %type <catch_> CatchOpt
351 %type <comprehension_> ComprehensionList
352 %type <comprehension_> ComprehensionListOpt
353 %type <expression_> ConditionalExpression
354 %type <statement_> ContinueStatement
355 %type <statement_> ConciseBody
356 %type <statement_> DebuggerStatement
357 %type <statement_> Declaration__
358 %type <statement_> Declaration_
359 %type <statement_> Declaration
360 %type <clause_> DefaultClause
361 %type <expression_> Element
362 %type <expression_> ElementOpt
363 %type <element_> ElementList
364 %type <element_> ElementListOpt
365 %type <statement_> ElseStatementOpt
366 %type <statement_> EmptyStatement
367 %type <expression_> EqualityExpression
368 %type <compound_> Expression_
369 %type <compound_> Expression
370 %type <expression_> ExpressionOpt
371 %type <statement_> ExpressionStatement
372 %type <finally_> FinallyOpt
373 %type <comprehension_> ForComprehension
374 %type <for_> ForStatementInitialiser
375 %type <forin_> ForInStatementInitialiser
376 %type <declaration_> FormalParameter
377 %type <functionParameter_> FormalParameterList_
378 %type <functionParameter_> FormalParameterList
379 %type <functionParameter_> FormalParameterListOpt
380 %type <statement_> FunctionBody
381 %type <statement_> FunctionDeclaration
382 %type <expression_> FunctionExpression
383 %type <identifier_> Identifier
384 %type <identifier_> IdentifierOpt
385 %type <comprehension_> IfComprehension
386 %type <statement_> IfStatement
387 %type <expression_> Initialiser
388 %type <expression_> InitialiserOpt
389 %type <statement_> IterationStatement
390 %type <statement_> LabelledStatement
391 %type <expression_> LeftHandSideExpression
392 %type <statement_> LetStatement
393 %type <statement_> LexicalDeclaration
394 %type <literal_> Literal
395 %type <literal_> LiteralNoRE
396 %type <expression_> LogicalANDExpression
397 %type <expression_> LogicalORExpression
398 %type <member_> MemberAccess
399 %type <expression_> MemberExpression_
400 %type <expression_> MemberExpression
401 %type <expression_> MultiplicativeExpression
402 %type <expression_> NewExpression
403 %type <null_> NullLiteral
404 %type <literal_> ObjectLiteral
405 %type <compound_> Parenthetical
406 %type <compound_> ParentheticalOpt
407 %type <expression_> PostfixExpression
408 %type <expression_> PrimaryExpression
409 %type <statement_> Program
410 %type <statement_> ProgramBody
411 %type <statement_> ProgramBodyOpt
412 %type <propertyName_> PropertyName_
413 %type <propertyName_> PropertyName
414 %type <property_> PropertyNameAndValueList_
415 %type <property_> PropertyNameAndValueList
416 %type <property_> PropertyNameAndValueListOpt
417 %type <expression_> RelationalExpression
418 %type <statement_> ReturnStatement
419 %type <rubyProc_> RubyProcExpression
420 %type <functionParameter_> RubyProcParameterList_
421 %type <functionParameter_> RubyProcParameterList
422 %type <functionParameter_> RubyProcParameters
423 %type <functionParameter_> RubyProcParametersOpt
424 %type <expression_> ShiftExpression
425 %type <declaration_> SingleNameBinding
426 %type <statement_> Statement__
427 %type <statement_> Statement_
428 %type <statement_> Statement
429 %type <statement_> StatementList
430 %type <statement_> StatementListOpt
431 %type <statement_> StatementListItem
432 %type <statement_> SwitchStatement
433 %type <statement_> ThrowStatement
434 %type <statement_> TryStatement
435 %type <expression_> UnaryExpression_
436 %type <expression_> UnaryExpression
437 %type <declaration_> VariableDeclaration
438 %type <declarations_> VariableDeclarationList_
439 %type <declarations_> VariableDeclarationList
440 %type <statement_> VariableStatement
441 %type <statement_> WithStatement
444 %type <statement_> CategoryStatement
445 %type <expression_> ClassExpression
446 %type <statement_> ClassStatement
447 %type <expression_> ClassSuperOpt
448 %type <field_> ClassFieldList
449 %type <message_> ClassMessageDeclaration
450 %type <message_> ClassMessageDeclarationListOpt
451 %type <className_> ClassName
452 %type <className_> ClassNameOpt
453 %type <protocol_> ClassProtocolListOpt
454 %type <protocol_> ClassProtocols
455 %type <protocol_> ClassProtocolsOpt
456 %type <expression_> MessageExpression
457 %type <messageParameter_> MessageParameter
458 %type <messageParameter_> MessageParameters
459 %type <messageParameter_> MessageParameterList
460 %type <messageParameter_> MessageParameterListOpt
461 %type <bool_> MessageScope
462 %type <argument_> SelectorCall_
463 %type <argument_> SelectorCall
464 %type <selector_> SelectorExpression_
465 %type <selector_> SelectorExpression
466 %type <selector_> SelectorExpressionOpt
467 %type <argument_> SelectorList
468 %type <word_> SelectorWordOpt
469 %type <expression_> TypeOpt
470 %type <argument_> VariadicCall
472 %type <word_> WordOpt
476 %type <propertyIdentifier_> PropertyIdentifier_
477 %type <selector_> PropertySelector_
478 %type <selector_> PropertySelector
479 %type <identifier_> QualifiedIdentifier_
480 %type <identifier_> QualifiedIdentifier
481 %type <identifier_> WildcardIdentifier
482 %type <identifier_> XMLComment
483 %type <identifier_> XMLCDATA
484 %type <identifier_> XMLElement
485 %type <identifier_> XMLElementContent
486 %type <identifier_> XMLMarkup
487 %type <identifier_> XMLPI
489 %type <attribute_> AttributeIdentifier
490 /* XXX: %type <statement_> DefaultXMLNamespaceStatement */
491 %type <expression_> PropertyIdentifier
492 %type <expression_> XMLListInitialiser
493 %type <expression_> XMLInitialiser
506 /* Lexer State {{{ */
508 : { driver.in_.push(true); }
512 : { driver.in_.push(false); }
516 : { driver.in_.pop(); }
520 : { driver.SetCondition(CYDriver::RegExpCondition); }
524 : { if (yychar == yyempty_) driver.nobrace_ = true; else if (yychar == token::OpenBrace || yychar == token::OpenBrace_) yychar = token::OpenBrace__; }
528 : { if (yychar == token::Function) yychar = token::Function_; }
532 : LexNoBrace LexNoFunction
542 : { driver.Warning(yylloc, "warning, automatic semi-colon insertion required"); }
552 | error { if (yychar != yyeof_ && yychar != token::CloseBrace && !yylval.newline_) YYABORT; else { yyerrok; driver.errors_.pop_back(); } } StrictSemi
557 | error { yyerrok; driver.errors_.pop_back(); } StrictSemi
572 : Identifier { $$ = $1; }
573 | "break" NewLineOpt { $$ = $1; }
574 | "case" { $$ = $1; }
575 | "catch" { $$ = $1; }
576 | "class" { $$ = $1; }
577 | "const" { $$ = $1; }
578 | "continue" NewLineOpt { $$ = $1; }
579 | "debugger" { $$ = $1; }
580 | "default" { $$ = $1; }
581 | "delete" { $$ = $1; }
583 | "else" { $$ = $1; }
584 | "enum" { $$ = $1; }
585 | "export" { $$ = $1; }
586 | "extends" { $$ = $1; }
587 | "false" { $$ = $1; }
588 | "finally" { $$ = $1; }
589 /* XXX: | "for" { $$ = $1; } */
590 | "function" { $$ = $1; }
592 | "import" { $$ = $1; }
593 /* XXX: | "in" { $$ = $1; } */
594 /* XXX: | "instanceof" { $$ = $1; } */
596 // XXX: as it currently is not an Identifier
600 | "null" { $$ = $1; }
601 | "return" NewLineOpt { $$ = $1; }
602 | "super" { $$ = $1; }
603 | "switch" { $$ = $1; }
604 | "this" { $$ = $1; }
605 | "throw" NewLineOpt { $$ = $1; }
606 | "true" { $$ = $1; }
608 | "typeof" { $$ = $1; }
610 | "void" { $$ = $1; }
611 | "while" { $$ = $1; }
612 | "with" { $$ = $1; }
621 : "@" LiteralNoRE { $$ = CYNew CYBox($2); }
622 | "@" ArrayLiteral { $$ = CYNew CYBox($2); }
623 | "@" ObjectLiteral { $$ = CYNew CYBox($2); }
624 | "@" Parenthetical { $$ = CYNew CYBox($2); }
629 : Identifier_ { $$ = $1; }
631 | "implements" { $$ = $1; }
632 | "interface" { $$ = $1; }
633 | "package" { $$ = $1; }
634 | "private" { $$ = $1; }
635 | "protected" { $$ = $1; }
636 | "public" { $$ = $1; }
637 | "static" { $$ = $1; }
639 | "abstract" { $$ = $1; }
640 | "boolean" { $$ = $1; }
641 | "byte" { $$ = $1; }
642 | "char" { $$ = $1; }
643 | "double" { $$ = $1; }
644 | "final" { $$ = $1; }
645 | "float" { $$ = $1; }
646 | "goto" { $$ = $1; }
648 | "long" { $$ = $1; }
649 | "native" { $$ = $1; }
650 | "short" { $$ = $1; }
651 | "synchronized" { $$ = $1; }
652 | "throws" { $$ = $1; }
653 | "transient" { $$ = $1; }
654 | "volatile" { $$ = $1; }
656 // XXX: currently I only have this as Word
657 // | "let" { $$ = $1; }
659 | "yield" { $$ = $1; }
661 | "each" { $$ = $1; }
666 : Identifier { $$ = $1; }
671 : NullLiteral { $$ = $1; }
672 | BooleanLiteral { $$ = $1; }
673 | NumericLiteral { $$ = $1; }
674 | StringLiteral { $$ = $1; }
678 : LiteralNoRE { $$ = $1; }
679 | RegularExpressionLiteral { $$ = $1; }
683 : "null" { $$ = $1; }
687 : "true" { $$ = $1; }
688 | "false" { $$ = $1; }
691 /* 11.1 Primary Expressions {{{ */
693 : "(" LexPushInOff Expression LexPopIn ")" { $$ = $3; }
697 : Parenthetical { $$ = $1; }
702 : "this" { $$ = $1; }
703 | Identifier { $$ = CYNew CYVariable($1); }
704 | Literal { $$ = $1; }
705 | ArrayLiteral { $$ = $1; }
706 | ObjectLiteral { $$ = $1; }
707 | FunctionExpression { $$ = $1; }
708 | Parenthetical { $$ = $1; }
709 | AutoComplete { driver.mode_ = CYDriver::AutoPrimary; YYACCEPT; }
712 /* 11.1.4.1 Array Initialiser {{{ */
714 : "[" LexPushInOff ElementListOpt LexPopIn "]" { $$ = CYNew CYArray($3); }
718 : AssignmentExpression { $$ = $1; }
722 : Element { $$ = $1; }
723 | LexSetRegExp { $$ = NULL; }
727 : ElementOpt "," ElementListOpt { $$ = CYNew CYElement($1, $3); }
728 | Element { $$ = CYNew CYElement($1, NULL); }
732 : ElementList { $$ = $1; }
733 | LexSetRegExp { $$ = NULL; }
736 /* 11.1.5 Object Initialiser {{{ */
738 : BRACE LexPushInOff PropertyNameAndValueListOpt LexPopIn "}" { $$ = CYNew CYObject($3); }
741 PropertyNameAndValueList_
742 : "," PropertyNameAndValueList { $$ = $2; }
746 PropertyNameAndValueList
747 : PropertyName ":" AssignmentExpression PropertyNameAndValueList_ { $$ = CYNew CYProperty($1, $3, $4); }
750 PropertyNameAndValueListOpt
751 : PropertyNameAndValueList { $$ = $1; }
756 : Identifier { $$ = $1; }
757 | StringLiteral { $$ = $1; }
758 | NumericLiteral { $$ = $1; }
762 : LexSetRegExp PropertyName_ { $$ = $2; }
766 /* 11.2 Left-Hand-Side Expressions {{{ */
768 : "[" LexPushInOff Expression LexPopIn "]" { $$ = CYNew CYDirectMember(NULL, $3); }
769 | "." Identifier { $$ = CYNew CYDirectMember(NULL, CYNew CYString($2)); }
770 | "." AutoComplete { driver.mode_ = CYDriver::AutoDirect; YYACCEPT; }
774 : MemberExpression { $$ = $1; }
775 //| "super" { $$ = $1; }
779 : LexSetRegExp PrimaryExpression { $$ = $2; }
780 | MemberExpression_ { driver.context_ = $1; } MemberAccess { $3->SetLeft($1); $$ = $3; }
781 | LexSetRegExp "new" MemberExpression Arguments { $$ = CYNew cy::Syntax::New($3, $4); }
785 : MemberExpression { $$ = $1; }
786 | LexSetRegExp "new" NewExpression { $$ = CYNew cy::Syntax::New($3, NULL); }
795 : CallExpression_ Arguments { $$ = CYNew CYCall($1, $2); }
796 | CallExpression { driver.context_ = $1; } MemberAccess { $3->SetLeft($1); $$ = $3; }
800 : "(" LexPushInOff ArgumentListOpt LexPopIn ")" { $$ = $3; }
804 : "," ArgumentList { $$ = $2; }
809 : AssignmentExpression ArgumentList_ { $$ = CYNew CYArgument(NULL, $1, $2); }
813 : ArgumentList { $$ = $1; }
814 | LexSetRegExp { $$ = NULL; }
817 LeftHandSideExpression
818 : NewExpression { $$ = $1; }
819 | CallExpression { $$ = $1; }
822 /* 11.3 Postfix Expressions {{{ */
824 : %prec "" LeftHandSideExpression { $$ = $1; }
825 | LeftHandSideExpression "++" { $$ = CYNew CYPostIncrement($1); }
826 | LeftHandSideExpression "--" { $$ = CYNew CYPostDecrement($1); }
829 /* 11.4 Unary Operators {{{ */
831 : "delete" UnaryExpression { $$ = CYNew CYDelete($2); }
832 | "void" UnaryExpression { $$ = CYNew CYVoid($2); }
833 | "typeof" UnaryExpression { $$ = CYNew CYTypeOf($2); }
834 | "++" UnaryExpression { $$ = CYNew CYPreIncrement($2); }
835 | "\n++" UnaryExpression { $$ = CYNew CYPreIncrement($2); }
836 | "--" UnaryExpression { $$ = CYNew CYPreDecrement($2); }
837 | "\n--" UnaryExpression { $$ = CYNew CYPreDecrement($2); }
838 | "+" UnaryExpression { $$ = CYNew CYAffirm($2); }
839 | "-" UnaryExpression { $$ = CYNew CYNegate($2); }
840 | "~" UnaryExpression { $$ = CYNew CYBitwiseNot($2); }
841 | "!" UnaryExpression { $$ = CYNew CYLogicalNot($2); }
845 : PostfixExpression { $$ = $1; }
846 | LexSetRegExp UnaryExpression_ { $$ = $2; }
849 /* 11.5 Multiplicative Operators {{{ */
850 MultiplicativeExpression
851 : UnaryExpression { $$ = $1; }
852 | MultiplicativeExpression "*" UnaryExpression { $$ = CYNew CYMultiply($1, $3); }
853 | MultiplicativeExpression "/" UnaryExpression { $$ = CYNew CYDivide($1, $3); }
854 | MultiplicativeExpression "%" UnaryExpression { $$ = CYNew CYModulus($1, $3); }
857 /* 11.6 Additive Operators {{{ */
859 : MultiplicativeExpression { $$ = $1; }
860 | AdditiveExpression "+" MultiplicativeExpression { $$ = CYNew CYAdd($1, $3); }
861 | AdditiveExpression "-" MultiplicativeExpression { $$ = CYNew CYSubtract($1, $3); }
864 /* 11.7 Bitwise Shift Operators {{{ */
866 : AdditiveExpression { $$ = $1; }
867 | ShiftExpression "<<" AdditiveExpression { $$ = CYNew CYShiftLeft($1, $3); }
868 | ShiftExpression ">>" AdditiveExpression { $$ = CYNew CYShiftRightSigned($1, $3); }
869 | ShiftExpression ">>>" AdditiveExpression { $$ = CYNew CYShiftRightUnsigned($1, $3); }
872 /* 11.8 Relational Operators {{{ */
874 : ShiftExpression { $$ = $1; }
875 | RelationalExpression "<" ShiftExpression { $$ = CYNew CYLess($1, $3); }
876 | RelationalExpression ">" ShiftExpression { $$ = CYNew CYGreater($1, $3); }
877 | RelationalExpression "<=" ShiftExpression { $$ = CYNew CYLessOrEqual($1, $3); }
878 | RelationalExpression ">=" ShiftExpression { $$ = CYNew CYGreaterOrEqual($1, $3); }
879 | RelationalExpression "instanceof" ShiftExpression { $$ = CYNew CYInstanceOf($1, $3); }
880 | RelationalExpression "in" ShiftExpression { $$ = CYNew CYIn($1, $3); }
883 /* 11.9 Equality Operators {{{ */
885 : RelationalExpression { $$ = $1; }
886 | EqualityExpression "==" RelationalExpression { $$ = CYNew CYEqual($1, $3); }
887 | EqualityExpression "!=" RelationalExpression { $$ = CYNew CYNotEqual($1, $3); }
888 | EqualityExpression "===" RelationalExpression { $$ = CYNew CYIdentical($1, $3); }
889 | EqualityExpression "!==" RelationalExpression { $$ = CYNew CYNotIdentical($1, $3); }
892 /* 11.10 Binary Bitwise Operators {{{ */
894 : EqualityExpression { $$ = $1; }
895 | BitwiseANDExpression "&" EqualityExpression { $$ = CYNew CYBitwiseAnd($1, $3); }
899 : BitwiseANDExpression { $$ = $1; }
900 | BitwiseXORExpression "^" BitwiseANDExpression { $$ = CYNew CYBitwiseXOr($1, $3); }
904 : BitwiseXORExpression { $$ = $1; }
905 | BitwiseORExpression "|" BitwiseXORExpression { $$ = CYNew CYBitwiseOr($1, $3); }
908 /* 11.11 Binary Logical Operators {{{ */
910 : BitwiseORExpression { $$ = $1; }
911 | LogicalANDExpression "&&" BitwiseORExpression { $$ = CYNew CYLogicalAnd($1, $3); }
915 : LogicalANDExpression { $$ = $1; }
916 | LogicalORExpression "||" LogicalANDExpression { $$ = CYNew CYLogicalOr($1, $3); }
919 /* 11.12 Conditional Operator ( ? : ) {{{ */
920 ConditionalExpression
921 : LogicalORExpression { $$ = $1; }
922 | LogicalORExpression "?" LexPushInOff AssignmentExpression LexPopIn ":" AssignmentExpression { $$ = CYNew CYCondition($1, $4, $7); }
925 /* 11.13 Assignment Operators {{{ */
927 : ConditionalExpression { $$ = $1; }
928 | ArrowFunction { $$ = $1; }
929 | LeftHandSideExpression "=" AssignmentExpression { $$ = CYNew CYAssign($1, $3); }
930 | LeftHandSideExpression "*=" AssignmentExpression { $$ = CYNew CYMultiplyAssign($1, $3); }
931 | LeftHandSideExpression "/=" AssignmentExpression { $$ = CYNew CYDivideAssign($1, $3); }
932 | LeftHandSideExpression "%=" AssignmentExpression { $$ = CYNew CYModulusAssign($1, $3); }
933 | LeftHandSideExpression "+=" AssignmentExpression { $$ = CYNew CYAddAssign($1, $3); }
934 | LeftHandSideExpression "-=" AssignmentExpression { $$ = CYNew CYSubtractAssign($1, $3); }
935 | LeftHandSideExpression "<<=" AssignmentExpression { $$ = CYNew CYShiftLeftAssign($1, $3); }
936 | LeftHandSideExpression ">>=" AssignmentExpression { $$ = CYNew CYShiftRightSignedAssign($1, $3); }
937 | LeftHandSideExpression ">>>=" AssignmentExpression { $$ = CYNew CYShiftRightUnsignedAssign($1, $3); }
938 | LeftHandSideExpression "&=" AssignmentExpression { $$ = CYNew CYBitwiseAndAssign($1, $3); }
939 | LeftHandSideExpression "^=" AssignmentExpression { $$ = CYNew CYBitwiseXOrAssign($1, $3); }
940 | LeftHandSideExpression "|=" AssignmentExpression { $$ = CYNew CYBitwiseOrAssign($1, $3); }
943 /* 11.14 Comma Operator {{{ */
945 : "," Expression { $$ = $2; }
946 | { $$ = CYNew CYCompound(); }
950 : AssignmentExpression Expression_ { $2->AddPrev($1); $$ = $2; }
954 : Expression { $$ = $1; }
955 | LexSetRegExp { $$ = NULL; }
959 /* 12 Statements {{{ */
962 | VariableStatement { $$ = $1; }
963 | EmptyStatement { $$ = $1; }
964 | IfStatement { $$ = $1; }
965 | BreakableStatement { $$ = $1; }
966 | ContinueStatement { $$ = $1; }
967 | BreakStatement { $$ = $1; }
968 | ReturnStatement { $$ = $1; }
969 | WithStatement { $$ = $1; }
970 | LabelledStatement { $$ = $1; }
971 | ThrowStatement { $$ = $1; }
972 | TryStatement { $$ = $1; }
973 | DebuggerStatement { $$ = $1; }
977 : LexSetRegExp Statement__ { $$ = $2; }
978 | ExpressionStatement { $$ = $1; }
982 : LexSetStatement Statement_ { $$ = $2; }
986 : FunctionDeclaration { $$ = $1; }
987 | LexicalDeclaration { $$ = $1; }
991 : LexSetRegExp Declaration__ { $$ = $2; }
995 : LexSetStatement Declaration_ { $$ = $2; }
999 : IterationStatement { $$ = $1; }
1000 | SwitchStatement { $$ = $1; }
1003 /* 12.1 Block {{{ */
1005 : BRACE StatementListOpt "}" { $$ = $2; }
1009 : ";{" StatementListOpt "}" { $$ = CYNew CYBlock($2); }
1013 : StatementListItem StatementListOpt { $1->SetNext($2); $$ = $1; }
1017 : StatementList { $$ = $1; }
1018 | LexSetRegExp { $$ = NULL; }
1022 : Statement { $$ = $1; }
1023 | Declaration { $$ = $1; }
1026 /* 12.2 Declarations {{{ */
1028 : Identifier { $$ = $1; }
1031 // XXX: BindingPattern
1033 /* 12.2.1 Let and Const Declarations {{{ */
1035 : LetOrConst VariableDeclarationList Terminator { $$ = CYNew CYVar($2); }
1043 /* 12.2.2 Variable Statement {{{ */
1045 : "var" VariableDeclarationList Terminator { $$ = CYNew CYVar($2); }
1048 VariableDeclarationList_
1049 : "," VariableDeclarationList { $$ = $2; }
1053 VariableDeclarationList
1054 : VariableDeclaration VariableDeclarationList_ { $$ = CYNew CYDeclarations($1, $2); }
1058 : BindingIdentifier InitialiserOpt { $$ = CYNew CYDeclaration($1, $2); }
1059 // XXX: | BindingPattern Initialiser { $$ = CYNew CYDeclaration($1, $2); }
1063 : "=" AssignmentExpression { $$ = $2; }
1067 : Initialiser { $$ = $1; }
1071 /* 12.2.4 Destructuring Binding Patterns {{{ */
1075 : SingleNameBinding { $$ = $1; }
1079 : BindingIdentifier InitialiserOpt { $$ = CYNew CYDeclaration($1, $2); }
1082 /* 12.3 Empty Statement {{{ */
1084 : ";" { $$ = CYNew CYEmpty(); }
1087 /* 12.4 Expression Statement {{{ */
1089 : Expression Terminator { $$ = CYNew CYExpress($1); }
1092 /* 12.5 The if Statement {{{ */
1094 : "else" Statement { $$ = $2; }
1095 | %prec "if" { $$ = NULL; }
1099 : "if" "(" Expression ")" Statement ElseStatementOpt { $$ = CYNew CYIf($3, $5, $6); }
1103 /* 12.6.1 The do-while Statement {{{ */
1105 : "do" Statement "while" "(" Expression ")" TerminatorOpt { $$ = CYNew CYDoWhile($5, $2); }
1108 /* 12.6.2 The while Statement {{{ */
1110 : "while" "(" Expression ")" Statement { $$ = CYNew CYWhile($3, $5); }
1113 /* 12.6.3 The for Statement {{{ */
1115 : "for" "(" LexPushInOn ForStatementInitialiser LexPopIn ";" ExpressionOpt ";" ExpressionOpt ")" Statement { $$ = CYNew CYFor($4, $7, $9, $11); }
1118 ForStatementInitialiser
1119 : ExpressionOpt { $$ = $1; }
1120 | LexSetRegExp "var" VariableDeclarationList { $$ = CYNew CYForDeclarations($3); }
1123 /* 12.6.4 The for-in and for-of Statements {{{ */
1125 : "for" "(" LexPushInOn ForInStatementInitialiser LexPopIn "!in" Expression ")" Statement { $$ = CYNew CYForIn($4, $7, $9); }
1126 | "for" "(" LexPushInOn ForInStatementInitialiser LexPopIn "of" Expression ")" Statement { $$ = CYNew CYForOf($4, $7, $9); }
1129 ForInStatementInitialiser
1130 : LeftHandSideExpression { $$ = $1; }
1131 | LexSetRegExp "var" VariableDeclaration { $$ = $3; }
1135 /* 12.7 The continue Statement {{{ */
1137 : "continue" IdentifierOpt Terminator { $$ = CYNew CYContinue($2); }
1140 /* 12.8 The break Statement {{{ */
1142 : "break" IdentifierOpt Terminator { $$ = CYNew CYBreak($2); }
1145 /* 12.9 The return Statement {{{ */
1147 : "return" ExpressionOpt Terminator { $$ = CYNew CYReturn($2); }
1150 /* 12.10 The with Statement {{{ */
1152 : "with" "(" Expression ")" Statement { $$ = CYNew CYWith($3, $5); }
1156 /* 12.11 The switch Statement {{{ */
1158 : "switch" "(" Expression ")" CaseBlock { $$ = CYNew CYSwitch($3, $5); }
1162 : BRACE CaseClausesOpt "}" { $$ = $2; }
1166 : "case" Expression ":" StatementListOpt { $$ = CYNew CYClause($2, $4); }
1170 : CaseClause CaseClausesOpt { $1->SetNext($2); $$ = $1; }
1171 | DefaultClause CaseClausesOpt { $1->SetNext($2); $$ = $1; }
1176 : "default" ":" StatementListOpt { $$ = CYNew CYClause(NULL, $3); }
1179 /* 12.12 Labelled Statements {{{ */
1181 : Identifier ":" Statement { $$ = CYNew CYLabel($1, $3); }
1184 /* 12.13 The throw Statement {{{ */
1186 : "throw" Expression Terminator { $$ = CYNew cy::Syntax::Throw($2); }
1189 /* 12.14 The try Statement {{{ */
1191 : "try" Block_ CatchOpt FinallyOpt { $$ = CYNew cy::Syntax::Try($2, $3, $4); }
1195 : "catch" "(" Identifier ")" Block_ { $$ = CYNew cy::Syntax::Catch($3, $5); }
1200 : "finally" Block_ { $$ = CYNew CYFinally($2); }
1204 /* 12.14 The debugger Statement {{{ */
1206 : "debugger" Terminator { $$ = CYNew CYDebugger(); }
1210 /* 13.1 Function Definitions {{{ */
1212 : ";function" Identifier "(" FormalParameterListOpt ")" BRACE FunctionBody "}" { $$ = CYNew CYFunctionStatement($2, $4, $7); }
1216 : "function" IdentifierOpt "(" LexPushInOff FormalParameterListOpt LexPopIn ")" BRACE LexPushInOff FunctionBody LexPopIn "}" { $$ = CYNew CYFunctionExpression($2, $5, $10); }
1219 FormalParameterList_
1220 : "," FormalParameterList { $$ = $2; }
1225 // XXX: : FunctionRestParameter { $$ = $1; }
1226 : FormalParameter FormalParameterList_ { $$ = CYNew CYFunctionParameter($1, $2); }
1229 FormalParameterListOpt
1230 : FormalParameterList
1234 /* XXX: FunctionRestParameter
1235 : "..." BindingIdentifier { $$ = CYNew CYFunctionRestParameter($2); }
1239 : BindingElement { $$ = $1; }
1243 : StatementListOpt { $$ = $1; }
1246 /* 13.2 Arrow Function Definitions {{{ */
1248 : LexSetRegExp ArrowParameters "=>" LexNoBrace ConciseBody { $$ = CYNew CYFunctionExpression(NULL, $2, $5); }
1252 : BindingIdentifier { $$ = CYNew CYFunctionParameter(CYNew CYDeclaration($1)); }
1253 //| ParentheticalOpt { $$ = $1; }
1257 : AssignmentExpression { $$ = CYNew CYReturn($1); }
1258 | ";{" LexPushInOff FunctionBody LexPopIn "}" { $$ = $3; }
1261 /* 14 Program {{{ */
1263 : ProgramBodyOpt { driver.program_ = CYNew CYProgram($1); }
1267 : StatementList { $$ = $1; }
1271 : ProgramBody { $$ = $1; }
1277 /* Cycript (Objective-C): @class Declaration {{{ */
1279 /* XXX: why the hell did I choose MemberExpression? */
1280 : ":" LexSetRegExp MemberExpression { $$ = $3; }
1285 : Expression Identifier ";"
1289 : BRACE ClassFieldListOpt "}" { $$ = NULL; }
1293 : ClassFieldListOpt ClassField
1298 : "+" { $$ = false; }
1299 | "-" { $$ = true; }
1303 : "(" Expression ")" { $$ = $2; }
1304 | "(" LexSetRegExp "void" ")" { $$ = NULL; }
1309 : Word ":" TypeOpt Identifier { $$ = CYNew CYMessageParameter($1, $3, $4); }
1312 MessageParameterList
1313 : MessageParameter MessageParameterListOpt { $1->SetNext($2); $$ = $1; }
1316 MessageParameterListOpt
1317 : MessageParameterList { $$ = $1; }
1322 : MessageParameterList { $$ = $1; }
1323 | Word { $$ = CYNew CYMessageParameter($1, NULL, NULL); }
1326 ClassMessageDeclaration
1327 : MessageScope TypeOpt MessageParameters BRACE FunctionBody "}" { $$ = CYNew CYMessage($1, $2, $3, $5); }
1330 ClassMessageDeclarationListOpt
1331 : ClassMessageDeclarationListOpt ClassMessageDeclaration { $2->SetNext($1); $$ = $2; }
1332 | ClassMessageDeclarationListOpt Comment { $$ = $1; }
1337 : Identifier { $$ = $1; }
1338 | "(" AssignmentExpression ")" { $$ = $2; }
1342 : ClassName { $$ = $1; }
1346 // XXX: this should be AssignmentExpressionNoRight
1348 : ShiftExpression ClassProtocolsOpt { $$ = CYNew CYProtocol($1, $2); }
1352 : "," ClassProtocols { $$ = $2; }
1356 ClassProtocolListOpt
1357 : "<" ClassProtocols ">" { $$ = $2; }
1362 : "@implementation" LexPushInOff ClassNameOpt ClassSuperOpt ClassProtocolListOpt ClassFieldList ClassMessageDeclarationListOpt LexPopIn "@end" { $$ = CYNew CYClassExpression($3, $4, $5, $6, $7); }
1366 : ";@implementation" ClassName ClassSuperOpt ClassProtocolListOpt ClassFieldList ClassMessageDeclarationListOpt "@end" { $$ = CYNew CYClassStatement($2, $3, $4, $5, $6); }
1374 : ";@implementation" ClassName CategoryName ClassMessageDeclarationListOpt "@end" { $$ = CYNew CYCategory($2, $4); }
1378 : ClassExpression { $$ = $1; }
1382 : ClassStatement { $$ = $1; }
1383 | CategoryStatement { $$ = $1; }
1386 /* Cycript (Objective-C): Send Message {{{ */
1388 : "," AssignmentExpression VariadicCall { $$ = CYNew CYArgument(NULL, $2, $3); }
1393 : WordOpt { driver.contexts_.back().words_.push_back($1); } { $$ = $1; }
1394 | AutoComplete { driver.mode_ = CYDriver::AutoMessage; YYACCEPT; }
1398 : SelectorCall { $$ = $1; }
1399 | VariadicCall { $$ = $1; }
1403 : SelectorWordOpt ":" AssignmentExpression SelectorCall_ { $$ = CYNew CYArgument($1 ?: CYNew CYBlank(), $3, $4); }
1407 : SelectorCall { $$ = $1; }
1408 | Word { $$ = CYNew CYArgument($1, NULL); }
1412 : "[" LexPushInOff AssignmentExpression { driver.contexts_.push_back($3); } SelectorList LexPopIn "]" { driver.contexts_.pop_back(); } { $$ = CYNew CYSendDirect($3, $5); }
1413 | "[" LexPushInOff LexSetRegExp "super" { driver.context_ = NULL; } SelectorList LexPopIn "]" { $$ = CYNew CYSendSuper($6); }
1417 : WordOpt ":" SelectorExpressionOpt { $$ = CYNew CYSelectorPart($1, true, $3); }
1421 : SelectorExpression_ { $$ = $1; }
1422 | Word { $$ = CYNew CYSelectorPart($1, false, NULL); }
1425 SelectorExpressionOpt
1426 : SelectorExpression_ { $$ = $1; }
1431 : MessageExpression { $$ = $1; }
1432 | "@selector" "(" LexPushInOff SelectorExpression LexPopIn ")" { $$ = CYNew CYSelector($4); }
1435 /* Cycript (Objective-C): @import Directive {{{ */
1449 : "@import" ImportPath { $$ = CYNew CYImport(); }
1455 /* Cycript (C): Pointer Indirection/Addressing {{{ */
1456 LeftHandSideExpression
1457 : LexSetRegExp "*" UnaryExpression { $$ = CYNew CYIndirect($3); }
1461 : "&" UnaryExpression { $$ = CYNew CYAddressOf($2); }
1465 : "->" "[" Expression "]" { $$ = CYNew CYIndirectMember(NULL, $3); }
1466 | "->" Identifier { $$ = CYNew CYIndirectMember(NULL, CYNew CYString($2)); }
1467 | "->" AutoComplete { driver.mode_ = CYDriver::AutoIndirect; YYACCEPT; }
1472 /* YUI: Documentation Comments {{{ */
1474 : Comment { $$ = $1; }
1479 /* Lexer State {{{ */
1481 : { driver.PushCondition(CYDriver::RegExpCondition); }
1485 : { driver.PushCondition(CYDriver::XMLContentCondition); }
1489 : { driver.PushCondition(CYDriver::XMLTagCondition); }
1493 : { driver.PopCondition(); }
1497 : { driver.SetCondition(CYDriver::XMLContentCondition); }
1501 : { driver.SetCondition(CYDriver::XMLTagCondition); }
1510 /* 8.1 Context Keywords {{{ */
1512 : "namespace" { $$ = $1; }
1513 | "xml" { $$ = $1; }
1516 /* 8.3 XML Initialiser Input Elements {{{ */
1518 : XMLComment { $$ = $1; }
1519 | XMLCDATA { $$ = $1; }
1520 | XMLPI { $$ = $1; }
1523 /* 11.1 Primary Expressions {{{ */
1525 : PropertyIdentifier { $$ = CYNew CYPropertyVariable($1); }
1526 | XMLInitialiser { $$ = $1; }
1527 | XMLListInitialiser { $$ = $1; }
1531 : AttributeIdentifier { $$ = $1; }
1532 | QualifiedIdentifier { $$ = $1; }
1533 | WildcardIdentifier { $$ = $1; }
1536 /* 11.1.1 Attribute Identifiers {{{ */
1538 : "@" QualifiedIdentifier_ { $$ = CYNew CYAttribute($2); }
1542 : PropertySelector { $$ = $1; }
1543 | "[" LexPushInOff Expression LexPopIn "]" { $$ = CYNew CYSelector($3); }
1547 : Identifier { $$ = CYNew CYSelector($1); }
1548 | WildcardIdentifier { $$ = $1; }
1551 /* 11.1.2 Qualified Identifiers {{{ */
1552 QualifiedIdentifier_
1553 : PropertySelector_ { $$ = CYNew CYQualified(NULL, $1); }
1554 | QualifiedIdentifier { $$ = $1; }
1558 : PropertySelector "::" PropertySelector_ { $$ = CYNew CYQualified($1, $3); }
1561 /* 11.1.3 Wildcard Identifiers {{{ */
1563 : "*" { $$ = CYNew CYWildcard(); }
1566 /* 11.1.4 XML Initialiser {{{ */
1568 : XMLMarkup { $$ = $1; }
1569 | XMLElement { $$ = $1; }
1573 : "<" LexPushInOff XMLTagContent LexPop LexPopIn "/>"
1574 | "<" LexPushInOff XMLTagContent ">" LexSetXMLContent XMLElementContentOpt "</" LexSetXMLTag XMLTagName XMLWhitespaceOpt LexPop LexPopIn ">"
1578 : LexPushXMLTag XMLTagName XMLAttributes
1582 : BRACE LexPushRegExp Expression LexPop "}"
1591 : XMLAttributes_ XMLAttribute
1596 : XMLAttributes_ XMLWhitespace XMLExpression XMLWhitespaceOpt
1597 | XMLAttributes_ XMLWhitespaceOpt
1606 : XMLWhitespace XMLName XMLWhitespaceOpt "=" XMLWhitespaceOpt XMLAttributeValue_
1610 : XMLExpression XMLElementContentOpt
1611 | XMLMarkup XMLElementContentOpt
1612 | XMLText XMLElementContentOpt
1613 | XMLElement XMLElementContentOpt
1616 XMLElementContentOpt
1621 /* 11.1.5 XMLList Initialiser {{{ */
1623 : "<>" LexPushInOff LexPushXMLContent XMLElementContent LexPop LexPopIn "</>" { $$ = CYNew CYXMLList($4); }
1626 /* 11.2 Left-Hand-Side Expressions {{{ */
1628 : Identifier { $$ = $1; }
1629 | PropertyIdentifier { $$ = $1; }
1633 : "." PropertyIdentifier { $$ = CYNew CYPropertyMember(NULL, $2); }
1634 | ".." PropertyIdentifier_ { $$ = CYNew CYDescendantMember(NULL, $2); }
1635 | "." "(" Expression ")" { $$ = CYNew CYFilteringPredicate(NULL, $3); }
1638 /* 12.1 The default xml namespace Statement {{{ */
1639 /* XXX: DefaultXMLNamespaceStatement
1640 : "default" "xml" "namespace" "=" Expression Terminator { $$ = CYNew CYDefaultXMLNamespace($5); }
1644 : DefaultXMLNamespaceStatement { $$ = $1; }
1649 /* ECMAScript5: Object Literal Trailing Comma {{{ */
1650 PropertyNameAndValueList_
1651 : "," { $$ = NULL; }
1655 /* JavaScript 1.7: Array Comprehensions {{{ */
1657 : "if" "(" Expression ")" { $$ = CYNew CYIfComprehension($3); }
1661 : "for" "(" LexPushInOn Identifier LexPopIn "!in" Expression ")" { $$ = CYNew CYForInComprehension($4, $7); }
1662 | "for" "each" "(" LexPushInOn Identifier LexPopIn "!in" Expression ")" { $$ = CYNew CYForOfComprehension($5, $8); }
1666 : ForComprehension ComprehensionListOpt { $1->SetNext($2); $$ = $1; }
1669 ComprehensionListOpt
1670 : ComprehensionList { $$ = $1; }
1671 | IfComprehension { $$ = $1; }
1676 : "[" LexPushInOff AssignmentExpression ComprehensionList LexPopIn "]" { $$ = CYNew CYArrayComprehension($3, $4); }
1679 /* JavaScript 1.7: for each {{{ */
1681 : "for" "each" "(" LexPushInOn ForInStatementInitialiser LexPopIn "!in" Expression ")" Statement { $$ = CYNew CYForOf($5, $8, $10); }
1684 /* JavaScript 1.7: let Statements {{{ */
1686 : "let" "(" VariableDeclarationList ")" Statement { $$ = CYNew CYLetStatement($3, $5); }
1694 /* JavaScript FTW: Ruby Blocks {{{ */
1695 RubyProcParameterList_
1696 : "," RubyProcParameterList { $$ = $2; }
1700 RubyProcParameterList
1701 : Identifier RubyProcParameterList_ { $$ = CYNew CYFunctionParameter(CYNew CYDeclaration($1), $2); }
1706 : "|" RubyProcParameterList "|" { $$ = $2; }
1707 | "||" { $$ = NULL; }
1710 RubyProcParametersOpt
1711 : RubyProcParameters
1716 : "{" RubyProcParametersOpt StatementListOpt "}" { $$ = CYNew CYRubyProc($2, $3); }
1720 : "{" LexPushInOff RubyProcParameters StatementListOpt LexPopIn "}" { $$ = CYNew CYRubyProc($3, $4); }
1724 : CallExpression_ RubyProcExpression { $$ = CYNew CYRubyBlock($1, $2); }