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 b8f522d  WIP.
b8f522d is described below

commit b8f522dcad0e24a8c3107f9ca027116bf3b95939
Author: Aaron Radzinski <[email protected]>
AuthorDate: Sun Feb 7 19:54:43 2021 -0800

    WIP.
---
 .../model/intent/impl/antlr4/NCIntentDsl.g4        |   24 -
 .../model/intent/impl/antlr4/NCIntentDsl.interp    |   48 +-
 .../model/intent/impl/antlr4/NCIntentDsl.tokens    |  151 +-
 .../impl/antlr4/NCIntentDslBaseListener.java       |  104 +-
 .../intent/impl/antlr4/NCIntentDslLexer.interp     |   42 +-
 .../model/intent/impl/antlr4/NCIntentDslLexer.java |  232 ++-
 .../intent/impl/antlr4/NCIntentDslLexer.tokens     |  151 +-
 .../intent/impl/antlr4/NCIntentDslListener.java    |  140 +-
 .../intent/impl/antlr4/NCIntentDslParser.java      | 1767 ++++++++------------
 .../intent/impl/ver2/NCIntentDslCompiler.scala     |  136 ++
 .../model/intent/utils/ver2/NCDslIntent.scala      |   35 +
 .../model/intent/utils/ver2/NCDslTerm.scala        |   38 +
 12 files changed, 1297 insertions(+), 1571 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 68d5919..8f8a531 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
@@ -70,30 +70,6 @@ val
     | MINUS? INT REAL? EXP?
     | BOOL
     | qstring
-    | tokQual? ('id' | 'aliases' | 'startidx' | 'endidx' | 'parent' | 'groups' 
| 'ancestors' | 'value')
-    | tokQual? tokMeta
-    | modelMeta
-    | intentMeta
-    ;
-tokQual
-    : tokQualPart
-    | tokQual tokQualPart
-    ;
-tokQualPart: ID DOT;
-tokMeta // Token metadata: ~prop
-    : TILDA ID
-    | TILDA ID LBR INT RBR
-    | TILDA ID LBR qstring RBR
-    ;
-modelMeta // Model metadata: #prop
-    : POUND ID
-    | POUND ID LBR INT RBR
-    | POUND ID LBR qstring RBR
-    ;
-intentMeta // Intent metadata: %prop
-    : PERCENT ID
-    | PERCENT ID LBR INT RBR
-    | PERCENT ID LBR qstring RBR
     ;
 qstring
     : SQSTRING
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.interp
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.interp
index 133ddba..5ac160a 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.interp
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.interp
@@ -4,16 +4,7 @@ null
 'ordered'
 'flow'
 'meta'
-'null'
 'term'
-'id'
-'aliases'
-'startidx'
-'endidx'
-'parent'
-'groups'
-'ancestors'
-'value'
 null
 null
 null
@@ -42,9 +33,12 @@ null
 '?'
 '*'
 '/'
+'%'
 '$'
 '^'
 null
+'null'
+null
 null
 null
 null
@@ -58,15 +52,6 @@ null
 null
 null
 null
-null
-null
-null
-null
-null
-null
-null
-null
-null
 SQSTRING
 DQSTRING
 PRED_OP
@@ -94,11 +79,14 @@ EQ
 PLUS
 QUESTION
 STAR
-DEVIDE
+FSLASH
+PERCENT
 DOLLAR
 POWER
 BOOL
+NULL
 INT
+REAL
 EXP
 ID
 WS
@@ -110,24 +98,20 @@ intentId
 orderedDecl
 flowDecl
 metaDecl
-metaList
-metaItem
-metaItemRval
+jsonObj
+jsonPair
+jsonVal
+jsonArr
 terms
 termEq
 term
+clsNer
+javaFqn
 termId
-item
-pred
+termDef
+termPred
 expr
-mathOp
 val
-singleVal
-tokQual
-tokQualPart
-tokMeta
-modelMeta
-intentMeta
 qstring
 minMax
 minMaxShortcut
@@ -135,4 +119,4 @@ minMaxRange
 
 
 atn:
