diff --git a/pom.xml b/pom.xml index b20bd1d..402d4d7 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ jar DHIS Antlr Expression Parser org.hisp.dhis.parser - 1.0.34-SNAPSHOT + 1.0.35 Antlr Expression Parser diff --git a/src/main/antlr4/org/hisp/dhis/parser/expression/antlr/Expression.g4 b/src/main/antlr4/org/hisp/dhis/parser/expression/antlr/Expression.g4 index 426e322..5d99cd2 100644 --- a/src/main/antlr4/org/hisp/dhis/parser/expression/antlr/Expression.g4 +++ b/src/main/antlr4/org/hisp/dhis/parser/expression/antlr/Expression.g4 @@ -6,6 +6,11 @@ grammar Expression; // Parser rules // ----------------------------------------------------------------------------- +// Note: ANTLR symbols for optional or repeating: +// ? -> 0 or 1 +// * -> 0 or more +// + -> 1 or more + expression // The expression must last until the end of the string : expr EOF ; @@ -59,6 +64,7 @@ expr | it='orgUnit.program(' WS* UID WS* (',' WS* UID WS* )* ')' | it='removeZeros(' expr ')' | it='subExpression(' expr ')' + | it='textContains(' expr (',' expr )+ ')' // Aggergation functions (alphabetical) @@ -303,6 +309,7 @@ ORGUNIT_GROUP : 'orgUnit.group('; ORGUNIT_PROGRAM : 'orgUnit.program('; REMOVE_ZEROS : 'removeZeros('; SUB_EXPRESSION : 'subExpression('; +TEXT_CONTAINS : 'textContains('; // Aggegation functions (alphabetical)