]> git.saurik.com Git - cycript.git/blobdiff - Cycript.y.in
Got true JS booleans working in GNUstep.
[cycript.git] / Cycript.y.in
index a77265f3538f5b0e7ab46560dc7f5469625bfa6f..dde7908ede31790ad216c8a0e0816258bd62d289 100644 (file)
@@ -51,7 +51,7 @@
 @end
 
 @begin E4X
-#include "E4X.hpp"
+#include "E4X/Syntax.hpp"
 @end
 
 typedef struct {
@@ -103,6 +103,8 @@ typedef struct {
 
 @begin E4X
         CYAttribute *attribute_;
+        CYPropertyIdentifier *propertyIdentifier_;
+        CYSelector *selector_;
 @end
     };
 } YYSTYPE;
@@ -151,11 +153,14 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner);
 %token SlashRight "/>"
 %token LeftSlash "</"
 
-%token At "@"
 %token ColonColon "::"
 %token PeriodPeriod ".."
 @end
 
+@begin E4X ObjectiveC
+%token At "@"
+@end
+
 %token Ampersand "&"
 %token AmpersandAmpersand "&&"
 %token AmpersandEqual "&="
@@ -302,6 +307,27 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner);
 %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
@@ -309,7 +335,6 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner);
 
 %type <expression_> AdditiveExpression
 %type <expression_> AdditiveExpressionNoBF
-%type <expression_> AdditiveExpressionNoWC
 %type <argument_> ArgumentList
 %type <argument_> ArgumentList_
 %type <argument_> ArgumentListOpt
@@ -317,30 +342,27 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner);
 %type <literal_> ArrayLiteral
 %type <expression_> AssigneeExpression
 %type <expression_> AssigneeExpressionNoBF
-%type <expression_> AssigneeExpressionNoWC
+%type <expression_> AssigneeExpressionNoRE
 %type <expression_> AssignmentExpression
 %type <assignment_> AssignmentExpression_
 %type <expression_> AssignmentExpressionNoBF
 %type <expression_> AssignmentExpressionNoIn
-%type <expression_> AssignmentExpressionNoWC
 %type <expression_> BitwiseANDExpression
 %type <expression_> BitwiseANDExpressionNoBF
 %type <expression_> BitwiseANDExpressionNoIn
-%type <expression_> BitwiseANDExpressionNoWC
 %type <statement_> Block
 %type <statement_> Block_
 %type <boolean_> BooleanLiteral
 %type <expression_> BitwiseORExpression
 %type <expression_> BitwiseORExpressionNoBF
 %type <expression_> BitwiseORExpressionNoIn
-%type <expression_> BitwiseORExpressionNoWC
 %type <expression_> BitwiseXORExpression
 %type <expression_> BitwiseXORExpressionNoBF
 %type <expression_> BitwiseXORExpressionNoIn
-%type <expression_> BitwiseXORExpressionNoWC
 %type <statement_> BreakStatement
 %type <expression_> CallExpression
 %type <expression_> CallExpressionNoBF
+%type <expression_> CallExpressionNoRE
 %type <clause_> CaseBlock
 %type <clause_> CaseClause
 %type <clause_> CaseClausesOpt
@@ -350,7 +372,6 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner);
 %type <expression_> ConditionalExpression
 %type <expression_> ConditionalExpressionNoBF
 %type <expression_> ConditionalExpressionNoIn
-%type <expression_> ConditionalExpressionNoWC
 %type <statement_> ContinueStatement
 %type <clause_> DefaultClause
 %type <statement_> DoWhileStatement
@@ -363,7 +384,6 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner);
 %type <expression_> EqualityExpression
 %type <expression_> EqualityExpressionNoBF
 %type <expression_> EqualityExpressionNoIn
-%type <expression_> EqualityExpressionNoWC
 %type <expression_> Expression
 %type <expression_> ExpressionOpt
 %type <compound_> Expression_
@@ -383,7 +403,6 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner);
 %type <statement_> FunctionBody
 %type <statement_> FunctionDeclaration
 %type <expression_> FunctionExpression
-%type <expression_> FunctionExpression_
 %type <identifier_> Identifier
 %type <identifier_> IdentifierOpt
 %type <comprehension_> IfComprehension