-[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 52, 295, 4, 2, 
9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 
4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 
14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 
20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 
25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 3, 2, 3, 2, 5, 2, 59, 10, 2, 3, 
2, 5, 2, 62, 10, 2, 3, 2,  [...]
\ No newline at end of file
+[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 46, 256, 4, 2, 
9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 
4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 
14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 
20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 3, 2, 3, 2, 
5, 2, 51, 10, 2, 3, 2, 5, 2, 54, 10, 2, 3, 2, 5, 2, 57, 10, 2, 3, 2, 3, 2, 3, 
2, 3, 3, 3, 3, 3, 3, 3,  [...]
\ No newline at end of file
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.tokens
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.tokens
index 7b0f50b..eeb5a65 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.tokens
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDsl.tokens
@@ -3,89 +3,76 @@ T__1=2
 T__2=3
 T__3=4
 T__4=5
-T__5=6
-T__6=7
-T__7=8
-T__8=9
-T__9=10
-T__10=11
-T__11=12
-T__12=13
-T__13=14
-SQSTRING=15
-DQSTRING=16
-PRED_OP=17
-AND=18
-OR=19
-VERT=20
-EXCL=21
-LPAREN=22
-RPAREN=23
-LCURLY=24
-RCURLY=25
-SQUOTE=26
-DQUOTE=27
-TILDA=28
-RIGHT=29
-LBR=30
-RBR=31
-POUND=32
-COMMA=33
-COLON=34
-MINUS=35
-DOT=36
-UNDERSCORE=37
-EQ=38
-PLUS=39
-QUESTION=40
-STAR=41
-DEVIDE=42
-DOLLAR=43
-POWER=44
-BOOL=45
-INT=46
-EXP=47
-ID=48
-WS=49
-ErrorCharacter=50
+SQSTRING=6
+DQSTRING=7
+PRED_OP=8
+AND=9
+OR=10
+VERT=11
+EXCL=12
+LPAREN=13
+RPAREN=14
+LCURLY=15
+RCURLY=16
+SQUOTE=17
+DQUOTE=18
+TILDA=19
+RIGHT=20
+LBR=21
+RBR=22
+POUND=23
+COMMA=24
+COLON=25
+MINUS=26
+DOT=27
+UNDERSCORE=28
+EQ=29
+PLUS=30
+QUESTION=31
+STAR=32
+FSLASH=33
+PERCENT=34
+DOLLAR=35
+POWER=36
+BOOL=37
+NULL=38
+INT=39
+REAL=40
+EXP=41
+ID=42
+WS=43
+ErrorCharacter=44
 'intent'=1
 'ordered'=2
 'flow'=3
 'meta'=4
-'null'=5
-'term'=6
-'id'=7
-'aliases'=8
-'startidx'=9
-'endidx'=10
-'parent'=11
-'groups'=12
-'ancestors'=13
-'value'=14
-'&&'=18
-'||'=19
-'|'=20
-'!'=21
-'('=22
-')'=23
-'{'=24
-'}'=25
-'\''=26
-'"'=27
-'~'=28
-'>>'=29
-'['=30
-']'=31
-'#'=32
-','=33
-':'=34
-'-'=35
-'.'=36
-'_'=37
-'='=38
-'+'=39
-'?'=40
-'*'=41
-'/'=42
-'$'=43
-'^'=44
+'term'=5
+'&&'=9
+'||'=10
+'|'=11
+'!'=12
+'('=13
+')'=14
+'{'=15
+'}'=16
+'\''=17
+'"'=18
+'~'=19
+'>>'=20
+'['=21
+']'=22
+'#'=23
+','=24
+':'=25
+'-'=26
+'.'=27
+'_'=28
+'='=29
+'+'=30
+'?'=31
+'*'=32
+'/'=33
+'%'=34
+'$'=35
+'^'=36
+'null'=38
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslBaseListener.java
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslBaseListener.java
index 689fd21..041b046 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslBaseListener.java
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslBaseListener.java
@@ -76,217 +76,169 @@ public class NCIntentDslBaseListener implements 
NCIntentDslListener {
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void enterMetaList(NCIntentDslParser.MetaListContext 
ctx) { }
+       @Override public void enterJsonObj(NCIntentDslParser.JsonObjContext 
ctx) { }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void exitMetaList(NCIntentDslParser.MetaListContext 
ctx) { }
+       @Override public void exitJsonObj(NCIntentDslParser.JsonObjContext ctx) 
{ }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void enterMetaItem(NCIntentDslParser.MetaItemContext 
ctx) { }
+       @Override public void enterJsonPair(NCIntentDslParser.JsonPairContext 
ctx) { }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void exitMetaItem(NCIntentDslParser.MetaItemContext 
ctx) { }
+       @Override public void exitJsonPair(NCIntentDslParser.JsonPairContext 
ctx) { }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void 
enterMetaItemRval(NCIntentDslParser.MetaItemRvalContext ctx) { }
+       @Override public void enterJsonVal(NCIntentDslParser.JsonValContext 
ctx) { }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void 
exitMetaItemRval(NCIntentDslParser.MetaItemRvalContext ctx) { }
+       @Override public void exitJsonVal(NCIntentDslParser.JsonValContext ctx) 
{ }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void enterTerms(NCIntentDslParser.TermsContext ctx) { }
-       /**
-        * {@inheritDoc}
-        *
-        * <p>The default implementation does nothing.</p>
-        */
-       @Override public void exitTerms(NCIntentDslParser.TermsContext ctx) { }
-       /**
-        * {@inheritDoc}
-        *
-        * <p>The default implementation does nothing.</p>
-        */
-       @Override public void enterTermEq(NCIntentDslParser.TermEqContext ctx) 
{ }
-       /**
-        * {@inheritDoc}
-        *
-        * <p>The default implementation does nothing.</p>
-        */
-       @Override public void exitTermEq(NCIntentDslParser.TermEqContext ctx) { 
}
-       /**
-        * {@inheritDoc}
-        *
-        * <p>The default implementation does nothing.</p>
-        */
-       @Override public void enterTerm(NCIntentDslParser.TermContext ctx) { }
-       /**
-        * {@inheritDoc}
-        *
-        * <p>The default implementation does nothing.</p>
-        */
-       @Override public void exitTerm(NCIntentDslParser.TermContext ctx) { }
-       /**
-        * {@inheritDoc}
-        *
-        * <p>The default implementation does nothing.</p>
-        */
-       @Override public void enterTermId(NCIntentDslParser.TermIdContext ctx) 
{ }
-       /**
-        * {@inheritDoc}
-        *
-        * <p>The default implementation does nothing.</p>
-        */
-       @Override public void exitTermId(NCIntentDslParser.TermIdContext ctx) { 
}
-       /**
-        * {@inheritDoc}
-        *
-        * <p>The default implementation does nothing.</p>
-        */
-       @Override public void enterItem(NCIntentDslParser.ItemContext ctx) { }
+       @Override public void enterJsonArr(NCIntentDslParser.JsonArrContext 
ctx) { }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void exitItem(NCIntentDslParser.ItemContext ctx) { }
+       @Override public void exitJsonArr(NCIntentDslParser.JsonArrContext ctx) 
{ }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void enterPred(NCIntentDslParser.PredContext ctx) { }
+       @Override public void enterTerms(NCIntentDslParser.TermsContext ctx) { }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void exitPred(NCIntentDslParser.PredContext ctx) { }
+       @Override public void exitTerms(NCIntentDslParser.TermsContext ctx) { }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void enterExpr(NCIntentDslParser.ExprContext ctx) { }
+       @Override public void enterTermEq(NCIntentDslParser.TermEqContext ctx) 
{ }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void exitExpr(NCIntentDslParser.ExprContext ctx) { }
+       @Override public void exitTermEq(NCIntentDslParser.TermEqContext ctx) { 
}
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void enterMathOp(NCIntentDslParser.MathOpContext ctx) 
{ }
+       @Override public void enterTerm(NCIntentDslParser.TermContext ctx) { }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void exitMathOp(NCIntentDslParser.MathOpContext ctx) { 
}
+       @Override public void exitTerm(NCIntentDslParser.TermContext ctx) { }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void enterVal(NCIntentDslParser.ValContext ctx) { }
+       @Override public void enterClsNer(NCIntentDslParser.ClsNerContext ctx) 
{ }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void exitVal(NCIntentDslParser.ValContext ctx) { }
+       @Override public void exitClsNer(NCIntentDslParser.ClsNerContext ctx) { 
}
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void enterSingleVal(NCIntentDslParser.SingleValContext 
ctx) { }
+       @Override public void enterJavaFqn(NCIntentDslParser.JavaFqnContext 
ctx) { }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void exitSingleVal(NCIntentDslParser.SingleValContext 
ctx) { }
+       @Override public void exitJavaFqn(NCIntentDslParser.JavaFqnContext ctx) 
{ }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void enterTokQual(NCIntentDslParser.TokQualContext 
ctx) { }
+       @Override public void enterTermId(NCIntentDslParser.TermIdContext ctx) 
{ }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void exitTokQual(NCIntentDslParser.TokQualContext ctx) 
{ }
+       @Override public void exitTermId(NCIntentDslParser.TermIdContext ctx) { 
}
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void 
enterTokQualPart(NCIntentDslParser.TokQualPartContext ctx) { }
+       @Override public void enterTermDef(NCIntentDslParser.TermDefContext 
ctx) { }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void 
exitTokQualPart(NCIntentDslParser.TokQualPartContext ctx) { }
+       @Override public void exitTermDef(NCIntentDslParser.TermDefContext ctx) 
{ }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void enterTokMeta(NCIntentDslParser.TokMetaContext 
ctx) { }
+       @Override public void enterTermPred(NCIntentDslParser.TermPredContext 
ctx) { }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void exitTokMeta(NCIntentDslParser.TokMetaContext ctx) 
{ }
+       @Override public void exitTermPred(NCIntentDslParser.TermPredContext 
ctx) { }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void enterModelMeta(NCIntentDslParser.ModelMetaContext 
ctx) { }
+       @Override public void enterExpr(NCIntentDslParser.ExprContext ctx) { }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void exitModelMeta(NCIntentDslParser.ModelMetaContext 
ctx) { }
+       @Override public void exitExpr(NCIntentDslParser.ExprContext ctx) { }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void 
enterIntentMeta(NCIntentDslParser.IntentMetaContext ctx) { }
+       @Override public void enterVal(NCIntentDslParser.ValContext ctx) { }
        /**
         * {@inheritDoc}
         *
         * <p>The default implementation does nothing.</p>
         */
-       @Override public void 
exitIntentMeta(NCIntentDslParser.IntentMetaContext ctx) { }
+       @Override public void exitVal(NCIntentDslParser.ValContext ctx) { }
        /**
         * {@inheritDoc}
         *
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.interp
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.interp
index 4183c24..03fecb1 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.interp
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.interp
@@ -4,16 +4,7 @@ null
 'ordered'
 'flow'
 'meta'
-'null'
 'term'
-'id'
-'aliases'
-'startidx'
-'endidx'
-'parent'
-'groups'
-'ancestors'
-'value'
 null
 null
 null
@@ -42,9 +33,12 @@ null
 '?'
 '*'
 '/'
+'%'
 '$'
 '^'
 null
+'null'
+null
 null
 null
 null
@@ -58,15 +52,6 @@ null
 null
 null
 null
-null
-null
-null
-null
-null
-null
-null
-null
-null
 SQSTRING
 DQSTRING
 PRED_OP
@@ -94,11 +79,14 @@ EQ
 PLUS
 QUESTION
 STAR
-DEVIDE
+FSLASH
+PERCENT
 DOLLAR
 POWER
 BOOL
+NULL
 INT
+REAL
 EXP
 ID
 WS
@@ -110,15 +98,6 @@ T__1
 T__2
 T__3
 T__4
-T__5
-T__6
-T__7
-T__8
-T__9
-T__10
-T__11
-T__12
-T__13
 SQSTRING
 DQSTRING
 PRED_OP
@@ -146,11 +125,14 @@ EQ
 PLUS
 QUESTION
 STAR
-DEVIDE
+FSLASH
+PERCENT
 DOLLAR
 POWER
 BOOL
+NULL
 INT
+REAL
 EXP
 ID
 WS
@@ -164,4 +146,4 @@ mode names:
 DEFAULT_MODE
 
 atn:
-[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 52, 336, 8, 1, 
4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 
9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 
14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 
19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 
25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 
30, 4, 31, 9, 31, 4, 32, 9,  [...]
\ No newline at end of file
+[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 46, 277, 8, 1, 
4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 
9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 
14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 
19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 
25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 
30, 4, 31, 9, 31, 4, 32, 9,  [...]
\ No newline at end of file
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.java
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.java
index 629af31..24d3f45 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.java
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.java
@@ -17,13 +17,12 @@ public class NCIntentDslLexer extends Lexer {
        protected static final PredictionContextCache _sharedContextCache =
                new PredictionContextCache();
        public static final int
-               T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, 
T__8=9, 
-               T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, SQSTRING=15, 
DQSTRING=16, 
-               PRED_OP=17, AND=18, OR=19, VERT=20, EXCL=21, LPAREN=22, 
RPAREN=23, LCURLY=24, 
-               RCURLY=25, SQUOTE=26, DQUOTE=27, TILDA=28, RIGHT=29, LBR=30, 
RBR=31, POUND=32, 
-               COMMA=33, COLON=34, MINUS=35, DOT=36, UNDERSCORE=37, EQ=38, 
PLUS=39, QUESTION=40, 
-               STAR=41, DEVIDE=42, DOLLAR=43, POWER=44, BOOL=45, INT=46, 
EXP=47, ID=48, 
-               WS=49, ErrorCharacter=50;
+               T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, SQSTRING=6, DQSTRING=7, 
PRED_OP=8, 
+               AND=9, OR=10, VERT=11, EXCL=12, LPAREN=13, RPAREN=14, 
LCURLY=15, RCURLY=16, 
+               SQUOTE=17, DQUOTE=18, TILDA=19, RIGHT=20, LBR=21, RBR=22, 
POUND=23, COMMA=24, 
+               COLON=25, MINUS=26, DOT=27, UNDERSCORE=28, EQ=29, PLUS=30, 
QUESTION=31, 
+               STAR=32, FSLASH=33, PERCENT=34, DOLLAR=35, POWER=36, BOOL=37, 
NULL=38, 
+               INT=39, REAL=40, EXP=41, ID=42, WS=43, ErrorCharacter=44;
        public static String[] channelNames = {
                "DEFAULT_TOKEN_CHANNEL", "HIDDEN"
        };
@@ -34,35 +33,34 @@ public class NCIntentDslLexer extends Lexer {
 
        private static String[] makeRuleNames() {
                return new String[] {
-                       "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", 
"T__7", "T__8", 
-                       "T__9", "T__10", "T__11", "T__12", "T__13", "SQSTRING", 
"DQSTRING", "PRED_OP", 
+                       "T__0", "T__1", "T__2", "T__3", "T__4", "SQSTRING", 
"DQSTRING", "PRED_OP", 
                        "AND", "OR", "VERT", "EXCL", "LPAREN", "RPAREN", 
"LCURLY", "RCURLY", 
                        "SQUOTE", "DQUOTE", "TILDA", "RIGHT", "LBR", "RBR", 
"POUND", "COMMA", 
                        "COLON", "MINUS", "DOT", "UNDERSCORE", "EQ", "PLUS", 
"QUESTION", "STAR", 
-                       "DEVIDE", "DOLLAR", "POWER", "BOOL", "INT", "EXP", 
"ID", "WS", "ErrorCharacter"
+                       "FSLASH", "PERCENT", "DOLLAR", "POWER", "BOOL", "NULL", 
"INT", "REAL", 
+                       "EXP", "ID", "WS", "ErrorCharacter"
                };
        }
        public static final String[] ruleNames = makeRuleNames();
 
        private static String[] makeLiteralNames() {
                return new String[] {
-                       null, "'intent'", "'ordered'", "'flow'", "'meta'", 
"'null'", "'term'", 
-                       "'id'", "'aliases'", "'startidx'", "'endidx'", 
"'parent'", "'groups'", 
-                       "'ancestors'", "'value'", null, null, null, "'&&'", 
"'||'", "'|'", "'!'", 
-                       "'('", "')'", "'{'", "'}'", "'''", "'\"'", "'~'", 
"'>>'", "'['", "']'", 
-                       "'#'", "','", "':'", "'-'", "'.'", "'_'", "'='", "'+'", 
"'?'", "'*'", 
-                       "'/'", "'$'", "'^'"
+                       null, "'intent'", "'ordered'", "'flow'", "'meta'", 
"'term'", null, null, 
+                       null, "'&&'", "'||'", "'|'", "'!'", "'('", "')'", 
"'{'", "'}'", "'''", 
+                       "'\"'", "'~'", "'>>'", "'['", "']'", "'#'", "','", 
"':'", "'-'", "'.'", 
+                       "'_'", "'='", "'+'", "'?'", "'*'", "'/'", "'%'", "'$'", 
"'^'", null, 
+                       "'null'"
                };
        }
        private static final String[] _LITERAL_NAMES = makeLiteralNames();
        private static String[] makeSymbolicNames() {
                return new String[] {
-                       null, null, null, null, null, null, null, null, null, 
null, null, null, 
-                       null, null, null, "SQSTRING", "DQSTRING", "PRED_OP", 
"AND", "OR", "VERT", 
-                       "EXCL", "LPAREN", "RPAREN", "LCURLY", "RCURLY", 
"SQUOTE", "DQUOTE", "TILDA", 
-                       "RIGHT", "LBR", "RBR", "POUND", "COMMA", "COLON", 
"MINUS", "DOT", "UNDERSCORE", 
-                       "EQ", "PLUS", "QUESTION", "STAR", "DEVIDE", "DOLLAR", 
"POWER", "BOOL", 
-                       "INT", "EXP", "ID", "WS", "ErrorCharacter"
+                       null, null, null, null, null, null, "SQSTRING", 
"DQSTRING", "PRED_OP", 
+                       "AND", "OR", "VERT", "EXCL", "LPAREN", "RPAREN", 
"LCURLY", "RCURLY", 
+                       "SQUOTE", "DQUOTE", "TILDA", "RIGHT", "LBR", "RBR", 
"POUND", "COMMA", 
+                       "COLON", "MINUS", "DOT", "UNDERSCORE", "EQ", "PLUS", 
"QUESTION", "STAR", 
+                       "FSLASH", "PERCENT", "DOLLAR", "POWER", "BOOL", "NULL", 
"INT", "REAL", 
+                       "EXP", "ID", "WS", "ErrorCharacter"
                };
        }
        private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
@@ -124,117 +122,97 @@ public class NCIntentDslLexer extends Lexer {
        public ATN getATN() { return _ATN; }
 
        public static final String _serializedATN =
-               
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\64\u0150\b\1\4\2"+
-               
"\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4"+
-               
"\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22"+
-               
"\t\22\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31"+
-               
"\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t"+
-               " 
\4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t"+
-               
"+\4,\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\3\2"+
-               
"\3\2\3\2\3\2\3\2\3\2\3\2\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\4\3\4\3\4\3"+
-               
"\4\3\4\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b"+
-               
"\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3"+
-               
"\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f"+
-               
"\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3"+
-               
"\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\20\3\20\7\20\u00c6\n\20\f\20"+
-               
"\16\20\u00c9\13\20\3\20\3\20\3\21\3\21\7\21\u00cf\n\21\f\21\16\21\u00d2"+
-               
"\13\21\3\21\3\21\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22"+
-               
"\3\22\3\22\5\22\u00e3\n\22\3\23\3\23\3\23\3\24\3\24\3\24\3\25\3\25\3\26"+
-               
"\3\26\3\27\3\27\3\30\3\30\3\31\3\31\3\32\3\32\3\33\3\33\3\34\3\34\3\35"+
-               "\3\35\3\36\3\36\3\36\3\37\3\37\3 \3 
\3!\3!\3\"\3\"\3#\3#\3$\3$\3%\3%\3"+
-               
"&\3&\3\'\3\'\3(\3(\3)\3)\3*\3*\3+\3+\3,\3,\3-\3-\3.\3.\3.\3.\3.\3.\3."+
-               
"\3.\3.\5.\u0127\n.\3/\3/\3/\7/\u012c\n/\f/\16/\u012f\13/\5/\u0131\n/\3"+
-               
"\60\3\60\6\60\u0135\n\60\r\60\16\60\u0136\3\61\3\61\6\61\u013b\n\61\r"+
-               
"\61\16\61\u013c\3\61\3\61\3\61\3\61\7\61\u0143\n\61\f\61\16\61\u0146\13"+
-               
"\61\3\62\6\62\u0149\n\62\r\62\16\62\u014a\3\62\3\62\3\63\3\63\2\2\64\3"+
-               
"\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37"+
-               
"\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36;\37="+
-               " 
?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.[/]\60_\61a\62c\63e\64\3\2\13\3\2))\3\2"+
-               
"$$\4\2>>@@\3\2\63;\4\2\62;aa\3\2\62;\4\2C\\c|\5\2\62;C\\c|\5\2\13\f\16"+
-               
"\17\"\"\2\u0162\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3"+
+               
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2.\u0115\b\1\4\2\t"+
+               
"\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+
+               
"\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+
+               
"\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+
+               "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 
\t \4!"+
+               
"\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4"+
+               
",\t,\4-\t-\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3"+
+               
"\3\4\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3\7\3\7\7"+
+               
"\7|\n\7\f\7\16\7\177\13\7\3\7\3\7\3\b\3\b\7\b\u0085\n\b\f\b\16\b\u0088"+
+               
"\13\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\5\t"+
+               
"\u0099\n\t\3\n\3\n\3\n\3\13\3\13\3\13\3\f\3\f\3\r\3\r\3\16\3\16\3\17\3"+
+               
"\17\3\20\3\20\3\21\3\21\3\22\3\22\3\23\3\23\3\24\3\24\3\25\3\25\3\25\3"+
+               
"\26\3\26\3\27\3\27\3\30\3\30\3\31\3\31\3\32\3\32\3\33\3\33\3\34\3\34\3"+
+               "\35\3\35\3\36\3\36\3\37\3\37\3 \3 
\3!\3!\3\"\3\"\3#\3#\3$\3$\3%\3%\3&"+
+               
"\3&\3&\3&\3&\3&\3&\3&\3&\5&\u00df\n&\3\'\3\'\3\'\3\'\3\'\3(\3(\3(\7(\u00e9"+
+               
"\n(\f(\16(\u00ec\13(\5(\u00ee\n(\3)\3)\6)\u00f2\n)\r)\16)\u00f3\3*\3*"+
+               
"\5*\u00f8\n*\3*\3*\3+\3+\3+\6+\u00ff\n+\r+\16+\u0100\3+\3+\3+\3+\3+\7"+
+               
"+\u0108\n+\f+\16+\u010b\13+\3,\6,\u010e\n,\r,\16,\u010f\3,\3,\3-\3-\2"+
+               
"\2.\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35"+
+               
"\20\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36"+
+               ";\37= 
?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.\3\2\r\3\2))\3\2$$\4\2>>@@\3\2\63"+
+               
";\4\2\62;aa\3\2\62;\4\2GGgg\4\2--//\4\2C\\c|\5\2\62;C\\c|\5\2\13\f\16"+
+               
"\17\"\"\2\u012a\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3"+
                
"\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2"+
                
"\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3"+
                
"\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2"+
                
"\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\2"+
                
"9\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3"+
                
"\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2\2"+
-               
"\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\2[\3\2\2\2\2]\3\2\2\2\2"+
-               
"_\3\2\2\2\2a\3\2\2\2\2c\3\2\2\2\2e\3\2\2\2\3g\3\2\2\2\5n\3\2\2\2\7v\3"+
-               
"\2\2\2\t{\3\2\2\2\13\u0080\3\2\2\2\r\u0085\3\2\2\2\17\u008a\3\2\2\2\21"+
-               
"\u008d\3\2\2\2\23\u0095\3\2\2\2\25\u009e\3\2\2\2\27\u00a5\3\2\2\2\31\u00ac"+
-               
"\3\2\2\2\33\u00b3\3\2\2\2\35\u00bd\3\2\2\2\37\u00c3\3\2\2\2!\u00cc\3\2"+
-               
"\2\2#\u00e2\3\2\2\2%\u00e4\3\2\2\2\'\u00e7\3\2\2\2)\u00ea\3\2\2\2+\u00ec"+
-               
"\3\2\2\2-\u00ee\3\2\2\2/\u00f0\3\2\2\2\61\u00f2\3\2\2\2\63\u00f4\3\2\2"+
-               
"\2\65\u00f6\3\2\2\2\67\u00f8\3\2\2\29\u00fa\3\2\2\2;\u00fc\3\2\2\2=\u00ff"+
-               
"\3\2\2\2?\u0101\3\2\2\2A\u0103\3\2\2\2C\u0105\3\2\2\2E\u0107\3\2\2\2G"+
-               
"\u0109\3\2\2\2I\u010b\3\2\2\2K\u010d\3\2\2\2M\u010f\3\2\2\2O\u0111\3\2"+
-               
"\2\2Q\u0113\3\2\2\2S\u0115\3\2\2\2U\u0117\3\2\2\2W\u0119\3\2\2\2Y\u011b"+
-               
"\3\2\2\2[\u0126\3\2\2\2]\u0130\3\2\2\2_\u0132\3\2\2\2a\u013a\3\2\2\2c"+
-               
"\u0148\3\2\2\2e\u014e\3\2\2\2gh\7k\2\2hi\7p\2\2ij\7v\2\2jk\7g\2\2kl\7"+
-               
"p\2\2lm\7v\2\2m\4\3\2\2\2no\7q\2\2op\7t\2\2pq\7f\2\2qr\7g\2\2rs\7t\2\2"+
-               
"st\7g\2\2tu\7f\2\2u\6\3\2\2\2vw\7h\2\2wx\7n\2\2xy\7q\2\2yz\7y\2\2z\b\3"+
-               
"\2\2\2{|\7o\2\2|}\7g\2\2}~\7v\2\2~\177\7c\2\2\177\n\3\2\2\2\u0080\u0081"+
-               
"\7p\2\2\u0081\u0082\7w\2\2\u0082\u0083\7n\2\2\u0083\u0084\7n\2\2\u0084"+
-               
"\f\3\2\2\2\u0085\u0086\7v\2\2\u0086\u0087\7g\2\2\u0087\u0088\7t\2\2\u0088"+
-               
"\u0089\7o\2\2\u0089\16\3\2\2\2\u008a\u008b\7k\2\2\u008b\u008c\7f\2\2\u008c"+
-               
"\20\3\2\2\2\u008d\u008e\7c\2\2\u008e\u008f\7n\2\2\u008f\u0090\7k\2\2\u0090"+
-               
"\u0091\7c\2\2\u0091\u0092\7u\2\2\u0092\u0093\7g\2\2\u0093\u0094\7u\2\2"+
-               
"\u0094\22\3\2\2\2\u0095\u0096\7u\2\2\u0096\u0097\7v\2\2\u0097\u0098\7"+
-               
"c\2\2\u0098\u0099\7t\2\2\u0099\u009a\7v\2\2\u009a\u009b\7k\2\2\u009b\u009c"+
-               
"\7f\2\2\u009c\u009d\7z\2\2\u009d\24\3\2\2\2\u009e\u009f\7g\2\2\u009f\u00a0"+
-               
"\7p\2\2\u00a0\u00a1\7f\2\2\u00a1\u00a2\7k\2\2\u00a2\u00a3\7f\2\2\u00a3"+
-               
"\u00a4\7z\2\2\u00a4\26\3\2\2\2\u00a5\u00a6\7r\2\2\u00a6\u00a7\7c\2\2\u00a7"+
-               
"\u00a8\7t\2\2\u00a8\u00a9\7g\2\2\u00a9\u00aa\7p\2\2\u00aa\u00ab\7v\2\2"+
-               
"\u00ab\30\3\2\2\2\u00ac\u00ad\7i\2\2\u00ad\u00ae\7t\2\2\u00ae\u00af\7"+
-               
"q\2\2\u00af\u00b0\7w\2\2\u00b0\u00b1\7r\2\2\u00b1\u00b2\7u\2\2\u00b2\32"+
-               
"\3\2\2\2\u00b3\u00b4\7c\2\2\u00b4\u00b5\7p\2\2\u00b5\u00b6\7e\2\2\u00b6"+
-               
"\u00b7\7g\2\2\u00b7\u00b8\7u\2\2\u00b8\u00b9\7v\2\2\u00b9\u00ba\7q\2\2"+
-               
"\u00ba\u00bb\7t\2\2\u00bb\u00bc\7u\2\2\u00bc\34\3\2\2\2\u00bd\u00be\7"+
-               
"x\2\2\u00be\u00bf\7c\2\2\u00bf\u00c0\7n\2\2\u00c0\u00c1\7w\2\2\u00c1\u00c2"+
-               
"\7g\2\2\u00c2\36\3\2\2\2\u00c3\u00c7\5\65\33\2\u00c4\u00c6\n\2\2\2\u00c5"+
-               
"\u00c4\3\2\2\2\u00c6\u00c9\3\2\2\2\u00c7\u00c5\3\2\2\2\u00c7\u00c8\3\2"+
-               
"\2\2\u00c8\u00ca\3\2\2\2\u00c9\u00c7\3\2\2\2\u00ca\u00cb\5\65\33\2\u00cb"+
-               " 
\3\2\2\2\u00cc\u00d0\5\67\34\2\u00cd\u00cf\n\3\2\2\u00ce\u00cd\3\2\2"+
-               
"\2\u00cf\u00d2\3\2\2\2\u00d0\u00ce\3\2\2\2\u00d0\u00d1\3\2\2\2\u00d1\u00d3"+
-               
"\3\2\2\2\u00d2\u00d0\3\2\2\2\u00d3\u00d4\5\67\34\2\u00d4\"\3\2\2\2\u00d5"+
-               
"\u00d6\7?\2\2\u00d6\u00e3\7?\2\2\u00d7\u00d8\7#\2\2\u00d8\u00e3\7?\2\2"+
-               
"\u00d9\u00da\7@\2\2\u00da\u00e3\7?\2\2\u00db\u00dc\7>\2\2\u00dc\u00e3"+
-               
"\7?\2\2\u00dd\u00e3\t\4\2\2\u00de\u00df\7B\2\2\u00df\u00e3\7B\2\2\u00e0"+
-               
"\u00e1\7#\2\2\u00e1\u00e3\7B\2\2\u00e2\u00d5\3\2\2\2\u00e2\u00d7\3\2\2"+
-               
"\2\u00e2\u00d9\3\2\2\2\u00e2\u00db\3\2\2\2\u00e2\u00dd\3\2\2\2\u00e2\u00de"+
-               
"\3\2\2\2\u00e2\u00e0\3\2\2\2\u00e3$\3\2\2\2\u00e4\u00e5\7(\2\2\u00e5\u00e6"+
-               
"\7(\2\2\u00e6&\3\2\2\2\u00e7\u00e8\7~\2\2\u00e8\u00e9\7~\2\2\u00e9(\3"+
-               
"\2\2\2\u00ea\u00eb\7~\2\2\u00eb*\3\2\2\2\u00ec\u00ed\7#\2\2\u00ed,\3\2"+
-               
"\2\2\u00ee\u00ef\7*\2\2\u00ef.\3\2\2\2\u00f0\u00f1\7+\2\2\u00f1\60\3\2"+
-               
"\2\2\u00f2\u00f3\7}\2\2\u00f3\62\3\2\2\2\u00f4\u00f5\7\177\2\2\u00f5\64"+
-               
"\3\2\2\2\u00f6\u00f7\7)\2\2\u00f7\66\3\2\2\2\u00f8\u00f9\7$\2\2\u00f9"+
-               
"8\3\2\2\2\u00fa\u00fb\7\u0080\2\2\u00fb:\3\2\2\2\u00fc\u00fd\7@\2\2\u00fd"+
-               
"\u00fe\7@\2\2\u00fe<\3\2\2\2\u00ff\u0100\7]\2\2\u0100>\3\2\2\2\u0101\u0102"+
-               
"\7_\2\2\u0102@\3\2\2\2\u0103\u0104\7%\2\2\u0104B\3\2\2\2\u0105\u0106\7"+
-               
".\2\2\u0106D\3\2\2\2\u0107\u0108\7<\2\2\u0108F\3\2\2\2\u0109\u010a\7/"+
-               
"\2\2\u010aH\3\2\2\2\u010b\u010c\7\60\2\2\u010cJ\3\2\2\2\u010d\u010e\7"+
-               
"a\2\2\u010eL\3\2\2\2\u010f\u0110\7?\2\2\u0110N\3\2\2\2\u0111\u0112\7-"+
-               
"\2\2\u0112P\3\2\2\2\u0113\u0114\7A\2\2\u0114R\3\2\2\2\u0115\u0116\7,\2"+
-               
"\2\u0116T\3\2\2\2\u0117\u0118\7\61\2\2\u0118V\3\2\2\2\u0119\u011a\7&\2"+
-               
"\2\u011aX\3\2\2\2\u011b\u011c\7`\2\2\u011cZ\3\2\2\2\u011d\u011e\7v\2\2"+
-               
"\u011e\u011f\7t\2\2\u011f\u0120\7w\2\2\u0120\u0127\7g\2\2\u0121\u0122"+
-               
"\7h\2\2\u0122\u0123\7c\2\2\u0123\u0124\7n\2\2\u0124\u0125\7u\2\2\u0125"+
-               
"\u0127\7g\2\2\u0126\u011d\3\2\2\2\u0126\u0121\3\2\2\2\u0127\\\3\2\2\2"+
-               
"\u0128\u0131\7\62\2\2\u0129\u012d\t\5\2\2\u012a\u012c\t\6\2\2\u012b\u012a"+
-               
"\3\2\2\2\u012c\u012f\3\2\2\2\u012d\u012b\3\2\2\2\u012d\u012e\3\2\2\2\u012e"+
-               
"\u0131\3\2\2\2\u012f\u012d\3\2\2\2\u0130\u0128\3\2\2\2\u0130\u0129\3\2"+
-               
"\2\2\u0131^\3\2\2\2\u0132\u0134\5I%\2\u0133\u0135\t\7\2\2\u0134\u0133"+
-               
"\3\2\2\2\u0135\u0136\3\2\2\2\u0136\u0134\3\2\2\2\u0136\u0137\3\2\2\2\u0137"+
-               
"`\3\2\2\2\u0138\u013b\5K&\2\u0139\u013b\t\b\2\2\u013a\u0138\3\2\2\2\u013a"+
-               
"\u0139\3\2\2\2\u013b\u013c\3\2\2\2\u013c\u013a\3\2\2\2\u013c\u013d\3\2"+
-               
"\2\2\u013d\u0144\3\2\2\2\u013e\u0143\t\t\2\2\u013f\u0143\5E#\2\u0140\u0143"+
-               
"\5G$\2\u0141\u0143\5K&\2\u0142\u013e\3\2\2\2\u0142\u013f\3\2\2\2\u0142"+
-               
"\u0140\3\2\2\2\u0142\u0141\3\2\2\2\u0143\u0146\3\2\2\2\u0144\u0142\3\2"+
-               
"\2\2\u0144\u0145\3\2\2\2\u0145b\3\2\2\2\u0146\u0144\3\2\2\2\u0147\u0149"+
-               
"\t\n\2\2\u0148\u0147\3\2\2\2\u0149\u014a\3\2\2\2\u014a\u0148\3\2\2\2\u014a"+
-               
"\u014b\3\2\2\2\u014b\u014c\3\2\2\2\u014c\u014d\b\62\2\2\u014dd\3\2\2\2"+
-               
"\u014e\u014f\13\2\2\2\u014ff\3\2\2\2\17\2\u00c7\u00d0\u00e2\u0126\u012d"+
-               "\u0130\u0136\u013a\u013c\u0142\u0144\u014a\3\b\2\2";
+               
"\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\3[\3\2\2\2\5b\3\2\2\2\7"+
+               
"j\3\2\2\2\to\3\2\2\2\13t\3\2\2\2\ry\3\2\2\2\17\u0082\3\2\2\2\21\u0098"+
+               
"\3\2\2\2\23\u009a\3\2\2\2\25\u009d\3\2\2\2\27\u00a0\3\2\2\2\31\u00a2\3"+
+               
"\2\2\2\33\u00a4\3\2\2\2\35\u00a6\3\2\2\2\37\u00a8\3\2\2\2!\u00aa\3\2\2"+
+               
"\2#\u00ac\3\2\2\2%\u00ae\3\2\2\2\'\u00b0\3\2\2\2)\u00b2\3\2\2\2+\u00b5"+
+               
"\3\2\2\2-\u00b7\3\2\2\2/\u00b9\3\2\2\2\61\u00bb\3\2\2\2\63\u00bd\3\2\2"+
+               
"\2\65\u00bf\3\2\2\2\67\u00c1\3\2\2\29\u00c3\3\2\2\2;\u00c5\3\2\2\2=\u00c7"+
+               
"\3\2\2\2?\u00c9\3\2\2\2A\u00cb\3\2\2\2C\u00cd\3\2\2\2E\u00cf\3\2\2\2G"+
+               
"\u00d1\3\2\2\2I\u00d3\3\2\2\2K\u00de\3\2\2\2M\u00e0\3\2\2\2O\u00ed\3\2"+
+               
"\2\2Q\u00ef\3\2\2\2S\u00f5\3\2\2\2U\u00fe\3\2\2\2W\u010d\3\2\2\2Y\u0113"+
+               
"\3\2\2\2[\\\7k\2\2\\]\7p\2\2]^\7v\2\2^_\7g\2\2_`\7p\2\2`a\7v\2\2a\4\3"+
+               
"\2\2\2bc\7q\2\2cd\7t\2\2de\7f\2\2ef\7g\2\2fg\7t\2\2gh\7g\2\2hi\7f\2\2"+
+               
"i\6\3\2\2\2jk\7h\2\2kl\7n\2\2lm\7q\2\2mn\7y\2\2n\b\3\2\2\2op\7o\2\2pq"+
+               
"\7g\2\2qr\7v\2\2rs\7c\2\2s\n\3\2\2\2tu\7v\2\2uv\7g\2\2vw\7t\2\2wx\7o\2"+
+               
"\2x\f\3\2\2\2y}\5#\22\2z|\n\2\2\2{z\3\2\2\2|\177\3\2\2\2}{\3\2\2\2}~\3"+
+               
"\2\2\2~\u0080\3\2\2\2\177}\3\2\2\2\u0080\u0081\5#\22\2\u0081\16\3\2\2"+
+               
"\2\u0082\u0086\5%\23\2\u0083\u0085\n\3\2\2\u0084\u0083\3\2\2\2\u0085\u0088"+
+               
"\3\2\2\2\u0086\u0084\3\2\2\2\u0086\u0087\3\2\2\2\u0087\u0089\3\2\2\2\u0088"+
+               
"\u0086\3\2\2\2\u0089\u008a\5%\23\2\u008a\20\3\2\2\2\u008b\u008c\7?\2\2"+
+               
"\u008c\u0099\7?\2\2\u008d\u008e\7#\2\2\u008e\u0099\7?\2\2\u008f\u0090"+
+               
"\7@\2\2\u0090\u0099\7?\2\2\u0091\u0092\7>\2\2\u0092\u0099\7?\2\2\u0093"+
+               
"\u0099\t\4\2\2\u0094\u0095\7B\2\2\u0095\u0099\7B\2\2\u0096\u0097\7#\2"+
+               
"\2\u0097\u0099\7B\2\2\u0098\u008b\3\2\2\2\u0098\u008d\3\2\2\2\u0098\u008f"+
+               
"\3\2\2\2\u0098\u0091\3\2\2\2\u0098\u0093\3\2\2\2\u0098\u0094\3\2\2\2\u0098"+
+               
"\u0096\3\2\2\2\u0099\22\3\2\2\2\u009a\u009b\7(\2\2\u009b\u009c\7(\2\2"+
+               
"\u009c\24\3\2\2\2\u009d\u009e\7~\2\2\u009e\u009f\7~\2\2\u009f\26\3\2\2"+
+               
"\2\u00a0\u00a1\7~\2\2\u00a1\30\3\2\2\2\u00a2\u00a3\7#\2\2\u00a3\32\3\2"+
+               
"\2\2\u00a4\u00a5\7*\2\2\u00a5\34\3\2\2\2\u00a6\u00a7\7+\2\2\u00a7\36\3"+
+               "\2\2\2\u00a8\u00a9\7}\2\2\u00a9 
\3\2\2\2\u00aa\u00ab\7\177\2\2\u00ab\""+
+               
"\3\2\2\2\u00ac\u00ad\7)\2\2\u00ad$\3\2\2\2\u00ae\u00af\7$\2\2\u00af&\3"+
+               
"\2\2\2\u00b0\u00b1\7\u0080\2\2\u00b1(\3\2\2\2\u00b2\u00b3\7@\2\2\u00b3"+
+               
"\u00b4\7@\2\2\u00b4*\3\2\2\2\u00b5\u00b6\7]\2\2\u00b6,\3\2\2\2\u00b7\u00b8"+
+               
"\7_\2\2\u00b8.\3\2\2\2\u00b9\u00ba\7%\2\2\u00ba\60\3\2\2\2\u00bb\u00bc"+
+               
"\7.\2\2\u00bc\62\3\2\2\2\u00bd\u00be\7<\2\2\u00be\64\3\2\2\2\u00bf\u00c0"+
+               
"\7/\2\2\u00c0\66\3\2\2\2\u00c1\u00c2\7\60\2\2\u00c28\3\2\2\2\u00c3\u00c4"+
+               
"\7a\2\2\u00c4:\3\2\2\2\u00c5\u00c6\7?\2\2\u00c6<\3\2\2\2\u00c7\u00c8\7"+
+               
"-\2\2\u00c8>\3\2\2\2\u00c9\u00ca\7A\2\2\u00ca@\3\2\2\2\u00cb\u00cc\7,"+
+               
"\2\2\u00ccB\3\2\2\2\u00cd\u00ce\7\61\2\2\u00ceD\3\2\2\2\u00cf\u00d0\7"+
+               
"\'\2\2\u00d0F\3\2\2\2\u00d1\u00d2\7&\2\2\u00d2H\3\2\2\2\u00d3\u00d4\7"+
+               
"`\2\2\u00d4J\3\2\2\2\u00d5\u00d6\7v\2\2\u00d6\u00d7\7t\2\2\u00d7\u00d8"+
+               
"\7w\2\2\u00d8\u00df\7g\2\2\u00d9\u00da\7h\2\2\u00da\u00db\7c\2\2\u00db"+
+               
"\u00dc\7n\2\2\u00dc\u00dd\7u\2\2\u00dd\u00df\7g\2\2\u00de\u00d5\3\2\2"+
+               
"\2\u00de\u00d9\3\2\2\2\u00dfL\3\2\2\2\u00e0\u00e1\7p\2\2\u00e1\u00e2\7"+
+               
"w\2\2\u00e2\u00e3\7n\2\2\u00e3\u00e4\7n\2\2\u00e4N\3\2\2\2\u00e5\u00ee"+
+               
"\7\62\2\2\u00e6\u00ea\t\5\2\2\u00e7\u00e9\t\6\2\2\u00e8\u00e7\3\2\2\2"+
+               
"\u00e9\u00ec\3\2\2\2\u00ea\u00e8\3\2\2\2\u00ea\u00eb\3\2\2\2\u00eb\u00ee"+
+               
"\3\2\2\2\u00ec\u00ea\3\2\2\2\u00ed\u00e5\3\2\2\2\u00ed\u00e6\3\2\2\2\u00ee"+
+               
"P\3\2\2\2\u00ef\u00f1\5\67\34\2\u00f0\u00f2\t\7\2\2\u00f1\u00f0\3\2\2"+
+               
"\2\u00f2\u00f3\3\2\2\2\u00f3\u00f1\3\2\2\2\u00f3\u00f4\3\2\2\2\u00f4R"+
+               
"\3\2\2\2\u00f5\u00f7\t\b\2\2\u00f6\u00f8\t\t\2\2\u00f7\u00f6\3\2\2\2\u00f7"+
+               
"\u00f8\3\2\2\2\u00f8\u00f9\3\2\2\2\u00f9\u00fa\5O(\2\u00faT\3\2\2\2\u00fb"+
+               
"\u00ff\59\35\2\u00fc\u00ff\t\n\2\2\u00fd\u00ff\5G$\2\u00fe\u00fb\3\2\2"+
+               
"\2\u00fe\u00fc\3\2\2\2\u00fe\u00fd\3\2\2\2\u00ff\u0100\3\2\2\2\u0100\u00fe"+
+               
"\3\2\2\2\u0100\u0101\3\2\2\2\u0101\u0109\3\2\2\2\u0102\u0108\5G$\2\u0103"+
+               
"\u0108\t\13\2\2\u0104\u0108\5\63\32\2\u0105\u0108\5\65\33\2\u0106\u0108"+
+               
"\59\35\2\u0107\u0102\3\2\2\2\u0107\u0103\3\2\2\2\u0107\u0104\3\2\2\2\u0107"+
+               
"\u0105\3\2\2\2\u0107\u0106\3\2\2\2\u0108\u010b\3\2\2\2\u0109\u0107\3\2"+
+               
"\2\2\u0109\u010a\3\2\2\2\u010aV\3\2\2\2\u010b\u0109\3\2\2\2\u010c\u010e"+
+               
"\t\f\2\2\u010d\u010c\3\2\2\2\u010e\u010f\3\2\2\2\u010f\u010d\3\2\2\2\u010f"+
+               
"\u0110\3\2\2\2\u0110\u0111\3\2\2\2\u0111\u0112\b,\2\2\u0112X\3\2\2\2\u0113"+
+               
"\u0114\13\2\2\2\u0114Z\3\2\2\2\20\2}\u0086\u0098\u00de\u00ea\u00ed\u00f3"+
+               "\u00f7\u00fe\u0100\u0107\u0109\u010f\3\b\2\2";
        public static final ATN _ATN =
                new ATNDeserializer().deserialize(_serializedATN.toCharArray());
        static {
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.tokens
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.tokens
index 7b0f50b..eeb5a65 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.tokens
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslLexer.tokens
@@ -3,89 +3,76 @@ T__1=2
 T__2=3
 T__3=4
 T__4=5
-T__5=6
-T__6=7
-T__7=8
-T__8=9
-T__9=10
-T__10=11
-T__11=12
-T__12=13
-T__13=14
-SQSTRING=15
-DQSTRING=16
-PRED_OP=17
-AND=18
-OR=19
-VERT=20
-EXCL=21
-LPAREN=22
-RPAREN=23
-LCURLY=24
-RCURLY=25
-SQUOTE=26
-DQUOTE=27
-TILDA=28
-RIGHT=29
-LBR=30
-RBR=31
-POUND=32
-COMMA=33
-COLON=34
-MINUS=35
-DOT=36
-UNDERSCORE=37
-EQ=38
-PLUS=39
-QUESTION=40
-STAR=41
-DEVIDE=42
-DOLLAR=43
-POWER=44
-BOOL=45
-INT=46
-EXP=47
-ID=48
-WS=49
-ErrorCharacter=50
+SQSTRING=6
+DQSTRING=7
+PRED_OP=8
+AND=9
+OR=10
+VERT=11
+EXCL=12
+LPAREN=13
+RPAREN=14
+LCURLY=15
+RCURLY=16
+SQUOTE=17
+DQUOTE=18
+TILDA=19
+RIGHT=20
+LBR=21
+RBR=22
+POUND=23
+COMMA=24
+COLON=25
+MINUS=26
+DOT=27
+UNDERSCORE=28
+EQ=29
+PLUS=30
+QUESTION=31
+STAR=32
+FSLASH=33
+PERCENT=34
+DOLLAR=35
+POWER=36
+BOOL=37
+NULL=38
+INT=39
+REAL=40
+EXP=41
+ID=42
+WS=43
+ErrorCharacter=44
 'intent'=1
 'ordered'=2
 'flow'=3
 'meta'=4
-'null'=5
-'term'=6
-'id'=7
-'aliases'=8
-'startidx'=9
-'endidx'=10
-'parent'=11
-'groups'=12
-'ancestors'=13
-'value'=14
-'&&'=18
-'||'=19
-'|'=20
-'!'=21
-'('=22
-')'=23
-'{'=24
-'}'=25
-'\''=26
-'"'=27
-'~'=28
-'>>'=29
-'['=30
-']'=31
-'#'=32
-','=33
-':'=34
-'-'=35
-'.'=36
-'_'=37
-'='=38
-'+'=39
-'?'=40
-'*'=41
-'/'=42
-'$'=43
-'^'=44
+'term'=5
+'&&'=9
+'||'=10
+'|'=11
+'!'=12
+'('=13
+')'=14
+'{'=15
+'}'=16
+'\''=17
+'"'=18
+'~'=19
+'>>'=20
+'['=21
+']'=22
+'#'=23
+','=24
+':'=25
+'-'=26
+'.'=27
+'_'=28
+'='=29
+'+'=30
+'?'=31
+'*'=32
+'/'=33
+'%'=34
+'$'=35
+'^'=36
+'null'=38
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslListener.java
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslListener.java
index c09ec34..b8bb1c1 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslListener.java
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslListener.java
@@ -58,35 +58,45 @@ public interface NCIntentDslListener extends 
ParseTreeListener {
         */
        void exitMetaDecl(NCIntentDslParser.MetaDeclContext ctx);
        /**
-        * Enter a parse tree produced by {@link NCIntentDslParser#metaList}.
+        * Enter a parse tree produced by {@link NCIntentDslParser#jsonObj}.
         * @param ctx the parse tree
         */
-       void enterMetaList(NCIntentDslParser.MetaListContext ctx);
+       void enterJsonObj(NCIntentDslParser.JsonObjContext ctx);
        /**
-        * Exit a parse tree produced by {@link NCIntentDslParser#metaList}.
+        * Exit a parse tree produced by {@link NCIntentDslParser#jsonObj}.
         * @param ctx the parse tree
         */
-       void exitMetaList(NCIntentDslParser.MetaListContext ctx);
+       void exitJsonObj(NCIntentDslParser.JsonObjContext ctx);
        /**
-        * Enter a parse tree produced by {@link NCIntentDslParser#metaItem}.
+        * Enter a parse tree produced by {@link NCIntentDslParser#jsonPair}.
         * @param ctx the parse tree
         */
-       void enterMetaItem(NCIntentDslParser.MetaItemContext ctx);
+       void enterJsonPair(NCIntentDslParser.JsonPairContext ctx);
        /**
-        * Exit a parse tree produced by {@link NCIntentDslParser#metaItem}.
+        * Exit a parse tree produced by {@link NCIntentDslParser#jsonPair}.
         * @param ctx the parse tree
         */
-       void exitMetaItem(NCIntentDslParser.MetaItemContext ctx);
+       void exitJsonPair(NCIntentDslParser.JsonPairContext ctx);
        /**
-        * Enter a parse tree produced by {@link 
NCIntentDslParser#metaItemRval}.
+        * Enter a parse tree produced by {@link NCIntentDslParser#jsonVal}.
         * @param ctx the parse tree
         */
-       void enterMetaItemRval(NCIntentDslParser.MetaItemRvalContext ctx);
+       void enterJsonVal(NCIntentDslParser.JsonValContext ctx);
        /**
-        * Exit a parse tree produced by {@link NCIntentDslParser#metaItemRval}.
+        * Exit a parse tree produced by {@link NCIntentDslParser#jsonVal}.
         * @param ctx the parse tree
         */
-       void exitMetaItemRval(NCIntentDslParser.MetaItemRvalContext ctx);
+       void exitJsonVal(NCIntentDslParser.JsonValContext ctx);
+       /**
+        * Enter a parse tree produced by {@link NCIntentDslParser#jsonArr}.
+        * @param ctx the parse tree
+        */
+       void enterJsonArr(NCIntentDslParser.JsonArrContext ctx);
+       /**
+        * Exit a parse tree produced by {@link NCIntentDslParser#jsonArr}.
+        * @param ctx the parse tree
+        */
+       void exitJsonArr(NCIntentDslParser.JsonArrContext ctx);
        /**
         * Enter a parse tree produced by {@link NCIntentDslParser#terms}.
         * @param ctx the parse tree
@@ -118,125 +128,75 @@ public interface NCIntentDslListener extends 
ParseTreeListener {
         */
        void exitTerm(NCIntentDslParser.TermContext ctx);
        /**
-        * Enter a parse tree produced by {@link NCIntentDslParser#termId}.
-        * @param ctx the parse tree
-        */
-       void enterTermId(NCIntentDslParser.TermIdContext ctx);
-       /**
-        * Exit a parse tree produced by {@link NCIntentDslParser#termId}.
-        * @param ctx the parse tree
-        */
-       void exitTermId(NCIntentDslParser.TermIdContext ctx);
-       /**
-        * Enter a parse tree produced by {@link NCIntentDslParser#item}.
-        * @param ctx the parse tree
-        */
-       void enterItem(NCIntentDslParser.ItemContext ctx);
-       /**
-        * Exit a parse tree produced by {@link NCIntentDslParser#item}.
-        * @param ctx the parse tree
-        */
-       void exitItem(NCIntentDslParser.ItemContext ctx);
-       /**
-        * Enter a parse tree produced by {@link NCIntentDslParser#pred}.
-        * @param ctx the parse tree
-        */
-       void enterPred(NCIntentDslParser.PredContext ctx);
-       /**
-        * Exit a parse tree produced by {@link NCIntentDslParser#pred}.
-        * @param ctx the parse tree
-        */
-       void exitPred(NCIntentDslParser.PredContext ctx);
-       /**
-        * Enter a parse tree produced by {@link NCIntentDslParser#expr}.
-        * @param ctx the parse tree
-        */
-       void enterExpr(NCIntentDslParser.ExprContext ctx);
-       /**
-        * Exit a parse tree produced by {@link NCIntentDslParser#expr}.
-        * @param ctx the parse tree
-        */
-       void exitExpr(NCIntentDslParser.ExprContext ctx);
-       /**
-        * Enter a parse tree produced by {@link NCIntentDslParser#mathOp}.
-        * @param ctx the parse tree
-        */
-       void enterMathOp(NCIntentDslParser.MathOpContext ctx);
-       /**
-        * Exit a parse tree produced by {@link NCIntentDslParser#mathOp}.
-        * @param ctx the parse tree
-        */
-       void exitMathOp(NCIntentDslParser.MathOpContext ctx);
-       /**
-        * Enter a parse tree produced by {@link NCIntentDslParser#val}.
+        * Enter a parse tree produced by {@link NCIntentDslParser#clsNer}.
         * @param ctx the parse tree
         */
-       void enterVal(NCIntentDslParser.ValContext ctx);
+       void enterClsNer(NCIntentDslParser.ClsNerContext ctx);
        /**
-        * Exit a parse tree produced by {@link NCIntentDslParser#val}.
+        * Exit a parse tree produced by {@link NCIntentDslParser#clsNer}.
         * @param ctx the parse tree
         */
-       void exitVal(NCIntentDslParser.ValContext ctx);
+       void exitClsNer(NCIntentDslParser.ClsNerContext ctx);
        /**
-        * Enter a parse tree produced by {@link NCIntentDslParser#singleVal}.
+        * Enter a parse tree produced by {@link NCIntentDslParser#javaFqn}.
         * @param ctx the parse tree
         */
-       void enterSingleVal(NCIntentDslParser.SingleValContext ctx);
+       void enterJavaFqn(NCIntentDslParser.JavaFqnContext ctx);
        /**
-        * Exit a parse tree produced by {@link NCIntentDslParser#singleVal}.
+        * Exit a parse tree produced by {@link NCIntentDslParser#javaFqn}.
         * @param ctx the parse tree
         */
-       void exitSingleVal(NCIntentDslParser.SingleValContext ctx);
+       void exitJavaFqn(NCIntentDslParser.JavaFqnContext ctx);
        /**
-        * Enter a parse tree produced by {@link NCIntentDslParser#tokQual}.
+        * Enter a parse tree produced by {@link NCIntentDslParser#termId}.
         * @param ctx the parse tree
         */
-       void enterTokQual(NCIntentDslParser.TokQualContext ctx);
+       void enterTermId(NCIntentDslParser.TermIdContext ctx);
        /**
-        * Exit a parse tree produced by {@link NCIntentDslParser#tokQual}.
+        * Exit a parse tree produced by {@link NCIntentDslParser#termId}.
         * @param ctx the parse tree
         */
-       void exitTokQual(NCIntentDslParser.TokQualContext ctx);
+       void exitTermId(NCIntentDslParser.TermIdContext ctx);
        /**
-        * Enter a parse tree produced by {@link NCIntentDslParser#tokQualPart}.
+        * Enter a parse tree produced by {@link NCIntentDslParser#termDef}.
         * @param ctx the parse tree
         */
-       void enterTokQualPart(NCIntentDslParser.TokQualPartContext ctx);
+       void enterTermDef(NCIntentDslParser.TermDefContext ctx);
        /**
-        * Exit a parse tree produced by {@link NCIntentDslParser#tokQualPart}.
+        * Exit a parse tree produced by {@link NCIntentDslParser#termDef}.
         * @param ctx the parse tree
         */
-       void exitTokQualPart(NCIntentDslParser.TokQualPartContext ctx);
+       void exitTermDef(NCIntentDslParser.TermDefContext ctx);
        /**
-        * Enter a parse tree produced by {@link NCIntentDslParser#tokMeta}.
+        * Enter a parse tree produced by {@link NCIntentDslParser#termPred}.
         * @param ctx the parse tree
         */
-       void enterTokMeta(NCIntentDslParser.TokMetaContext ctx);
+       void enterTermPred(NCIntentDslParser.TermPredContext ctx);
        /**
-        * Exit a parse tree produced by {@link NCIntentDslParser#tokMeta}.
+        * Exit a parse tree produced by {@link NCIntentDslParser#termPred}.
         * @param ctx the parse tree
         */
-       void exitTokMeta(NCIntentDslParser.TokMetaContext ctx);
+       void exitTermPred(NCIntentDslParser.TermPredContext ctx);
        /**
-        * Enter a parse tree produced by {@link NCIntentDslParser#modelMeta}.
+        * Enter a parse tree produced by {@link NCIntentDslParser#expr}.
         * @param ctx the parse tree
         */
-       void enterModelMeta(NCIntentDslParser.ModelMetaContext ctx);
+       void enterExpr(NCIntentDslParser.ExprContext ctx);
        /**
-        * Exit a parse tree produced by {@link NCIntentDslParser#modelMeta}.
+        * Exit a parse tree produced by {@link NCIntentDslParser#expr}.
         * @param ctx the parse tree
         */
-       void exitModelMeta(NCIntentDslParser.ModelMetaContext ctx);
+       void exitExpr(NCIntentDslParser.ExprContext ctx);
        /**
-        * Enter a parse tree produced by {@link NCIntentDslParser#intentMeta}.
+        * Enter a parse tree produced by {@link NCIntentDslParser#val}.
         * @param ctx the parse tree
         */
-       void enterIntentMeta(NCIntentDslParser.IntentMetaContext ctx);
+       void enterVal(NCIntentDslParser.ValContext ctx);
        /**
-        * Exit a parse tree produced by {@link NCIntentDslParser#intentMeta}.
+        * Exit a parse tree produced by {@link NCIntentDslParser#val}.
         * @param ctx the parse tree
         */
-       void exitIntentMeta(NCIntentDslParser.IntentMetaContext ctx);
+       void exitVal(NCIntentDslParser.ValContext ctx);
        /**
         * Enter a parse tree produced by {@link NCIntentDslParser#qstring}.
         * @param ctx the parse tree
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslParser.java
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslParser.java
index 6b04ee5..5bbffa3 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslParser.java
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/antlr4/NCIntentDslParser.java
@@ -17,51 +17,47 @@ public class NCIntentDslParser extends Parser {
        protected static final PredictionContextCache _sharedContextCache =
                new PredictionContextCache();
        public static final int
-               T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, 
T__8=9, 
-               T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, SQSTRING=15, 
DQSTRING=16, 
-               PRED_OP=17, AND=18, OR=19, VERT=20, EXCL=21, LPAREN=22, 
RPAREN=23, LCURLY=24, 
-               RCURLY=25, SQUOTE=26, DQUOTE=27, TILDA=28, RIGHT=29, LBR=30, 
RBR=31, POUND=32, 
-               COMMA=33, COLON=34, MINUS=35, DOT=36, UNDERSCORE=37, EQ=38, 
PLUS=39, QUESTION=40, 
-               STAR=41, DEVIDE=42, DOLLAR=43, POWER=44, BOOL=45, INT=46, 
EXP=47, ID=48, 
-               WS=49, ErrorCharacter=50;
+               T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, SQSTRING=6, DQSTRING=7, 
PRED_OP=8, 
+               AND=9, OR=10, VERT=11, EXCL=12, LPAREN=13, RPAREN=14, 
LCURLY=15, RCURLY=16, 
+               SQUOTE=17, DQUOTE=18, TILDA=19, RIGHT=20, LBR=21, RBR=22, 
POUND=23, COMMA=24, 
+               COLON=25, MINUS=26, DOT=27, UNDERSCORE=28, EQ=29, PLUS=30, 
QUESTION=31, 
+               STAR=32, FSLASH=33, PERCENT=34, DOLLAR=35, POWER=36, BOOL=37, 
NULL=38, 
+               INT=39, REAL=40, EXP=41, ID=42, WS=43, ErrorCharacter=44;
        public static final int
                RULE_intent = 0, RULE_intentId = 1, RULE_orderedDecl = 2, 
RULE_flowDecl = 3, 
-               RULE_metaDecl = 4, RULE_metaList = 5, RULE_metaItem = 6, 
RULE_metaItemRval = 7, 
-               RULE_terms = 8, RULE_termEq = 9, RULE_term = 10, RULE_termId = 
11, RULE_item = 12, 
-               RULE_pred = 13, RULE_expr = 14, RULE_mathOp = 15, RULE_val = 
16, RULE_singleVal = 17, 
-               RULE_tokQual = 18, RULE_tokQualPart = 19, RULE_tokMeta = 20, 
RULE_modelMeta = 21, 
-               RULE_intentMeta = 22, RULE_qstring = 23, RULE_minMax = 24, 
RULE_minMaxShortcut = 25, 
-               RULE_minMaxRange = 26;
+               RULE_metaDecl = 4, RULE_jsonObj = 5, RULE_jsonPair = 6, 
RULE_jsonVal = 7, 
+               RULE_jsonArr = 8, RULE_terms = 9, RULE_termEq = 10, RULE_term = 
11, RULE_clsNer = 12, 
+               RULE_javaFqn = 13, RULE_termId = 14, RULE_termDef = 15, 
RULE_termPred = 16, 
+               RULE_expr = 17, RULE_val = 18, RULE_qstring = 19, RULE_minMax = 
20, RULE_minMaxShortcut = 21, 
+               RULE_minMaxRange = 22;
        private static String[] makeRuleNames() {
                return new String[] {
-                       "intent", "intentId", "orderedDecl", "flowDecl", 
"metaDecl", "metaList", 
-                       "metaItem", "metaItemRval", "terms", "termEq", "term", 
"termId", "item", 
-                       "pred", "expr", "mathOp", "val", "singleVal", 
"tokQual", "tokQualPart", 
-                       "tokMeta", "modelMeta", "intentMeta", "qstring", 
"minMax", "minMaxShortcut", 
-                       "minMaxRange"
+                       "intent", "intentId", "orderedDecl", "flowDecl", 
"metaDecl", "jsonObj", 
+                       "jsonPair", "jsonVal", "jsonArr", "terms", "termEq", 
"term", "clsNer", 
+                       "javaFqn", "termId", "termDef", "termPred", "expr", 
"val", "qstring", 
+                       "minMax", "minMaxShortcut", "minMaxRange"
                };
        }
        public static final String[] ruleNames = makeRuleNames();
 
        private static String[] makeLiteralNames() {
                return new String[] {
-                       null, "'intent'", "'ordered'", "'flow'", "'meta'", 
"'null'", "'term'", 
-                       "'id'", "'aliases'", "'startidx'", "'endidx'", 
"'parent'", "'groups'", 
-                       "'ancestors'", "'value'", null, null, null, "'&&'", 
"'||'", "'|'", "'!'", 
-                       "'('", "')'", "'{'", "'}'", "'''", "'\"'", "'~'", 
"'>>'", "'['", "']'", 
-                       "'#'", "','", "':'", "'-'", "'.'", "'_'", "'='", "'+'", 
"'?'", "'*'", 
-                       "'/'", "'$'", "'^'"
+                       null, "'intent'", "'ordered'", "'flow'", "'meta'", 
"'term'", null, null, 
+                       null, "'&&'", "'||'", "'|'", "'!'", "'('", "')'", 
"'{'", "'}'", "'''", 
+                       "'\"'", "'~'", "'>>'", "'['", "']'", "'#'", "','", 
"':'", "'-'", "'.'", 
+                       "'_'", "'='", "'+'", "'?'", "'*'", "'/'", "'%'", "'$'", 
"'^'", null, 
+                       "'null'"
                };
        }
        private static final String[] _LITERAL_NAMES = makeLiteralNames();
        private static String[] makeSymbolicNames() {
                return new String[] {
-                       null, null, null, null, null, null, null, null, null, 
null, null, null, 
-                       null, null, null, "SQSTRING", "DQSTRING", "PRED_OP", 
"AND", "OR", "VERT", 
-                       "EXCL", "LPAREN", "RPAREN", "LCURLY", "RCURLY", 
"SQUOTE", "DQUOTE", "TILDA", 
-                       "RIGHT", "LBR", "RBR", "POUND", "COMMA", "COLON", 
"MINUS", "DOT", "UNDERSCORE", 
-                       "EQ", "PLUS", "QUESTION", "STAR", "DEVIDE", "DOLLAR", 
"POWER", "BOOL", 
-                       "INT", "EXP", "ID", "WS", "ErrorCharacter"
+                       null, null, null, null, null, null, "SQSTRING", 
"DQSTRING", "PRED_OP", 
+                       "AND", "OR", "VERT", "EXCL", "LPAREN", "RPAREN", 
"LCURLY", "RCURLY", 
+                       "SQUOTE", "DQUOTE", "TILDA", "RIGHT", "LBR", "RBR", 
"POUND", "COMMA", 
+                       "COLON", "MINUS", "DOT", "UNDERSCORE", "EQ", "PLUS", 
"QUESTION", "STAR", 
+                       "FSLASH", "PERCENT", "DOLLAR", "POWER", "BOOL", "NULL", 
"INT", "REAL", 
+                       "EXP", "ID", "WS", "ErrorCharacter"
                };
        }
        private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
@@ -153,41 +149,41 @@ public class NCIntentDslParser extends Parser {
                try {
                        enterOuterAlt(_localctx, 1);
                        {
-                       setState(54);
+                       setState(46);
                        intentId();
-                       setState(56);
+                       setState(48);
                        _errHandler.sync(this);
                        _la = _input.LA(1);
                        if (_la==T__1) {
                                {
-                               setState(55);
+                               setState(47);
                                orderedDecl();
                                }
                        }
 
-                       setState(59);
+                       setState(51);
                        _errHandler.sync(this);
                        _la = _input.LA(1);
                        if (_la==T__2) {
                                {
-                               setState(58);
+                               setState(50);
                                flowDecl();
                                }
                        }
 
-                       setState(62);
+                       setState(54);
                        _errHandler.sync(this);
                        _la = _input.LA(1);
                        if (_la==T__3) {
                                {
-                               setState(61);
+                               setState(53);
                                metaDecl();
                                }
                        }
 
-                       setState(64);
+                       setState(56);
                        terms(0);
-                       setState(65);
+                       setState(57);
                        match(EOF);
                        }
                }
@@ -225,11 +221,11 @@ public class NCIntentDslParser extends Parser {
                try {
                        enterOuterAlt(_localctx, 1);
                        {
-                       setState(67);
+                       setState(59);
                        match(T__0);
-                       setState(68);
+                       setState(60);
                        match(EQ);
-                       setState(69);
+                       setState(61);
                        match(ID);
                        }
                }
@@ -267,11 +263,11 @@ public class NCIntentDslParser extends Parser {
                try {
                        enterOuterAlt(_localctx, 1);
                        {
-                       setState(71);
+                       setState(63);
                        match(T__1);
-                       setState(72);
+                       setState(64);
                        match(EQ);
-                       setState(73);
+                       setState(65);
                        match(BOOL);
                        }
                }
@@ -311,11 +307,11 @@ public class NCIntentDslParser extends Parser {
                try {
                        enterOuterAlt(_localctx, 1);
                        {
-                       setState(75);
+                       setState(67);
                        match(T__2);
-                       setState(76);
+                       setState(68);
                        match(EQ);
-                       setState(77);
+                       setState(69);
                        qstring();
                        }
                }
@@ -332,10 +328,8 @@ public class NCIntentDslParser extends Parser {
 
        public static class MetaDeclContext extends ParserRuleContext {
                public TerminalNode EQ() { return 
getToken(NCIntentDslParser.EQ, 0); }
-               public TerminalNode LCURLY() { return 
getToken(NCIntentDslParser.LCURLY, 0); }
-               public TerminalNode RCURLY() { return 
getToken(NCIntentDslParser.RCURLY, 0); }
-               public MetaListContext metaList() {
-                       return getRuleContext(MetaListContext.class,0);
+               public JsonObjContext jsonObj() {
+                       return getRuleContext(JsonObjContext.class,0);
                }
                public MetaDeclContext(ParserRuleContext parent, int 
invokingState) {
                        super(parent, invokingState);
@@ -354,28 +348,15 @@ public class NCIntentDslParser extends Parser {
        public final MetaDeclContext metaDecl() throws RecognitionException {
                MetaDeclContext _localctx = new MetaDeclContext(_ctx, 
getState());
                enterRule(_localctx, 8, RULE_metaDecl);
-               int _la;
                try {
                        enterOuterAlt(_localctx, 1);
                        {
-                       setState(79);
+                       setState(71);
                        match(T__3);
-                       setState(80);
+                       setState(72);
                        match(EQ);
-                       setState(81);
-                       match(LCURLY);
-                       setState(83);
-                       _errHandler.sync(this);
-                       _la = _input.LA(1);
-                       if (_la==SQSTRING || _la==DQSTRING) {
-                               {
-                               setState(82);
-                               metaList(0);
-                               }
-                       }
-
-                       setState(85);
-                       match(RCURLY);
+                       setState(73);
+                       jsonObj();
                        }
                }
                catch (RecognitionException re) {
@@ -389,72 +370,77 @@ public class NCIntentDslParser extends Parser {
                return _localctx;
        }
 
-       public static class MetaListContext extends ParserRuleContext {
-               public MetaItemContext metaItem() {
-                       return getRuleContext(MetaItemContext.class,0);
+       public static class JsonObjContext extends ParserRuleContext {
+               public TerminalNode LCURLY() { return 
getToken(NCIntentDslParser.LCURLY, 0); }
+               public List<JsonPairContext> jsonPair() {
+                       return getRuleContexts(JsonPairContext.class);
                }
-               public MetaListContext metaList() {
-                       return getRuleContext(MetaListContext.class,0);
+               public JsonPairContext jsonPair(int i) {
+                       return getRuleContext(JsonPairContext.class,i);
                }
-               public TerminalNode COMMA() { return 
getToken(NCIntentDslParser.COMMA, 0); }
-               public MetaListContext(ParserRuleContext parent, int 
invokingState) {
+               public TerminalNode RCURLY() { return 
getToken(NCIntentDslParser.RCURLY, 0); }
+               public List<TerminalNode> COMMA() { return 
getTokens(NCIntentDslParser.COMMA); }
+               public TerminalNode COMMA(int i) {
+                       return getToken(NCIntentDslParser.COMMA, i);
+               }
+               public JsonObjContext(ParserRuleContext parent, int 
invokingState) {
                        super(parent, invokingState);
                }
-               @Override public int getRuleIndex() { return RULE_metaList; }
+               @Override public int getRuleIndex() { return RULE_jsonObj; }
                @Override
                public void enterRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterMetaList(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterJsonObj(this);
                }
                @Override
                public void exitRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitMetaList(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitJsonObj(this);
                }
        }
 
-       public final MetaListContext metaList() throws RecognitionException {
-               return metaList(0);
-       }
-
-       private MetaListContext metaList(int _p) throws RecognitionException {
-               ParserRuleContext _parentctx = _ctx;
-               int _parentState = getState();
-               MetaListContext _localctx = new MetaListContext(_ctx, 
_parentState);
-               MetaListContext _prevctx = _localctx;
-               int _startState = 10;
-               enterRecursionRule(_localctx, 10, RULE_metaList, _p);
+       public final JsonObjContext jsonObj() throws RecognitionException {
+               JsonObjContext _localctx = new JsonObjContext(_ctx, getState());
+               enterRule(_localctx, 10, RULE_jsonObj);
+               int _la;
                try {
-                       int _alt;
-                       enterOuterAlt(_localctx, 1);
-                       {
-                       {
                        setState(88);
-                       metaItem();
-                       }
-                       _ctx.stop = _input.LT(-1);
-                       setState(95);
                        _errHandler.sync(this);
-                       _alt = getInterpreter().adaptivePredict(_input,4,_ctx);
-                       while ( _alt!=2 && 
_alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
-                               if ( _alt==1 ) {
-                                       if ( _parseListeners!=null ) 
triggerExitRuleEvent();
-                                       _prevctx = _localctx;
+                       switch ( 
getInterpreter().adaptivePredict(_input,4,_ctx) ) {
+                       case 1:
+                               enterOuterAlt(_localctx, 1);
+                               {
+                               setState(75);
+                               match(LCURLY);
+                               setState(76);
+                               jsonPair();
+                               setState(81);
+                               _errHandler.sync(this);
+                               _la = _input.LA(1);
+                               while (_la==COMMA) {
                                        {
                                        {
-                                       _localctx = new 
MetaListContext(_parentctx, _parentState);
-                                       pushNewRecursionContext(_localctx, 
_startState, RULE_metaList);
-                                       setState(90);
-                                       if (!(precpred(_ctx, 1))) throw new 
FailedPredicateException(this, "precpred(_ctx, 1)");
-                                       setState(91);
+                                       setState(77);
                                        match(COMMA);
-                                       setState(92);
-                                       metaItem();
+                                       setState(78);
+                                       jsonPair();
                                        }
-                                       } 
+                                       }
+                                       setState(83);
+                                       _errHandler.sync(this);
+                                       _la = _input.LA(1);
                                }
-                               setState(97);
-                               _errHandler.sync(this);
-                               _alt = 
getInterpreter().adaptivePredict(_input,4,_ctx);
-                       }
+                               setState(84);
+                               match(RCURLY);
+                               }
+                               break;
+                       case 2:
+                               enterOuterAlt(_localctx, 2);
+                               {
+                               setState(86);
+                               match(LCURLY);
+                               setState(87);
+                               match(RCURLY);
+                               }
+                               break;
                        }
                }
                catch (RecognitionException re) {
@@ -463,45 +449,45 @@ public class NCIntentDslParser extends Parser {
                        _errHandler.recover(this, re);
                }
                finally {
-                       unrollRecursionContexts(_parentctx);
+                       exitRule();
                }
                return _localctx;
        }
 
-       public static class MetaItemContext extends ParserRuleContext {
+       public static class JsonPairContext extends ParserRuleContext {
                public QstringContext qstring() {
                        return getRuleContext(QstringContext.class,0);
                }
                public TerminalNode COLON() { return 
getToken(NCIntentDslParser.COLON, 0); }
-               public MetaItemRvalContext metaItemRval() {
-                       return getRuleContext(MetaItemRvalContext.class,0);
+               public JsonValContext jsonVal() {
+                       return getRuleContext(JsonValContext.class,0);
                }
-               public MetaItemContext(ParserRuleContext parent, int 
invokingState) {
+               public JsonPairContext(ParserRuleContext parent, int 
invokingState) {
                        super(parent, invokingState);
                }
-               @Override public int getRuleIndex() { return RULE_metaItem; }
+               @Override public int getRuleIndex() { return RULE_jsonPair; }
                @Override
                public void enterRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterMetaItem(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterJsonPair(this);
                }
                @Override
                public void exitRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitMetaItem(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitJsonPair(this);
                }
        }
 
-       public final MetaItemContext metaItem() throws RecognitionException {
-               MetaItemContext _localctx = new MetaItemContext(_ctx, 
getState());
-               enterRule(_localctx, 12, RULE_metaItem);
+       public final JsonPairContext jsonPair() throws RecognitionException {
+               JsonPairContext _localctx = new JsonPairContext(_ctx, 
getState());
+               enterRule(_localctx, 12, RULE_jsonPair);
                try {
                        enterOuterAlt(_localctx, 1);
                        {
-                       setState(98);
+                       setState(90);
                        qstring();
-                       setState(99);
+                       setState(91);
                        match(COLON);
-                       setState(100);
-                       metaItemRval();
+                       setState(92);
+                       jsonVal();
                        }
                }
                catch (RecognitionException re) {
@@ -515,52 +501,116 @@ public class NCIntentDslParser extends Parser {
                return _localctx;
        }
 
-       public static class MetaItemRvalContext extends ParserRuleContext {
-               public TerminalNode BOOL() { return 
getToken(NCIntentDslParser.BOOL, 0); }
+       public static class JsonValContext extends ParserRuleContext {
                public QstringContext qstring() {
                        return getRuleContext(QstringContext.class,0);
                }
-               public MetaItemRvalContext(ParserRuleContext parent, int 
invokingState) {
+               public TerminalNode INT() { return 
getToken(NCIntentDslParser.INT, 0); }
+               public TerminalNode MINUS() { return 
getToken(NCIntentDslParser.MINUS, 0); }
+               public TerminalNode REAL() { return 
getToken(NCIntentDslParser.REAL, 0); }
+               public TerminalNode EXP() { return 
getToken(NCIntentDslParser.EXP, 0); }
+               public JsonObjContext jsonObj() {
+                       return getRuleContext(JsonObjContext.class,0);
+               }
+               public JsonArrContext jsonArr() {
+                       return getRuleContext(JsonArrContext.class,0);
+               }
+               public TerminalNode BOOL() { return 
getToken(NCIntentDslParser.BOOL, 0); }
+               public TerminalNode NULL() { return 
getToken(NCIntentDslParser.NULL, 0); }
+               public JsonValContext(ParserRuleContext parent, int 
invokingState) {
                        super(parent, invokingState);
                }
-               @Override public int getRuleIndex() { return RULE_metaItemRval; 
}
+               @Override public int getRuleIndex() { return RULE_jsonVal; }
                @Override
                public void enterRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterMetaItemRval(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterJsonVal(this);
                }
                @Override
                public void exitRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitMetaItemRval(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitJsonVal(this);
                }
        }
 
-       public final MetaItemRvalContext metaItemRval() throws 
RecognitionException {
-               MetaItemRvalContext _localctx = new MetaItemRvalContext(_ctx, 
getState());
-               enterRule(_localctx, 14, RULE_metaItemRval);
+       public final JsonValContext jsonVal() throws RecognitionException {
+               JsonValContext _localctx = new JsonValContext(_ctx, getState());
+               enterRule(_localctx, 14, RULE_jsonVal);
+               int _la;
                try {
-                       setState(105);
+                       setState(109);
                        _errHandler.sync(this);
                        switch (_input.LA(1)) {
-                       case T__4:
+                       case SQSTRING:
+                       case DQSTRING:
                                enterOuterAlt(_localctx, 1);
                                {
-                               setState(102);
-                               match(T__4);
+                               setState(94);
+                               qstring();
                                }
                                break;
-                       case BOOL:
+                       case MINUS:
+                       case INT:
                                enterOuterAlt(_localctx, 2);
                                {
+                               setState(96);
+                               _errHandler.sync(this);
+                               _la = _input.LA(1);
+                               if (_la==MINUS) {
+                                       {
+                                       setState(95);
+                                       match(MINUS);
+                                       }
+                               }
+
+                               setState(98);
+                               match(INT);
+                               setState(100);
+                               _errHandler.sync(this);
+                               _la = _input.LA(1);
+                               if (_la==REAL) {
+                                       {
+                                       setState(99);
+                                       match(REAL);
+                                       }
+                               }
+
                                setState(103);
-                               match(BOOL);
+                               _errHandler.sync(this);
+                               _la = _input.LA(1);
+                               if (_la==EXP) {
+                                       {
+                                       setState(102);
+                                       match(EXP);
+                                       }
+                               }
+
                                }
                                break;
-                       case SQSTRING:
-                       case DQSTRING:
+                       case LCURLY:
                                enterOuterAlt(_localctx, 3);
                                {
-                               setState(104);
-                               qstring();
+                               setState(105);
+                               jsonObj();
+                               }
+                               break;
+                       case LBR:
+                               enterOuterAlt(_localctx, 4);
+                               {
+                               setState(106);
+                               jsonArr();
+                               }
+                               break;
+                       case BOOL:
+                               enterOuterAlt(_localctx, 5);
+                               {
+                               setState(107);
+                               match(BOOL);
+                               }
+                               break;
+                       case NULL:
+                               enterOuterAlt(_localctx, 6);
+                               {
+                               setState(108);
+                               match(NULL);
                                }
                                break;
                        default:
@@ -578,6 +628,90 @@ public class NCIntentDslParser extends Parser {
                return _localctx;
        }
 
+       public static class JsonArrContext extends ParserRuleContext {
+               public TerminalNode LBR() { return 
getToken(NCIntentDslParser.LBR, 0); }
+               public List<JsonValContext> jsonVal() {
+                       return getRuleContexts(JsonValContext.class);
+               }
+               public JsonValContext jsonVal(int i) {
+                       return getRuleContext(JsonValContext.class,i);
+               }
+               public TerminalNode RBR() { return 
getToken(NCIntentDslParser.RBR, 0); }
+               public List<TerminalNode> COMMA() { return 
getTokens(NCIntentDslParser.COMMA); }
+               public TerminalNode COMMA(int i) {
+                       return getToken(NCIntentDslParser.COMMA, i);
+               }
+               public JsonArrContext(ParserRuleContext parent, int 
invokingState) {
+                       super(parent, invokingState);
+               }
+               @Override public int getRuleIndex() { return RULE_jsonArr; }
+               @Override
+               public void enterRule(ParseTreeListener listener) {
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterJsonArr(this);
+               }
+               @Override
+               public void exitRule(ParseTreeListener listener) {
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitJsonArr(this);
+               }
+       }
+
+       public final JsonArrContext jsonArr() throws RecognitionException {
+               JsonArrContext _localctx = new JsonArrContext(_ctx, getState());
+               enterRule(_localctx, 16, RULE_jsonArr);
+               int _la;
+               try {
+                       setState(124);
+                       _errHandler.sync(this);
+                       switch ( 
getInterpreter().adaptivePredict(_input,10,_ctx) ) {
+                       case 1:
+                               enterOuterAlt(_localctx, 1);
+                               {
+                               setState(111);
+                               match(LBR);
+                               setState(112);
+                               jsonVal();
+                               setState(117);
+                               _errHandler.sync(this);
+                               _la = _input.LA(1);
+                               while (_la==COMMA) {
+                                       {
+                                       {
+                                       setState(113);
+                                       match(COMMA);
+                                       setState(114);
+                                       jsonVal();
+                                       }
+                                       }
+                                       setState(119);
+                                       _errHandler.sync(this);
+                                       _la = _input.LA(1);
+                               }
+                               setState(120);
+                               match(RBR);
+                               }
+                               break;
+                       case 2:
+                               enterOuterAlt(_localctx, 2);
+                               {
+                               setState(122);
+                               match(LBR);
+                               setState(123);
+                               match(RBR);
+                               }
+                               break;
+                       }
+               }
+               catch (RecognitionException re) {
+                       _localctx.exception = re;
+                       _errHandler.reportError(this, re);
+                       _errHandler.recover(this, re);
+               }
+               finally {
+                       exitRule();
+               }
+               return _localctx;
+       }
+
        public static class TermsContext extends ParserRuleContext {
                public TermContext term() {
                        return getRuleContext(TermContext.class,0);
@@ -608,20 +742,20 @@ public class NCIntentDslParser extends Parser {
                int _parentState = getState();
                TermsContext _localctx = new TermsContext(_ctx, _parentState);
                TermsContext _prevctx = _localctx;
-               int _startState = 16;
-               enterRecursionRule(_localctx, 16, RULE_terms, _p);
+               int _startState = 18;
+               enterRecursionRule(_localctx, 18, RULE_terms, _p);
                try {
                        int _alt;
                        enterOuterAlt(_localctx, 1);
                        {
                        {
-                       setState(108);
+                       setState(127);
                        term();
                        }
                        _ctx.stop = _input.LT(-1);
-                       setState(114);
+                       setState(133);
                        _errHandler.sync(this);
-                       _alt = getInterpreter().adaptivePredict(_input,6,_ctx);
+                       _alt = getInterpreter().adaptivePredict(_input,11,_ctx);
                        while ( _alt!=2 && 
_alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
                                if ( _alt==1 ) {
                                        if ( _parseListeners!=null ) 
triggerExitRuleEvent();
@@ -630,16 +764,16 @@ public class NCIntentDslParser extends Parser {
                                        {
                                        _localctx = new 
TermsContext(_parentctx, _parentState);
                                        pushNewRecursionContext(_localctx, 
_startState, RULE_terms);
-                                       setState(110);
+                                       setState(129);
                                        if (!(precpred(_ctx, 1))) throw new 
FailedPredicateException(this, "precpred(_ctx, 1)");
-                                       setState(111);
+                                       setState(130);
                                        term();
                                        }
                                        } 
                                }
-                               setState(116);
+                               setState(135);
                                _errHandler.sync(this);
-                               _alt = 
getInterpreter().adaptivePredict(_input,6,_ctx);
+                               _alt = 
getInterpreter().adaptivePredict(_input,11,_ctx);
                        }
                        }
                }
@@ -673,12 +807,12 @@ public class NCIntentDslParser extends Parser {
 
        public final TermEqContext termEq() throws RecognitionException {
                TermEqContext _localctx = new TermEqContext(_ctx, getState());
-               enterRule(_localctx, 18, RULE_termEq);
+               enterRule(_localctx, 20, RULE_termEq);
                int _la;
                try {
                        enterOuterAlt(_localctx, 1);
                        {
-                       setState(117);
+                       setState(136);
                        _la = _input.LA(1);
                        if ( !(_la==TILDA || _la==EQ) ) {
                        _errHandler.recoverInline(this);
@@ -705,17 +839,24 @@ public class NCIntentDslParser extends Parser {
                public TermEqContext termEq() {
                        return getRuleContext(TermEqContext.class,0);
                }
-               public TerminalNode LCURLY() { return 
getToken(NCIntentDslParser.LCURLY, 0); }
-               public ItemContext item() {
-                       return getRuleContext(ItemContext.class,0);
-               }
-               public TerminalNode RCURLY() { return 
getToken(NCIntentDslParser.RCURLY, 0); }
                public TermIdContext termId() {
                        return getRuleContext(TermIdContext.class,0);
                }
                public MinMaxContext minMax() {
                        return getRuleContext(MinMaxContext.class,0);
                }
+               public TerminalNode LCURLY() { return 
getToken(NCIntentDslParser.LCURLY, 0); }
+               public TermDefContext termDef() {
+                       return getRuleContext(TermDefContext.class,0);
+               }
+               public TerminalNode RCURLY() { return 
getToken(NCIntentDslParser.RCURLY, 0); }
+               public List<TerminalNode> FSLASH() { return 
getTokens(NCIntentDslParser.FSLASH); }
+               public TerminalNode FSLASH(int i) {
+                       return getToken(NCIntentDslParser.FSLASH, i);
+               }
+               public ClsNerContext clsNer() {
+                       return getRuleContext(ClsNerContext.class,0);
+               }
                public TermContext(ParserRuleContext parent, int invokingState) 
{
                        super(parent, invokingState);
                }
@@ -732,37 +873,61 @@ public class NCIntentDslParser extends Parser {
 
        public final TermContext term() throws RecognitionException {
                TermContext _localctx = new TermContext(_ctx, getState());
-               enterRule(_localctx, 20, RULE_term);
+               enterRule(_localctx, 22, RULE_term);
                int _la;
                try {
                        enterOuterAlt(_localctx, 1);
                        {
-                       setState(119);
-                       match(T__5);
-                       setState(121);
+                       setState(138);
+                       match(T__4);
+                       setState(140);
                        _errHandler.sync(this);
                        _la = _input.LA(1);
                        if (_la==LPAREN) {
                                {
-                               setState(120);
+                               setState(139);
                                termId();
                                }
                        }
 
-                       setState(123);
+                       setState(142);
                        termEq();
-                       setState(124);
-                       match(LCURLY);
-                       setState(125);
-                       item(0);
-                       setState(126);
-                       match(RCURLY);
-                       setState(128);
+                       setState(151);
+                       _errHandler.sync(this);
+                       switch (_input.LA(1)) {
+                       case LCURLY:
+                               {
+                               {
+                               setState(143);
+                               match(LCURLY);
+                               setState(144);
+                               termDef(0);
+                               setState(145);
+                               match(RCURLY);
+                               }
+                               }
+                               break;
+                       case FSLASH:
+                               {
+                               {
+                               setState(147);
+                               match(FSLASH);
+                               setState(148);
+                               clsNer();
+                               setState(149);
+                               match(FSLASH);
+                               }
+                               }
+                               break;
+                       default:
+                               throw new NoViableAltException(this);
+                       }
+                       setState(154);
                        _errHandler.sync(this);
-                       switch ( 
getInterpreter().adaptivePredict(_input,8,_ctx) ) {
+                       switch ( 
getInterpreter().adaptivePredict(_input,14,_ctx) ) {
                        case 1:
                                {
-                               setState(127);
+                               setState(153);
                                minMax();
                                }
                                break;
@@ -780,36 +945,47 @@ public class NCIntentDslParser extends Parser {
                return _localctx;
        }
 
-       public static class TermIdContext extends ParserRuleContext {
-               public TerminalNode LPAREN() { return 
getToken(NCIntentDslParser.LPAREN, 0); }
+       public static class ClsNerContext extends ParserRuleContext {
+               public TerminalNode POUND() { return 
getToken(NCIntentDslParser.POUND, 0); }
                public TerminalNode ID() { return 
getToken(NCIntentDslParser.ID, 0); }
-               public TerminalNode RPAREN() { return 
getToken(NCIntentDslParser.RPAREN, 0); }
-               public TermIdContext(ParserRuleContext parent, int 
invokingState) {
+               public JavaFqnContext javaFqn() {
+                       return getRuleContext(JavaFqnContext.class,0);
+               }
+               public ClsNerContext(ParserRuleContext parent, int 
invokingState) {
                        super(parent, invokingState);
                }
-               @Override public int getRuleIndex() { return RULE_termId; }
+               @Override public int getRuleIndex() { return RULE_clsNer; }
                @Override
                public void enterRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterTermId(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterClsNer(this);
                }
                @Override
                public void exitRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitTermId(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitClsNer(this);
                }
        }
 
-       public final TermIdContext termId() throws RecognitionException {
-               TermIdContext _localctx = new TermIdContext(_ctx, getState());
-               enterRule(_localctx, 22, RULE_termId);
+       public final ClsNerContext clsNer() throws RecognitionException {
+               ClsNerContext _localctx = new ClsNerContext(_ctx, getState());
+               enterRule(_localctx, 24, RULE_clsNer);
+               int _la;
                try {
                        enterOuterAlt(_localctx, 1);
                        {
-                       setState(130);
-                       match(LPAREN);
-                       setState(131);
+                       setState(157);
+                       _errHandler.sync(this);
+                       _la = _input.LA(1);
+                       if (_la==ID) {
+                               {
+                               setState(156);
+                               javaFqn(0);
+                               }
+                       }
+
+                       setState(159);
+                       match(POUND);
+                       setState(160);
                        match(ID);
-                       setState(132);
-                       match(RPAREN);
                        }
                }
                catch (RecognitionException re) {
@@ -823,111 +999,69 @@ public class NCIntentDslParser extends Parser {
                return _localctx;
        }
 
-       public static class ItemContext extends ParserRuleContext {
-               public PredContext pred() {
-                       return getRuleContext(PredContext.class,0);
-               }
-               public TerminalNode LPAREN() { return 
getToken(NCIntentDslParser.LPAREN, 0); }
-               public List<ItemContext> item() {
-                       return getRuleContexts(ItemContext.class);
-               }
-               public ItemContext item(int i) {
-                       return getRuleContext(ItemContext.class,i);
+       public static class JavaFqnContext extends ParserRuleContext {
+               public TerminalNode ID() { return 
getToken(NCIntentDslParser.ID, 0); }
+               public JavaFqnContext javaFqn() {
+                       return getRuleContext(JavaFqnContext.class,0);
                }
-               public TerminalNode RPAREN() { return 
getToken(NCIntentDslParser.RPAREN, 0); }
-               public TerminalNode EXCL() { return 
getToken(NCIntentDslParser.EXCL, 0); }
-               public TerminalNode AND() { return 
getToken(NCIntentDslParser.AND, 0); }
-               public TerminalNode OR() { return 
getToken(NCIntentDslParser.OR, 0); }
-               public ItemContext(ParserRuleContext parent, int invokingState) 
{
+               public TerminalNode DOT() { return 
getToken(NCIntentDslParser.DOT, 0); }
+               public JavaFqnContext(ParserRuleContext parent, int 
invokingState) {
                        super(parent, invokingState);
                }
-               @Override public int getRuleIndex() { return RULE_item; }
+               @Override public int getRuleIndex() { return RULE_javaFqn; }
                @Override
                public void enterRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterItem(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterJavaFqn(this);
                }
                @Override
                public void exitRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitItem(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitJavaFqn(this);
                }
        }
 
-       public final ItemContext item() throws RecognitionException {
-               return item(0);
+       public final JavaFqnContext javaFqn() throws RecognitionException {
+               return javaFqn(0);
        }
 
-       private ItemContext item(int _p) throws RecognitionException {
+       private JavaFqnContext javaFqn(int _p) throws RecognitionException {
                ParserRuleContext _parentctx = _ctx;
                int _parentState = getState();
-               ItemContext _localctx = new ItemContext(_ctx, _parentState);
-               ItemContext _prevctx = _localctx;
-               int _startState = 24;
-               enterRecursionRule(_localctx, 24, RULE_item, _p);
-               int _la;
+               JavaFqnContext _localctx = new JavaFqnContext(_ctx, 
_parentState);
+               JavaFqnContext _prevctx = _localctx;
+               int _startState = 26;
+               enterRecursionRule(_localctx, 26, RULE_javaFqn, _p);
                try {
                        int _alt;
                        enterOuterAlt(_localctx, 1);
                        {
-                       setState(142);
+                       {
+                       setState(163);
+                       match(ID);
+                       }
+                       _ctx.stop = _input.LT(-1);
+                       setState(170);
                        _errHandler.sync(this);
-                       switch ( 
getInterpreter().adaptivePredict(_input,9,_ctx) ) {
-                       case 1:
-                               {
-                               setState(135);
-                               pred();
+                       _alt = getInterpreter().adaptivePredict(_input,16,_ctx);
+                       while ( _alt!=2 && 
_alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
+                               if ( _alt==1 ) {
+                                       if ( _parseListeners!=null ) 
triggerExitRuleEvent();
+                                       _prevctx = _localctx;
+                                       {
+                                       {
+                                       _localctx = new 
JavaFqnContext(_parentctx, _parentState);
+                                       pushNewRecursionContext(_localctx, 
_startState, RULE_javaFqn);
+                                       setState(165);
+                                       if (!(precpred(_ctx, 1))) throw new 
FailedPredicateException(this, "precpred(_ctx, 1)");
+                                       setState(166);
+                                       match(DOT);
+                                       setState(167);
+                                       match(ID);
+                                       }
+                                       } 
                                }
-                               break;
-                       case 2:
-                               {
-                               setState(136);
-                               match(LPAREN);
-                               setState(137);
-                               item(0);
-                               setState(138);
-                               match(RPAREN);
-                               }
-                               break;
-                       case 3:
-                               {
-                               setState(140);
-                               match(EXCL);
-                               setState(141);
-                               item(1);
-                               }
-                               break;
-                       }
-                       _ctx.stop = _input.LT(-1);
-                       setState(149);
-                       _errHandler.sync(this);
-                       _alt = getInterpreter().adaptivePredict(_input,10,_ctx);
-                       while ( _alt!=2 && 
_alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
-                               if ( _alt==1 ) {
-                                       if ( _parseListeners!=null ) 
triggerExitRuleEvent();
-                                       _prevctx = _localctx;
-                                       {
-                                       {
-                                       _localctx = new ItemContext(_parentctx, 
_parentState);
-                                       pushNewRecursionContext(_localctx, 
_startState, RULE_item);
-                                       setState(144);
-                                       if (!(precpred(_ctx, 2))) throw new 
FailedPredicateException(this, "precpred(_ctx, 2)");
-                                       setState(145);
-                                       _la = _input.LA(1);
-                                       if ( !(_la==AND || _la==OR) ) {
-                                       _errHandler.recoverInline(this);
-                                       }
-                                       else {
-                                               if ( _input.LA(1)==Token.EOF ) 
matchedEOF = true;
-                                               _errHandler.reportMatch(this);
-                                               consume();
-                                       }
-                                       setState(146);
-                                       item(3);
-                                       }
-                                       } 
-                               }
-                               setState(151);
+                               setState(172);
                                _errHandler.sync(this);
-                               _alt = 
getInterpreter().adaptivePredict(_input,10,_ctx);
+                               _alt = 
getInterpreter().adaptivePredict(_input,16,_ctx);
                        }
                        }
                }
@@ -942,40 +1076,36 @@ public class NCIntentDslParser extends Parser {
                return _localctx;
        }
 
-       public static class PredContext extends ParserRuleContext {
-               public List<ExprContext> expr() {
-                       return getRuleContexts(ExprContext.class);
-               }
-               public ExprContext expr(int i) {
-                       return getRuleContext(ExprContext.class,i);
-               }
-               public TerminalNode PRED_OP() { return 
getToken(NCIntentDslParser.PRED_OP, 0); }
-               public PredContext(ParserRuleContext parent, int invokingState) 
{
+       public static class TermIdContext extends ParserRuleContext {
+               public TerminalNode LPAREN() { return 
getToken(NCIntentDslParser.LPAREN, 0); }
+               public TerminalNode ID() { return 
getToken(NCIntentDslParser.ID, 0); }
+               public TerminalNode RPAREN() { return 
getToken(NCIntentDslParser.RPAREN, 0); }
+               public TermIdContext(ParserRuleContext parent, int 
invokingState) {
                        super(parent, invokingState);
                }
-               @Override public int getRuleIndex() { return RULE_pred; }
+               @Override public int getRuleIndex() { return RULE_termId; }
                @Override
                public void enterRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterPred(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterTermId(this);
                }
                @Override
                public void exitRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitPred(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitTermId(this);
                }
        }
 
-       public final PredContext pred() throws RecognitionException {
-               PredContext _localctx = new PredContext(_ctx, getState());
-               enterRule(_localctx, 26, RULE_pred);
+       public final TermIdContext termId() throws RecognitionException {
+               TermIdContext _localctx = new TermIdContext(_ctx, getState());
+               enterRule(_localctx, 28, RULE_termId);
                try {
                        enterOuterAlt(_localctx, 1);
                        {
-                       setState(152);
-                       expr(0);
-                       setState(153);
-                       match(PRED_OP);
-                       setState(154);
-                       expr(0);
+                       setState(173);
+                       match(LPAREN);
+                       setState(174);
+                       match(ID);
+                       setState(175);
+                       match(RPAREN);
                        }
                }
                catch (RecognitionException re) {
@@ -989,116 +1119,111 @@ public class NCIntentDslParser extends Parser {
                return _localctx;
        }
 
-       public static class ExprContext extends ParserRuleContext {
-               public ValContext val() {
-                       return getRuleContext(ValContext.class,0);
+       public static class TermDefContext extends ParserRuleContext {
+               public TermPredContext termPred() {
+                       return getRuleContext(TermPredContext.class,0);
                }
                public TerminalNode LPAREN() { return 
getToken(NCIntentDslParser.LPAREN, 0); }
-               public List<ExprContext> expr() {
-                       return getRuleContexts(ExprContext.class);
+               public List<TermDefContext> termDef() {
+                       return getRuleContexts(TermDefContext.class);
                }
-               public ExprContext expr(int i) {
-                       return getRuleContext(ExprContext.class,i);
+               public TermDefContext termDef(int i) {
+                       return getRuleContext(TermDefContext.class,i);
                }
                public TerminalNode RPAREN() { return 
getToken(NCIntentDslParser.RPAREN, 0); }
-               public TerminalNode ID() { return 
getToken(NCIntentDslParser.ID, 0); }
-               public MathOpContext mathOp() {
-                       return getRuleContext(MathOpContext.class,0);
-               }
-               public ExprContext(ParserRuleContext parent, int invokingState) 
{
+               public TerminalNode EXCL() { return 
getToken(NCIntentDslParser.EXCL, 0); }
+               public TerminalNode AND() { return 
getToken(NCIntentDslParser.AND, 0); }
+               public TerminalNode OR() { return 
getToken(NCIntentDslParser.OR, 0); }
+               public TermDefContext(ParserRuleContext parent, int 
invokingState) {
                        super(parent, invokingState);
                }
-               @Override public int getRuleIndex() { return RULE_expr; }
+               @Override public int getRuleIndex() { return RULE_termDef; }
                @Override
                public void enterRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterExpr(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterTermDef(this);
                }
                @Override
                public void exitRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitExpr(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitTermDef(this);
                }
        }
 
-       public final ExprContext expr() throws RecognitionException {
-               return expr(0);
+       public final TermDefContext termDef() throws RecognitionException {
+               return termDef(0);
        }
 
-       private ExprContext expr(int _p) throws RecognitionException {
+       private TermDefContext termDef(int _p) throws RecognitionException {
                ParserRuleContext _parentctx = _ctx;
                int _parentState = getState();
-               ExprContext _localctx = new ExprContext(_ctx, _parentState);
-               ExprContext _prevctx = _localctx;
-               int _startState = 28;
-               enterRecursionRule(_localctx, 28, RULE_expr, _p);
+               TermDefContext _localctx = new TermDefContext(_ctx, 
_parentState);
+               TermDefContext _prevctx = _localctx;
+               int _startState = 30;
+               enterRecursionRule(_localctx, 30, RULE_termDef, _p);
                int _la;
                try {
                        int _alt;
                        enterOuterAlt(_localctx, 1);
                        {
-                       setState(168);
+                       setState(185);
                        _errHandler.sync(this);
-                       switch ( 
getInterpreter().adaptivePredict(_input,12,_ctx) ) {
+                       switch ( 
getInterpreter().adaptivePredict(_input,17,_ctx) ) {
                        case 1:
                                {
-                               setState(157);
-                               val(0);
+                               setState(178);
+                               termPred();
                                }
                                break;
                        case 2:
                                {
-                               setState(158);
+                               setState(179);
                                match(LPAREN);
-                               setState(159);
-                               expr(0);
-                               setState(160);
+                               setState(180);
+                               termDef(0);
+                               setState(181);
                                match(RPAREN);
                                }
                                break;
                        case 3:
                                {
-                               setState(162);
-                               match(ID);
-                               setState(163);
-                               match(LPAREN);
-                               setState(165);
-                               _errHandler.sync(this);
-                               _la = _input.LA(1);
-                               if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 
((1L << T__4) | (1L << T__6) | (1L << T__7) | (1L << T__8) | (1L << T__9) | (1L 
<< T__10) | (1L << T__11) | (1L << T__12) | (1L << T__13) | (1L << SQSTRING) | 
(1L << DQSTRING) | (1L << LPAREN) | (1L << TILDA) | (1L << POUND) | (1L << 
MINUS) | (1L << DOLLAR) | (1L << BOOL) | (1L << INT) | (1L << ID))) != 0)) {
-                                       {
-                                       setState(164);
-                                       expr(0);
-                                       }
-                               }
-
-                               setState(167);
-                               match(RPAREN);
+                               setState(183);
+                               match(EXCL);
+                               setState(184);
+                               termDef(1);
                                }
                                break;
                        }
                        _ctx.stop = _input.LT(-1);
-                       setState(176);
+                       setState(192);
                        _errHandler.sync(this);
-                       _alt = getInterpreter().adaptivePredict(_input,13,_ctx);
+                       _alt = getInterpreter().adaptivePredict(_input,18,_ctx);
                        while ( _alt!=2 && 
_alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
                                if ( _alt==1 ) {
                                        if ( _parseListeners!=null ) 
triggerExitRuleEvent();
                                        _prevctx = _localctx;
                                        {
                                        {
-                                       _localctx = new ExprContext(_parentctx, 
_parentState);
-                                       pushNewRecursionContext(_localctx, 
_startState, RULE_expr);
-                                       setState(170);
+                                       _localctx = new 
TermDefContext(_parentctx, _parentState);
+                                       pushNewRecursionContext(_localctx, 
_startState, RULE_termDef);
+                                       setState(187);
                                        if (!(precpred(_ctx, 2))) throw new 
FailedPredicateException(this, "precpred(_ctx, 2)");
-                                       setState(171);
-                                       mathOp();
-                                       setState(172);
-                                       expr(3);
+                                       setState(188);
+                                       _la = _input.LA(1);
+                                       if ( !(_la==AND || _la==OR) ) {
+                                       _errHandler.recoverInline(this);
+                                       }
+                                       else {
+                                               if ( _input.LA(1)==Token.EOF ) 
matchedEOF = true;
+                                               _errHandler.reportMatch(this);
+                                               consume();
+                                       }
+                                       setState(189);
+                                       termDef(3);
                                        }
                                        } 
                                }
-                               setState(178);
+                               setState(194);
                                _errHandler.sync(this);
-                               _alt = 
getInterpreter().adaptivePredict(_input,13,_ctx);
+                               _alt = 
getInterpreter().adaptivePredict(_input,18,_ctx);
                        }
                        }
                }
@@ -1113,42 +1238,40 @@ public class NCIntentDslParser extends Parser {
                return _localctx;
        }
 
-       public static class MathOpContext extends ParserRuleContext {
-               public TerminalNode MINUS() { return 
getToken(NCIntentDslParser.MINUS, 0); }
-               public TerminalNode PLUS() { return 
getToken(NCIntentDslParser.PLUS, 0); }
-               public TerminalNode STAR() { return 
getToken(NCIntentDslParser.STAR, 0); }
-               public TerminalNode DEVIDE() { return 
getToken(NCIntentDslParser.DEVIDE, 0); }
-               public MathOpContext(ParserRuleContext parent, int 
invokingState) {
+       public static class TermPredContext extends ParserRuleContext {
+               public List<ExprContext> expr() {
+                       return getRuleContexts(ExprContext.class);
+               }
+               public ExprContext expr(int i) {
+                       return getRuleContext(ExprContext.class,i);
+               }
+               public TerminalNode PRED_OP() { return 
getToken(NCIntentDslParser.PRED_OP, 0); }
+               public TermPredContext(ParserRuleContext parent, int 
invokingState) {
                        super(parent, invokingState);
                }
-               @Override public int getRuleIndex() { return RULE_mathOp; }
+               @Override public int getRuleIndex() { return RULE_termPred; }
                @Override
                public void enterRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterMathOp(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterTermPred(this);
                }
                @Override
                public void exitRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitMathOp(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitTermPred(this);
                }
        }
 
-       public final MathOpContext mathOp() throws RecognitionException {
-               MathOpContext _localctx = new MathOpContext(_ctx, getState());
-               enterRule(_localctx, 30, RULE_mathOp);
-               int _la;
+       public final TermPredContext termPred() throws RecognitionException {
+               TermPredContext _localctx = new TermPredContext(_ctx, 
getState());
+               enterRule(_localctx, 32, RULE_termPred);
                try {
                        enterOuterAlt(_localctx, 1);
                        {
-                       setState(179);
-                       _la = _input.LA(1);
-                       if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << 
MINUS) | (1L << PLUS) | (1L << STAR) | (1L << DEVIDE))) != 0)) ) {
-                       _errHandler.recoverInline(this);
-                       }
-                       else {
-                               if ( _input.LA(1)==Token.EOF ) matchedEOF = 
true;
-                               _errHandler.reportMatch(this);
-                               consume();
-                       }
+                       setState(195);
+                       expr(0);
+                       setState(196);
+                       match(PRED_OP);
+                       setState(197);
+                       expr(0);
                        }
                }
                catch (RecognitionException re) {
@@ -1162,81 +1285,95 @@ public class NCIntentDslParser extends Parser {
                return _localctx;
        }
 
-       public static class ValContext extends ParserRuleContext {
-               public SingleValContext singleVal() {
-                       return getRuleContext(SingleValContext.class,0);
+       public static class ExprContext extends ParserRuleContext {
+               public ValContext val() {
+                       return getRuleContext(ValContext.class,0);
                }
                public TerminalNode LPAREN() { return 
getToken(NCIntentDslParser.LPAREN, 0); }
-               public List<ValContext> val() {
-                       return getRuleContexts(ValContext.class);
+               public List<ExprContext> expr() {
+                       return getRuleContexts(ExprContext.class);
                }
-               public ValContext val(int i) {
-                       return getRuleContext(ValContext.class,i);
+               public ExprContext expr(int i) {
+                       return getRuleContext(ExprContext.class,i);
                }
                public TerminalNode RPAREN() { return 
getToken(NCIntentDslParser.RPAREN, 0); }
+               public TerminalNode ID() { return 
getToken(NCIntentDslParser.ID, 0); }
+               public TerminalNode MINUS() { return 
getToken(NCIntentDslParser.MINUS, 0); }
+               public TerminalNode PLUS() { return 
getToken(NCIntentDslParser.PLUS, 0); }
+               public TerminalNode STAR() { return 
getToken(NCIntentDslParser.STAR, 0); }
+               public TerminalNode FSLASH() { return 
getToken(NCIntentDslParser.FSLASH, 0); }
                public TerminalNode COMMA() { return 
getToken(NCIntentDslParser.COMMA, 0); }
-               public ValContext(ParserRuleContext parent, int invokingState) {
+               public ExprContext(ParserRuleContext parent, int invokingState) 
{
                        super(parent, invokingState);
                }
-               @Override public int getRuleIndex() { return RULE_val; }
+               @Override public int getRuleIndex() { return RULE_expr; }
                @Override
                public void enterRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterVal(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterExpr(this);
                }
                @Override
                public void exitRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitVal(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitExpr(this);
                }
        }
 
-       public final ValContext val() throws RecognitionException {
-               return val(0);
+       public final ExprContext expr() throws RecognitionException {
+               return expr(0);
        }
 
-       private ValContext val(int _p) throws RecognitionException {
+       private ExprContext expr(int _p) throws RecognitionException {
                ParserRuleContext _parentctx = _ctx;
                int _parentState = getState();
-               ValContext _localctx = new ValContext(_ctx, _parentState);
-               ValContext _prevctx = _localctx;
-               int _startState = 32;
-               enterRecursionRule(_localctx, 32, RULE_val, _p);
+               ExprContext _localctx = new ExprContext(_ctx, _parentState);
+               ExprContext _prevctx = _localctx;
+               int _startState = 34;
+               enterRecursionRule(_localctx, 34, RULE_expr, _p);
+               int _la;
                try {
                        int _alt;
                        enterOuterAlt(_localctx, 1);
                        {
-                       setState(187);
+                       setState(211);
                        _errHandler.sync(this);
                        switch (_input.LA(1)) {
-                       case T__4:
-                       case T__6:
-                       case T__7:
-                       case T__8:
-                       case T__9:
-                       case T__10:
-                       case T__11:
-                       case T__12:
-                       case T__13:
                        case SQSTRING:
                        case DQSTRING:
-                       case TILDA:
-                       case POUND:
                        case MINUS:
-                       case DOLLAR:
                        case BOOL:
+                       case NULL:
                        case INT:
-                       case ID:
                                {
-                               setState(182);
-                               singleVal();
+                               setState(200);
+                               val();
                                }
                                break;
                        case LPAREN:
                                {
-                               setState(183);
+                               setState(201);
                                match(LPAREN);
-                               setState(184);
-                               val(0);
-                               setState(185);
+                               setState(202);
+                               expr(0);
+                               setState(203);
+                               match(RPAREN);
+                               }
+                               break;
+                       case ID:
+                               {
+                               setState(205);
+                               match(ID);
+                               setState(206);
+                               match(LPAREN);
+                               setState(208);
+                               _errHandler.sync(this);
+                               _la = _input.LA(1);
+                               if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 
((1L << SQSTRING) | (1L << DQSTRING) | (1L << LPAREN) | (1L << MINUS) | (1L << 
BOOL) | (1L << NULL) | (1L << INT) | (1L << ID))) != 0)) {
+                                       {
+                                       setState(207);
+                                       expr(0);
+                                       }
+                               }
+
+                               setState(210);
                                match(RPAREN);
                                }
                                break;
@@ -1244,29 +1381,55 @@ public class NCIntentDslParser extends Parser {
                                throw new NoViableAltException(this);
                        }
                        _ctx.stop = _input.LT(-1);
-                       setState(194);
+                       setState(221);
                        _errHandler.sync(this);
-                       _alt = getInterpreter().adaptivePredict(_input,15,_ctx);
+                       _alt = getInterpreter().adaptivePredict(_input,22,_ctx);
                        while ( _alt!=2 && 
_alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
                                if ( _alt==1 ) {
                                        if ( _parseListeners!=null ) 
triggerExitRuleEvent();
                                        _prevctx = _localctx;
                                        {
-                                       {
-                                       _localctx = new ValContext(_parentctx, 
_parentState);
-                                       pushNewRecursionContext(_localctx, 
_startState, RULE_val);
-                                       setState(189);
-                                       if (!(precpred(_ctx, 1))) throw new 
FailedPredicateException(this, "precpred(_ctx, 1)");
-                                       setState(190);
-                                       match(COMMA);
-                                       setState(191);
-                                       val(2);
+                                       setState(219);
+                                       _errHandler.sync(this);
+                                       switch ( 
getInterpreter().adaptivePredict(_input,21,_ctx) ) {
+                                       case 1:
+                                               {
+                                               _localctx = new 
ExprContext(_parentctx, _parentState);
+                                               
pushNewRecursionContext(_localctx, _startState, RULE_expr);
+                                               setState(213);
+                                               if (!(precpred(_ctx, 2))) throw 
new FailedPredicateException(this, "precpred(_ctx, 2)");
+                                               setState(214);
+                                               _la = _input.LA(1);
+                                               if ( !((((_la) & ~0x3f) == 0 && 
((1L << _la) & ((1L << MINUS) | (1L << PLUS) | (1L << STAR) | (1L << FSLASH))) 
!= 0)) ) {
+                                               _errHandler.recoverInline(this);
+                                               }
+                                               else {
+                                                       if ( 
_input.LA(1)==Token.EOF ) matchedEOF = true;
+                                                       
_errHandler.reportMatch(this);
+                                                       consume();
+                                               }
+                                               setState(215);
+                                               expr(3);
+                                               }
+                                               break;
+                                       case 2:
+                                               {
+                                               _localctx = new 
ExprContext(_parentctx, _parentState);
+                                               
pushNewRecursionContext(_localctx, _startState, RULE_expr);
+                                               setState(216);
+                                               if (!(precpred(_ctx, 4))) throw 
new FailedPredicateException(this, "precpred(_ctx, 4)");
+                                               setState(217);
+                                               match(COMMA);
+                                               setState(218);
+                                               val();
+                                               }
+                                               break;
                                        }
                                        } 
                                }
-                               setState(196);
+                               setState(223);
                                _errHandler.sync(this);
-                               _alt = 
getInterpreter().adaptivePredict(_input,15,_ctx);
+                               _alt = 
getInterpreter().adaptivePredict(_input,22,_ctx);
                        }
                        }
                }
@@ -1281,520 +1444,100 @@ public class NCIntentDslParser extends Parser {
                return _localctx;
        }
 
-       public static class SingleValContext extends ParserRuleContext {
+       public static class ValContext extends ParserRuleContext {
+               public TerminalNode NULL() { return 
getToken(NCIntentDslParser.NULL, 0); }
                public TerminalNode INT() { return 
getToken(NCIntentDslParser.INT, 0); }
-               public TerminalNode EXP() { return 
getToken(NCIntentDslParser.EXP, 0); }
                public TerminalNode MINUS() { return 
getToken(NCIntentDslParser.MINUS, 0); }
+               public TerminalNode REAL() { return 
getToken(NCIntentDslParser.REAL, 0); }
+               public TerminalNode EXP() { return 
getToken(NCIntentDslParser.EXP, 0); }
                public TerminalNode BOOL() { return 
getToken(NCIntentDslParser.BOOL, 0); }
                public QstringContext qstring() {
                        return getRuleContext(QstringContext.class,0);
                }
-               public TokQualContext tokQual() {
-                       return getRuleContext(TokQualContext.class,0);
-               }
-               public TokMetaContext tokMeta() {
-                       return getRuleContext(TokMetaContext.class,0);
-               }
-               public ModelMetaContext modelMeta() {
-                       return getRuleContext(ModelMetaContext.class,0);
-               }
-               public IntentMetaContext intentMeta() {
-                       return getRuleContext(IntentMetaContext.class,0);
-               }
-               public SingleValContext(ParserRuleContext parent, int 
invokingState) {
+               public ValContext(ParserRuleContext parent, int invokingState) {
                        super(parent, invokingState);
                }
-               @Override public int getRuleIndex() { return RULE_singleVal; }
+               @Override public int getRuleIndex() { return RULE_val; }
                @Override
                public void enterRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterSingleVal(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterVal(this);
                }
                @Override
                public void exitRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitSingleVal(this);
+                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitVal(this);
                }
        }
 
-       public final SingleValContext singleVal() throws RecognitionException {
-               SingleValContext _localctx = new SingleValContext(_ctx, 
getState());
-               enterRule(_localctx, 34, RULE_singleVal);
+       public final ValContext val() throws RecognitionException {
+               ValContext _localctx = new ValContext(_ctx, getState());
+               enterRule(_localctx, 36, RULE_val);
                int _la;
                try {
-                       setState(218);
+                       setState(237);
                        _errHandler.sync(this);
-                       switch ( 
getInterpreter().adaptivePredict(_input,20,_ctx) ) {
-                       case 1:
+                       switch (_input.LA(1)) {
+                       case NULL:
                                enterOuterAlt(_localctx, 1);
                                {
-                               setState(197);
-                               match(T__4);
+                               setState(224);
+                               match(NULL);
                                }
                                break;
-                       case 2:
+                       case MINUS:
+                       case INT:
                                enterOuterAlt(_localctx, 2);
                                {
-                               setState(199);
+                               setState(226);
                                _errHandler.sync(this);
                                _la = _input.LA(1);
                                if (_la==MINUS) {
                                        {
-                                       setState(198);
+                                       setState(225);
                                        match(MINUS);
                                        }
                                }
 
-                               setState(204);
+                               setState(228);
+                               match(INT);
+                               setState(230);
                                _errHandler.sync(this);
-                               switch ( 
getInterpreter().adaptivePredict(_input,17,_ctx) ) {
+                               switch ( 
getInterpreter().adaptivePredict(_input,24,_ctx) ) {
                                case 1:
                                        {
-                                       setState(201);
-                                       match(INT);
+                                       setState(229);
+                                       match(REAL);
                                        }
                                        break;
-                               case 2:
+                               }
+                               setState(233);
+                               _errHandler.sync(this);
+                               switch ( 
getInterpreter().adaptivePredict(_input,25,_ctx) ) {
+                               case 1:
                                        {
-                                       setState(202);
-                                       match(INT);
-                                       setState(203);
+                                       setState(232);
                                        match(EXP);
                                        }
                                        break;
                                }
                                }
                                break;
-                       case 3:
+                       case BOOL:
                                enterOuterAlt(_localctx, 3);
                                {
-                               setState(206);
+                               setState(235);
                                match(BOOL);
                                }
                                break;
-                       case 4:
+                       case SQSTRING:
+                       case DQSTRING:
                                enterOuterAlt(_localctx, 4);
                                {
-                               setState(207);
-                               qstring();
-                               }
-                               break;
-                       case 5:
-                               enterOuterAlt(_localctx, 5);
-                               {
-                               setState(209);
-                               _errHandler.sync(this);
-                               _la = _input.LA(1);
-                               if (_la==ID) {
-                                       {
-                                       setState(208);
-                                       tokQual(0);
-                                       }
-                               }
-
-                               setState(211);
-                               _la = _input.LA(1);
-                               if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 
((1L << T__6) | (1L << T__7) | (1L << T__8) | (1L << T__9) | (1L << T__10) | 
(1L << T__11) | (1L << T__12) | (1L << T__13))) != 0)) ) {
-                               _errHandler.recoverInline(this);
-                               }
-                               else {
-                                       if ( _input.LA(1)==Token.EOF ) 
matchedEOF = true;
-                                       _errHandler.reportMatch(this);
-                                       consume();
-                               }
-                               }
-                               break;
-                       case 6:
-                               enterOuterAlt(_localctx, 6);
-                               {
-                               setState(213);
-                               _errHandler.sync(this);
-                               _la = _input.LA(1);
-                               if (_la==ID) {
-                                       {
-                                       setState(212);
-                                       tokQual(0);
-                                       }
-                               }
-
-                               setState(215);
-                               tokMeta();
-                               }
-                               break;
-                       case 7:
-                               enterOuterAlt(_localctx, 7);
-                               {
-                               setState(216);
-                               modelMeta();
-                               }
-                               break;
-                       case 8:
-                               enterOuterAlt(_localctx, 8);
-                               {
-                               setState(217);
-                               intentMeta();
-                               }
-                               break;
-                       }
-               }
-               catch (RecognitionException re) {
-                       _localctx.exception = re;
-                       _errHandler.reportError(this, re);
-                       _errHandler.recover(this, re);
-               }
-               finally {
-                       exitRule();
-               }
-               return _localctx;
-       }
-
-       public static class TokQualContext extends ParserRuleContext {
-               public TokQualPartContext tokQualPart() {
-                       return getRuleContext(TokQualPartContext.class,0);
-               }
-               public TokQualContext tokQual() {
-                       return getRuleContext(TokQualContext.class,0);
-               }
-               public TokQualContext(ParserRuleContext parent, int 
invokingState) {
-                       super(parent, invokingState);
-               }
-               @Override public int getRuleIndex() { return RULE_tokQual; }
-               @Override
-               public void enterRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterTokQual(this);
-               }
-               @Override
-               public void exitRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitTokQual(this);
-               }
-       }
-
-       public final TokQualContext tokQual() throws RecognitionException {
-               return tokQual(0);
-       }
-
-       private TokQualContext tokQual(int _p) throws RecognitionException {
-               ParserRuleContext _parentctx = _ctx;
-               int _parentState = getState();
-               TokQualContext _localctx = new TokQualContext(_ctx, 
_parentState);
-               TokQualContext _prevctx = _localctx;
-               int _startState = 36;
-               enterRecursionRule(_localctx, 36, RULE_tokQual, _p);
-               try {
-                       int _alt;
-                       enterOuterAlt(_localctx, 1);
-                       {
-                       {
-                       setState(221);
-                       tokQualPart();
-                       }
-                       _ctx.stop = _input.LT(-1);
-                       setState(227);
-                       _errHandler.sync(this);
-                       _alt = getInterpreter().adaptivePredict(_input,21,_ctx);
-                       while ( _alt!=2 && 
_alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
-                               if ( _alt==1 ) {
-                                       if ( _parseListeners!=null ) 
triggerExitRuleEvent();
-                                       _prevctx = _localctx;
-                                       {
-                                       {
-                                       _localctx = new 
TokQualContext(_parentctx, _parentState);
-                                       pushNewRecursionContext(_localctx, 
_startState, RULE_tokQual);
-                                       setState(223);
-                                       if (!(precpred(_ctx, 1))) throw new 
FailedPredicateException(this, "precpred(_ctx, 1)");
-                                       setState(224);
-                                       tokQualPart();
-                                       }
-                                       } 
-                               }
-                               setState(229);
-                               _errHandler.sync(this);
-                               _alt = 
getInterpreter().adaptivePredict(_input,21,_ctx);
-                       }
-                       }
-               }
-               catch (RecognitionException re) {
-                       _localctx.exception = re;
-                       _errHandler.reportError(this, re);
-                       _errHandler.recover(this, re);
-               }
-               finally {
-                       unrollRecursionContexts(_parentctx);
-               }
-               return _localctx;
-       }
-
-       public static class TokQualPartContext extends ParserRuleContext {
-               public TerminalNode ID() { return 
getToken(NCIntentDslParser.ID, 0); }
-               public TerminalNode DOT() { return 
getToken(NCIntentDslParser.DOT, 0); }
-               public TokQualPartContext(ParserRuleContext parent, int 
invokingState) {
-                       super(parent, invokingState);
-               }
-               @Override public int getRuleIndex() { return RULE_tokQualPart; }
-               @Override
-               public void enterRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterTokQualPart(this);
-               }
-               @Override
-               public void exitRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitTokQualPart(this);
-               }
-       }
-
-       public final TokQualPartContext tokQualPart() throws 
RecognitionException {
-               TokQualPartContext _localctx = new TokQualPartContext(_ctx, 
getState());
-               enterRule(_localctx, 38, RULE_tokQualPart);
-               try {
-                       enterOuterAlt(_localctx, 1);
-                       {
-                       setState(230);
-                       match(ID);
-                       setState(231);
-                       match(DOT);
-                       }
-               }
-               catch (RecognitionException re) {
-                       _localctx.exception = re;
-                       _errHandler.reportError(this, re);
-                       _errHandler.recover(this, re);
-               }
-               finally {
-                       exitRule();
-               }
-               return _localctx;
-       }
-
-       public static class TokMetaContext extends ParserRuleContext {
-               public TerminalNode TILDA() { return 
getToken(NCIntentDslParser.TILDA, 0); }
-               public TerminalNode ID() { return 
getToken(NCIntentDslParser.ID, 0); }
-               public TerminalNode LBR() { return 
getToken(NCIntentDslParser.LBR, 0); }
-               public TerminalNode INT() { return 
getToken(NCIntentDslParser.INT, 0); }
-               public TerminalNode RBR() { return 
getToken(NCIntentDslParser.RBR, 0); }
-               public QstringContext qstring() {
-                       return getRuleContext(QstringContext.class,0);
-               }
-               public TokMetaContext(ParserRuleContext parent, int 
invokingState) {
-                       super(parent, invokingState);
-               }
-               @Override public int getRuleIndex() { return RULE_tokMeta; }
-               @Override
-               public void enterRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterTokMeta(this);
-               }
-               @Override
-               public void exitRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitTokMeta(this);
-               }
-       }
-
-       public final TokMetaContext tokMeta() throws RecognitionException {
-               TokMetaContext _localctx = new TokMetaContext(_ctx, getState());
-               enterRule(_localctx, 40, RULE_tokMeta);
-               try {
-                       setState(246);
-                       _errHandler.sync(this);
-                       switch ( 
getInterpreter().adaptivePredict(_input,22,_ctx) ) {
-                       case 1:
-                               enterOuterAlt(_localctx, 1);
-                               {
-                               setState(233);
-                               match(TILDA);
-                               setState(234);
-                               match(ID);
-                               }
-                               break;
-                       case 2:
-                               enterOuterAlt(_localctx, 2);
-                               {
-                               setState(235);
-                               match(TILDA);
                                setState(236);
-                               match(ID);
-                               setState(237);
-                               match(LBR);
-                               setState(238);
-                               match(INT);
-                               setState(239);
-                               match(RBR);
-                               }
-                               break;
-                       case 3:
-                               enterOuterAlt(_localctx, 3);
-                               {
-                               setState(240);
-                               match(TILDA);
-                               setState(241);
-                               match(ID);
-                               setState(242);
-                               match(LBR);
-                               setState(243);
-                               qstring();
-                               setState(244);
-                               match(RBR);
-                               }
-                               break;
-                       }
-               }
-               catch (RecognitionException re) {
-                       _localctx.exception = re;
-                       _errHandler.reportError(this, re);
-                       _errHandler.recover(this, re);
-               }
-               finally {
-                       exitRule();
-               }
-               return _localctx;
-       }
-
-       public static class ModelMetaContext extends ParserRuleContext {
-               public TerminalNode POUND() { return 
getToken(NCIntentDslParser.POUND, 0); }
-               public TerminalNode ID() { return 
getToken(NCIntentDslParser.ID, 0); }
-               public TerminalNode LBR() { return 
getToken(NCIntentDslParser.LBR, 0); }
-               public TerminalNode INT() { return 
getToken(NCIntentDslParser.INT, 0); }
-               public TerminalNode RBR() { return 
getToken(NCIntentDslParser.RBR, 0); }
-               public QstringContext qstring() {
-                       return getRuleContext(QstringContext.class,0);
-               }
-               public ModelMetaContext(ParserRuleContext parent, int 
invokingState) {
-                       super(parent, invokingState);
-               }
-               @Override public int getRuleIndex() { return RULE_modelMeta; }
-               @Override
-               public void enterRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterModelMeta(this);
-               }
-               @Override
-               public void exitRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitModelMeta(this);
-               }
-       }
-
-       public final ModelMetaContext modelMeta() throws RecognitionException {
-               ModelMetaContext _localctx = new ModelMetaContext(_ctx, 
getState());
-               enterRule(_localctx, 42, RULE_modelMeta);
-               try {
-                       setState(261);
-                       _errHandler.sync(this);
-                       switch ( 
getInterpreter().adaptivePredict(_input,23,_ctx) ) {
-                       case 1:
-                               enterOuterAlt(_localctx, 1);
-                               {
-                               setState(248);
-                               match(POUND);
-                               setState(249);
-                               match(ID);
-                               }
-                               break;
-                       case 2:
-                               enterOuterAlt(_localctx, 2);
-                               {
-                               setState(250);
-                               match(POUND);
-                               setState(251);
-                               match(ID);
-                               setState(252);
-                               match(LBR);
-                               setState(253);
-                               match(INT);
-                               setState(254);
-                               match(RBR);
-                               }
-                               break;
-                       case 3:
-                               enterOuterAlt(_localctx, 3);
-                               {
-                               setState(255);
-                               match(POUND);
-                               setState(256);
-                               match(ID);
-                               setState(257);
-                               match(LBR);
-                               setState(258);
-                               qstring();
-                               setState(259);
-                               match(RBR);
-                               }
-                               break;
-                       }
-               }
-               catch (RecognitionException re) {
-                       _localctx.exception = re;
-                       _errHandler.reportError(this, re);
-                       _errHandler.recover(this, re);
-               }
-               finally {
-                       exitRule();
-               }
-               return _localctx;
-       }
-
-       public static class IntentMetaContext extends ParserRuleContext {
-               public TerminalNode DOLLAR() { return 
getToken(NCIntentDslParser.DOLLAR, 0); }
-               public TerminalNode ID() { return 
getToken(NCIntentDslParser.ID, 0); }
-               public TerminalNode LBR() { return 
getToken(NCIntentDslParser.LBR, 0); }
-               public TerminalNode INT() { return 
getToken(NCIntentDslParser.INT, 0); }
-               public TerminalNode RBR() { return 
getToken(NCIntentDslParser.RBR, 0); }
-               public QstringContext qstring() {
-                       return getRuleContext(QstringContext.class,0);
-               }
-               public IntentMetaContext(ParserRuleContext parent, int 
invokingState) {
-                       super(parent, invokingState);
-               }
-               @Override public int getRuleIndex() { return RULE_intentMeta; }
-               @Override
-               public void enterRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).enterIntentMeta(this);
-               }
-               @Override
-               public void exitRule(ParseTreeListener listener) {
-                       if ( listener instanceof NCIntentDslListener ) 
((NCIntentDslListener)listener).exitIntentMeta(this);
-               }
-       }
-
-       public final IntentMetaContext intentMeta() throws RecognitionException 
{
-               IntentMetaContext _localctx = new IntentMetaContext(_ctx, 
getState());
-               enterRule(_localctx, 44, RULE_intentMeta);
-               try {
-                       setState(276);
-                       _errHandler.sync(this);
-                       switch ( 
getInterpreter().adaptivePredict(_input,24,_ctx) ) {
-                       case 1:
-                               enterOuterAlt(_localctx, 1);
-                               {
-                               setState(263);
-                               match(DOLLAR);
-                               setState(264);
-                               match(ID);
-                               }
-                               break;
-                       case 2:
-                               enterOuterAlt(_localctx, 2);
-                               {
-                               setState(265);
-                               match(DOLLAR);
-                               setState(266);
-                               match(ID);
-                               setState(267);
-                               match(LBR);
-                               setState(268);
-                               match(INT);
-                               setState(269);
-                               match(RBR);
-                               }
-                               break;
-                       case 3:
-                               enterOuterAlt(_localctx, 3);
-                               {
-                               setState(270);
-                               match(DOLLAR);
-                               setState(271);
-                               match(ID);
-                               setState(272);
-                               match(LBR);
-                               setState(273);
                                qstring();
-                               setState(274);
-                               match(RBR);
                                }
                                break;
+                       default:
+                               throw new NoViableAltException(this);
                        }
                }
                catch (RecognitionException re) {
@@ -1827,12 +1570,12 @@ public class NCIntentDslParser extends Parser {
 
        public final QstringContext qstring() throws RecognitionException {
                QstringContext _localctx = new QstringContext(_ctx, getState());
-               enterRule(_localctx, 46, RULE_qstring);
+               enterRule(_localctx, 38, RULE_qstring);
                int _la;
                try {
                        enterOuterAlt(_localctx, 1);
                        {
-                       setState(278);
+                       setState(239);
                        _la = _input.LA(1);
                        if ( !(_la==SQSTRING || _la==DQSTRING) ) {
                        _errHandler.recoverInline(this);
@@ -1878,9 +1621,9 @@ public class NCIntentDslParser extends Parser {
 
        public final MinMaxContext minMax() throws RecognitionException {
                MinMaxContext _localctx = new MinMaxContext(_ctx, getState());
-               enterRule(_localctx, 48, RULE_minMax);
+               enterRule(_localctx, 40, RULE_minMax);
                try {
-                       setState(282);
+                       setState(243);
                        _errHandler.sync(this);
                        switch (_input.LA(1)) {
                        case PLUS:
@@ -1888,14 +1631,14 @@ public class NCIntentDslParser extends Parser {
                        case STAR:
                                enterOuterAlt(_localctx, 1);
                                {
-                               setState(280);
+                               setState(241);
                                minMaxShortcut();
                                }
                                break;
                        case LBR:
                                enterOuterAlt(_localctx, 2);
                                {
-                               setState(281);
+                               setState(242);
                                minMaxRange();
                                }
                                break;
@@ -1934,12 +1677,12 @@ public class NCIntentDslParser extends Parser {
 
        public final MinMaxShortcutContext minMaxShortcut() throws 
RecognitionException {
                MinMaxShortcutContext _localctx = new 
MinMaxShortcutContext(_ctx, getState());
-               enterRule(_localctx, 50, RULE_minMaxShortcut);
+               enterRule(_localctx, 42, RULE_minMaxShortcut);
                int _la;
                try {
                        enterOuterAlt(_localctx, 1);
                        {
-                       setState(284);
+                       setState(245);
                        _la = _input.LA(1);
                        if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << 
PLUS) | (1L << QUESTION) | (1L << STAR))) != 0)) ) {
                        _errHandler.recoverInline(this);
@@ -1986,19 +1729,19 @@ public class NCIntentDslParser extends Parser {
 
        public final MinMaxRangeContext minMaxRange() throws 
RecognitionException {
                MinMaxRangeContext _localctx = new MinMaxRangeContext(_ctx, 
getState());
-               enterRule(_localctx, 52, RULE_minMaxRange);
+               enterRule(_localctx, 44, RULE_minMaxRange);
                try {
                        enterOuterAlt(_localctx, 1);
                        {
-                       setState(286);
+                       setState(247);
                        match(LBR);
-                       setState(287);
+                       setState(248);
                        match(INT);
-                       setState(288);
+                       setState(249);
                        match(COMMA);
-                       setState(289);
+                       setState(250);
                        match(INT);
-                       setState(290);
+                       setState(251);
                        match(RBR);
                        }
                }
@@ -2015,36 +1758,32 @@ public class NCIntentDslParser extends Parser {
 
        public boolean sempred(RuleContext _localctx, int ruleIndex, int 
predIndex) {
                switch (ruleIndex) {
-               case 5:
-                       return metaList_sempred((MetaListContext)_localctx, 
predIndex);
-               case 8:
+               case 9:
                        return terms_sempred((TermsContext)_localctx, 
predIndex);
-               case 12:
-                       return item_sempred((ItemContext)_localctx, predIndex);
-               case 14:
+               case 13:
+                       return javaFqn_sempred((JavaFqnContext)_localctx, 
predIndex);
+               case 15:
+                       return termDef_sempred((TermDefContext)_localctx, 
predIndex);
+               case 17:
                        return expr_sempred((ExprContext)_localctx, predIndex);
-               case 16:
-                       return val_sempred((ValContext)_localctx, predIndex);
-               case 18:
-                       return tokQual_sempred((TokQualContext)_localctx, 
predIndex);
                }
                return true;
        }
-       private boolean metaList_sempred(MetaListContext _localctx, int 
predIndex) {
+       private boolean terms_sempred(TermsContext _localctx, int predIndex) {
                switch (predIndex) {
                case 0:
                        return precpred(_ctx, 1);
                }
                return true;
        }
-       private boolean terms_sempred(TermsContext _localctx, int predIndex) {
+       private boolean javaFqn_sempred(JavaFqnContext _localctx, int 
predIndex) {
                switch (predIndex) {
                case 1:
                        return precpred(_ctx, 1);
                }
                return true;
        }
-       private boolean item_sempred(ItemContext _localctx, int predIndex) {
+       private boolean termDef_sempred(TermDefContext _localctx, int 
predIndex) {
                switch (predIndex) {
                case 2:
                        return precpred(_ctx, 2);
@@ -2055,125 +1794,97 @@ public class NCIntentDslParser extends Parser {
                switch (predIndex) {
                case 3:
                        return precpred(_ctx, 2);
-               }
-               return true;
-       }
-       private boolean val_sempred(ValContext _localctx, int predIndex) {
-               switch (predIndex) {
                case 4:
-                       return precpred(_ctx, 1);
-               }
-               return true;
-       }
-       private boolean tokQual_sempred(TokQualContext _localctx, int 
predIndex) {
-               switch (predIndex) {
-               case 5:
-                       return precpred(_ctx, 1);
+                       return precpred(_ctx, 4);
                }
                return true;
        }
 
        public static final String _serializedATN =
-               
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\64\u0127\4\2\t\2"+
-               
"\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+
-               
"\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+
-               
"\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+
-               
"\4\32\t\32\4\33\t\33\4\34\t\34\3\2\3\2\5\2;\n\2\3\2\5\2>\n\2\3\2\5\2A"+
-               
"\n\2\3\2\3\2\3\2\3\3\3\3\3\3\3\3\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\6\3"+
-               
"\6\3\6\3\6\5\6V\n\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\7\7\7`\n\7\f\7\16\7"+
-               
"c\13\7\3\b\3\b\3\b\3\b\3\t\3\t\3\t\5\tl\n\t\3\n\3\n\3\n\3\n\3\n\7\ns\n"+
-               
"\n\f\n\16\nv\13\n\3\13\3\13\3\f\3\f\5\f|\n\f\3\f\3\f\3\f\3\f\3\f\5\f\u0083"+
-               
"\n\f\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\5\16\u0091"+
-               
"\n\16\3\16\3\16\3\16\7\16\u0096\n\16\f\16\16\16\u0099\13\16\3\17\3\17"+
-               
"\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\5\20\u00a8\n\20"+
-               
"\3\20\5\20\u00ab\n\20\3\20\3\20\3\20\3\20\7\20\u00b1\n\20\f\20\16\20\u00b4"+
-               
"\13\20\3\21\3\21\3\22\3\22\3\22\3\22\3\22\3\22\5\22\u00be\n\22\3\22\3"+
-               
"\22\3\22\7\22\u00c3\n\22\f\22\16\22\u00c6\13\22\3\23\3\23\5\23\u00ca\n"+
-               
"\23\3\23\3\23\3\23\5\23\u00cf\n\23\3\23\3\23\3\23\5\23\u00d4\n\23\3\23"+
-               
"\3\23\5\23\u00d8\n\23\3\23\3\23\3\23\5\23\u00dd\n\23\3\24\3\24\3\24\3"+
-               
"\24\3\24\7\24\u00e4\n\24\f\24\16\24\u00e7\13\24\3\25\3\25\3\25\3\26\3"+
-               
"\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\5\26\u00f9"+
-               
"\n\26\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27"+
-               
"\5\27\u0108\n\27\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30"+
-               
"\3\30\3\30\5\30\u0117\n\30\3\31\3\31\3\32\3\32\5\32\u011d\n\32\3\33\3"+
-               
"\33\3\34\3\34\3\34\3\34\3\34\3\34\3\34\2\b\f\22\32\36\"&\35\2\4\6\b\n"+
-               "\f\16\20\22\24\26\30\32\34\36 
\"$&(*,.\60\62\64\66\2\b\4\2\36\36((\3\2"+
-               
"\24\25\5\2%%))+,\3\2\t\20\3\2\21\22\3\2)+\2\u0131\28\3\2\2\2\4E\3\2\2"+
-               
"\2\6I\3\2\2\2\bM\3\2\2\2\nQ\3\2\2\2\fY\3\2\2\2\16d\3\2\2\2\20k\3\2\2\2"+
-               
"\22m\3\2\2\2\24w\3\2\2\2\26y\3\2\2\2\30\u0084\3\2\2\2\32\u0090\3\2\2\2"+
-               "\34\u009a\3\2\2\2\36\u00aa\3\2\2\2 
\u00b5\3\2\2\2\"\u00bd\3\2\2\2$\u00dc"+
-               
"\3\2\2\2&\u00de\3\2\2\2(\u00e8\3\2\2\2*\u00f8\3\2\2\2,\u0107\3\2\2\2."+
-               
"\u0116\3\2\2\2\60\u0118\3\2\2\2\62\u011c\3\2\2\2\64\u011e\3\2\2\2\66\u0120"+
-               
"\3\2\2\28:\5\4\3\29;\5\6\4\2:9\3\2\2\2:;\3\2\2\2;=\3\2\2\2<>\5\b\5\2="+
-               
"<\3\2\2\2=>\3\2\2\2>@\3\2\2\2?A\5\n\6\2@?\3\2\2\2@A\3\2\2\2AB\3\2\2\2"+
-               
"BC\5\22\n\2CD\7\2\2\3D\3\3\2\2\2EF\7\3\2\2FG\7(\2\2GH\7\62\2\2H\5\3\2"+
-               
"\2\2IJ\7\4\2\2JK\7(\2\2KL\7/\2\2L\7\3\2\2\2MN\7\5\2\2NO\7(\2\2OP\5\60"+
-               
"\31\2P\t\3\2\2\2QR\7\6\2\2RS\7(\2\2SU\7\32\2\2TV\5\f\7\2UT\3\2\2\2UV\3"+
-               
"\2\2\2VW\3\2\2\2WX\7\33\2\2X\13\3\2\2\2YZ\b\7\1\2Z[\5\16\b\2[a\3\2\2\2"+
-               
"\\]\f\3\2\2]^\7#\2\2^`\5\16\b\2_\\\3\2\2\2`c\3\2\2\2a_\3\2\2\2ab\3\2\2"+
-               
"\2b\r\3\2\2\2ca\3\2\2\2de\5\60\31\2ef\7$\2\2fg\5\20\t\2g\17\3\2\2\2hl"+
-               
"\7\7\2\2il\7/\2\2jl\5\60\31\2kh\3\2\2\2ki\3\2\2\2kj\3\2\2\2l\21\3\2\2"+
-               
"\2mn\b\n\1\2no\5\26\f\2ot\3\2\2\2pq\f\3\2\2qs\5\26\f\2rp\3\2\2\2sv\3\2"+
-               
"\2\2tr\3\2\2\2tu\3\2\2\2u\23\3\2\2\2vt\3\2\2\2wx\t\2\2\2x\25\3\2\2\2y"+
-               
"{\7\b\2\2z|\5\30\r\2{z\3\2\2\2{|\3\2\2\2|}\3\2\2\2}~\5\24\13\2~\177\7"+
-               
"\32\2\2\177\u0080\5\32\16\2\u0080\u0082\7\33\2\2\u0081\u0083\5\62\32\2"+
-               
"\u0082\u0081\3\2\2\2\u0082\u0083\3\2\2\2\u0083\27\3\2\2\2\u0084\u0085"+
-               
"\7\30\2\2\u0085\u0086\7\62\2\2\u0086\u0087\7\31\2\2\u0087\31\3\2\2\2\u0088"+
-               
"\u0089\b\16\1\2\u0089\u0091\5\34\17\2\u008a\u008b\7\30\2\2\u008b\u008c"+
-               
"\5\32\16\2\u008c\u008d\7\31\2\2\u008d\u0091\3\2\2\2\u008e\u008f\7\27\2"+
-               
"\2\u008f\u0091\5\32\16\3\u0090\u0088\3\2\2\2\u0090\u008a\3\2\2\2\u0090"+
-               
"\u008e\3\2\2\2\u0091\u0097\3\2\2\2\u0092\u0093\f\4\2\2\u0093\u0094\t\3"+
-               
"\2\2\u0094\u0096\5\32\16\5\u0095\u0092\3\2\2\2\u0096\u0099\3\2\2\2\u0097"+
-               
"\u0095\3\2\2\2\u0097\u0098\3\2\2\2\u0098\33\3\2\2\2\u0099\u0097\3\2\2"+
-               
"\2\u009a\u009b\5\36\20\2\u009b\u009c\7\23\2\2\u009c\u009d\5\36\20\2\u009d"+
-               
"\35\3\2\2\2\u009e\u009f\b\20\1\2\u009f\u00ab\5\"\22\2\u00a0\u00a1\7\30"+
-               
"\2\2\u00a1\u00a2\5\36\20\2\u00a2\u00a3\7\31\2\2\u00a3\u00ab\3\2\2\2\u00a4"+
-               
"\u00a5\7\62\2\2\u00a5\u00a7\7\30\2\2\u00a6\u00a8\5\36\20\2\u00a7\u00a6"+
-               
"\3\2\2\2\u00a7\u00a8\3\2\2\2\u00a8\u00a9\3\2\2\2\u00a9\u00ab\7\31\2\2"+
-               
"\u00aa\u009e\3\2\2\2\u00aa\u00a0\3\2\2\2\u00aa\u00a4\3\2\2\2\u00ab\u00b2"+
-               "\3\2\2\2\u00ac\u00ad\f\4\2\2\u00ad\u00ae\5 
\21\2\u00ae\u00af\5\36\20\5"+
-               
"\u00af\u00b1\3\2\2\2\u00b0\u00ac\3\2\2\2\u00b1\u00b4\3\2\2\2\u00b2\u00b0"+
-               
"\3\2\2\2\u00b2\u00b3\3\2\2\2\u00b3\37\3\2\2\2\u00b4\u00b2\3\2\2\2\u00b5"+
-               
"\u00b6\t\4\2\2\u00b6!\3\2\2\2\u00b7\u00b8\b\22\1\2\u00b8\u00be\5$\23\2"+
-               
"\u00b9\u00ba\7\30\2\2\u00ba\u00bb\5\"\22\2\u00bb\u00bc\7\31\2\2\u00bc"+
-               
"\u00be\3\2\2\2\u00bd\u00b7\3\2\2\2\u00bd\u00b9\3\2\2\2\u00be\u00c4\3\2"+
-               
"\2\2\u00bf\u00c0\f\3\2\2\u00c0\u00c1\7#\2\2\u00c1\u00c3\5\"\22\4\u00c2"+
-               
"\u00bf\3\2\2\2\u00c3\u00c6\3\2\2\2\u00c4\u00c2\3\2\2\2\u00c4\u00c5\3\2"+
-               
"\2\2\u00c5#\3\2\2\2\u00c6\u00c4\3\2\2\2\u00c7\u00dd\7\7\2\2\u00c8\u00ca"+
-               
"\7%\2\2\u00c9\u00c8\3\2\2\2\u00c9\u00ca\3\2\2\2\u00ca\u00ce\3\2\2\2\u00cb"+
-               
"\u00cf\7\60\2\2\u00cc\u00cd\7\60\2\2\u00cd\u00cf\7\61\2\2\u00ce\u00cb"+
-               
"\3\2\2\2\u00ce\u00cc\3\2\2\2\u00cf\u00dd\3\2\2\2\u00d0\u00dd\7/\2\2\u00d1"+
-               
"\u00dd\5\60\31\2\u00d2\u00d4\5&\24\2\u00d3\u00d2\3\2\2\2\u00d3\u00d4\3"+
-               
"\2\2\2\u00d4\u00d5\3\2\2\2\u00d5\u00dd\t\5\2\2\u00d6\u00d8\5&\24\2\u00d7"+
-               
"\u00d6\3\2\2\2\u00d7\u00d8\3\2\2\2\u00d8\u00d9\3\2\2\2\u00d9\u00dd\5*"+
-               
"\26\2\u00da\u00dd\5,\27\2\u00db\u00dd\5.\30\2\u00dc\u00c7\3\2\2\2\u00dc"+
-               
"\u00c9\3\2\2\2\u00dc\u00d0\3\2\2\2\u00dc\u00d1\3\2\2\2\u00dc\u00d3\3\2"+
-               
"\2\2\u00dc\u00d7\3\2\2\2\u00dc\u00da\3\2\2\2\u00dc\u00db\3\2\2\2\u00dd"+
-               
"%\3\2\2\2\u00de\u00df\b\24\1\2\u00df\u00e0\5(\25\2\u00e0\u00e5\3\2\2\2"+
-               
"\u00e1\u00e2\f\3\2\2\u00e2\u00e4\5(\25\2\u00e3\u00e1\3\2\2\2\u00e4\u00e7"+
-               
"\3\2\2\2\u00e5\u00e3\3\2\2\2\u00e5\u00e6\3\2\2\2\u00e6\'\3\2\2\2\u00e7"+
-               
"\u00e5\3\2\2\2\u00e8\u00e9\7\62\2\2\u00e9\u00ea\7&\2\2\u00ea)\3\2\2\2"+
-               
"\u00eb\u00ec\7\36\2\2\u00ec\u00f9\7\62\2\2\u00ed\u00ee\7\36\2\2\u00ee"+
-               "\u00ef\7\62\2\2\u00ef\u00f0\7 
\2\2\u00f0\u00f1\7\60\2\2\u00f1\u00f9\7"+
-               "!\2\2\u00f2\u00f3\7\36\2\2\u00f3\u00f4\7\62\2\2\u00f4\u00f5\7 
\2\2\u00f5"+
-               
"\u00f6\5\60\31\2\u00f6\u00f7\7!\2\2\u00f7\u00f9\3\2\2\2\u00f8\u00eb\3"+
-               
"\2\2\2\u00f8\u00ed\3\2\2\2\u00f8\u00f2\3\2\2\2\u00f9+\3\2\2\2\u00fa\u00fb"+
-               
"\7\"\2\2\u00fb\u0108\7\62\2\2\u00fc\u00fd\7\"\2\2\u00fd\u00fe\7\62\2\2"+
-               "\u00fe\u00ff\7 
\2\2\u00ff\u0100\7\60\2\2\u0100\u0108\7!\2\2\u0101\u0102"+
-               "\7\"\2\2\u0102\u0103\7\62\2\2\u0103\u0104\7 
\2\2\u0104\u0105\5\60\31\2"+
-               
"\u0105\u0106\7!\2\2\u0106\u0108\3\2\2\2\u0107\u00fa\3\2\2\2\u0107\u00fc"+
-               
"\3\2\2\2\u0107\u0101\3\2\2\2\u0108-\3\2\2\2\u0109\u010a\7-\2\2\u010a\u0117"+
-               
"\7\62\2\2\u010b\u010c\7-\2\2\u010c\u010d\7\62\2\2\u010d\u010e\7 \2\2\u010e"+
-               
"\u010f\7\60\2\2\u010f\u0117\7!\2\2\u0110\u0111\7-\2\2\u0111\u0112\7\62"+
-               "\2\2\u0112\u0113\7 
\2\2\u0113\u0114\5\60\31\2\u0114\u0115\7!\2\2\u0115"+
-               
"\u0117\3\2\2\2\u0116\u0109\3\2\2\2\u0116\u010b\3\2\2\2\u0116\u0110\3\2"+
-               
"\2\2\u0117/\3\2\2\2\u0118\u0119\t\6\2\2\u0119\61\3\2\2\2\u011a\u011d\5"+
-               
"\64\33\2\u011b\u011d\5\66\34\2\u011c\u011a\3\2\2\2\u011c\u011b\3\2\2\2"+
-               
"\u011d\63\3\2\2\2\u011e\u011f\t\7\2\2\u011f\65\3\2\2\2\u0120\u0121\7 "+
-               
"\2\2\u0121\u0122\7\60\2\2\u0122\u0123\7#\2\2\u0123\u0124\7\60\2\2\u0124"+
-               
"\u0125\7!\2\2\u0125\67\3\2\2\2\34:=@Uakt{\u0082\u0090\u0097\u00a7\u00aa"+
-               
"\u00b2\u00bd\u00c4\u00c9\u00ce\u00d3\u00d7\u00dc\u00e5\u00f8\u0107\u0116"+
-               "\u011c";
+               
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3.\u0100\4\2\t\2\4"+
+               
"\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t"+
+               
"\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+
+               
"\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\3\2\3\2\5"+
+               
"\2\63\n\2\3\2\5\2\66\n\2\3\2\5\29\n\2\3\2\3\2\3\2\3\3\3\3\3\3\3\3\3\4"+
+               
"\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\7\7R\n\7"+
+               
"\f\7\16\7U\13\7\3\7\3\7\3\7\3\7\5\7[\n\7\3\b\3\b\3\b\3\b\3\t\3\t\5\tc"+
+               
"\n\t\3\t\3\t\5\tg\n\t\3\t\5\tj\n\t\3\t\3\t\3\t\3\t\5\tp\n\t\3\n\3\n\3"+
+               
"\n\3\n\7\nv\n\n\f\n\16\ny\13\n\3\n\3\n\3\n\3\n\5\n\177\n\n\3\13\3\13\3"+
+               
"\13\3\13\3\13\7\13\u0086\n\13\f\13\16\13\u0089\13\13\3\f\3\f\3\r\3\r\5"+
+               
"\r\u008f\n\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\5\r\u009a\n\r\3\r\5\r"+
+               
"\u009d\n\r\3\16\5\16\u00a0\n\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17"+
+               
"\3\17\7\17\u00ab\n\17\f\17\16\17\u00ae\13\17\3\20\3\20\3\20\3\20\3\21"+
+               
"\3\21\3\21\3\21\3\21\3\21\3\21\3\21\5\21\u00bc\n\21\3\21\3\21\3\21\7\21"+
+               
"\u00c1\n\21\f\21\16\21\u00c4\13\21\3\22\3\22\3\22\3\22\3\23\3\23\3\23"+
+               
"\3\23\3\23\3\23\3\23\3\23\3\23\5\23\u00d3\n\23\3\23\5\23\u00d6\n\23\3"+
+               
"\23\3\23\3\23\3\23\3\23\3\23\7\23\u00de\n\23\f\23\16\23\u00e1\13\23\3"+
+               
"\24\3\24\5\24\u00e5\n\24\3\24\3\24\5\24\u00e9\n\24\3\24\5\24\u00ec\n\24"+
+               
"\3\24\3\24\5\24\u00f0\n\24\3\25\3\25\3\26\3\26\5\26\u00f6\n\26\3\27\3"+
+               "\27\3\30\3\30\3\30\3\30\3\30\3\30\3\30\2\6\24\34 
$\31\2\4\6\b\n\f\16\20"+
+               "\22\24\26\30\32\34\36 
\"$&(*,.\2\7\4\2\25\25\37\37\3\2\13\f\5\2\34\34"+
+               "  \"#\3\2\b\t\3\2 
\"\2\u010c\2\60\3\2\2\2\4=\3\2\2\2\6A\3\2\2\2\bE\3\2"+
+               
"\2\2\nI\3\2\2\2\fZ\3\2\2\2\16\\\3\2\2\2\20o\3\2\2\2\22~\3\2\2\2\24\u0080"+
+               
"\3\2\2\2\26\u008a\3\2\2\2\30\u008c\3\2\2\2\32\u009f\3\2\2\2\34\u00a4\3"+
+               "\2\2\2\36\u00af\3\2\2\2 
\u00bb\3\2\2\2\"\u00c5\3\2\2\2$\u00d5\3\2\2\2"+
+               
"&\u00ef\3\2\2\2(\u00f1\3\2\2\2*\u00f5\3\2\2\2,\u00f7\3\2\2\2.\u00f9\3"+
+               
"\2\2\2\60\62\5\4\3\2\61\63\5\6\4\2\62\61\3\2\2\2\62\63\3\2\2\2\63\65\3"+
+               
"\2\2\2\64\66\5\b\5\2\65\64\3\2\2\2\65\66\3\2\2\2\668\3\2\2\2\679\5\n\6"+
+               
"\28\67\3\2\2\289\3\2\2\29:\3\2\2\2:;\5\24\13\2;<\7\2\2\3<\3\3\2\2\2=>"+
+               
"\7\3\2\2>?\7\37\2\2?@\7,\2\2@\5\3\2\2\2AB\7\4\2\2BC\7\37\2\2CD\7\'\2\2"+
+               
"D\7\3\2\2\2EF\7\5\2\2FG\7\37\2\2GH\5(\25\2H\t\3\2\2\2IJ\7\6\2\2JK\7\37"+
+               
"\2\2KL\5\f\7\2L\13\3\2\2\2MN\7\21\2\2NS\5\16\b\2OP\7\32\2\2PR\5\16\b\2"+
+               
"QO\3\2\2\2RU\3\2\2\2SQ\3\2\2\2ST\3\2\2\2TV\3\2\2\2US\3\2\2\2VW\7\22\2"+
+               
"\2W[\3\2\2\2XY\7\21\2\2Y[\7\22\2\2ZM\3\2\2\2ZX\3\2\2\2[\r\3\2\2\2\\]\5"+
+               
"(\25\2]^\7\33\2\2^_\5\20\t\2_\17\3\2\2\2`p\5(\25\2ac\7\34\2\2ba\3\2\2"+
+               
"\2bc\3\2\2\2cd\3\2\2\2df\7)\2\2eg\7*\2\2fe\3\2\2\2fg\3\2\2\2gi\3\2\2\2"+
+               
"hj\7+\2\2ih\3\2\2\2ij\3\2\2\2jp\3\2\2\2kp\5\f\7\2lp\5\22\n\2mp\7\'\2\2"+
+               
"np\7(\2\2o`\3\2\2\2ob\3\2\2\2ok\3\2\2\2ol\3\2\2\2om\3\2\2\2on\3\2\2\2"+
+               
"p\21\3\2\2\2qr\7\27\2\2rw\5\20\t\2st\7\32\2\2tv\5\20\t\2us\3\2\2\2vy\3"+
+               
"\2\2\2wu\3\2\2\2wx\3\2\2\2xz\3\2\2\2yw\3\2\2\2z{\7\30\2\2{\177\3\2\2\2"+
+               
"|}\7\27\2\2}\177\7\30\2\2~q\3\2\2\2~|\3\2\2\2\177\23\3\2\2\2\u0080\u0081"+
+               
"\b\13\1\2\u0081\u0082\5\30\r\2\u0082\u0087\3\2\2\2\u0083\u0084\f\3\2\2"+
+               
"\u0084\u0086\5\30\r\2\u0085\u0083\3\2\2\2\u0086\u0089\3\2\2\2\u0087\u0085"+
+               
"\3\2\2\2\u0087\u0088\3\2\2\2\u0088\25\3\2\2\2\u0089\u0087\3\2\2\2\u008a"+
+               
"\u008b\t\2\2\2\u008b\27\3\2\2\2\u008c\u008e\7\7\2\2\u008d\u008f\5\36\20"+
+               
"\2\u008e\u008d\3\2\2\2\u008e\u008f\3\2\2\2\u008f\u0090\3\2\2\2\u0090\u0099"+
+               "\5\26\f\2\u0091\u0092\7\21\2\2\u0092\u0093\5 
\21\2\u0093\u0094\7\22\2"+
+               
"\2\u0094\u009a\3\2\2\2\u0095\u0096\7#\2\2\u0096\u0097\5\32\16\2\u0097"+
+               
"\u0098\7#\2\2\u0098\u009a\3\2\2\2\u0099\u0091\3\2\2\2\u0099\u0095\3\2"+
+               
"\2\2\u009a\u009c\3\2\2\2\u009b\u009d\5*\26\2\u009c\u009b\3\2\2\2\u009c"+
+               
"\u009d\3\2\2\2\u009d\31\3\2\2\2\u009e\u00a0\5\34\17\2\u009f\u009e\3\2"+
+               
"\2\2\u009f\u00a0\3\2\2\2\u00a0\u00a1\3\2\2\2\u00a1\u00a2\7\31\2\2\u00a2"+
+               
"\u00a3\7,\2\2\u00a3\33\3\2\2\2\u00a4\u00a5\b\17\1\2\u00a5\u00a6\7,\2\2"+
+               
"\u00a6\u00ac\3\2\2\2\u00a7\u00a8\f\3\2\2\u00a8\u00a9\7\35\2\2\u00a9\u00ab"+
+               
"\7,\2\2\u00aa\u00a7\3\2\2\2\u00ab\u00ae\3\2\2\2\u00ac\u00aa\3\2\2\2\u00ac"+
+               
"\u00ad\3\2\2\2\u00ad\35\3\2\2\2\u00ae\u00ac\3\2\2\2\u00af\u00b0\7\17\2"+
+               
"\2\u00b0\u00b1\7,\2\2\u00b1\u00b2\7\20\2\2\u00b2\37\3\2\2\2\u00b3\u00b4"+
+               
"\b\21\1\2\u00b4\u00bc\5\"\22\2\u00b5\u00b6\7\17\2\2\u00b6\u00b7\5 \21"+
+               
"\2\u00b7\u00b8\7\20\2\2\u00b8\u00bc\3\2\2\2\u00b9\u00ba\7\16\2\2\u00ba"+
+               "\u00bc\5 
\21\3\u00bb\u00b3\3\2\2\2\u00bb\u00b5\3\2\2\2\u00bb\u00b9\3\2"+
+               
"\2\2\u00bc\u00c2\3\2\2\2\u00bd\u00be\f\4\2\2\u00be\u00bf\t\3\2\2\u00bf"+
+               "\u00c1\5 
\21\5\u00c0\u00bd\3\2\2\2\u00c1\u00c4\3\2\2\2\u00c2\u00c0\3\2"+
+               
"\2\2\u00c2\u00c3\3\2\2\2\u00c3!\3\2\2\2\u00c4\u00c2\3\2\2\2\u00c5\u00c6"+
+               
"\5$\23\2\u00c6\u00c7\7\n\2\2\u00c7\u00c8\5$\23\2\u00c8#\3\2\2\2\u00c9"+
+               
"\u00ca\b\23\1\2\u00ca\u00d6\5&\24\2\u00cb\u00cc\7\17\2\2\u00cc\u00cd\5"+
+               
"$\23\2\u00cd\u00ce\7\20\2\2\u00ce\u00d6\3\2\2\2\u00cf\u00d0\7,\2\2\u00d0"+
+               
"\u00d2\7\17\2\2\u00d1\u00d3\5$\23\2\u00d2\u00d1\3\2\2\2\u00d2\u00d3\3"+
+               
"\2\2\2\u00d3\u00d4\3\2\2\2\u00d4\u00d6\7\20\2\2\u00d5\u00c9\3\2\2\2\u00d5"+
+               
"\u00cb\3\2\2\2\u00d5\u00cf\3\2\2\2\u00d6\u00df\3\2\2\2\u00d7\u00d8\f\4"+
+               
"\2\2\u00d8\u00d9\t\4\2\2\u00d9\u00de\5$\23\5\u00da\u00db\f\6\2\2\u00db"+
+               
"\u00dc\7\32\2\2\u00dc\u00de\5&\24\2\u00dd\u00d7\3\2\2\2\u00dd\u00da\3"+
+               
"\2\2\2\u00de\u00e1\3\2\2\2\u00df\u00dd\3\2\2\2\u00df\u00e0\3\2\2\2\u00e0"+
+               
"%\3\2\2\2\u00e1\u00df\3\2\2\2\u00e2\u00f0\7(\2\2\u00e3\u00e5\7\34\2\2"+
+               
"\u00e4\u00e3\3\2\2\2\u00e4\u00e5\3\2\2\2\u00e5\u00e6\3\2\2\2\u00e6\u00e8"+
+               
"\7)\2\2\u00e7\u00e9\7*\2\2\u00e8\u00e7\3\2\2\2\u00e8\u00e9\3\2\2\2\u00e9"+
+               
"\u00eb\3\2\2\2\u00ea\u00ec\7+\2\2\u00eb\u00ea\3\2\2\2\u00eb\u00ec\3\2"+
+               
"\2\2\u00ec\u00f0\3\2\2\2\u00ed\u00f0\7\'\2\2\u00ee\u00f0\5(\25\2\u00ef"+
+               
"\u00e2\3\2\2\2\u00ef\u00e4\3\2\2\2\u00ef\u00ed\3\2\2\2\u00ef\u00ee\3\2"+
+               
"\2\2\u00f0\'\3\2\2\2\u00f1\u00f2\t\5\2\2\u00f2)\3\2\2\2\u00f3\u00f6\5"+
+               
",\27\2\u00f4\u00f6\5.\30\2\u00f5\u00f3\3\2\2\2\u00f5\u00f4\3\2\2\2\u00f6"+
+               
"+\3\2\2\2\u00f7\u00f8\t\6\2\2\u00f8-\3\2\2\2\u00f9\u00fa\7\27\2\2\u00fa"+
+               
"\u00fb\7)\2\2\u00fb\u00fc\7\32\2\2\u00fc\u00fd\7)\2\2\u00fd\u00fe\7\30"+
+               
"\2\2\u00fe/\3\2\2\2\36\62\658SZbfiow~\u0087\u008e\u0099\u009c\u009f\u00ac"+
+               
"\u00bb\u00c2\u00d2\u00d5\u00dd\u00df\u00e4\u00e8\u00eb\u00ef\u00f5";
        public static final ATN _ATN =
                new ATNDeserializer().deserialize(_serializedATN.toCharArray());
        static {
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/ver2/NCIntentDslCompiler.scala
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/ver2/NCIntentDslCompiler.scala
new file mode 100644
index 0000000..c3c8b10
--- /dev/null
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/impl/ver2/NCIntentDslCompiler.scala
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.nlpcraft.model.intent.impl.ver2
+
+import com.typesafe.scalalogging.LazyLogging
+import org.antlr.v4.runtime._
+import org.antlr.v4.runtime.tree.ParseTreeWalker
+import org.apache.nlpcraft.common._
+import org.apache.nlpcraft.model.intent.impl.antlr4._
+import org.apache.nlpcraft.model.intent.utils.ver2._
+
+import scala.collection.mutable
+import scala.collection.mutable.ArrayBuffer
+
+object NCIntentDslCompiler extends LazyLogging {
+    // Compiler cache.
+    private val cache = new mutable.HashMap[String, NCDslIntent]
+
+    private var mdlId: String = _
+
+    /**
+     *
+     */
+    class FiniteStateMachine(dsl: String) extends NCIntentDslBaseListener {
+        // Intent components.
+        private var id: String = _
+        private var ordered: Boolean = false
+        private var meta: Map[String, Any] = _
+        private val terms = ArrayBuffer.empty[NCDslTerm] // Accumulator for 
parsed terms.
+        private var flowRegex: Option[String] = None
+
+        /**
+         *
+         * @return
+         */
+        def getBuiltIntent: NCDslIntent = {
+            require(id != null)
+            require(terms.nonEmpty)
+
+            NCDslIntent(dsl, id, ordered, meta, flowRegex, terms.toArray)
+        }
+    }
+
+    /**
+     * Custom error handler.
+     */
+    class CompilerErrorListener(dsl: String) extends BaseErrorListener {
+        /**
+         *
+         * @param len
+         * @param pos
+         * @return
+         */
+        private def makeCharPosPointer(len: Int, pos: Int): String = {
+            val s = (for (_ ← 1 to len) yield '-').mkString("")
+
+            s.substring(0, pos - 1) + '^' + s.substring(pos)
+        }
+
+        /**
+         *
+         * @param recognizer
+         * @param offendingSymbol
+         * @param line
+         * @param charPos
+         * @param msg
+         * @param e
+         */
+        override def syntaxError(
+            recognizer: Recognizer[_, _],
+            offendingSymbol: scala.Any,
+            line: Int,
+            charPos: Int,
+            msg: String,
+            e: RecognitionException): Unit = {
+
+            val errMsg = s"Intent DSL syntax error at line $line:$charPos - 
$msg\n" +
+                s"  |-- ${c("Model:")}  $mdlId\n" +
+                s"  |-- ${c("Intent:")} $dsl\n" +
+                s"  +-- ${c("Error:")}  ${makeCharPosPointer(dsl.length, 
charPos)}"
+
+            throw new NCE(errMsg)
+        }
+    }
+
+    /**
+     *
+     * @param dsl Intent DSL to parse.
+     * @param mdlId ID of the model the intent belongs to.
+     * @return
+     */
+    def compile(dsl: String, mdlId: String): NCDslIntent = {
+        require(dsl != null)
+
+        this.mdlId = mdlId
+
+        val intent: NCDslIntent = cache.getOrElseUpdate(dsl, {
+            // ANTLR4 armature.
+            val lexer = new NCIntentDslLexer(CharStreams.fromString(dsl))
+            val tokens = new CommonTokenStream(lexer)
+            val parser = new NCIntentDslParser(tokens)
+
+            // Set custom error handlers.
+            lexer.removeErrorListeners()
+            parser.removeErrorListeners()
+            lexer.addErrorListener(new CompilerErrorListener(dsl))
+            parser.addErrorListener(new CompilerErrorListener(dsl))
+
+            // State automata.
+            val fsm = new FiniteStateMachine(dsl)
+
+            // Parse the input DSL and walk built AST.
+            (new ParseTreeWalker).walk(fsm, parser.intent())
+
+            // Return the built intent.
+            fsm.getBuiltIntent
+        })
+
+        intent
+    }
+}
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/utils/ver2/NCDslIntent.scala
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/utils/ver2/NCDslIntent.scala
new file mode 100644
index 0000000..c93a3e4
--- /dev/null
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/utils/ver2/NCDslIntent.scala
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.nlpcraft.model.intent.utils.ver2
+
+/**
+ * DSL intent.
+ */
+case class NCDslIntent(
+    orig: String,
+    id: String,
+    ordered: Boolean,
+    meta: Map[String, Any],
+    flow: Option[String],
+    terms: Array[NCDslTerm]
+) {
+    if (id == null)
+        throw new IllegalArgumentException("Intent ID must be provided.")
+    if (terms.length == 0)
+        throw new IllegalArgumentException("Intent should have at least one 
term.")
+}
diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/utils/ver2/NCDslTerm.scala
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/utils/ver2/NCDslTerm.scala
new file mode 100644
index 0000000..9cc3ad4
--- /dev/null
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/utils/ver2/NCDslTerm.scala
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.nlpcraft.model.intent.utils.ver2
+
+import org.apache.nlpcraft.model.NCToken
+
+/**
+ * DSL term.
+ */
+case class NCDslTerm(
+    id: String,
+    pred: NCToken ⇒ Boolean,
+    min: Int,
+    max: Int,
+    conv: Boolean
+) {
+    if (pred == null)
+        throw new IllegalArgumentException("Intent DSL term must be defined.")
+    if (min < 0 || min > max)
+        throw new IllegalArgumentException(s"Invalid intent DSL term min 
quantifiers: $min (must be min >= 0 && min <= max).")
+    if (max < 1)
+        throw new IllegalArgumentException(s"Invalid intent DSL term max 
quantifiers: $max (must be max >= 1).")
+}

Reply via email to