RPA Toolkit
work on conditional expressions
authorMartin Stoilov <martin@rpasearch.com>
Mon, 17 Jan 2011 06:37:49 +0000 (22:37 -0800)
committerMartin Stoilov <martin@rpasearch.com>
Mon, 17 Jan 2011 06:37:49 +0000 (22:37 -0800)
tests/ecma262.rpa
tests/rpagen-test.c

index d1c6c57..3677984 100644 (file)
@@ -296,10 +296,14 @@ IterationStatement                                        ::= <:IterationWhileOp:> |
                                                                        <:IterationDo:>
 
 # 11.12 Conditional Operator ( ? : )
-#ConditionalExpression         ::= <:LogicalORExpression:> ( <S>? '?' <S>? <:AssignmentExpression:> <S>? ':' <S>? <:AssignmentExpression:> )?
-#ConditionalExpressionNoIn::=<:LogicalORExpressionNoIn:> ( <S>? '?' <S>? <:AssignmentExpression:> <S>? ':' <S>? <:AssignmentExpressionNoIn:> )?
+#ConditionalExpression                                 ::= <:LogicalORExpression:> ( <S>? '?' <S>? <:AssignmentExpression:> <S>? ':' <S>? <:AssignmentExpression:> )?
+#ConditionalExpressionNoIn                     ::=<:LogicalORExpressionNoIn:> ( <S>? '?' <S>? <:AssignmentExpression:> <S>? ':' <S>? <:AssignmentExpressionNoIn:> )?
 #
-ConditionalExpression  ::= <:LogicalORExpression:>
+
+AssignmentExpressionTrueOp                     ::= <:AssignmentExpression:>
+AssignmentExpressionFalseOp                    ::= <:AssignmentExpression:>
+ConditionalExpressionActionOp          ::= <S>? '?' <S>? <:AssignmentExpressionTrueOp:> <S>? ':' <S>? <:AssignmentExpressionFalseOp:> 
+ConditionalExpression                          ::= <:LogicalORExpression:> <:ConditionalExpressionActionOp:>?
 
 # 11.13 Assignment Operators
 LeftHandSideExpressionPush             ::= <:LeftHandSideExpression:>
index c616fa9..36ef82a 100644 (file)
@@ -1613,7 +1613,6 @@ void rpagen_load_rules(rpa_dbex_handle dbex, rvm_compiler_t *co)
        rpa_dbex_add_callback_exact(dbex, "NewArrayNoSize", RPA_REASON_MATCHED, codegen_newarraynosize_callback, co);
        rpa_dbex_add_callback_exact(dbex, "compile_error", RPA_REASON_MATCHED, codegen_compile_error_callback, co);
 
-//     rpa_dbex_add_callback_exact(dbex, "ValCallExpression", RPA_REASON_ALL, codegen_costate_callback, co);
        rpa_dbex_add_callback_exact(dbex, "ArgumentsOp", RPA_REASON_ALL, codegen_costate_callback, co);
        rpa_dbex_add_callback_exact(dbex, "BracketExpressionOp", RPA_REASON_ALL, codegen_costate_callback, co);