ancestorPath: yangElement (SLASH yangElement)* ;
-cpsPathWithSingleLeafCondition: prefix singleValueCondition ;
+cpsPathWithSingleLeafCondition: prefix singleValueCondition postfix? ;
/*
No need to ditinguish between cpsPathWithDescendant | cpsPathWithDescendantAndLeafConditions really!
prefix: (SLASH yangElement)* SLASH containerName ;
+postfix: (SLASH yangElement)+ ;
+
yangElement: containerName listElementRef? ;
containerName: QName ;
import org.onap.cps.cpspath.parser.antlr4.CpsPathParser.CpsPathWithSingleLeafConditionContext;
import org.onap.cps.cpspath.parser.antlr4.CpsPathParser.LeafConditionContext;
import org.onap.cps.cpspath.parser.antlr4.CpsPathParser.MultipleValueConditionsContext;
+import org.onap.cps.cpspath.parser.antlr4.CpsPathParser.PostfixContext;
import org.onap.cps.cpspath.parser.antlr4.CpsPathParser.PrefixContext;
import org.onap.cps.cpspath.parser.antlr4.CpsPathParser.SingleValueConditionContext;
cpsPathQuery.setXpathPrefix(ctx.getText());
}
+ @Override
+ public void exitPostfix(final PostfixContext ctx) {
+ throw new IllegalStateException(String.format("Unsupported postfix %s encountered in CpsPath.", ctx.getText()));
+ }
+
@Override
public void exitLeafCondition(final LeafConditionContext ctx) {
Object comparisonValue = null;
'end with descendant and more than one attribute separated by "or"' | '//child[@int-leaf=5 or @leaf-name="leaf value"]'
'missing attribute value' | '//child[@int-leaf=5 and @name]'
'incomplete ancestor value' | '//books/ancestor::'
+ 'unsupported postfix after single value condition (JIRA CPS-450)' | '/parent/child[@id=1]/somePostFix'
}
def 'Parse cps path using ancestor by schema node identifier with a #scenario.'() {