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"
314 %token <identifier_> Namespace "namespace"
315 %token <identifier_> XML "xml"
320 %token <identifier_> Identifier_
321 %token <number_> NumericLiteral
322 %token <string_> StringLiteral
323 %token <literal_> RegularExpressionLiteral
325 %type <expression_> AdditiveExpression
326 %type <argument_> ArgumentList_
327 %type <argument_> ArgumentList
328 %type <argument_> ArgumentListOpt
329 %type <argument_> Arguments
330 %type <literal_> ArrayLiteral
331 %type <expression_> ArrowFunction
332 %type <functionParameter_> ArrowParameters
333 %type <expression_> AssignmentExpression
334 %type <identifier_> BindingIdentifier
335 %type <expression_> BitwiseANDExpression
336 %type <statement_> Block_
337 %type <statement_> Block
338 %type <boolean_> BooleanLiteral
339 %type <declaration_> BindingElement
340 %type <expression_> BitwiseORExpression
341 %type <expression_> BitwiseXORExpression
342 %type <statement_> BreakStatement
343 %type <statement_> BreakableStatement
344 %type <expression_> CallExpression_
345 %type <expression_> CallExpression
346 %type <clause_> CaseBlock
347 %type <clause_> CaseClause
348 %type <clause_> CaseClausesOpt
349 %type <catch_> CatchOpt
350 %type <comprehension_> ComprehensionList
351 %type <comprehension_> ComprehensionListOpt
352 %type <expression_> ConditionalExpression
353 %type <statement_> ContinueStatement
354 %type <statement_> ConciseBody
355 %type <statement_> DebuggerStatement
356 %type <statement_> Declaration__
357 %type <statement_> Declaration_
358 %type <statement_> Declaration
359 %type <clause_> DefaultClause
360 %type <statement_> DoWhileStatement
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 <statement_> ForStatement
375 %type <for_> ForStatementInitialiser
376 %type <statement_> ForInStatement
377 %type <forin_> ForInStatementInitialiser
378 %type <declaration_> FormalParameter
379 %type <functionParameter_> FormalParameterList_
380 %type <functionParameter_> FormalParameterList
381 %type <functionParameter_> FormalParameterListOpt
382 %type <statement_> FunctionBody
383 %type <statement_> FunctionDeclaration
384 %type <expression_> FunctionExpression
385 %type <identifier_> Identifier
386 %type <identifier_> IdentifierOpt
387 %type <comprehension_> IfComprehension
388 %type <statement_> IfStatement
389 %type <expression_> Initialiser
390 %type <expression_> InitialiserOpt
391 %type <statement_> IterationStatement
392 %type <statement_> LabelledStatement
393 %type <expression_> LeftHandSideExpression
394 %type <statement_> LetStatement
395 %type <statement_> LexicalDeclaration
396 %type <literal_> Literal
397 %type <literal_> LiteralNoRE
398 %type <expression_> LogicalANDExpression
399 %type <expression_> LogicalORExpression
400 %type <member_> MemberAccess
401 %type <expression_> MemberExpression_
402 %type <expression_> MemberExpression
403 %type <expression_> MultiplicativeExpression
404 %type <expression_> NewExpression
405 %type <null_> NullLiteral
406 %type <literal_> ObjectLiteral
407 %type <compound_> Parenthetical
408 %type <compound_> ParentheticalOpt
409 %type <expression_> PostfixExpression
410 %type <expression_> PrimaryExpression
411 %type <statement_> Program
412 %type <statement_> ProgramBody
413 %type <statement_> ProgramBodyOpt
414 %type <propertyName_> PropertyName_
415 %type <propertyName_> PropertyName
416 %type <property_> PropertyNameAndValueList_
417 %type <property_> PropertyNameAndValueList
418 %type <property_> PropertyNameAndValueListOpt
419 %type <expression_> RelationalExpression
420 %type <statement_> ReturnStatement
421 %type <rubyProc_> RubyProcExpression
422 %type <functionParameter_> RubyProcParameterList_
423 %type <functionParameter_> RubyProcParameterList
424 %type <functionParameter_> RubyProcParameters
425 %type <functionParameter_> RubyProcParametersOpt
426 %type <expression_> ShiftExpression
427 %type <declaration_> SingleNameBinding
428 %type <statement_> Statement__
429 %type <statement_> Statement_
430 %type <statement_> Statement
431 %type <statement_> StatementList
432 %type <statement_> StatementListOpt
433 %type <statement_> StatementListItem
434 %type <statement_> SwitchStatement
435 %type <statement_> ThrowStatement
436 %type <statement_> TryStatement
437 %type <expression_> UnaryExpression_
438 %type <expression_> UnaryExpression
439 %type <declaration_> VariableDeclaration
440 %type <declarations_> VariableDeclarationList_
441 %type <declarations_> VariableDeclarationList
442 %type <statement_> VariableStatement
443 %type <statement_> WhileStatement
444 %type <statement_> WithStatement
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
475 %type <word_> WordOpt
479 %type <propertyIdentifier_> PropertyIdentifier_
480 %type <selector_> PropertySelector_
481 %type <selector_> PropertySelector
482 %type <identifier_> QualifiedIdentifier_
483 %type <identifier_> QualifiedIdentifier
484 %type <identifier_> WildcardIdentifier
485 %type <identifier_> XMLComment
486 %type <identifier_> XMLCDATA
487 %type <identifier_> XMLElement
488 %type <identifier_> XMLElementContent
489 %type <identifier_> XMLMarkup
490 %type <identifier_> XMLPI
492 %type <attribute_> AttributeIdentifier
493 /* XXX: %type <statement_> DefaultXMLNamespaceStatement */
494 %type <expression_> PropertyIdentifier
495 %type <expression_> XMLListInitialiser
496 %type <expression_> XMLInitialiser
509 /* Lexer State {{{ */
511 : { driver.in_.push(true); }
515 : { driver.in_.push(false); }
519 : { driver.in_.pop(); }
523 : { driver.SetCondition(CYDriver::RegExpCondition); }
527 : { if (yychar == yyempty_) driver.nobrace_ = true; else if (yychar == token::OpenBrace || yychar == token::OpenBrace_) yychar = token::OpenBrace__; }
531 : { if (yychar == token::Function) yychar = token::Function_; }
535 : LexNoBrace LexNoFunction
545 : { driver.Warning(yylloc, "warning, automatic semi-colon insertion required"); }
555 | error { if (yychar != yyeof_ && yychar != token::CloseBrace && !yylval.newline_) YYABORT; else { yyerrok; driver.errors_.pop_back(); } } StrictSemi
560 | error { yyerrok; driver.errors_.pop_back(); } StrictSemi
575 : Identifier { $$ = $1; }
576 | "break" NewLineOpt { $$ = $1; }
577 | "case" { $$ = $1; }
578 | "catch" { $$ = $1; }
579 | "class" { $$ = $1; }
580 | "const" { $$ = $1; }
581 | "continue" NewLineOpt { $$ = $1; }
582 | "debugger" { $$ = $1; }
583 | "default" { $$ = $1; }
584 | "delete" { $$ = $1; }
586 | "else" { $$ = $1; }
587 | "enum" { $$ = $1; }
588 | "export" { $$ = $1; }
589 | "extends" { $$ = $1; }
590 | "false" { $$ = $1; }
591 | "finally" { $$ = $1; }
592 /* XXX: | "for" { $$ = $1; } */
593 | "function" { $$ = $1; }
595 | "import" { $$ = $1; }
596 /* XXX: | "in" { $$ = $1; } */
597 /* XXX: | "instanceof" { $$ = $1; } */
599 | "null" { $$ = $1; }
600 | "return" NewLineOpt { $$ = $1; }
601 | "super" { $$ = $1; }
602 | "switch" { $$ = $1; }
603 | "this" { $$ = $1; }
604 | "throw" NewLineOpt { $$ = $1; }
605 | "true" { $$ = $1; }
607 | "typeof" { $$ = $1; }
609 | "void" { $$ = $1; }
610 | "while" { $$ = $1; }
611 | "with" { $$ = $1; }
620 : "@" LiteralNoRE { $$ = CYNew CYBox($2); }
621 | "@" ArrayLiteral { $$ = CYNew CYBox($2); }
622 | "@" ObjectLiteral { $$ = CYNew CYBox($2); }
623 | "@" Parenthetical { $$ = CYNew CYBox($2); }
628 : Identifier_ { $$ = $1; }
630 | "implements" { $$ = $1; }
631 | "interface" { $$ = $1; }
632 | "package" { $$ = $1; }
633 | "private" { $$ = $1; }
634 | "protected" { $$ = $1; }
635 | "public" { $$ = $1; }
636 | "static" { $$ = $1; }
638 | "abstract" { $$ = $1; }
639 | "boolean" { $$ = $1; }
640 | "byte" { $$ = $1; }
641 | "char" { $$ = $1; }
642 | "double" { $$ = $1; }
643 | "final" { $$ = $1; }
644 | "float" { $$ = $1; }
645 | "goto" { $$ = $1; }
647 | "long" { $$ = $1; }
648 | "native" { $$ = $1; }
649 | "short" { $$ = $1; }
650 | "synchronized" { $$ = $1; }
651 | "throws" { $$ = $1; }
652 | "transient" { $$ = $1; }
653 | "volatile" { $$ = $1; }
655 // XXX: is this allowed?! | "let" { $$ = $1; }
656 | "yield" { $$ = $1; }
658 | "each" { $$ = $1; }
662 : Identifier { $$ = $1; }
667 : NullLiteral { $$ = $1; }
668 | BooleanLiteral { $$ = $1; }
669 | NumericLiteral { $$ = $1; }
670 | StringLiteral { $$ = $1; }
674 : LiteralNoRE { $$ = $1; }
675 | RegularExpressionLiteral { $$ = $1; }
679 : "null" { $$ = $1; }
683 : "true" { $$ = $1; }
684 | "false" { $$ = $1; }
687 /* 11.1 Primary Expressions {{{ */
689 : "(" LexPushInOff Expression LexPopIn ")" { $$ = $3; }
693 : Parenthetical { $$ = $1; }
698 : "this" { $$ = $1; }
699 | Identifier { $$ = CYNew CYVariable($1); }
700 | Literal { $$ = $1; }
701 | ArrayLiteral { $$ = $1; }
702 | ObjectLiteral { $$ = $1; }
703 | FunctionExpression { $$ = $1; }
704 | Parenthetical { $$ = $1; }
705 | AutoComplete { driver.mode_ = CYDriver::AutoPrimary; YYACCEPT; }
708 /* 11.1.4.1 Array Initialiser {{{ */
710 : "[" LexPushInOff ElementListOpt LexPopIn "]" { $$ = CYNew CYArray($3); }
714 : AssignmentExpression { $$ = $1; }
718 : Element { $$ = $1; }
719 | LexSetRegExp { $$ = NULL; }
723 : ElementOpt "," ElementListOpt { $$ = CYNew CYElement($1, $3); }
724 | Element { $$ = CYNew CYElement($1, NULL); }
728 : ElementList { $$ = $1; }
729 | LexSetRegExp { $$ = NULL; }
732 /* 11.1.5 Object Initialiser {{{ */
734 : BRACE LexPushInOff PropertyNameAndValueListOpt LexPopIn "}" { $$ = CYNew CYObject($3); }
737 PropertyNameAndValueList_
738 : "," PropertyNameAndValueList { $$ = $2; }
742 PropertyNameAndValueList
743 : PropertyName ":" AssignmentExpression PropertyNameAndValueList_ { $$ = CYNew CYProperty($1, $3, $4); }
746 PropertyNameAndValueListOpt
747 : PropertyNameAndValueList { $$ = $1; }
752 : Identifier { $$ = $1; }
753 | StringLiteral { $$ = $1; }
754 | NumericLiteral { $$ = $1; }
758 : LexSetRegExp PropertyName_ { $$ = $2; }
762 /* 11.2 Left-Hand-Side Expressions {{{ */
764 : "[" LexPushInOff Expression LexPopIn "]" { $$ = CYNew CYDirectMember(NULL, $3); }
765 | "." Identifier { $$ = CYNew CYDirectMember(NULL, CYNew CYString($2)); }
766 | "." AutoComplete { driver.mode_ = CYDriver::AutoDirect; YYACCEPT; }
770 : MemberExpression { $$ = $1; }
771 //| "super" { $$ = $1; }
775 : LexSetRegExp PrimaryExpression { $$ = $2; }
776 | MemberExpression_ { driver.context_ = $1; } MemberAccess { $3->SetLeft($1); $$ = $3; }
777 | LexSetRegExp "new" MemberExpression Arguments { $$ = CYNew cy::Syntax::New($3, $4); }
781 : MemberExpression { $$ = $1; }
782 | LexSetRegExp "new" NewExpression { $$ = CYNew cy::Syntax::New($3, NULL); }
791 : CallExpression_ Arguments { $$ = CYNew CYCall($1, $2); }
792 | CallExpression { driver.context_ = $1; } MemberAccess { $3->SetLeft($1); $$ = $3; }
796 : "(" LexPushInOff ArgumentListOpt LexPopIn ")" { $$ = $3; }
800 : "," ArgumentList { $$ = $2; }
805 : AssignmentExpression ArgumentList_ { $$ = CYNew CYArgument(NULL, $1, $2); }
809 : ArgumentList { $$ = $1; }
810 | LexSetRegExp { $$ = NULL; }
813 LeftHandSideExpression
814 : NewExpression { $$ = $1; }
815 | CallExpression { $$ = $1; }
818 /* 11.3 Postfix Expressions {{{ */
820 : %prec "" LeftHandSideExpression { $$ = $1; }
821 | LeftHandSideExpression "++" { $$ = CYNew CYPostIncrement($1); }
822 | LeftHandSideExpression "--" { $$ = CYNew CYPostDecrement($1); }
825 /* 11.4 Unary Operators {{{ */
827 : "delete" UnaryExpression { $$ = CYNew CYDelete($2); }
828 | "void" UnaryExpression { $$ = CYNew CYVoid($2); }
829 | "typeof" UnaryExpression { $$ = CYNew CYTypeOf($2); }
830 | "++" UnaryExpression { $$ = CYNew CYPreIncrement($2); }
831 | "\n++" UnaryExpression { $$ = CYNew CYPreIncrement($2); }
832 | "--" UnaryExpression { $$ = CYNew CYPreDecrement($2); }
833 | "\n--" UnaryExpression { $$ = CYNew CYPreDecrement($2); }
834 | "+" UnaryExpression { $$ = CYNew CYAffirm($2); }
835 | "-" UnaryExpression { $$ = CYNew CYNegate($2); }
836 | "~" UnaryExpression { $$ = CYNew CYBitwiseNot($2); }
837 | "!" UnaryExpression { $$ = CYNew CYLogicalNot($2); }
841 : PostfixExpression { $$ = $1; }
842 | LexSetRegExp UnaryExpression_ { $$ = $2; }
845 /* 11.5 Multiplicative Operators {{{ */
846 MultiplicativeExpression
847 : UnaryExpression { $$ = $1; }
848 | MultiplicativeExpression "*" UnaryExpression { $$ = CYNew CYMultiply($1, $3); }
849 | MultiplicativeExpression "/" UnaryExpression { $$ = CYNew CYDivide($1, $3); }
850 | MultiplicativeExpression "%" UnaryExpression { $$ = CYNew CYModulus($1, $3); }
853 /* 11.6 Additive Operators {{{ */
855 : MultiplicativeExpression { $$ = $1; }
856 | AdditiveExpression "+" MultiplicativeExpression { $$ = CYNew CYAdd($1, $3); }
857 | AdditiveExpression "-" MultiplicativeExpression { $$ = CYNew CYSubtract($1, $3); }
860 /* 11.7 Bitwise Shift Operators {{{ */
862 : AdditiveExpression { $$ = $1; }
863 | ShiftExpression "<<" AdditiveExpression { $$ = CYNew CYShiftLeft($1, $3); }
864 | ShiftExpression ">>" AdditiveExpression { $$ = CYNew CYShiftRightSigned($1, $3); }
865 | ShiftExpression ">>>" AdditiveExpression { $$ = CYNew CYShiftRightUnsigned($1, $3); }
868 /* 11.8 Relational Operators {{{ */
870 : ShiftExpression { $$ = $1; }
871 | RelationalExpression "<" ShiftExpression { $$ = CYNew CYLess($1, $3); }
872 | RelationalExpression ">" ShiftExpression { $$ = CYNew CYGreater($1, $3); }
873 | RelationalExpression "<=" ShiftExpression { $$ = CYNew CYLessOrEqual($1, $3); }
874 | RelationalExpression ">=" ShiftExpression { $$ = CYNew CYGreaterOrEqual($1, $3); }
875 | RelationalExpression "instanceof" ShiftExpression { $$ = CYNew CYInstanceOf($1, $3); }
876 | RelationalExpression "in" ShiftExpression { $$ = CYNew CYIn($1, $3); }
879 /* 11.9 Equality Operators {{{ */
881 : RelationalExpression { $$ = $1; }
882 | EqualityExpression "==" RelationalExpression { $$ = CYNew CYEqual($1, $3); }
883 | EqualityExpression "!=" RelationalExpression { $$ = CYNew CYNotEqual($1, $3); }
884 | EqualityExpression "===" RelationalExpression { $$ = CYNew CYIdentical($1, $3); }
885 | EqualityExpression "!==" RelationalExpression { $$ = CYNew CYNotIdentical($1, $3); }
888 /* 11.10 Binary Bitwise Operators {{{ */
890 : EqualityExpression { $$ = $1; }
891 | BitwiseANDExpression "&" EqualityExpression { $$ = CYNew CYBitwiseAnd($1, $3); }
895 : BitwiseANDExpression { $$ = $1; }
896 | BitwiseXORExpression "^" BitwiseANDExpression { $$ = CYNew CYBitwiseXOr($1, $3); }
900 : BitwiseXORExpression { $$ = $1; }
901 | BitwiseORExpression "|" BitwiseXORExpression { $$ = CYNew CYBitwiseOr($1, $3); }
904 /* 11.11 Binary Logical Operators {{{ */
906 : BitwiseORExpression { $$ = $1; }
907 | LogicalANDExpression "&&" BitwiseORExpression { $$ = CYNew CYLogicalAnd($1, $3); }
911 : LogicalANDExpression { $$ = $1; }
912 | LogicalORExpression "||" LogicalANDExpression { $$ = CYNew CYLogicalOr($1, $3); }
915 /* 11.12 Conditional Operator ( ? : ) {{{ */
916 ConditionalExpression
917 : LogicalORExpression { $$ = $1; }
918 | LogicalORExpression "?" LexPushInOff AssignmentExpression LexPopIn ":" AssignmentExpression { $$ = CYNew CYCondition($1, $4, $7); }
921 /* 11.13 Assignment Operators {{{ */
923 : ConditionalExpression { $$ = $1; }
924 | ArrowFunction { $$ = $1; }
925 | LeftHandSideExpression "=" AssignmentExpression { $$ = CYNew CYAssign($1, $3); }
926 | LeftHandSideExpression "*=" AssignmentExpression { $$ = CYNew CYMultiplyAssign($1, $3); }
927 | LeftHandSideExpression "/=" AssignmentExpression { $$ = CYNew CYDivideAssign($1, $3); }
928 | LeftHandSideExpression "%=" AssignmentExpression { $$ = CYNew CYModulusAssign($1, $3); }
929 | LeftHandSideExpression "+=" AssignmentExpression { $$ = CYNew CYAddAssign($1, $3); }
930 | LeftHandSideExpression "-=" AssignmentExpression { $$ = CYNew CYSubtractAssign($1, $3); }
931 | LeftHandSideExpression "<<=" AssignmentExpression { $$ = CYNew CYShiftLeftAssign($1, $3); }
932 | LeftHandSideExpression ">>=" AssignmentExpression { $$ = CYNew CYShiftRightSignedAssign($1, $3); }
933 | LeftHandSideExpression ">>>=" AssignmentExpression { $$ = CYNew CYShiftRightUnsignedAssign($1, $3); }
934 | LeftHandSideExpression "&=" AssignmentExpression { $$ = CYNew CYBitwiseAndAssign($1, $3); }
935 | LeftHandSideExpression "^=" AssignmentExpression { $$ = CYNew CYBitwiseXOrAssign($1, $3); }
936 | LeftHandSideExpression "|=" AssignmentExpression { $$ = CYNew CYBitwiseOrAssign($1, $3); }
939 /* 11.14 Comma Operator {{{ */
941 : "," Expression { $$ = $2; }
942 | { $$ = CYNew CYCompound(); }
946 : AssignmentExpression Expression_ { $2->AddPrev($1); $$ = $2; }
950 : Expression { $$ = $1; }
951 | LexSetRegExp { $$ = NULL; }
955 /* 12 Statements {{{ */
958 | VariableStatement { $$ = $1; }
959 | EmptyStatement { $$ = $1; }
960 | IfStatement { $$ = $1; }
961 | BreakableStatement { $$ = $1; }
962 | ContinueStatement { $$ = $1; }
963 | BreakStatement { $$ = $1; }
964 | ReturnStatement { $$ = $1; }
965 | WithStatement { $$ = $1; }
966 | LabelledStatement { $$ = $1; }
967 | ThrowStatement { $$ = $1; }
968 | TryStatement { $$ = $1; }
969 | DebuggerStatement { $$ = $1; }
973 : LexSetRegExp Statement__ { $$ = $2; }
974 | ExpressionStatement { $$ = $1; }
978 : LexSetStatement Statement_ { $$ = $2; }
982 : FunctionDeclaration { $$ = $1; }
983 | LexicalDeclaration { $$ = $1; }
987 : LexSetRegExp Declaration__ { $$ = $2; }
991 : LexSetStatement Declaration_ { $$ = $2; }
995 : IterationStatement { $$ = $1; }
996 | SwitchStatement { $$ = $1; }
1001 : BRACE StatementListOpt "}" { $$ = $2; }
1005 : ";{" StatementListOpt "}" { $$ = CYNew CYBlock($2); }
1009 : StatementListItem StatementListOpt { $1->SetNext($2); $$ = $1; }
1013 : StatementList { $$ = $1; }
1014 | LexSetRegExp { $$ = NULL; }
1018 : Statement { $$ = $1; }
1019 | Declaration { $$ = $1; }
1022 /* 12.2 Declarations {{{ */
1024 : Identifier { $$ = $1; }
1027 // XXX: BindingPattern
1029 /* 12.2.1 Let and Const Declarations {{{ */
1031 : LetOrConst VariableDeclarationList Terminator { $$ = CYNew CYVar($2); }
1039 /* 12.2.2 Variable Statement {{{ */
1041 : "var" VariableDeclarationList Terminator { $$ = CYNew CYVar($2); }
1044 VariableDeclarationList_
1045 : "," VariableDeclarationList { $$ = $2; }
1049 VariableDeclarationList
1050 : VariableDeclaration VariableDeclarationList_ { $$ = CYNew CYDeclarations($1, $2); }
1054 : BindingIdentifier InitialiserOpt { $$ = CYNew CYDeclaration($1, $2); }
1055 // XXX: | BindingPattern Initialiser { $$ = CYNew CYDeclaration($1, $2); }
1059 : "=" AssignmentExpression { $$ = $2; }
1063 : Initialiser { $$ = $1; }
1067 /* 12.2.4 Destructuring Binding Patterns {{{ */
1071 : SingleNameBinding { $$ = $1; }
1075 : BindingIdentifier InitialiserOpt { $$ = CYNew CYDeclaration($1, $2); }
1078 /* 12.3 Empty Statement {{{ */
1080 : ";" { $$ = CYNew CYEmpty(); }
1083 /* 12.4 Expression Statement {{{ */
1085 : Expression Terminator { $$ = CYNew CYExpress($1); }
1088 /* 12.5 The if Statement {{{ */
1090 : "else" Statement { $$ = $2; }
1091 | %prec "if" { $$ = NULL; }
1095 : "if" "(" Expression ")" Statement ElseStatementOpt { $$ = CYNew CYIf($3, $5, $6); }
1099 /* 12.6 Iteration Statements {{{ */
1101 : DoWhileStatement { $$ = $1; }
1102 | WhileStatement { $$ = $1; }
1103 | ForStatement { $$ = $1; }
1104 | ForInStatement { $$ = $1; }
1107 /* 12.6.1 The do-while Statement {{{ */
1109 : "do" Statement "while" "(" Expression ")" TerminatorOpt { $$ = CYNew CYDoWhile($5, $2); }
1112 /* 12.6.2 The while Statement {{{ */
1114 : "while" "(" Expression ")" Statement { $$ = CYNew CYWhile($3, $5); }
1117 /* 12.6.3 The for Statement {{{ */
1119 : "for" "(" LexPushInOn ForStatementInitialiser LexPopIn ";" ExpressionOpt ";" ExpressionOpt ")" Statement { $$ = CYNew CYFor($4, $7, $9, $11); }
1122 ForStatementInitialiser
1123 : ExpressionOpt { $$ = $1; }
1124 | LexSetRegExp "var" VariableDeclarationList { $$ = CYNew CYForDeclarations($3); }
1127 /* 12.6.4 The for-in Statement {{{ */
1129 : "for" "(" LexPushInOn ForInStatementInitialiser LexPopIn "!in" Expression ")" Statement { $$ = CYNew CYForIn($4, $7, $9); }
1132 ForInStatementInitialiser
1133 : LeftHandSideExpression { $$ = $1; }
1134 | LexSetRegExp "var" VariableDeclaration { $$ = $3; }
1138 /* 12.7 The continue Statement {{{ */
1140 : "continue" IdentifierOpt Terminator { $$ = CYNew CYContinue($2); }
1143 /* 12.8 The break Statement {{{ */
1145 : "break" IdentifierOpt Terminator { $$ = CYNew CYBreak($2); }
1148 /* 12.9 The return Statement {{{ */
1150 : "return" ExpressionOpt Terminator { $$ = CYNew CYReturn($2); }
1153 /* 12.10 The with Statement {{{ */
1155 : "with" "(" Expression ")" Statement { $$ = CYNew CYWith($3, $5); }
1159 /* 12.11 The switch Statement {{{ */
1161 : "switch" "(" Expression ")" CaseBlock { $$ = CYNew CYSwitch($3, $5); }
1165 : BRACE CaseClausesOpt "}" { $$ = $2; }
1169 : "case" Expression ":" StatementListOpt { $$ = CYNew CYClause($2, $4); }
1173 : CaseClause CaseClausesOpt { $1->SetNext($2); $$ = $1; }
1174 | DefaultClause CaseClausesOpt { $1->SetNext($2); $$ = $1; }
1179 : "default" ":" StatementListOpt { $$ = CYNew CYClause(NULL, $3); }
1182 /* 12.12 Labelled Statements {{{ */
1184 : Identifier ":" Statement { $$ = CYNew CYLabel($1, $3); }
1187 /* 12.13 The throw Statement {{{ */
1189 : "throw" Expression Terminator { $$ = CYNew cy::Syntax::Throw($2); }
1192 /* 12.14 The try Statement {{{ */
1194 : "try" Block_ CatchOpt FinallyOpt { $$ = CYNew cy::Syntax::Try($2, $3, $4); }
1198 : "catch" "(" Identifier ")" Block_ { $$ = CYNew cy::Syntax::Catch($3, $5); }
1203 : "finally" Block_ { $$ = CYNew CYFinally($2); }
1207 /* 12.14 The debugger Statement {{{ */
1209 : "debugger" Terminator { $$ = CYNew CYDebugger(); }
1213 /* 13.1 Function Definitions {{{ */
1215 : ";function" Identifier "(" FormalParameterListOpt ")" BRACE FunctionBody "}" { $$ = CYNew CYFunctionStatement($2, $4, $7); }
1219 : "function" IdentifierOpt "(" LexPushInOff FormalParameterListOpt LexPopIn ")" BRACE LexPushInOff FunctionBody LexPopIn "}" { $$ = CYNew CYFunctionExpression($2, $5, $10); }
1222 FormalParameterList_
1223 : "," FormalParameterList { $$ = $2; }
1228 // XXX: : FunctionRestParameter { $$ = $1; }
1229 : FormalParameter FormalParameterList_ { $$ = CYNew CYFunctionParameter($1, $2); }
1232 FormalParameterListOpt
1233 : FormalParameterList
1237 /* XXX: FunctionRestParameter
1238 : "..." BindingIdentifier { $$ = CYNew CYFunctionRestParameter($2); }
1242 : BindingElement { $$ = $1; }
1246 : StatementListOpt { $$ = $1; }
1249 /* 13.2 Arrow Function Definitions {{{ */
1251 : LexSetRegExp ArrowParameters "=>" LexNoBrace ConciseBody { $$ = CYNew CYFunctionExpression(NULL, $2, $5); }
1255 : BindingIdentifier { $$ = CYNew CYFunctionParameter(CYNew CYDeclaration($1)); }
1256 //| ParentheticalOpt { $$ = $1; }
1260 : AssignmentExpression { $$ = CYNew CYReturn($1); }
1261 | ";{" LexPushInOff FunctionBody LexPopIn "}" { $$ = $3; }
1264 /* 14 Program {{{ */
1266 : ProgramBodyOpt { driver.program_ = CYNew CYProgram($1); }
1270 : StatementList { $$ = $1; }
1274 : ProgramBody { $$ = $1; }
1280 /* Cycript (Objective-C): @class Declaration {{{ */
1282 /* XXX: why the hell did I choose MemberExpression? */
1283 : ":" LexSetRegExp MemberExpression { $$ = $3; }
1288 : Expression Identifier ";"
1292 : BRACE ClassFieldListOpt "}" { $$ = NULL; }
1296 : ClassFieldListOpt ClassField
1301 : "+" { $$ = false; }
1302 | "-" { $$ = true; }
1306 : "(" Expression ")" { $$ = $2; }
1307 | "(" LexSetRegExp "void" ")" { $$ = NULL; }
1312 : Word ":" TypeOpt Identifier { $$ = CYNew CYMessageParameter($1, $3, $4); }
1315 MessageParameterList
1316 : MessageParameter MessageParameterListOpt { $1->SetNext($2); $$ = $1; }
1319 MessageParameterListOpt
1320 : MessageParameterList { $$ = $1; }
1325 : MessageParameterList { $$ = $1; }
1326 | Word { $$ = CYNew CYMessageParameter($1, NULL, NULL); }
1329 ClassMessageDeclaration
1330 : MessageScope TypeOpt MessageParameters BRACE FunctionBody "}" { $$ = CYNew CYMessage($1, $2, $3, $5); }
1333 ClassMessageDeclarationListOpt
1334 : ClassMessageDeclarationListOpt ClassMessageDeclaration { $2->SetNext($1); $$ = $2; }
1335 | ClassMessageDeclarationListOpt Comment { $$ = $1; }
1340 : Identifier { $$ = $1; }
1341 | "(" AssignmentExpression ")" { $$ = $2; }
1345 : ClassName { $$ = $1; }
1349 // XXX: this should be AssignmentExpressionNoRight
1351 : ShiftExpression ClassProtocolsOpt { $$ = CYNew CYProtocol($1, $2); }
1355 : "," ClassProtocols { $$ = $2; }
1359 ClassProtocolListOpt
1360 : "<" ClassProtocols ">" { $$ = $2; }
1365 : "@implementation" LexPushInOff ClassNameOpt ClassSuperOpt ClassProtocolListOpt ClassFieldList ClassMessageDeclarationListOpt LexPopIn "@end" { $$ = CYNew CYClassExpression($3, $4, $5, $6, $7); }
1369 : ";@implementation" ClassName ClassSuperOpt ClassProtocolListOpt ClassFieldList ClassMessageDeclarationListOpt "@end" { $$ = CYNew CYClassStatement($2, $3, $4, $5, $6); }
1377 : ";@implementation" ClassName CategoryName ClassMessageDeclarationListOpt "@end" { $$ = CYNew CYCategory($2, $4); }
1381 : ClassExpression { $$ = $1; }
1385 : ClassStatement { $$ = $1; }
1386 | CategoryStatement { $$ = $1; }
1389 /* Cycript (Objective-C): Send Message {{{ */
1391 : "," AssignmentExpression VariadicCall { $$ = CYNew CYArgument(NULL, $2, $3); }
1396 : WordOpt { driver.contexts_.back().words_.push_back($1); } { $$ = $1; }
1397 | AutoComplete { driver.mode_ = CYDriver::AutoMessage; YYACCEPT; }
1401 : SelectorCall { $$ = $1; }
1402 | VariadicCall { $$ = $1; }
1406 : SelectorWordOpt ":" AssignmentExpression SelectorCall_ { $$ = CYNew CYArgument($1 ?: CYNew CYBlank(), $3, $4); }
1410 : SelectorCall { $$ = $1; }
1411 | Word { $$ = CYNew CYArgument($1, NULL); }
1415 : "[" LexPushInOff AssignmentExpression { driver.contexts_.push_back($3); } SelectorList LexPopIn "]" { driver.contexts_.pop_back(); } { $$ = CYNew CYSendDirect($3, $5); }
1416 | "[" LexPushInOff LexSetRegExp "super" { driver.context_ = NULL; } SelectorList LexPopIn "]" { $$ = CYNew CYSendSuper($6); }
1420 : WordOpt ":" SelectorExpressionOpt { $$ = CYNew CYSelectorPart($1, true, $3); }
1424 : SelectorExpression_ { $$ = $1; }
1425 | Word { $$ = CYNew CYSelectorPart($1, false, NULL); }
1428 SelectorExpressionOpt
1429 : SelectorExpression_ { $$ = $1; }
1434 : MessageExpression { $$ = $1; }
1435 | "@selector" "(" LexPushInOff SelectorExpression LexPopIn ")" { $$ = CYNew CYSelector($4); }
1438 /* Cycript (Objective-C): @import Directive {{{ */
1452 : "@import" ImportPath { $$ = CYNew CYImport(); }
1458 /* Cycript (C): Pointer Indirection/Addressing {{{ */
1459 LeftHandSideExpression
1460 : LexSetRegExp "*" UnaryExpression { $$ = CYNew CYIndirect($3); }
1464 : "&" UnaryExpression { $$ = CYNew CYAddressOf($2); }
1468 : "->" "[" Expression "]" { $$ = CYNew CYIndirectMember(NULL, $3); }
1469 | "->" Identifier { $$ = CYNew CYIndirectMember(NULL, CYNew CYString($2)); }
1470 | "->" AutoComplete { driver.mode_ = CYDriver::AutoIndirect; YYACCEPT; }
1475 /* YUI: Documentation Comments {{{ */
1477 : Comment { $$ = $1; }
1482 /* Lexer State {{{ */
1484 : { driver.PushCondition(CYDriver::RegExpCondition); }
1488 : { driver.PushCondition(CYDriver::XMLContentCondition); }
1492 : { driver.PushCondition(CYDriver::XMLTagCondition); }
1496 : { driver.PopCondition(); }
1500 : { driver.SetCondition(CYDriver::XMLContentCondition); }
1504 : { driver.SetCondition(CYDriver::XMLTagCondition); }
1513 /* 8.1 Context Keywords {{{ */
1515 : "namespace" { $$ = $1; }
1516 | "xml" { $$ = $1; }
1519 /* 8.3 XML Initialiser Input Elements {{{ */
1521 : XMLComment { $$ = $1; }
1522 | XMLCDATA { $$ = $1; }
1523 | XMLPI { $$ = $1; }
1526 /* 11.1 Primary Expressions {{{ */
1528 : PropertyIdentifier { $$ = CYNew CYPropertyVariable($1); }
1529 | XMLInitialiser { $$ = $1; }
1530 | XMLListInitialiser { $$ = $1; }
1534 : AttributeIdentifier { $$ = $1; }
1535 | QualifiedIdentifier { $$ = $1; }
1536 | WildcardIdentifier { $$ = $1; }
1539 /* 11.1.1 Attribute Identifiers {{{ */
1541 : "@" QualifiedIdentifier_ { $$ = CYNew CYAttribute($2); }
1545 : PropertySelector { $$ = $1; }
1546 | "[" LexPushInOff Expression LexPopIn "]" { $$ = CYNew CYSelector($3); }
1550 : Identifier { $$ = CYNew CYSelector($1); }
1551 | WildcardIdentifier { $$ = $1; }
1554 /* 11.1.2 Qualified Identifiers {{{ */
1555 QualifiedIdentifier_
1556 : PropertySelector_ { $$ = CYNew CYQualified(NULL, $1); }
1557 | QualifiedIdentifier { $$ = $1; }
1561 : PropertySelector "::" PropertySelector_ { $$ = CYNew CYQualified($1, $3); }
1564 /* 11.1.3 Wildcard Identifiers {{{ */
1566 : "*" { $$ = CYNew CYWildcard(); }
1569 /* 11.1.4 XML Initialiser {{{ */
1571 : XMLMarkup { $$ = $1; }
1572 | XMLElement { $$ = $1; }
1576 : "<" LexPushInOff XMLTagContent LexPop LexPopIn "/>"
1577 | "<" LexPushInOff XMLTagContent ">" LexSetXMLContent XMLElementContentOpt "</" LexSetXMLTag XMLTagName XMLWhitespaceOpt LexPop LexPopIn ">"
1581 : LexPushXMLTag XMLTagName XMLAttributes
1585 : BRACE LexPushRegExp Expression LexPop "}"
1594 : XMLAttributes_ XMLAttribute
1599 : XMLAttributes_ XMLWhitespace XMLExpression XMLWhitespaceOpt
1600 | XMLAttributes_ XMLWhitespaceOpt
1609 : XMLWhitespace XMLName XMLWhitespaceOpt "=" XMLWhitespaceOpt XMLAttributeValue_
1613 : XMLExpression XMLElementContentOpt
1614 | XMLMarkup XMLElementContentOpt
1615 | XMLText XMLElementContentOpt
1616 | XMLElement XMLElementContentOpt
1619 XMLElementContentOpt
1624 /* 11.1.5 XMLList Initialiser {{{ */
1626 : "<>" LexPushInOff LexPushXMLContent XMLElementContent LexPop LexPopIn "</>" { $$ = CYNew CYXMLList($4); }
1629 /* 11.2 Left-Hand-Side Expressions {{{ */
1631 : Identifier { $$ = $1; }
1632 | PropertyIdentifier { $$ = $1; }
1636 : "." PropertyIdentifier { $$ = CYNew CYPropertyMember(NULL, $2); }
1637 | ".." PropertyIdentifier_ { $$ = CYNew CYDescendantMember(NULL, $2); }
1638 | "." "(" Expression ")" { $$ = CYNew CYFilteringPredicate(NULL, $3); }
1641 /* 12.1 The default xml namespace Statement {{{ */
1642 /* XXX: DefaultXMLNamespaceStatement
1643 : "default" "xml" "namespace" "=" Expression Terminator { $$ = CYNew CYDefaultXMLNamespace($5); }
1647 : DefaultXMLNamespaceStatement { $$ = $1; }
1652 /* ECMAScript5: Object Literal Trailing Comma {{{ */
1653 PropertyNameAndValueList_
1654 : "," { $$ = NULL; }
1658 /* JavaScript 1.7: Array Comprehensions {{{ */
1660 : "if" "(" Expression ")" { $$ = CYNew CYIfComprehension($3); }
1664 : "for" "(" LexPushInOn Identifier LexPopIn "!in" Expression ")" { $$ = CYNew CYForInComprehension($4, $7); }
1665 | "for" "each" "(" LexPushInOn Identifier LexPopIn "!in" Expression ")" { $$ = CYNew CYForEachInComprehension($5, $8); }
1669 : ForComprehension ComprehensionListOpt { $1->SetNext($2); $$ = $1; }
1672 ComprehensionListOpt
1673 : ComprehensionList { $$ = $1; }
1674 | IfComprehension { $$ = $1; }
1679 : "[" LexPushInOff AssignmentExpression ComprehensionList LexPopIn "]" { $$ = CYNew CYArrayComprehension($3, $4); }
1682 /* JavaScript 1.7: for each {{{ */
1684 : "for" "each" "(" LexPushInOn ForInStatementInitialiser LexPopIn "!in" Expression ")" Statement { $$ = CYNew CYForEachIn($5, $8, $10); }
1687 /* JavaScript 1.7: let Statements {{{ */
1689 : "let" "(" VariableDeclarationList ")" Statement { $$ = CYNew CYLetStatement($3, $5); }
1697 /* JavaScript FTW: Ruby Blocks {{{ */
1698 RubyProcParameterList_
1699 : "," RubyProcParameterList { $$ = $2; }
1703 RubyProcParameterList
1704 : Identifier RubyProcParameterList_ { $$ = CYNew CYFunctionParameter(CYNew CYDeclaration($1), $2); }
1709 : "|" RubyProcParameterList "|" { $$ = $2; }
1710 | "||" { $$ = NULL; }
1713 RubyProcParametersOpt
1714 : RubyProcParameters
1719 : "{" RubyProcParametersOpt StatementListOpt "}" { $$ = CYNew CYRubyProc($2, $3); }
1723 : "{" LexPushInOff RubyProcParameters StatementListOpt LexPopIn "}" { $$ = CYNew CYRubyProc($3, $4); }
1727 : CallExpression_ RubyProcExpression { $$ = CYNew CYRubyBlock($1, $2); }