From 16700753dcf0e3600f600b0b769c89eb2273f1d6 Mon Sep 17 00:00:00 2001 From: "Kajur, Harish (vk250x)" Date: Mon, 13 Aug 2018 05:32:35 -0400 Subject: Initial seed code for graphadmin Issue-ID: AAI-1469 Change-Id: Ic170c326ad1fe4b43960de674797766f6f7b94bf Signed-off-by: Kajur, Harish (vk250x) --- src/main/resources/antlr4/org/onap/aai/AAIDsl.g4 | 66 ++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/main/resources/antlr4/org/onap/aai/AAIDsl.g4 (limited to 'src/main/resources/antlr4') diff --git a/src/main/resources/antlr4/org/onap/aai/AAIDsl.g4 b/src/main/resources/antlr4/org/onap/aai/AAIDsl.g4 new file mode 100644 index 0000000..2713677 --- /dev/null +++ b/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