@@ -396,7 +415,7 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner);
 %type <statement_> LabelledStatement
 %type <expression_> LeftHandSideExpression
 %type <expression_> LeftHandSideExpressionNoBF
-%type <expression_> LeftHandSideExpressionNoWC
+%type <expression_> LeftHandSideExpressionNoRE
 //%type <statement_> LetStatement
 %type <literal_> Literal
 %type <literal_> LiteralNoRE
@@ -404,31 +423,29 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner);
 %type <expression_> LogicalANDExpression
 %type <expression_> LogicalANDExpressionNoBF
 %type <expression_> LogicalANDExpressionNoIn
-%type <expression_> LogicalANDExpressionNoWC
 %type <expression_> LogicalORExpression
 %type <expression_> LogicalORExpressionNoBF
 %type <expression_> LogicalORExpressionNoIn
-%type <expression_> LogicalORExpressionNoWC
 %type <member_> MemberAccess
 %type <expression_> MemberExpression
 %type <expression_> MemberExpression_
 %type <expression_> MemberExpressionNoBF
-%type <expression_> MemberExpressionNoWC
+%type <expression_> MemberExpressionNoRE
 %type <expression_> MultiplicativeExpression
 %type <expression_> MultiplicativeExpressionNoBF
-%type <expression_> MultiplicativeExpressionNoWC
 %type <expression_> NewExpression
 %type <expression_> NewExpression_
 %type <expression_> NewExpressionNoBF
-%type <expression_> NewExpressionNoWC
+%type <expression_> NewExpressionNoRE
 %type <null_> NullLiteral
 %type <literal_> ObjectLiteral
 %type <expression_> PostfixExpression
 %type <expression_> PostfixExpressionNoBF
-%type <expression_> PostfixExpressionNoWC
+%type <expression_> PostfixExpressionNoRE
 %type <expression_> PrimaryExpression
 %type <expression_> PrimaryExpressionNo
 %type <expression_> PrimaryExpressionNoBF
+%type <expression_> PrimaryExpressionNoRE
 %type <expression_> PrimaryExpressionNoWC
 %type <expression_> PrimaryExpressionNoWC_
 @begin E4X
@@ -437,6 +454,7 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner);
 %type <expression_> PrimaryExpressionBF
 %type <statement_> Program
 %type <propertyName_> PropertyName
+%type <propertyName_> PropertyName_
 %type <property_> PropertyNameAndValueList
 %type <property_> PropertyNameAndValueList_
 %type <property_> PropertyNameAndValueListOpt
@@ -444,12 +462,10 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner);
 %type <infix_> RelationalExpression_
 %type <expression_> RelationalExpressionNoBF
 %type <expression_> RelationalExpressionNoIn
-%type <expression_> RelationalExpressionNoWC
 %type <infix_> RelationalExpressionNoIn_
 %type <statement_> ReturnStatement
 %type <expression_> ShiftExpression
 %type <expression_> ShiftExpressionNoBF
-%type <expression_> ShiftExpressionNoWC
 %type <statement_> SourceElement
 %type <statement_> SourceElement_
 %type <statement_> SourceElements
@@ -464,7 +480,7 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner);
 %type <expression_> UnaryExpression
 %type <expression_> UnaryExpression_
 %type <expression_> UnaryExpressionNoBF
-%type <expression_> UnaryExpressionNoWC
+%type <expression_> UnaryExpressionNoRE
 %type <declaration_> VariableDeclaration
 %type <declaration_> VariableDeclarationNoIn
 %type <declarations_> VariableDeclarationList
@@ -504,9 +520,9 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner);
 @end
 
 @begin E4X
-%type <identifier_> PropertyIdentifier_
-%type <identifier_> PropertySelector
-%type <identifier_> PropertySelector_
+%type <propertyIdentifier_> PropertyIdentifier_
+%type <selector_> PropertySelector
+%type <selector_> PropertySelector_
 %type <identifier_> QualifiedIdentifier
 %type <identifier_> QualifiedIdentifier_
 %type <identifier_> WildcardIdentifier
@@ -518,13 +534,22 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner);
 %type <identifier_> XMLPI
 
 %type <attribute_> AttributeIdentifier
-%type <statement_> DefaultXMLNamespaceStatement
+/* XXX: %type <statement_> DefaultXMLNamespaceStatement */
 %type <expression_> PropertyIdentifier
 %type <expression_> XMLListInitialiser
 %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"
