From bbc81d85bda5e9c446e3218e30b1ba5bdf3dc3e0 Mon Sep 17 00:00:00 2001 From: danielhanrahan Date: Sat, 31 Aug 2024 22:06:12 +0100 Subject: [Cps Path Parser] Remove unneeded validation in grammar The invalid prefix/postfix is not needed; existing tests show that PathParsingException is thrown in for invalid paths. Issue-ID: CPS-2365 Signed-off-by: danielhanrahan Change-Id: I202f0ca0bc5eb768fc3af711180405882dafc22d --- .../src/main/antlr4/org/onap/cps/cpspath/parser/antlr4/CpsPath.g4 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'cps-path-parser/src/main/antlr4/org') 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 3aef120fed..be8d968fcb 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,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2021-2023 Nordix Foundation + * Copyright (C) 2021-2024 Nordix Foundation * Modifications Copyright (C) 2023 TechMahindra Ltd * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -27,7 +27,7 @@ grammar CpsPath ; -cpsPath : ( prefix | descendant | incorrectPrefix ) multipleLeafConditions? textFunctionCondition? containsFunctionCondition? ancestorAxis? invalidPostFix?; +cpsPath : ( prefix | descendant ) multipleLeafConditions? textFunctionCondition? containsFunctionCondition? ancestorAxis? EOF ; ancestorAxis : SLASH KW_ANCESTOR COLONCOLON ancestorPath ; @@ -43,8 +43,6 @@ prefix : parent SLASH containerName ; descendant : SLASH prefix ; -incorrectPrefix : SLASH SLASH SLASH+ ; - yangElement : containerName listElementRef? ; containerName : QName ; @@ -61,8 +59,6 @@ booleanOperators : ( KW_AND | KW_OR ) ; comparativeOperators : ( EQ | GT | LT | GE | LE ) ; -invalidPostFix : (AT | CB | COLONCOLON | comparativeOperators ).+ ; - /* * Lexer Rules * Most of the lexer rules below are inspired by -- cgit