From 890bb39f8daa894f760f07351d83fad1a13a52ff Mon Sep 17 00:00:00 2001 From: Valentino Pinna Date: Fri, 15 Nov 2024 14:07:02 +0100 Subject: [PATCH] Fix several bugs in the grammar --- v2.1/src/main/antlr4/org/sdmx/vtl/Vtl.g4 | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/v2.1/src/main/antlr4/org/sdmx/vtl/Vtl.g4 b/v2.1/src/main/antlr4/org/sdmx/vtl/Vtl.g4 index e4d2648a..58bbb489 100644 --- a/v2.1/src/main/antlr4/org/sdmx/vtl/Vtl.g4 +++ b/v2.1/src/main/antlr4/org/sdmx/vtl/Vtl.g4 @@ -233,16 +233,16 @@ timeOperatorsComponent: | TIMESHIFT LPAREN exprComponent COMMA signedInteger RPAREN # timeShiftAtomComponent | TIME_AGG LPAREN periodIndTo=STRING_CONSTANT (COMMA periodIndFrom=(STRING_CONSTANT| OPTIONAL ))? (COMMA op=optionalExprComponent)? (COMMA delim=(FIRST|LAST))? RPAREN # timeAggAtomComponent | CURRENT_DATE LPAREN RPAREN # currentDateAtomComponent - | DATEDIFF LPAREN dateFrom=expr COMMA dateTo=expr RPAREN # dateDiffAtomComponent - | DATEADD LPAREN op=expr COMMA shiftNumber=expr COMMA periodInd=expr RPAREN # dateAddAtomComponent - | YEAR_OP LPAREN expr RPAREN # yearAtomComponent - | MONTH_OP LPAREN expr RPAREN # monthAtomComponent - | DAYOFMONTH LPAREN expr RPAREN # dayOfMonthAtomComponent - | DAYOFYEAR LPAREN expr RPAREN # datOfYearAtomComponent - | DAYTOYEAR LPAREN expr RPAREN # dayToYearAtomComponent - | DAYTOMONTH LPAREN expr RPAREN # dayToMonthAtomComponent - | YEARTODAY LPAREN expr RPAREN # yearTodayAtomComponent - | MONTHTODAY LPAREN expr RPAREN # monthTodayAtomComponent + | DATEDIFF LPAREN dateFrom=exprComponent COMMA dateTo=expr RPAREN # dateDiffAtomComponent + | DATEADD LPAREN op=exprComponent COMMA shiftNumber=exprComponent COMMA periodInd=exprComponent RPAREN # dateAddAtomComponent + | YEAR_OP LPAREN exprComponent RPAREN # yearAtomComponent + | MONTH_OP LPAREN exprComponent RPAREN # monthAtomComponent + | DAYOFMONTH LPAREN exprComponent RPAREN # dayOfMonthAtomComponent + | DAYOFYEAR LPAREN exprComponent RPAREN # datOfYearAtomComponent + | DAYTOYEAR LPAREN exprComponent RPAREN # dayToYearAtomComponent + | DAYTOMONTH LPAREN exprComponent RPAREN # dayToMonthAtomComponent + | YEARTODAY LPAREN exprComponent RPAREN # yearTodayAtomComponent + | MONTHTODAY LPAREN exprComponent RPAREN # monthTodayAtomComponent ; setOperators: @@ -433,7 +433,7 @@ limitClauseItem: /* ------------------------------------------------------------ GROUPING CLAUSE ------------------------------------*/ groupingClause: GROUP op=(BY | EXCEPT) componentID (COMMA componentID)* ( TIME_AGG LPAREN STRING_CONSTANT (COMMA delim=(FIRST|LAST))? RPAREN )? # groupByOrExcept - | GROUP ALL exprComponent ( TIME_AGG LPAREN STRING_CONSTANT RPAREN )? # groupAll + | GROUP ALL ( TIME_AGG LPAREN STRING_CONSTANT RPAREN )? # groupAll ; havingClause: