Skip to content

Commit

Permalink
#2196 #2178 Extend the yield operand rule with expressions involving …
Browse files Browse the repository at this point in the history
…yield operands

This allows the body of expressions to use yield operands, not just
single operands.
  • Loading branch information
homedirectory committed Mar 4, 2024
1 parent dd0f493 commit b2d8e9a
Show file tree
Hide file tree
Showing 5 changed files with 170 additions and 126 deletions.
1 change: 1 addition & 0 deletions platform-eql-grammar/src/main/antlr4/EQL.g4
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ aliasedYield :

yieldOperand :
singleOperand # YieldOperand_SingleOperand
| BEGINEXPR first=yieldOperand (operators+=arithmeticalOperator rest+=yieldOperand)* ENDEXPR # YieldOperandExpr
| COUNTALL # YieldOperand_CountAll
| funcName=yieldOperandFunctionName argument=singleOperand # YieldOperandFunction
;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ public final class CanonicalEqlGrammar {

derive(YieldOperand).
to(SingleOperand).
or(beginExpr, YieldOperand, repeat(ArithmeticalOperator, YieldOperand), endExpr).
or(countAll).
or(YieldOperandFunction).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,13 @@ public class EQLBaseVisitor<T> extends AbstractParseTreeVisitor<T> implements EQ
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitYieldOperand_SingleOperand(EQLParser.YieldOperand_SingleOperandContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitYieldOperandExpr(EQLParser.YieldOperandExprContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
Expand Down

0 comments on commit b2d8e9a

Please sign in to comment.