%token <identifier_> XML "xml"
@end
-@begin ObjectiveC
-%type <expression_> AdditiveExpressionNoWC
-%type <expression_> AssigneeExpressionNoWC
-%type <expression_> AssignmentExpressionNoWC
-%type <expression_> BitwiseANDExpressionNoWC
-%type <expression_> BitwiseXORExpressionNoWC
-%type <expression_> BitwiseORExpressionNoWC
-%type <expression_> ConditionalExpressionNoWC
-%type <expression_> EqualityExpressionNoWC
-%type <expression_> LeftHandSideExpressionNoWC
-%type <expression_> LogicalANDExpressionNoWC
-%type <expression_> LogicalORExpressionNoWC
-%type <expression_> MemberExpressionNoWC
-%type <expression_> MultiplicativeExpressionNoWC
-%type <expression_> NewExpressionNoWC
-%type <expression_> PostfixExpressionNoWC
-%type <expression_> RelationalExpressionNoWC
-%type <expression_> ShiftExpressionNoWC
-%type <expression_> UnaryExpressionNoWC
-@end
-
%token <identifier_> Identifier_
%token <number_> NumericLiteral
%token <string_> StringLiteral
%type <expression_> PrimaryExpressionNo
%type <expression_> PrimaryExpressionNoBF
%type <expression_> PrimaryExpressionNoRE
-%type <expression_> PrimaryExpressionNoWC
-%type <expression_> PrimaryExpressionNoWC_
-@begin E4X
-%type <expression_> PrimaryExpressionWC
-@end
%type <expression_> PrimaryExpressionBF
%type <statement_> Program
%type <propertyName_> PropertyName
%type <expression_> XMLInitialiser
@end
-%token WC
-
%nonassoc Identifier_ "abstract" "boolean" "break" "byte" "case" "catch" "char" "class" "const" "continue" "debugger" "default" "delete" "do" "double" "each" "enum" "export" "extends" "false" "final" "finally" "float" /*"for"*/ "function" "goto" "implements" "import" /*"in"*/ /*"instanceof"*/ "int" "interface" "let" "long" "namespace" "native" "new" "null" "package" "private" "protected" "public" "return" "short" "super" "static" "switch" "synchronized" "this" "throw" "throws" "transient" "true" "try" "typeof" "var" "void" "volatile" "while" "with" "xml" "yield"
%nonassoc "if"
/* 11.1 Primary Expressions {{{ */
PrimaryExpression
- : PrimaryExpressionNoWC { $$ = $1; }
-@begin E4X
- | LexSetRegExp PrimaryExpressionWC { $$ = $2; }
-@end
+ : LexSetRegExp PrimaryExpressionNoRE { $$ = $2; }
;
PrimaryExpressionNoBF
: PrimaryExpressionNo { $$ = $1; }
-@begin E4X
- | PrimaryExpressionWC { $$ = $1; }
-@end
;
PrimaryExpressionNoRE
- : PrimaryExpressionNoWC_ { $$ = $1; }
-@begin E4X
- | PrimaryExpressionWC { $$ = $1; }
-@end
- ;
-
-PrimaryExpressionNoWC_
: PrimaryExpressionBF { $$ = $1; }
| PrimaryExpressionNo { $$ = $1; }
;
-PrimaryExpressionNoWC
- : LexSetRegExp PrimaryExpressionNoWC_ { $$ = $2; }
- ;
-
PrimaryExpressionNo
: "this" { $$ = $1; }
| Identifier { $$ = new(driver.pool_) CYVariable($1); }
| MemberExpression_ { $$ = $1; }
;
-@begin ObjectiveC
-MemberExpressionNoWC
- : PrimaryExpression { $$ = $1; }
- | LexSetRegExp FunctionExpression { $$ = $2; }
- | MemberExpression MemberAccess { $2->SetLeft($1); $$ = $2; }
- | LexSetRegExp MemberExpression_ { $$ = $2; }
- ;
-@end
-
NewExpression_
: "new" NewExpression { $$ = new(driver.pool_) CYNew($2, NULL); }
;
| NewExpression_ { $$ = $1; }
;
-@begin ObjectiveC
-NewExpressionNoWC
- : MemberExpressionNoWC { $$ = $1; }
- | LexSetRegExp NewExpression_ { $$ = $2; }
- ;
-@end
-
CallExpression
- : PrimaryExpressionNoWC Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
+ : MemberExpression Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
| CallExpression Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
| CallExpression MemberAccess { $2->SetLeft($1); $$ = $2; }
;
;
CallExpressionNoRE
- : PrimaryExpressionNoRE Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
+ : MemberExpressionNoRE Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
| CallExpressionNoRE Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
| CallExpressionNoRE MemberAccess { $2->SetLeft($1); $$ = $2; }
;
: NewExpressionNoRE { $$ = $1; }
| CallExpressionNoRE { $$ = $1; }
;
-
-@begin ObjectiveC
-LeftHandSideExpressionNoWC
- : NewExpressionNoWC { $$ = $1; }
- | CallExpression { $$ = $1; }
- ;
-@end
/* }}} */
/* 11.3 Postfix Expressions {{{ */
PostfixExpression
| LeftHandSideExpressionNoRE "++" { $$ = new(driver.pool_) CYPostIncrement($1); }
| LeftHandSideExpressionNoRE "--" { $$ = new(driver.pool_) CYPostDecrement($1); }
;
-
-@begin ObjectiveC
-PostfixExpressionNoWC
- : AssigneeExpressionNoWC { $$ = $1; }
- | LeftHandSideExpression "++" { $$ = new(driver.pool_) CYPostIncrement($1); }
- | LeftHandSideExpression "--" { $$ = new(driver.pool_) CYPostDecrement($1); }
- ;
-@end
/* }}} */
/* 11.4 Unary Operators {{{ */
UnaryExpression_
: PostfixExpressionNoRE { $$ = $1; }
| UnaryExpression_ { $$ = $1; }
;
-
-@begin ObjectiveC
-UnaryExpressionNoWC
- : PostfixExpressionNoWC { $$ = $1; }
- | LexSetRegExp UnaryExpression_ { $$ = $2; }
- ;
-@end
/* }}} */
/* 11.5 Multiplicative Operators {{{ */
MultiplicativeExpression
| MultiplicativeExpressionNoBF "/" UnaryExpression { $$ = new(driver.pool_) CYDivide($1, $3); }
| MultiplicativeExpressionNoBF "%" UnaryExpression { $$ = new(driver.pool_) CYModulus($1, $3); }
;
-
-@begin ObjectiveC
-MultiplicativeExpressionNoWC
- : UnaryExpressionNoWC { $$ = $1; }
- | MultiplicativeExpression "*" UnaryExpression { $$ = new(driver.pool_) CYMultiply($1, $3); }
- | MultiplicativeExpression "/" UnaryExpression { $$ = new(driver.pool_) CYDivide($1, $3); }
- | MultiplicativeExpression "%" UnaryExpression { $$ = new(driver.pool_) CYModulus($1, $3); }
- ;
-@end
/* }}} */
/* 11.6 Additive Operators {{{ */
AdditiveExpression
| AdditiveExpressionNoBF "+" MultiplicativeExpression { $$ = new(driver.pool_) CYAdd($1, $3); }
| AdditiveExpressionNoBF "-" MultiplicativeExpression { $$ = new(driver.pool_) CYSubtract($1, $3); }
;
-
-@begin ObjectiveC
-AdditiveExpressionNoWC
- : MultiplicativeExpressionNoWC { $$ = $1; }
- | AdditiveExpression "+" MultiplicativeExpression { $$ = new(driver.pool_) CYAdd($1, $3); }
- | AdditiveExpression "-" MultiplicativeExpression { $$ = new(driver.pool_) CYSubtract($1, $3); }
- ;
-@end
/* }}} */
/* 11.7 Bitwise Shift Operators {{{ */
ShiftExpression
| ShiftExpressionNoBF ">>" AdditiveExpression { $$ = new(driver.pool_) CYShiftRightSigned($1, $3); }
| ShiftExpressionNoBF ">>>" AdditiveExpression { $$ = new(driver.pool_) CYShiftRightUnsigned($1, $3); }
;
-
-@begin ObjectiveC
-ShiftExpressionNoWC
- : AdditiveExpressionNoWC { $$ = $1; }
- | ShiftExpression "<<" AdditiveExpression { $$ = new(driver.pool_) CYShiftLeft($1, $3); }
- | ShiftExpression ">>" AdditiveExpression { $$ = new(driver.pool_) CYShiftRightSigned($1, $3); }
- | ShiftExpression ">>>" AdditiveExpression { $$ = new(driver.pool_) CYShiftRightUnsigned($1, $3); }
- ;
-@end
/* }}} */
/* 11.8 Relational Operators {{{ */
RelationalExpressionNoIn_
: ShiftExpressionNoBF { $$ = $1; }
| RelationalExpressionNoBF RelationalExpression_ { $2->SetLeft($1); $$ = $2; }
;
-
-@begin ObjectiveC
-RelationalExpressionNoWC
- : ShiftExpressionNoWC { $$ = $1; }
- | RelationalExpression RelationalExpression_ { $2->SetLeft($1); $$ = $2; }
- ;
-@end
/* }}} */
/* 11.9 Equality Operators {{{ */
EqualityExpression
| EqualityExpressionNoBF "===" RelationalExpression { $$ = new(driver.pool_) CYIdentical($1, $3); }
| EqualityExpressionNoBF "!==" RelationalExpression { $$ = new(driver.pool_) CYNotIdentical($1, $3); }
;
-
-@begin ObjectiveC
-EqualityExpressionNoWC
- : RelationalExpressionNoWC { $$ = $1; }
- | EqualityExpression "==" RelationalExpression { $$ = new(driver.pool_) CYEqual($1, $3); }
- | EqualityExpression "!=" RelationalExpression { $$ = new(driver.pool_) CYNotEqual($1, $3); }
- | EqualityExpression "===" RelationalExpression { $$ = new(driver.pool_) CYIdentical($1, $3); }
- | EqualityExpression "!==" RelationalExpression { $$ = new(driver.pool_) CYNotIdentical($1, $3); }
- ;
-@end
/* }}} */
/* 11.10 Binary Bitwise Operators {{{ */
BitwiseANDExpression
| BitwiseANDExpressionNoBF "&" EqualityExpression { $$ = new(driver.pool_) CYBitwiseAnd($1, $3); }
;
-@begin ObjectiveC
-BitwiseANDExpressionNoWC
- : EqualityExpressionNoWC { $$ = $1; }
- | BitwiseANDExpression "&" EqualityExpression { $$ = new(driver.pool_) CYBitwiseAnd($1, $3); }
- ;
-@end
-
BitwiseXORExpression
: BitwiseANDExpression { $$ = $1; }
| BitwiseXORExpression "^" BitwiseANDExpression { $$ = new(driver.pool_) CYBitwiseXOr($1, $3); }
| BitwiseXORExpressionNoBF "^" BitwiseANDExpression { $$ = new(driver.pool_) CYBitwiseXOr($1, $3); }
;
-@begin ObjectiveC
-BitwiseXORExpressionNoWC
- : BitwiseANDExpressionNoWC { $$ = $1; }
- | BitwiseXORExpression "^" BitwiseANDExpression { $$ = new(driver.pool_) CYBitwiseXOr($1, $3); }
- ;
-@end
-
BitwiseORExpression
: BitwiseXORExpression { $$ = $1; }
| BitwiseORExpression "|" BitwiseXORExpression { $$ = new(driver.pool_) CYBitwiseOr($1, $3); }
: BitwiseXORExpressionNoBF { $$ = $1; }
| BitwiseORExpressionNoBF "|" BitwiseXORExpression { $$ = new(driver.pool_) CYBitwiseOr($1, $3); }
;
-
-@begin ObjectiveC
-BitwiseORExpressionNoWC
- : BitwiseXORExpressionNoWC { $$ = $1; }
- | BitwiseORExpression "|" BitwiseXORExpression { $$ = new(driver.pool_) CYBitwiseOr($1, $3); }
- ;
-@end
/* }}} */
/* 11.11 Binary Logical Operators {{{ */
LogicalANDExpression
| LogicalANDExpressionNoBF "&&" BitwiseORExpression { $$ = new(driver.pool_) CYLogicalAnd($1, $3); }
;
-@begin ObjectiveC
-LogicalANDExpressionNoWC
- : BitwiseORExpressionNoWC { $$ = $1; }
- | LogicalANDExpression "&&" BitwiseORExpression { $$ = new(driver.pool_) CYLogicalAnd($1, $3); }
- ;
-@end
-
LogicalORExpression
: LogicalANDExpression { $$ = $1; }
| LogicalORExpression "||" LogicalANDExpression { $$ = new(driver.pool_) CYLogicalOr($1, $3); }
: LogicalANDExpressionNoBF { $$ = $1; }
| LogicalORExpressionNoBF "||" LogicalANDExpression { $$ = new(driver.pool_) CYLogicalOr($1, $3); }
;
-
-@begin ObjectiveC
-LogicalORExpressionNoWC
- : LogicalANDExpressionNoWC { $$ = $1; }
- | LogicalORExpression "||" LogicalANDExpression { $$ = new(driver.pool_) CYLogicalOr($1, $3); }
- ;
-@end
/* }}} */
/* 11.12 Conditional Operator ( ? : ) {{{ */
ConditionalExpression
: LogicalORExpressionNoBF { $$ = $1; }
| LogicalORExpressionNoBF "?" AssignmentExpression ":" AssignmentExpression { $$ = new(driver.pool_) CYCondition($1, $3, $5); }
;
-
-@begin ObjectiveC
-ConditionalExpressionNoWC
- : LogicalORExpressionNoWC { $$ = $1; }
- | LogicalORExpression "?" AssignmentExpression ":" AssignmentExpression { $$ = new(driver.pool_) CYCondition($1, $3, $5); }
- ;
-@end
/* }}} */
/* 11.13 Assignment Operators {{{ */
AssignmentExpression_
| UnaryAssigneeExpression { $$ = $1; }
;
-@begin ObjectiveC
-AssigneeExpressionNoWC
- : LeftHandSideExpressionNoWC { $$ = $1; }
- | LexSetRegExp UnaryAssigneeExpression { $$ = $2; }
- ;
-@end
-
AssignmentExpression
: ConditionalExpression { $$ = $1; }
| AssigneeExpression AssignmentExpression_ { $2->SetLeft($1); $$ = $2; }
: ConditionalExpressionNoBF { $$ = $1; }
| AssigneeExpressionNoBF AssignmentExpression_ { $2->SetLeft($1); $$ = $2; }
;
-
-@begin ObjectiveC
-AssignmentExpressionNoWC
- : ConditionalExpressionNoWC { $$ = $1; }
- | AssigneeExpression AssignmentExpression_ { $2->SetLeft($1); $$ = $2; }
- ;
-@end
/* }}} */
/* 11.14 Comma Operator {{{ */
Expression_
;
MessageExpression
- : "[" AssignmentExpressionNoWC SelectorList "]" { $$ = new(driver.pool_) CYSendDirect($2, $3); }
+ : "[" AssignmentExpression SelectorList "]" { $$ = new(driver.pool_) CYSendDirect($2, $3); }
| "[" LexSetRegExp "super" SelectorList "]" { $$ = new(driver.pool_) CYSendSuper($4); }
;
;
/* }}} */
/* 11.1 Primary Expressions {{{ */
-PrimaryExpressionWC
+PrimaryExpressionNo
: PropertyIdentifier { $$ = new(driver.pool_) CYPropertyVariable($1); }
| XMLInitialiser { $$ = $1; }
| XMLListInitialiser { $$ = $1; }