From f702ccd5b3f92fabfe21a1d3f3af762b6c628b88 Mon Sep 17 00:00:00 2001 From: Venkata Harish K Kajur Date: Thu, 18 Jan 2018 11:04:20 -0500 Subject: Sync logging context changes Issue-ID: AAI-493 Change-Id: I8c460cce840b4fe46ff4deacbe3a770755a4c677 Signed-off-by: Venkata Harish K Kajur --- .../main/resources/antlr4/org/onap/aai/AAIDsl.g4 | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 aai-traversal/src/main/resources/antlr4/org/onap/aai/AAIDsl.g4 (limited to 'aai-traversal/src/main/resources/antlr4/org') diff --git a/aai-traversal/src/main/resources/antlr4/org/onap/aai/AAIDsl.g4 b/aai-traversal/src/main/resources/antlr4/org/onap/aai/AAIDsl.g4 new file mode 100644 index 0000000..2713677 --- /dev/null +++ b/aai-traversal/src/main/resources/antlr4/org/onap/aai/AAIDsl.g4 @@ -0,0 +1,66 @@ +/** + * Define a grammar called AAIDsl + */ +grammar AAIDsl; + + +aaiquery: dslStatement; + +dslStatement: (queryStep) (traverseStep | unionTraverseStep)* limitStep*; + +queryStep : (singleNodeStep |singleQueryStep | multiQueryStep); + +unionQueryStep: LBRACKET dslStatement ( COMMA (dslStatement))* RBRACKET; + +traverseStep: (TRAVERSE ( queryStep | unionQueryStep)); + +unionTraverseStep: TRAVERSE unionQueryStep; + +singleNodeStep: NODE STORE? ; +singleQueryStep: NODE STORE? (filterStep | filterTraverseStep); +multiQueryStep: NODE STORE? (filterStep | filterTraverseStep) (filterStep)+; + +filterStep: NOT? (LPAREN KEY COMMA KEY (COMMA KEY)*RPAREN); +filterTraverseStep: (LPAREN traverseStep* RPAREN); + +limitStep: LIMIT NODE; + +LIMIT: 'LIMIT'; +NODE: ID; + +KEY: ['] ID ['] ; + +AND: [&]; + +STORE: [*]; + +OR: [|]; + +TRAVERSE: [>] ; + +LPAREN: [(]; + +RPAREN: [)]; + +COMMA: [,] ; + +EQUAL: [=]; + +LBRACKET: [[]; + +RBRACKET: [\]]; + +NOT: [!]; + +VALUE: DIGIT; + +fragment LOWERCASE : [a-z] ; +fragment UPPERCASE : [A-Z] ; +fragment DIGIT : [0-9] ; +ID + : ( LOWERCASE | UPPERCASE | DIGIT) ( LOWERCASE | UPPERCASE | DIGIT | '-' |'.' |'_')* + ; + +WS : [ \t\r\n]+ -> skip ; // skip spaces, tabs, newlines + + -- cgit 1.2.3-korg