summaryrefslogtreecommitdiffstats
path: root/aai-traversal/src/main/resources/antlr4
diff options
context:
space:
mode:
authorVenkata Harish K Kajur <vk250x@att.com>2018-01-18 11:04:20 -0500
committerVenkata Harish K Kajur <vk250x@att.com>2018-02-15 11:43:25 -0500
commitf702ccd5b3f92fabfe21a1d3f3af762b6c628b88 (patch)
tree19204529e31d9393f5eb6e496a4ce2a6857d22ac /aai-traversal/src/main/resources/antlr4
parent0de265c8b69c955c296f368c2875e9845bb824e4 (diff)
Sync logging context changes
Issue-ID: AAI-493 Change-Id: I8c460cce840b4fe46ff4deacbe3a770755a4c677 Signed-off-by: Venkata Harish K Kajur <vk250x@att.com>
Diffstat (limited to 'aai-traversal/src/main/resources/antlr4')
-rw-r--r--aai-traversal/src/main/resources/antlr4/org/onap/aai/AAIDsl.g466
1 files changed, 66 insertions, 0 deletions
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
+
+