6491
6501
JSONAppendExpr :
6492
APPEND JSON ExprSingle TO ExprSingle
6502
APPEND JSON LBRACK Expr RBRACK TO ExprSingle
6494
$$ = new JSONArrayAppendExpr(LOC(@$), $3, $5);
6504
$$ = new JSONArrayAppendExpr(LOC(@$), $4, $7);
6498
6508
JSONDeleteExpr :
6499
_DELETE JSON PrimaryExpr LPAR ExprSingle RPAR
6509
_DELETE JSON FilterExpr
6501
$$ = new JSONDeleteExpr(LOC(@$), $3, $5);
6511
rchandle<DynamicFunctionInvocation> lDynamicFunctionInvocation =
6512
dynamic_cast<DynamicFunctionInvocation*>($3);
6514
if (lDynamicFunctionInvocation == NULL)
6516
error(@3, "An object invocation is expected. A filter was found instead.");
6520
rchandle<exprnode> lPrimaryExpr =
6521
lDynamicFunctionInvocation->getPrimaryExpr().release();
6523
rchandle<ArgList> lArgList =
6524
lDynamicFunctionInvocation->getArgList().release();
6526
if (lArgList->size() != 1)
6528
error(@3, "An object invocation with exactly one argument is expected. Zero or more than one argument were found.");
6532
rchandle<exprnode> lKey = (*lArgList)[0].release();
6533
$$ = new JSONDeleteExpr(LOC(@$), lPrimaryExpr.release(), lKey.release());
6505
6537
JSONRenameExpr :
6506
RENAME JSON PrimaryExpr LPAR ExprSingle RPAR AS ExprSingle
6538
RENAME JSON FilterExpr AS ExprSingle
6508
$$ = new JSONRenameExpr(LOC(@$), $3, $5, $8);
6540
rchandle<DynamicFunctionInvocation> lDynamicFunctionInvocation =
6541
dynamic_cast<DynamicFunctionInvocation*>($3);
6543
if(lDynamicFunctionInvocation == NULL)
6545
error(@3, "An object invocation is expected. A filter was found instead.");
6549
rchandle<exprnode> lPrimaryExpr =
6550
lDynamicFunctionInvocation->getPrimaryExpr().release();
6552
rchandle<ArgList> lArgList =
6553
lDynamicFunctionInvocation->getArgList().release();
6555
if (lArgList->size() != 1)
6557
error(@3, "An object invocation with exactly one argument is expected. Zero or more than one argument were found.");
6561
rchandle<exprnode> lKey = (*lArgList)[0].release();
6562
$$ = new JSONRenameExpr(LOC(@$), lPrimaryExpr.release(), lKey.release(), $5);
6512
6566
JSONReplaceExpr :
6513
REPLACE JSON VALUE OF PrimaryExpr LPAR ExprSingle RPAR WITH ExprSingle
6567
REPLACE JSON VALUE OF FilterExpr WITH ExprSingle
6515
$$ = new JSONReplaceExpr(LOC(@$), $5, $7, $10);
6569
rchandle<DynamicFunctionInvocation> lDynamicFunctionInvocation =
6570
dynamic_cast<DynamicFunctionInvocation*>($5);
6572
if(lDynamicFunctionInvocation == NULL)
6574
error(@3, "An object invocation is expected. A filter was found instead.");
6578
rchandle<exprnode> lPrimaryExpr =
6579
lDynamicFunctionInvocation->getPrimaryExpr().release();
6581
rchandle<ArgList> lArgList =
6582
lDynamicFunctionInvocation->getArgList().release();
6584
if (lArgList->size() != 1)
6586
error(@3, "An object invocation with exactly one argument is expected. Zero or more than one argument were found.");
6590
rchandle<exprnode> lKey = (*lArgList)[0].release();
6591
$$ = new JSONReplaceExpr(LOC(@$), lPrimaryExpr.release(), lKey.release(), $7);