Merge "Add cascade delete fragments to liquibase test config"
[cps.git] / cps-path-parser / src / main / antlr4 / org / onap / cps / cpspath / parser / antlr4 / CpsPath.g4
index d471811..86c1705 100644 (file)
@@ -21,7 +21,7 @@
 
 grammar CpsPath ;
 
-cpsPath : ( prefix | descendant | incorrectPrefix ) multipleLeafConditions? textFunctionCondition? ancestorAxis? invalidPostFix?;
+cpsPath : ( prefix | descendant | incorrectPrefix ) multipleLeafConditions? textFunctionCondition? containsFunctionCondition? ancestorAxis? invalidPostFix?;
 
 ancestorAxis : SLASH KW_ANCESTOR COLONCOLON ancestorPath ;
 
@@ -29,6 +29,8 @@ ancestorPath : yangElement ( SLASH yangElement)* ;
 
 textFunctionCondition : SLASH leafName OB KW_TEXT_FUNCTION EQ StringLiteral CB ;
 
+containsFunctionCondition : OB KW_CONTAINS_FUNCTION OP AT leafName COMMA StringLiteral CP CB ;
+
 parent : ( SLASH yangElement)* ;
 
 prefix : parent SLASH containerName ;
@@ -65,6 +67,9 @@ COLONCOLON : '::' ;
 EQ : '=' ;
 OB : '[' ;
 SLASH : '/' ;
+COMMA : ',' ;
+OP : '(' ;
+CP : ')' ;
 
 // KEYWORDS
 
@@ -72,6 +77,7 @@ KW_ANCESTOR : 'ancestor' ;
 KW_AND : 'and' ;
 KW_TEXT_FUNCTION: 'text()' ;
 KW_OR : 'or' ;
+KW_CONTAINS_FUNCTION: 'contains' ;
 
 IntegerLiteral : FragDigits ;
 // Add below type definitions for leafvalue comparision in https://jira.onap.org/browse/CPS-440