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 <word_> IdentifierName
386 %type <comprehension_> IfComprehension
387 %type <statement_> IfStatement
388 %type <expression_> Initialiser
389 %type <expression_> InitialiserOpt
390 %type <statement_> IterationStatement
391 %type <statement_> LabelledStatement
392 %type <expression_> LeftHandSideExpression
393 %type <statement_> LetStatement
394 %type <statement_> LexicalDeclaration
395 %type <literal_> Literal
396 %type <literal_> LiteralNoRE
397 %type <expression_> LogicalANDExpression
398 %type <expression_> LogicalORExpression
399 %type <member_> MemberAccess
400 %type <expression_> MemberExpression_
401 %type <expression_> MemberExpression
402 %type <expression_> MultiplicativeExpression
403 %type <expression_> NewExpression
404 %type <null_> NullLiteral
405 %type <literal_> ObjectLiteral
406 %type <compound_> Parenthetical
407 %type <compound_> ParentheticalOpt
408 %type <expression_> PostfixExpression
409 %type <expression_> PrimaryExpression
410 %type <statement_> Program
411 %type <statement_> ProgramBody
412 %type <statement_> ProgramBodyOpt
413 %type <propertyName_> PropertyName_
414 %type <propertyName_> PropertyName
415 %type <property_> PropertyNameAndValueList_
416 %type <property_> PropertyNameAndValueList
417 %type <property_> PropertyNameAndValueListOpt
418 %type <expression_> RelationalExpression
419 %type <statement_> ReturnStatement
420 %type <rubyProc_> RubyProcExpression
421 %type <functionParameter_> RubyProcParameterList_
422 %type <functionParameter_> RubyProcParameterList
423 %type <functionParameter_> RubyProcParameters
424 %type <functionParameter_> RubyProcParametersOpt
425 %type <expression_> ShiftExpression
426 %type <declaration_> SingleNameBinding
427 %type <statement_> Statement__
428 %type <statement_> Statement_
429 %type <statement_> Statement
430 %type <statement_> StatementList
431 %type <statement_> StatementListOpt
432 %type <statement_> StatementListItem
433 %type <statement_> SwitchStatement
434 %type <statement_> ThrowStatement
435 %type <statement_> TryStatement
436 %type <expression_> UnaryExpression_
437 %type <expression_> UnaryExpression
438 %type <declaration_> VariableDeclaration
439 %type <declarations_> VariableDeclarationList_
440 %type <declarations_> VariableDeclarationList
441 %type <statement_> VariableStatement
442 %type <statement_> WithStatement
444 %type <word_> WordOpt
447 %type <statement_> CategoryStatement
448 %type <expression_> ClassExpression
449 %type <statement_> ClassStatement
450 %type <expression_> ClassSuperOpt
451 %type <field_> ClassFieldList
452 %type <message_> ClassMessageDeclaration
453 %type <message_> ClassMessageDeclarationListOpt
454 %type <className_> ClassName
455 %type <className_> ClassNameOpt
456 %type <protocol_> ClassProtocolListOpt
457 %type <protocol_> ClassProtocols
458 %type <protocol_> ClassProtocolsOpt
459 %type <expression_> MessageExpression
460 %type <messageParameter_> MessageParameter
461 %type <messageParameter_> MessageParameters
462 %type <messageParameter_> MessageParameterList
463 %type <messageParameter_> MessageParameterListOpt
464 %type <bool_> MessageScope
465 %type <argument_> SelectorCall_
466 %type <argument_> SelectorCall
467 %type <selector_> SelectorExpression_
468 %type <selector_> SelectorExpression
469 %type <selector_> SelectorExpressionOpt
470 %type <argument_> SelectorList
471 %type <word_> SelectorWordOpt
472 %type <expression_> TypeOpt
473 %type <argument_> VariadicCall
477 %type <propertyIdentifier_> PropertyIdentifier_
478 %type <selector_> PropertySelector_
479 %type <selector_> PropertySelector
480 %type <identifier_> QualifiedIdentifier_
481 %type <identifier_> QualifiedIdentifier
482 %type <identifier_> WildcardIdentifier
483 %type <identifier_> XMLComment
484 %type <identifier_> XMLCDATA
485 %type <identifier_> XMLElement
486 %type <identifier_> XMLElementContent
487 %type <identifier_> XMLMarkup
488 %type <identifier_> XMLPI
490 %type <attribute_> AttributeIdentifier
491 /* XXX: %type <statement_> DefaultXMLNamespaceStatement */
492 %type <expression_> PropertyIdentifier
493 %type <expression_> XMLListInitialiser
494 %type <expression_> XMLInitialiser
507 /* Lexer State {{{ */
509 : { driver.in_.push(true); }
513 : { driver.in_.push(false); }
517 : { driver.in_.pop(); }
521 : { driver.SetCondition(CYDriver::RegExpCondition); }
525 : { if (yychar == yyempty_) driver.nobrace_ = true; else if (yychar == token::OpenBrace || yychar == token::OpenBrace_) yychar = token::OpenBrace__; }
529 : { if (yychar == token::Function) yychar = token::Function_; }
533 : LexNoBrace LexNoFunction
543 : { driver.Warning(yylloc, "warning, automatic semi-colon insertion required"); }
553 | error { if (yychar != yyeof_ && yychar != token::CloseBrace && !yylval.newline_) YYABORT; else { yyerrok; driver.errors_.pop_back(); } } StrictSemi
558 | error { yyerrok; driver.errors_.pop_back(); } StrictSemi
576 : Identifier { $$ = $1; }
577 | "break" NewLineOpt { $$ = $1; }
578 | "case" { $$ = $1; }
579 | "catch" { $$ = $1; }
580 | "class" { $$ = $1; }
581 | "const" { $$ = $1; }
582 | "continue" NewLineOpt { $$ = $1; }
583 | "debugger" { $$ = $1; }
584 | "default" { $$ = $1; }
585 | "delete" { $$ = $1; }
587 | "else" { $$ = $1; }
588 | "enum" { $$ = $1; }
589 | "export" { $$ = $1; }
590 | "extends" { $$ = $1; }
591 | "false" { $$ = $1; }
592 | "finally" { $$ = $1; }
593 /* XXX: | "for" { $$ = $1; } */
594 | "function" { $$ = $1; }
596 | "import" { $$ = $1; }
597 /* XXX: | "in" { $$ = $1; } */
599 /* XXX: | "instanceof" { $$ = $1; } */
601 // XXX: as it currently is not an Identifier
605 | "null" { $$ = $1; }
606 | "return" NewLineOpt { $$ = $1; }
607 | "super" { $$ = $1; }
608 | "switch" { $$ = $1; }
609 | "this" { $$ = $1; }
610 | "throw" NewLineOpt { $$ = $1; }
611 | "true" { $$ = $1; }
613 | "typeof" { $$ = $1; }
615 | "void" { $$ = $1; }
616 | "while" { $$ = $1; }
617 | "with" { $$ = $1; }
627 : "@" LiteralNoRE { $$ = CYNew CYBox($2); }
628 | "@" ArrayLiteral { $$ = CYNew CYBox($2); }
629 | "@" ObjectLiteral { $$ = CYNew CYBox($2); }
630 | "@" Parenthetical { $$ = CYNew CYBox($2); }
635 : Identifier_ { $$ = $1; }
637 | "implements" { $$ = $1; }
638 | "interface" { $$ = $1; }
639 | "package" { $$ = $1; }
640 | "private" { $$ = $1; }
641 | "protected" { $$ = $1; }
642 | "public" { $$ = $1; }
643 | "static" { $$ = $1; }
645 | "abstract" { $$ = $1; }
646 | "boolean" { $$ = $1; }
647 | "byte" { $$ = $1; }
648 | "char" { $$ = $1; }
649 | "double" { $$ = $1; }
650 | "final" { $$ = $1; }
651 | "float" { $$ = $1; }
652 | "goto" { $$ = $1; }
654 | "long" { $$ = $1; }
655 | "native" { $$ = $1; }
656 | "short" { $$ = $1; }
657 | "synchronized" { $$ = $1; }
658 | "throws" { $$ = $1; }
659 | "transient" { $$ = $1; }
660 | "volatile" { $$ = $1; }
662 // XXX: currently I only have this as Word
663 // | "let" { $$ = $1; }
665 | "yield" { $$ = $1; }
667 | "each" { $$ = $1; }
672 : Identifier { $$ = $1; }
677 : NullLiteral { $$ = $1; }
678 | BooleanLiteral { $$ = $1; }
679 | NumericLiteral { $$ = $1; }
680 | StringLiteral { $$ = $1; }
684 : LiteralNoRE { $$ = $1; }
685 | RegularExpressionLiteral { $$ = $1; }
689 : "null" { $$ = $1; }
693 : "true" { $$ = $1; }
694 | "false" { $$ = $1; }
697 /* 11.1 Primary Expressions {{{ */
699 : "(" LexPushInOff Expression LexPopIn ")" { $$ = $3; }
703 : Parenthetical { $$ = $1; }
708 : "this" { $$ = $1; }
709 | Identifier { $$ = CYNew CYVariable($1); }
710 | Literal { $$ = $1; }
711 | ArrayLiteral { $$ = $1; }
712 | ObjectLiteral { $$ = $1; }
713 | FunctionExpression { $$ = $1; }
714 | Parenthetical { $$ = $1; }
715 | AutoComplete { driver.mode_ = CYDriver::AutoPrimary; YYACCEPT; }
718 /* 11.1.4.1 Array Initialiser {{{ */
720 : "[" LexPushInOff ElementListOpt LexPopIn "]" { $$ = CYNew CYArray($3); }
724 : AssignmentExpression { $$ = $1; }
728 : Element { $$ = $1; }
729 | LexSetRegExp { $$ = NULL; }
733 : ElementOpt "," ElementListOpt { $$ = CYNew CYElement($1, $3); }
734 | Element { $$ = CYNew CYElement($1, NULL); }
738 : ElementList { $$ = $1; }
739 | LexSetRegExp { $$ = NULL; }
742 /* 11.1.5 Object Initialiser {{{ */
744 : BRACE LexPushInOff PropertyNameAndValueListOpt LexPopIn "}" { $$ = CYNew CYObject($3); }
747 PropertyNameAndValueList_
748 : "," PropertyNameAndValueList { $$ = $2; }
752 PropertyNameAndValueList
753 : PropertyName ":" AssignmentExpression PropertyNameAndValueList_ { $$ = CYNew CYProperty($1, $3, $4); }
756 PropertyNameAndValueListOpt
757 : PropertyNameAndValueList { $$ = $1; }
762 : IdentifierName { $$ = $1; }
763 | StringLiteral { $$ = $1; }
764 | NumericLiteral { $$ = $1; }
768 : LexSetRegExp PropertyName_ { $$ = $2; }
772 /* 11.2 Left-Hand-Side Expressions {{{ */
774 : "[" LexPushInOff Expression LexPopIn "]" { $$ = CYNew CYDirectMember(NULL, $3); }
775 | "." Identifier { $$ = CYNew CYDirectMember(NULL, CYNew CYString($2)); }
776 | "." AutoComplete { driver.mode_ = CYDriver::AutoDirect; YYACCEPT; }
780 : MemberExpression { $$ = $1; }
781 //| "super" { $$ = $1; }
785 : LexSetRegExp PrimaryExpression { $$ = $2; }
786 | MemberExpression_ { driver.context_ = $1; } MemberAccess { $3->SetLeft($1); $$ = $3; }
787 | LexSetRegExp "new" MemberExpression Arguments { $$ = CYNew cy::Syntax::New($3, $4); }
791 : MemberExpression { $$ = $1; }
792 | LexSetRegExp "new" NewExpression { $$ = CYNew cy::Syntax::New($3, NULL); }
801 : CallExpression_ Arguments { $$ = CYNew CYCall($1, $2); }
802 | CallExpression { driver.context_ = $1; } MemberAccess { $3->SetLeft($1); $$ = $3; }
806 : "(" LexPushInOff ArgumentListOpt LexPopIn ")" { $$ = $3; }
810 : "," ArgumentList { $$ = $2; }
815 : AssignmentExpression ArgumentList_ { $$ = CYNew CYArgument(NULL, $1, $2); }
819 : ArgumentList { $$ = $1; }
820 | LexSetRegExp { $$ = NULL; }
823 LeftHandSideExpression
824 : NewExpression { $$ = $1; }
825 | CallExpression { $$ = $1; }
828 /* 11.3 Postfix Expressions {{{ */
830 : %prec "" LeftHandSideExpression { $$ = $1; }
831 | LeftHandSideExpression "++" { $$ = CYNew CYPostIncrement($1); }
832 | LeftHandSideExpression "--" { $$ = CYNew CYPostDecrement($1); }
835 /* 11.4 Unary Operators {{{ */
837 : "delete" UnaryExpression { $$ = CYNew CYDelete($2); }
838 | "void" UnaryExpression { $$ = CYNew CYVoid($2); }
839 | "typeof" UnaryExpression { $$ = CYNew CYTypeOf($2); }
840 | "++" UnaryExpression { $$ = CYNew CYPreIncrement($2); }
841 | "\n++" UnaryExpression { $$ = CYNew CYPreIncrement($2); }
842 | "--" UnaryExpression { $$ = CYNew CYPreDecrement($2); }
843 | "\n--" UnaryExpression { $$ = CYNew CYPreDecrement($2); }
844 | "+" UnaryExpression { $$ = CYNew CYAffirm($2); }
845 | "-" UnaryExpression { $$ = CYNew CYNegate($2); }
846 | "~" UnaryExpression { $$ = CYNew CYBitwiseNot($2); }
847 | "!" UnaryExpression { $$ = CYNew CYLogicalNot($2); }
851 : PostfixExpression { $$ = $1; }
852 | LexSetRegExp UnaryExpression_ { $$ = $2; }
855 /* 11.5 Multiplicative Operators {{{ */
856 MultiplicativeExpression
857 : UnaryExpression { $$ = $1; }
858 | MultiplicativeExpression "*" UnaryExpression { $$ = CYNew CYMultiply($1, $3); }
859 | MultiplicativeExpression "/" UnaryExpression { $$ = CYNew CYDivide($1, $3); }
860 | MultiplicativeExpression "%" UnaryExpression { $$ = CYNew CYModulus($1, $3); }
863 /* 11.6 Additive Operators {{{ */
865 : MultiplicativeExpression { $$ = $1; }
866 | AdditiveExpression "+" MultiplicativeExpression { $$ = CYNew CYAdd($1, $3); }
867 | AdditiveExpression "-" MultiplicativeExpression { $$ = CYNew CYSubtract($1, $3); }
870 /* 11.7 Bitwise Shift Operators {{{ */
872 : AdditiveExpression { $$ = $1; }
873 | ShiftExpression "<<" AdditiveExpression { $$ = CYNew CYShiftLeft($1, $3); }
874 | ShiftExpression ">>" AdditiveExpression { $$ = CYNew CYShiftRightSigned($1, $3); }
875 | ShiftExpression ">>>" AdditiveExpression { $$ = CYNew CYShiftRightUnsigned($1, $3); }
878 /* 11.8 Relational Operators {{{ */
880 : ShiftExpression { $$ = $1; }
881 | RelationalExpression "<" ShiftExpression { $$ = CYNew CYLess($1, $3); }
882 | RelationalExpression ">" ShiftExpression { $$ = CYNew CYGreater($1, $3); }
883 | RelationalExpression "<=" ShiftExpression { $$ = CYNew CYLessOrEqual($1, $3); }
884 | RelationalExpression ">=" ShiftExpression { $$ = CYNew CYGreaterOrEqual($1, $3); }
885 | RelationalExpression "instanceof" ShiftExpression { $$ = CYNew CYInstanceOf($1, $3); }
886 | RelationalExpression "in" ShiftExpression { $$ = CYNew CYIn($1, $3); }
889 /* 11.9 Equality Operators {{{ */
891 : RelationalExpression { $$ = $1; }
892 | EqualityExpression "==" RelationalExpression { $$ = CYNew CYEqual($1, $3); }
893 | EqualityExpression "!=" RelationalExpression { $$ = CYNew CYNotEqual($1, $3); }
894 | EqualityExpression "===" RelationalExpression { $$ = CYNew CYIdentical($1, $3); }
895 | EqualityExpression "!==" RelationalExpression { $$ = CYNew CYNotIdentical($1, $3); }
898 /* 11.10 Binary Bitwise Operators {{{ */
900 : EqualityExpression { $$ = $1; }
901 | BitwiseANDExpression "&" EqualityExpression { $$ = CYNew CYBitwiseAnd($1, $3); }
905 : BitwiseANDExpression { $$ = $1; }
906 | BitwiseXORExpression "^" BitwiseANDExpression { $$ = CYNew CYBitwiseXOr($1, $3); }
910 : BitwiseXORExpression { $$ = $1; }
911 | BitwiseORExpression "|" BitwiseXORExpression { $$ = CYNew CYBitwiseOr($1, $3); }
914 /* 11.11 Binary Logical Operators {{{ */
916 : BitwiseORExpression { $$ = $1; }
917 | LogicalANDExpression "&&" BitwiseORExpression { $$ = CYNew CYLogicalAnd($1, $3); }
921 : LogicalANDExpression { $$ = $1; }
922 | LogicalORExpression "||" LogicalANDExpression { $$ = CYNew CYLogicalOr($1, $3); }
925 /* 11.12 Conditional Operator ( ? : ) {{{ */
926 ConditionalExpression
927 : LogicalORExpression { $$ = $1; }
928 | LogicalORExpression "?" LexPushInOff AssignmentExpression LexPopIn ":" AssignmentExpression { $$ = CYNew CYCondition($1, $4, $7); }
931 /* 11.13 Assignment Operators {{{ */
933 : ConditionalExpression { $$ = $1; }
934 | ArrowFunction { $$ = $1; }
935 | LeftHandSideExpression "=" AssignmentExpression { $$ = CYNew CYAssign($1, $3); }
936 | LeftHandSideExpression "*=" AssignmentExpression { $$ = CYNew CYMultiplyAssign($1, $3); }
937 | LeftHandSideExpression "/=" AssignmentExpression { $$ = CYNew CYDivideAssign($1, $3); }
938 | LeftHandSideExpression "%=" AssignmentExpression { $$ = CYNew CYModulusAssign($1, $3); }
939 | LeftHandSideExpression "+=" AssignmentExpression { $$ = CYNew CYAddAssign($1, $3); }
940 | LeftHandSideExpression "-=" AssignmentExpression { $$ = CYNew CYSubtractAssign($1, $3); }
941 | LeftHandSideExpression "<<=" AssignmentExpression { $$ = CYNew CYShiftLeftAssign($1, $3); }
942 | LeftHandSideExpression ">>=" AssignmentExpression { $$ = CYNew CYShiftRightSignedAssign($1, $3); }
943 | LeftHandSideExpression ">>>=" AssignmentExpression { $$ = CYNew CYShiftRightUnsignedAssign($1, $3); }
944 | LeftHandSideExpression "&=" AssignmentExpression { $$ = CYNew CYBitwiseAndAssign($1, $3); }
945 | LeftHandSideExpression "^=" AssignmentExpression { $$ = CYNew CYBitwiseXOrAssign($1, $3); }
946 | LeftHandSideExpression "|=" AssignmentExpression { $$ = CYNew CYBitwiseOrAssign($1, $3); }
949 /* 11.14 Comma Operator {{{ */
951 : "," Expression { $$ = $2; }
952 | { $$ = CYNew CYCompound(); }
956 : AssignmentExpression Expression_ { $2->AddPrev($1); $$ = $2; }
960 : Expression { $$ = $1; }
961 | LexSetRegExp { $$ = NULL; }
965 /* 12 Statements {{{ */
968 | VariableStatement { $$ = $1; }
969 | EmptyStatement { $$ = $1; }
970 | IfStatement { $$ = $1; }
971 | BreakableStatement { $$ = $1; }
972 | ContinueStatement { $$ = $1; }
973 | BreakStatement { $$ = $1; }
974 | ReturnStatement { $$ = $1; }
975 | WithStatement { $$ = $1; }
976 | LabelledStatement { $$ = $1; }
977 | ThrowStatement { $$ = $1; }
978 | TryStatement { $$ = $1; }
979 | DebuggerStatement { $$ = $1; }
983 : LexSetRegExp Statement__ { $$ = $2; }
984 | ExpressionStatement { $$ = $1; }
988 : LexSetStatement Statement_ { $$ = $2; }
992 : FunctionDeclaration { $$ = $1; }
993 | LexicalDeclaration { $$ = $1; }
997 : LexSetRegExp Declaration__ { $$ = $2; }
1001 : LexSetStatement Declaration_ { $$ = $2; }
1005 : IterationStatement { $$ = $1; }
1006 | SwitchStatement { $$ = $1; }
1009 /* 12.1 Block {{{ */
1011 : BRACE StatementListOpt "}" { $$ = $2; }
1015 : ";{" StatementListOpt "}" { $$ = CYNew CYBlock($2); }
1019 : StatementListItem StatementListOpt { $1->SetNext($2); $$ = $1; }
1023 : StatementList { $$ = $1; }
1024 | LexSetRegExp { $$ = NULL; }
1028 : Statement { $$ = $1; }
1029 | Declaration { $$ = $1; }
1032 /* 12.2 Declarations {{{ */
1034 : Identifier { $$ = $1; }
1037 // XXX: BindingPattern
1039 /* 12.2.1 Let and Const Declarations {{{ */
1041 : LetOrConst VariableDeclarationList Terminator { $$ = CYNew CYVar($2); }
1049 /* 12.2.2 Variable Statement {{{ */
1051 : "var" VariableDeclarationList Terminator { $$ = CYNew CYVar($2); }
1054 VariableDeclarationList_
1055 : "," VariableDeclarationList { $$ = $2; }
1059 VariableDeclarationList
1060 : VariableDeclaration VariableDeclarationList_ { $$ = CYNew CYDeclarations($1, $2); }
1064 : BindingIdentifier InitialiserOpt { $$ = CYNew CYDeclaration($1, $2); }
1065 // XXX: | BindingPattern Initialiser { $$ = CYNew CYDeclaration($1, $2); }
1069 : "=" AssignmentExpression { $$ = $2; }
1073 : Initialiser { $$ = $1; }
1077 /* 12.2.4 Destructuring Binding Patterns {{{ */
1081 : SingleNameBinding { $$ = $1; }
1085 : BindingIdentifier InitialiserOpt { $$ = CYNew CYDeclaration($1, $2); }
1088 /* 12.3 Empty Statement {{{ */
1090 : ";" { $$ = CYNew CYEmpty(); }
1093 /* 12.4 Expression Statement {{{ */
1095 : Expression Terminator { $$ = CYNew CYExpress($1); }
1098 /* 12.5 The if Statement {{{ */
1100 : "else" Statement { $$ = $2; }
1101 | %prec "if" { $$ = NULL; }
1105 : "if" "(" Expression ")" Statement ElseStatementOpt { $$ = CYNew CYIf($3, $5, $6); }
1109 /* 12.6.1 The do-while Statement {{{ */
1111 : "do" Statement "while" "(" Expression ")" TerminatorOpt { $$ = CYNew CYDoWhile($5, $2); }
1114 /* 12.6.2 The while Statement {{{ */
1116 : "while" "(" Expression ")" Statement { $$ = CYNew CYWhile($3, $5); }
1119 /* 12.6.3 The for Statement {{{ */
1121 : "for" "(" LexPushInOn ForStatementInitialiser LexPopIn ";" ExpressionOpt ";" ExpressionOpt ")" Statement { $$ = CYNew CYFor($4, $7, $9, $11); }
1124 ForStatementInitialiser
1125 : ExpressionOpt { $$ = $1; }
1126 | LexSetRegExp "var" VariableDeclarationList { $$ = CYNew CYForDeclarations($3); }
1129 /* 12.6.4 The for-in and for-of Statements {{{ */
1131 : "for" "(" LexPushInOn ForInStatementInitialiser LexPopIn "!in" Expression ")" Statement { $$ = CYNew CYForIn($4, $7, $9); }
1132 | "for" "(" LexPushInOn ForInStatementInitialiser LexPopIn "of" Expression ")" Statement { $$ = CYNew CYForOf($4, $7, $9); }
1135 ForInStatementInitialiser
1136 : LeftHandSideExpression { $$ = $1; }
1137 | LexSetRegExp "var" VariableDeclaration { $$ = $3; }
1141 /* 12.7 The continue Statement {{{ */
1143 : "continue" IdentifierOpt Terminator { $$ = CYNew CYContinue($2); }
1146 /* 12.8 The break Statement {{{ */
1148 : "break" IdentifierOpt Terminator { $$ = CYNew CYBreak($2); }
1151 /* 12.9 The return Statement {{{ */
1153 : "return" ExpressionOpt Terminator { $$ = CYNew CYReturn($2); }
1156 /* 12.10 The with Statement {{{ */
1158 : "with" "(" Expression ")" Statement { $$ = CYNew CYWith($3, $5); }
1162 /* 12.11 The switch Statement {{{ */
1164 : "switch" "(" Expression ")" CaseBlock { $$ = CYNew CYSwitch($3, $5); }
1168 : BRACE CaseClausesOpt "}" { $$ = $2; }
1172 : "case" Expression ":" StatementListOpt { $$ = CYNew CYClause($2, $4); }
1176 : CaseClause CaseClausesOpt { $1->SetNext($2); $$ = $1; }
1177 | DefaultClause CaseClausesOpt { $1->SetNext($2); $$ = $1; }
1182 : "default" ":" StatementListOpt { $$ = CYNew CYClause(NULL, $3); }
1185 /* 12.12 Labelled Statements {{{ */
1187 : Identifier ":" Statement { $$ = CYNew CYLabel($1, $3); }
1190 /* 12.13 The throw Statement {{{ */
1192 : "throw" Expression Terminator { $$ = CYNew cy::Syntax::Throw($2); }
1195 /* 12.14 The try Statement {{{ */
1197 : "try" Block_ CatchOpt FinallyOpt { $$ = CYNew cy::Syntax::Try($2, $3, $4); }
1201 : "catch" "(" Identifier ")" Block_ { $$ = CYNew cy::Syntax::Catch($3, $5); }
1206 : "finally" Block_ { $$ = CYNew CYFinally($2); }
1210 /* 12.14 The debugger Statement {{{ */
1212 : "debugger" Terminator { $$ = CYNew CYDebugger(); }
1216 /* 13.1 Function Definitions {{{ */
1218 : ";function" Identifier "(" FormalParameterListOpt ")" BRACE FunctionBody "}" { $$ = CYNew CYFunctionStatement($2, $4, $7); }
1222 : "function" IdentifierOpt "(" LexPushInOff FormalParameterListOpt LexPopIn ")" BRACE LexPushInOff FunctionBody LexPopIn "}" { $$ = CYNew CYFunctionExpression($2, $5, $10); }
1225 FormalParameterList_
1226 : "," FormalParameterList { $$ = $2; }
1231 // XXX: : FunctionRestParameter { $$ = $1; }
1232 : FormalParameter FormalParameterList_ { $$ = CYNew CYFunctionParameter($1, $2); }
1235 FormalParameterListOpt
1236 : FormalParameterList
1240 /* XXX: FunctionRestParameter
1241 : "..." BindingIdentifier { $$ = CYNew CYFunctionRestParameter($2); }
1245 : BindingElement { $$ = $1; }
1249 : StatementListOpt { $$ = $1; }
1252 /* 13.2 Arrow Function Definitions {{{ */
1254 : LexSetRegExp ArrowParameters "=>" LexNoBrace ConciseBody { $$ = CYNew CYFunctionExpression(NULL, $2, $5); }
1258 : BindingIdentifier { $$ = CYNew CYFunctionParameter(CYNew CYDeclaration($1)); }
1259 //| ParentheticalOpt { $$ = $1; }
1263 : AssignmentExpression { $$ = CYNew CYReturn($1); }
1264 | ";{" LexPushInOff FunctionBody LexPopIn "}" { $$ = $3; }
1267 /* 14 Program {{{ */
1269 : ProgramBodyOpt { driver.program_ = CYNew CYProgram($1); }
1273 : StatementList { $$ = $1; }
1277 : ProgramBody { $$ = $1; }
1283 /* Cycript (Objective-C): @class Declaration {{{ */
1285 /* XXX: why the hell did I choose MemberExpression? */
1286 : ":" LexSetRegExp MemberExpression { $$ = $3; }
1291 : Expression Identifier ";"
1295 : BRACE ClassFieldListOpt "}" { $$ = NULL; }
1299 : ClassFieldListOpt ClassField
1304 : "+" { $$ = false; }
1305 | "-" { $$ = true; }
1309 : "(" Expression ")" { $$ = $2; }
1310 | "(" LexSetRegExp "void" ")" { $$ = NULL; }
1315 : Word ":" TypeOpt Identifier { $$ = CYNew CYMessageParameter($1, $3, $4); }
1318 MessageParameterList
1319 : MessageParameter MessageParameterListOpt { $1->SetNext($2); $$ = $1; }
1322 MessageParameterListOpt
1323 : MessageParameterList { $$ = $1; }
1328 : MessageParameterList { $$ = $1; }
1329 | Word { $$ = CYNew CYMessageParameter($1, NULL, NULL); }
1332 ClassMessageDeclaration
1333 : MessageScope TypeOpt MessageParameters BRACE FunctionBody "}" { $$ = CYNew CYMessage($1, $2, $3, $5); }
1336 ClassMessageDeclarationListOpt
1337 : ClassMessageDeclarationListOpt ClassMessageDeclaration { $2->SetNext($1); $$ = $2; }
1338 | ClassMessageDeclarationListOpt Comment { $$ = $1; }
1343 : Identifier { $$ = $1; }
1344 | "(" AssignmentExpression ")" { $$ = $2; }
1348 : ClassName { $$ = $1; }
1352 // XXX: this should be AssignmentExpressionNoRight
1354 : ShiftExpression ClassProtocolsOpt { $$ = CYNew CYProtocol($1, $2); }
1358 : "," ClassProtocols { $$ = $2; }
1362 ClassProtocolListOpt
1363 : "<" ClassProtocols ">" { $$ = $2; }
1368 : "@implementation" LexPushInOff ClassNameOpt ClassSuperOpt ClassProtocolListOpt ClassFieldList ClassMessageDeclarationListOpt LexPopIn "@end" { $$ = CYNew CYClassExpression($3, $4, $5, $6, $7); }
1372 : ";@implementation" ClassName ClassSuperOpt ClassProtocolListOpt ClassFieldList ClassMessageDeclarationListOpt "@end" { $$ = CYNew CYClassStatement($2, $3, $4, $5, $6); }
1380 : ";@implementation" ClassName CategoryName ClassMessageDeclarationListOpt "@end" { $$ = CYNew CYCategory($2, $4); }
1384 : ClassExpression { $$ = $1; }
1388 : ClassStatement { $$ = $1; }
1389 | CategoryStatement { $$ = $1; }
1392 /* Cycript (Objective-C): Send Message {{{ */
1394 : "," AssignmentExpression VariadicCall { $$ = CYNew CYArgument(NULL, $2, $3); }
1399 : WordOpt { driver.contexts_.back().words_.push_back($1); } { $$ = $1; }
1400 | AutoComplete { driver.mode_ = CYDriver::AutoMessage; YYACCEPT; }
1404 : SelectorCall { $$ = $1; }
1405 | VariadicCall { $$ = $1; }
1409 : SelectorWordOpt ":" AssignmentExpression SelectorCall_ { $$ = CYNew CYArgument($1 ?: CYNew CYBlank(), $3, $4); }
1413 : SelectorCall { $$ = $1; }
1414 | Word { $$ = CYNew CYArgument($1, NULL); }
1418 : "[" LexPushInOff AssignmentExpression { driver.contexts_.push_back($3); } SelectorList LexPopIn "]" { driver.contexts_.pop_back(); } { $$ = CYNew CYSendDirect($3, $5); }
1419 | "[" LexPushInOff LexSetRegExp "super" { driver.context_ = NULL; } SelectorList LexPopIn "]" { $$ = CYNew CYSendSuper($6); }
1423 : WordOpt ":" SelectorExpressionOpt { $$ = CYNew CYSelectorPart($1, true, $3); }
1427 : SelectorExpression_ { $$ = $1; }
1428 | Word { $$ = CYNew CYSelectorPart($1, false, NULL); }
1431 SelectorExpressionOpt
1432 : SelectorExpression_ { $$ = $1; }
1437 : MessageExpression { $$ = $1; }
1438 | "@selector" "(" LexPushInOff SelectorExpression LexPopIn ")" { $$ = CYNew CYSelector($4); }
1441 /* Cycript (Objective-C): @import Directive {{{ */
1455 : "@import" ImportPath { $$ = CYNew CYImport(); }
1461 /* Cycript (C): Pointer Indirection/Addressing {{{ */
1462 LeftHandSideExpression
1463 : LexSetRegExp "*" UnaryExpression { $$ = CYNew CYIndirect($3); }
1467 : "&" UnaryExpression { $$ = CYNew CYAddressOf($2); }
1471 : "->" "[" Expression "]" { $$ = CYNew CYIndirectMember(NULL, $3); }
1472 | "->" Identifier { $$ = CYNew CYIndirectMember(NULL, CYNew CYString($2)); }
1473 | "->" AutoComplete { driver.mode_ = CYDriver::AutoIndirect; YYACCEPT; }
1478 /* YUI: Documentation Comments {{{ */
1480 : Comment { $$ = $1; }
1485 /* Lexer State {{{ */
1487 : { driver.PushCondition(CYDriver::RegExpCondition); }
1491 : { driver.PushCondition(CYDriver::XMLContentCondition); }
1495 : { driver.PushCondition(CYDriver::XMLTagCondition); }
1499 : { driver.PopCondition(); }
1503 : { driver.SetCondition(CYDriver::XMLContentCondition); }
1507 : { driver.SetCondition(CYDriver::XMLTagCondition); }
1516 /* 8.1 Context Keywords {{{ */
1518 : "namespace" { $$ = $1; }
1519 | "xml" { $$ = $1; }
1522 /* 8.3 XML Initialiser Input Elements {{{ */
1524 : XMLComment { $$ = $1; }
1525 | XMLCDATA { $$ = $1; }
1526 | XMLPI { $$ = $1; }
1529 /* 11.1 Primary Expressions {{{ */
1531 : PropertyIdentifier { $$ = CYNew CYPropertyVariable($1); }
1532 | XMLInitialiser { $$ = $1; }
1533 | XMLListInitialiser { $$ = $1; }
1537 : AttributeIdentifier { $$ = $1; }
1538 | QualifiedIdentifier { $$ = $1; }
1539 | WildcardIdentifier { $$ = $1; }
1542 /* 11.1.1 Attribute Identifiers {{{ */
1544 : "@" QualifiedIdentifier_ { $$ = CYNew CYAttribute($2); }
1548 : PropertySelector { $$ = $1; }
1549 | "[" LexPushInOff Expression LexPopIn "]" { $$ = CYNew CYSelector($3); }
1553 : Identifier { $$ = CYNew CYSelector($1); }
1554 | WildcardIdentifier { $$ = $1; }
1557 /* 11.1.2 Qualified Identifiers {{{ */
1558 QualifiedIdentifier_
1559 : PropertySelector_ { $$ = CYNew CYQualified(NULL, $1); }
1560 | QualifiedIdentifier { $$ = $1; }
1564 : PropertySelector "::" PropertySelector_ { $$ = CYNew CYQualified($1, $3); }
1567 /* 11.1.3 Wildcard Identifiers {{{ */
1569 : "*" { $$ = CYNew CYWildcard(); }
1572 /* 11.1.4 XML Initialiser {{{ */
1574 : XMLMarkup { $$ = $1; }
1575 | XMLElement { $$ = $1; }
1579 : "<" LexPushInOff XMLTagContent LexPop LexPopIn "/>"
1580 | "<" LexPushInOff XMLTagContent ">" LexSetXMLContent XMLElementContentOpt "</" LexSetXMLTag XMLTagName XMLWhitespaceOpt LexPop LexPopIn ">"
1584 : LexPushXMLTag XMLTagName XMLAttributes
1588 : BRACE LexPushRegExp Expression LexPop "}"
1597 : XMLAttributes_ XMLAttribute
1602 : XMLAttributes_ XMLWhitespace XMLExpression XMLWhitespaceOpt
1603 | XMLAttributes_ XMLWhitespaceOpt
1612 : XMLWhitespace XMLName XMLWhitespaceOpt "=" XMLWhitespaceOpt XMLAttributeValue_
1616 : XMLExpression XMLElementContentOpt
1617 | XMLMarkup XMLElementContentOpt
1618 | XMLText XMLElementContentOpt
1619 | XMLElement XMLElementContentOpt
1622 XMLElementContentOpt
1627 /* 11.1.5 XMLList Initialiser {{{ */
1629 : "<>" LexPushInOff LexPushXMLContent XMLElementContent LexPop LexPopIn "</>" { $$ = CYNew CYXMLList($4); }
1632 /* 11.2 Left-Hand-Side Expressions {{{ */
1634 : Identifier { $$ = $1; }
1635 | PropertyIdentifier { $$ = $1; }
1639 : "." PropertyIdentifier { $$ = CYNew CYPropertyMember(NULL, $2); }
1640 | ".." PropertyIdentifier_ { $$ = CYNew CYDescendantMember(NULL, $2); }
1641 | "." "(" Expression ")" { $$ = CYNew CYFilteringPredicate(NULL, $3); }
1644 /* 12.1 The default xml namespace Statement {{{ */
1645 /* XXX: DefaultXMLNamespaceStatement
1646 : "default" "xml" "namespace" "=" Expression Terminator { $$ = CYNew CYDefaultXMLNamespace($5); }
1650 : DefaultXMLNamespaceStatement { $$ = $1; }
1655 /* ECMAScript5: Object Literal Trailing Comma {{{ */
1656 PropertyNameAndValueList_
1657 : "," { $$ = NULL; }
1661 /* JavaScript 1.7: Array Comprehensions {{{ */
1663 : "if" "(" Expression ")" { $$ = CYNew CYIfComprehension($3); }
1667 : "for" "(" LexPushInOn Identifier LexPopIn "!in" Expression ")" { $$ = CYNew CYForInComprehension($4, $7); }
1668 | "for" "each" "(" LexPushInOn Identifier LexPopIn "!in" Expression ")" { $$ = CYNew CYForOfComprehension($5, $8); }
1672 : ForComprehension ComprehensionListOpt { $1->SetNext($2); $$ = $1; }
1675 ComprehensionListOpt
1676 : ComprehensionList { $$ = $1; }
1677 | IfComprehension { $$ = $1; }
1682 : "[" LexPushInOff AssignmentExpression ComprehensionList LexPopIn "]" { $$ = CYNew CYArrayComprehension($3, $4); }
1685 /* JavaScript 1.7: for each {{{ */
1687 : "for" "each" "(" LexPushInOn ForInStatementInitialiser LexPopIn "!in" Expression ")" Statement { $$ = CYNew CYForOf($5, $8, $10); }
1690 /* JavaScript 1.7: let Statements {{{ */
1692 : "let" "(" VariableDeclarationList ")" Statement { $$ = CYNew CYLetStatement($3, $5); }
1700 /* JavaScript FTW: Ruby Blocks {{{ */
1701 RubyProcParameterList_
1702 : "," RubyProcParameterList { $$ = $2; }
1706 RubyProcParameterList
1707 : Identifier RubyProcParameterList_ { $$ = CYNew CYFunctionParameter(CYNew CYDeclaration($1), $2); }
1712 : "|" RubyProcParameterList "|" { $$ = $2; }
1713 | "||" { $$ = NULL; }
1716 RubyProcParametersOpt
1717 : RubyProcParameters
1722 : "{" RubyProcParametersOpt StatementListOpt "}" { $$ = CYNew CYRubyProc($2, $3); }
1726 : "{" LexPushInOff RubyProcParameters StatementListOpt LexPopIn "}" { $$ = CYNew CYRubyProc($3, $4); }
1730 : CallExpression_ RubyProcExpression { $$ = CYNew CYRubyBlock($1, $2); }