+%nonassoc "else"
+
+%nonassoc "++" "--"
+%nonassoc "(" "["
+
 %left "*" "/" "%"
 %left "+" "-"
 %left "<<" ">>" ">>>"
@@ -537,10 +562,6 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner);
 %left "||"
 
 %right "=" "*=" "/=" "%=" "+=" "-=" "<<=" ">>=" ">>>=" "&=" "^=" "|="
-*/
-
-%nonassoc "if"
-%nonassoc "else"
 
 %start Program
 
@@ -672,6 +693,7 @@ LiteralNoRE
     | BooleanLiteral { $$ = $1; }
     | NumericLiteral { $$ = $1; }
     | StringLiteral { $$ = $1; }
+    | "@" StringLiteral { $$ = $2; }
     ;
 
 LiteralRE
@@ -707,6 +729,13 @@ PrimaryExpressionNoBF
 @end
     ;
 
+PrimaryExpressionNoRE
+    : PrimaryExpressionNoWC_ { $$ = $1; }
+@begin E4X
+    | PrimaryExpressionWC { $$ = $1; }
+@end
+    ;
+
 PrimaryExpressionNoWC_
     : PrimaryExpressionBF { $$ = $1; }
     | PrimaryExpressionNo { $$ = $1; }
@@ -771,11 +800,15 @@ PropertyNameAndValueList
     : PropertyName ":" AssignmentExpression PropertyNameAndValueList_ { $$ = new(driver.pool_) CYProperty($1, $3, $4); }
     ;
 
-PropertyName
+PropertyName_
     : Identifier { $$ = $1; }
     | StringLiteral { $$ = $1; }
     | NumericLiteral { $$ = $1; }
     ;
+
+PropertyName
+    : LexSetRegExp PropertyName_ { $$ = $2; }
+    ;
 /* }}} */
 
 /* 11.2 Left-Hand-Side Expressions {{{ */
@@ -790,7 +823,7 @@ MemberAccess
 
 MemberExpression
     : PrimaryExpression { $$ = $1; }
-    | FunctionExpression { $$ = $1; }
+    | LexSetRegExp FunctionExpression { $$ = $2; }
     | MemberExpression MemberAccess { $2->SetLeft($1); $$ = $2; }
     | LexSetRegExp MemberExpression_ { $$ = $2; }
     ;
@@ -801,12 +834,21 @@ MemberExpressionNoBF
     | MemberExpression_ { $$ = $1; }
     ;
 
-MemberExpressionNoWC
-    : PrimaryExpressionNoWC { $$ = $1; }
+MemberExpressionNoRE
+    : PrimaryExpressionNoRE { $$ = $1; }
     | FunctionExpression { $$ = $1; }
+    | MemberExpressionNoRE MemberAccess { $2->SetLeft($1); $$ = $2; }
+    | 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); }
@@ -822,10 +864,17 @@ NewExpressionNoBF
     | NewExpression_ { $$ = $1; }
     ;
 
+NewExpressionNoRE
+    : MemberExpressionNoRE { $$ = $1; }
+    | NewExpression_ { $$ = $1; }
+    ;
+
+@begin ObjectiveC
 NewExpressionNoWC
     : MemberExpressionNoWC { $$ = $1; }
     | LexSetRegExp NewExpression_ { $$ = $2; }
     ;
+@end
 
 CallExpression
     : PrimaryExpressionNoWC Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
@@ -839,6 +888,12 @@ CallExpressionNoBF
     | CallExpressionNoBF MemberAccess { $2->SetLeft($1); $$ = $2; }
     ;
 
+CallExpressionNoRE
+    : PrimaryExpressionNoRE Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
+    | CallExpressionNoRE Arguments { $$ = new(driver.pool_) CYCall($1, $2); }
+    | CallExpressionNoRE MemberAccess { $2->SetLeft($1); $$ = $2; }
+    ;
+
 ArgumentList_
     : "," ArgumentList { $$ = $2; }
     | { $$ = NULL; }
@@ -867,10 +922,17 @@ LeftHandSideExpressionNoBF
     | CallExpressionNoBF { $$ = $1; }
     ;
 
