From 2696de664b097c8dceb4332e9896417835e77178 Mon Sep 17 00:00:00 2001 From: Rudrangi Anupriya Date: Tue, 30 May 2023 17:20:20 +0530 Subject: Add <,> operators support to cps-path Issue-ID: CPS-1273 Change-Id: I5d562463b9a49abfe0436047a637857d10596fff Signed-off-by: Rudrangi Anupriya --- .../main/antlr4/org/onap/cps/cpspath/parser/antlr4/CpsPath.g4 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'cps-path-parser/src/main/antlr4/org/onap') diff --git a/cps-path-parser/src/main/antlr4/org/onap/cps/cpspath/parser/antlr4/CpsPath.g4 b/cps-path-parser/src/main/antlr4/org/onap/cps/cpspath/parser/antlr4/CpsPath.g4 index 86c1705617..c88a822654 100644 --- a/cps-path-parser/src/main/antlr4/org/onap/cps/cpspath/parser/antlr4/CpsPath.g4 +++ b/cps-path-parser/src/main/antlr4/org/onap/cps/cpspath/parser/antlr4/CpsPath.g4 @@ -47,13 +47,15 @@ listElementRef : OB leafCondition ( booleanOperators leafCondition)* CB ; multipleLeafConditions : OB leafCondition ( booleanOperators leafCondition)* CB ; -leafCondition : AT leafName EQ ( IntegerLiteral | StringLiteral) ; +leafCondition : AT leafName comparativeOperators ( IntegerLiteral | StringLiteral) ; leafName : QName ; booleanOperators : ( KW_AND | KW_OR ) ; -invalidPostFix : (AT | CB | COLONCOLON | EQ ).+ ; +comparativeOperators : ( EQ | GT | LT | GE | LE ) ; + +invalidPostFix : (AT | CB | COLONCOLON | comparativeOperators ).+ ; /* * Lexer Rules @@ -70,6 +72,10 @@ SLASH : '/' ; COMMA : ',' ; OP : '(' ; CP : ')' ; +GT : '>' ; +LT : '<' ; +GE : '>=' ; +LE : '<=' ; // KEYWORDS -- cgit 1.2.3-korg