This is an automated email from the ASF dual-hosted git repository.

aradzinski pushed a commit to branch NLPCRAFT-206
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git


The following commit(s) were added to refs/heads/NLPCRAFT-206 by this push:
     new 207ca19  Update NCIntentDsl.g4
207ca19 is described below

commit 207ca19b549df7d371fe2ad325b39ee415baf9c0
Author: Aaron Radzinski <[email protected]>
AuthorDate: Thu Feb 4 18:56:18 2021 -0800

    Update NCIntentDsl.g4
---
 .../model/intent/impl/antlr4/NCIntentDsl.g4        | 41 ++++++++++++++--------
 1 file changed, 27 insertions(+), 14 deletions(-)

diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.g4
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.g4
index 43ed661..ecd5fe6 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.g4
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.g4
@@ -21,16 +21,23 @@ intent: intentId orderedDecl? flowDecl? metaDecl? terms EOF;
 intentId: 'intent' EQ ID;
 orderedDecl: 'ordered' EQ BOOL;
 flowDecl: 'flow' EQ qstring;
-metaDecl: 'meta' EQ LCURLY metaList? RCURLY;
-metaList
-    : metaItem
-    | metaList COMMA metaItem
-    ;
-metaItem: qstring COLON metaItemRval;
-metaItemRval
-    : 'null'
+metaDecl: 'meta' EQ jsonObj;
+jsonObj
+    : LCURLY jsonPair (COMMA jsonPair)* RCURLY
+    | LCURLY RCURLY
+    ;
+jsonPair: qstring COLON jsonVal;
+jsonVal
+    : qstring
+    | NUM
+    | jsonObj
+    | jsonArr
     | BOOL
-    | qstring
+    | NULL
+    ;
+jsonArr
+    : LBR jsonVal (COMMA jsonVal)* RBR
+    | LBR RBR
     ;
 terms: term | terms term;
 termEq
@@ -49,6 +56,9 @@ javaFqn
     | javaFqn DOT ID
     ;
 termId: LPAREN ID RPAREN;
+
+
+
 item
     : pred
     | LPAREN item RPAREN
@@ -71,12 +81,14 @@ mathOp
 val
     : singleVal
     | LPAREN val RPAREN
-    |
-    
     ;
+
+
+
+
 singleVal
-    : 'null'
-    | MINUS? (INT | INT EXP)
+    : NULL
+    | NUM
     | BOOL
     | qstring
     | tokQual? ('id' | 'aliases' | 'startidx' | 'endidx' | 'parent' | 'groups' 
| 'ancestors' | 'value')
@@ -158,8 +170,9 @@ FSLASH: '/';
 PERCENT: '%';
 POWER: '^';
 BOOL: 'true' | 'false';
+NULL: 'null';
 INT: '0' | [1-9][_0-9]*;
-EXP: DOT [0-9]+;
+NUM: MINUS? INT (DOT [0-9]+)? ([Ee][+\-]? INT)?;
 ID: 
(UNDERSCORE|[a-z]|[A-Z]|[$])+([$]|[a-z]|[A-Z]|[0-9]|COLON|MINUS|UNDERSCORE)*;
 WS: [ \r\t\u000C\n]+ -> skip ;
 

Reply via email to