+LeftHandSideExpressionNoRE
+    : NewExpressionNoRE { $$ = $1; }
+    | CallExpressionNoRE { $$ = $1; }
+    ;
+
+@begin ObjectiveC
 LeftHandSideExpressionNoWC
     : NewExpressionNoWC { $$ = $1; }
     | CallExpression { $$ = $1; }
     ;
+@end
 /* }}} */
 /* 11.3 Postfix Expressions {{{ */
 PostfixExpression
@@ -885,11 +947,19 @@ PostfixExpressionNoBF
     | LeftHandSideExpressionNoBF "--" { $$ = new(driver.pool_) CYPostDecrement($1); }
     ;
 
+PostfixExpressionNoRE
+    : AssigneeExpressionNoRE { $$ = $1; }
+    | 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_
@@ -916,10 +986,17 @@ UnaryExpressionNoBF
     | UnaryExpression_ { $$ = $1; }
     ;
 
+UnaryExpressionNoRE
+    : PostfixExpressionNoRE { $$ = $1; }
+    | UnaryExpression_ { $$ = $1; }
+    ;
+
+@begin ObjectiveC
 UnaryExpressionNoWC
     : PostfixExpressionNoWC { $$ = $1; }
     | LexSetRegExp UnaryExpression_ { $$ = $2; }
     ;
+@end
 /* }}} */
 /* 11.5 Multiplicative Operators {{{ */
 MultiplicativeExpression
@@ -936,12 +1013,14 @@ MultiplicativeExpressionNoBF
     | 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
@@ -956,11 +1035,13 @@ AdditiveExpressionNoBF
     | AdditiveExpressionNoBF "-" MultiplicativeExpression { $$ = new(driver.pool_) CYSubtract($1, $3); }
     ;
 
+@begin ObjectiveC
 AdditiveExpressionNoWC
-    : MultiplicativeExpressionNoWC{ $$ = $1; }
+    : 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
@@ -977,12 +1058,14 @@ ShiftExpressionNoBF
     | 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_
@@ -1013,10 +1096,12 @@ RelationalExpressionNoBF
     | RelationalExpressionNoBF RelationalExpression_ { $2->SetLeft($1); $$ = $2; }
     ;
 
+@begin ObjectiveC
 RelationalExpressionNoWC
     : ShiftExpressionNoWC { $$ = $1; }
     | RelationalExpression RelationalExpression_ { $2->SetLeft($1); $$ = $2; }
     ;
+@end
 /* }}} */
 /* 11.9 Equality Operators {{{ */
 EqualityExpression
@@ -1043,6 +1128,7 @@ EqualityExpressionNoBF
     | EqualityExpressionNoBF "!==" RelationalExpression { $$ = new(driver.pool_) CYNotIdentical($1, $3); }
     ;
 
+@begin ObjectiveC
 EqualityExpressionNoWC
     : RelationalExpressionNoWC { $$ = $1; }
     | EqualityExpression "==" RelationalExpression { $$ = new(driver.pool_) CYEqual($1, $3); }
@@ -1050,6 +1136,7 @@ EqualityExpressionNoWC
     | EqualityExpression "===" RelationalExpression { $$ = new(driver.pool_) CYIdentical($1, $3); }
     | EqualityExpression "!==" RelationalExpression { $$ = new(driver.pool_) CYNotIdentical($1, $3); }
     ;
+@end
 /* }}} */
 /* 11.10 Binary Bitwise Operators {{{ */
 BitwiseANDExpression
@@ -1067,10 +1154,12 @@ BitwiseANDExpressionNoBF
     | 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; }
@@ -1087,10 +1176,12 @@ BitwiseXORExpressionNoBF
     | 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; }
@@ -1107,10 +1198,12 @@ BitwiseORExpressionNoBF
     | 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
@@ -1128,10 +1221,12 @@ LogicalANDExpressionNoBF
     | 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; }
@@ -1148,10 +1243,12 @@ LogicalORExpressionNoBF
     | 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
@@ -1169,10 +1266,12 @@ ConditionalExpressionNoBF
     | 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_
@@ -1200,10 +1299,17 @@ AssigneeExpressionNoBF
     | UnaryAssigneeExpression { $$ = $1; }
     ;
 
+AssigneeExpressionNoRE
+    : LeftHandSideExpressionNoRE { $$ = $1; }
+    | UnaryAssigneeExpression { $$ = $1; }
+    ;
+
+@begin ObjectiveC
 AssigneeExpressionNoWC
     : LeftHandSideExpressionNoWC { $$ = $1; }
     | LexSetRegExp UnaryAssigneeExpression { $$ = $2; }
     ;
