summaryrefslogtreecommitdiffstats
path: root/cps-path-parser/src/main/antlr4
diff options
context:
space:
mode:
authorRudrangi Anupriya <ra00745022@techmahindra.com>2023-04-13 22:49:06 +0530
committerRudrangi Anupriya <ra00745022@techmahindra.com>2023-04-14 18:11:50 +0530
commitc4621cbcb1f9aad97ba3389468546444d1e9f3dc (patch)
tree3d65556788ac1be9257ffe6d266f0f258ee9b6d1 /cps-path-parser/src/main/antlr4
parent0bc4f677b59b616ebc5eb5e4fd9529ca2a497cf6 (diff)
Add OR operator to cps-path
Issue-ID: CPS-1215 Change-Id: I91fdf5bddcc4fc12a8cf9dbce75f77c832c55871 Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
Diffstat (limited to 'cps-path-parser/src/main/antlr4')
-rw-r--r--cps-path-parser/src/main/antlr4/org/onap/cps/cpspath/parser/antlr4/CpsPath.g48
1 files changed, 6 insertions, 2 deletions
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 db09b3c532..d4718111f6 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
@@ -1,6 +1,7 @@
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021-2022 Nordix Foundation
+ * Modifications Copyright (C) 2023 TechMahindra Ltd
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,14 +41,16 @@ yangElement : containerName listElementRef? ;
containerName : QName ;
-listElementRef : OB leafCondition ( KW_AND leafCondition)* CB ;
+listElementRef : OB leafCondition ( booleanOperators leafCondition)* CB ;
-multipleLeafConditions : OB leafCondition ( KW_AND leafCondition)* CB ;
+multipleLeafConditions : OB leafCondition ( booleanOperators leafCondition)* CB ;
leafCondition : AT leafName EQ ( IntegerLiteral | StringLiteral) ;
leafName : QName ;
+booleanOperators : ( KW_AND | KW_OR ) ;
+
invalidPostFix : (AT | CB | COLONCOLON | EQ ).+ ;
/*
@@ -68,6 +71,7 @@ SLASH : '/' ;
KW_ANCESTOR : 'ancestor' ;
KW_AND : 'and' ;
KW_TEXT_FUNCTION: 'text()' ;
+KW_OR : 'or' ;
IntegerLiteral : FragDigits ;
// Add below type definitions for leafvalue comparision in https://jira.onap.org/browse/CPS-440