File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,10 +41,14 @@ options { tokenVocab=EfxLexer;}
4141 * A single-expression is typically used to evaluate a condition.
4242 * If you do not need to process EFX templates, then you can create a full EFX parser that parses these expressions.
4343 * A single-expression contains two parts: a context-declaration and an expression-block.
44- * Currently we only allow a field-identifier, a node-identifier or an identifier in the context-declaration.
45- * We may also add support for adding one or more predicates to the context-declaration in the future.
44+ *
45+ * EFX-1 syntax: {context, params} ${expression}
46+ * EFX-2 syntax: WITH context, params COMPUTE expression
4647 */
47- singleExpression : StartExpressionBlock context=(FieldId | NodeId | Identifier) (Comma parameterList)? EndBlock expressionBlock EOF ;
48+ singleExpression
49+ : StartExpressionBlock context=(FieldId | NodeId | Identifier) (Comma parameterList)? EndBlock expressionBlock EOF // EFX-1
50+ | With context=(FieldId | NodeId | Identifier) (Comma parameterList)? Compute expression EOF // EFX-2
51+ ;
4852
4953/* *****************************************************************************
5054 Expressions are matched when the lexical analyser is in EXPRESSION mode
Original file line number Diff line number Diff line change @@ -326,6 +326,7 @@ Index: INDEX;
326326By: BY;
327327Assert: ASSERT;
328328Report: REPORT;
329+ Compute: COMPUTE;
329330
330331// Data types ------------------------------------------------------------------------------------------------
331332
@@ -514,6 +515,7 @@ fragment WHEN: ('WHEN' | 'when');
514515fragment OTHERWISE : (' OTHERWISE' | ' otherwise' );
515516fragment ASSERT : (' ASSERT' | ' assert' );
516517fragment REPORT : (' REPORT' | ' report' );
518+ fragment COMPUTE : (' COMPUTE' | ' compute' );
517519fragment STAGE : (' STAGE' | ' stage' );
518520fragment ENDPOINT : (' ENDPOINT' | ' endpoint' );
519521fragment INDEX : (' INDEX' | ' index' );
You can’t perform that action at this time.
0 commit comments