+@end
 
 AssignmentExpression
     : ConditionalExpression { $$ = $1; }
@@ -1231,10 +1337,12 @@ AssignmentExpressionNoBF
     | AssigneeExpressionNoBF AssignmentExpression_ { $2->SetLeft($1); $$ = $2; }
     ;
 
+@begin ObjectiveC
 AssignmentExpressionNoWC
     : ConditionalExpressionNoWC { $$ = $1; }
     | AssigneeExpression AssignmentExpression_ { $2->SetLeft($1); $$ = $2; }
     ;
+@end
 /* }}} */
 /* 11.14 Comma Operator {{{ */
 Expression_
@@ -1494,12 +1602,8 @@ FunctionDeclaration
     : "function" Identifier "(" FormalParameterList ")" "{" FunctionBody "}" { $$ = new(driver.pool_) CYFunctionStatement($2, $4, $7); }
     ;
 
-FunctionExpression_
-    : "function" IdentifierOpt "(" FormalParameterList ")" "{" FunctionBody "}" { $$ = new(driver.pool_) CYFunctionExpression($2, $4, $7); }
-    ;
-
 FunctionExpression
-    : LexSetRegExp FunctionExpression_ { $$ = $2; }
+    : "function" IdentifierOpt "(" FormalParameterList ")" "{" FunctionBody "}" { $$ = new(driver.pool_) CYFunctionExpression($2, $4, $7); }
     ;
 
 FormalParameterList_
@@ -1665,7 +1769,7 @@ PrimaryExpressionNo
 @begin C
 /* Cycript (C): Pointer Indirection/Addressing {{{ */
 UnaryAssigneeExpression
-    : "*" UnaryExpression { $$ = new(driver.pool_) CYIndirect($2); }
+    : "*" UnaryExpressionNoRE { $$ = new(driver.pool_) CYIndirect($2); }
     ;
 
 UnaryExpression_
@@ -1726,7 +1830,7 @@ XMLMarkup
 /* }}} */
 /* 11.1 Primary Expressions {{{ */
 PrimaryExpressionWC
-    : PropertyIdentifier { $$ = $1; }
+    : PropertyIdentifier { $$ = new(driver.pool_) CYPropertyVariable($1); }
     | XMLInitialiser { $$ = $1; }
     | XMLListInitialiser { $$ = $1; }
     ;
@@ -1743,23 +1847,23 @@ AttributeIdentifier
     ;
 
 PropertySelector_
-    : PropertySelector
-    | "[" Expression "]"
+    : PropertySelector { $$ = $1; }
+    | "[" Expression "]" { $$ = new(driver.pool_) CYSelector($2); }
     ;
 
 PropertySelector
-    : Identifier { $$ = $1; }
+    : Identifier { $$ = new(driver.pool_) CYSelector($1); }
     | WildcardIdentifier { $$ = $1; }
     ;
 /* }}} */
 /* 11.1.2 Qualified Identifiers {{{ */
 QualifiedIdentifier_
-    : PropertySelector_ { $$ = $1; }
+    : PropertySelector_ { $$ = new(driver.pool_) CYQualified(NULL, $1); }
     | QualifiedIdentifier { $$ = $1; }
     ;
 
 QualifiedIdentifier
-    : PropertySelector "::" PropertySelector_ { $$ = new(driver.pool_) CYQName($1, $3); }
+    : PropertySelector "::" PropertySelector_ { $$ = new(driver.pool_) CYQualified($1, $3); }
     ;
 /* }}} */
 /* 11.1.3 Wildcard Identifiers {{{ */
@@ -1840,13 +1944,13 @@ MemberAccess
     ;
 /* }}} */
 /* 12.1 The default xml namespace Statement {{{ */
-DefaultXMLNamespaceStatement
+/* XXX: DefaultXMLNamespaceStatement
     : "default" "xml" "namespace" "=" Expression Terminator { $$ = new(driver.pool_) CYDefaultXMLNamespace($5); }
     ;
 
 Statement_
     : DefaultXMLNamespaceStatement { $$ = $1; }
-    ;
+    ; */
 /* }}} */
 @end