how to run antlr grun tool against feel-grammar

已查看 100 次
跳至第一个未读帖子

Anonymous

未读,
2019年6月10日 09:22:212019/6/10
收件人 Drools Development
Hi,

Below are the steps tried:-
1. cloned complete drools project https://github.com/kiegroup/drools
2. mvn clean install -DskipTests
4.JPG














3. created a input file
1.JPG



4. tried running grun
and got below error

3.JPG

Matteo Mortari

未读,
2019年6月10日 09:48:012019/6/10
收件人 drools-de...@googlegroups.com
Hi,
if you goal is to test some FEEL expressions, I believe the easiest way would be to extend some of the tests unit in the code base.

but not limiting to, you can take reference other unit tests in the same module.

This way, you don't need to build the complete drools repo, and just work on the IDE

Otherwise, can you explain a bit further what is the requirement behind running "grun", please?
The reason I'm asking is because FEEL, as from the DMN specification, is NOT a context free grammar. Hence I believe any generic tool would not be able to support the full DMN semantic, as you might want to provide which variables are in scope, for more complex expression.

Please let me know, I'd be glad to support further !
MM

--
You received this message because you are subscribed to the Google Groups "Drools Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-developm...@googlegroups.com.
To post to this group, send email to drools-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-development/5bbc4e1c-0a00-4cc3-acb9-719eb6975c18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anonymous

未读,
2019年6月11日 02:35:082019/6/11
收件人 Drools Development
Hi, 

we are just interested in studying the parse tree


On Monday, June 10, 2019 at 7:18:01 PM UTC+5:30, Matteo Mortari wrote:
Hi,
if you goal is to test some FEEL expressions, I believe the easiest way would be to extend some of the tests unit in the code base.

but not limiting to, you can take reference other unit tests in the same module.

This way, you don't need to build the complete drools repo, and just work on the IDE

Otherwise, can you explain a bit further what is the requirement behind running "grun", please?
The reason I'm asking is because FEEL, as from the DMN specification, is NOT a context free grammar. Hence I believe any generic tool would not be able to support the full DMN semantic, as you might want to provide which variables are in scope, for more complex expression.

Please let me know, I'd be glad to support further !
MM

On Mon, 10 Jun 2019 at 15:22, Anonymous <yoyo.pr...@gmail.com> wrote:
Hi,

Below are the steps tried:-
1. cloned complete drools project https://github.com/kiegroup/drools
2. mvn clean install -DskipTests
4.JPG














3. created a input file
1.JPG



4. tried running grun
and got below error

3.JPG

--
You received this message because you are subscribed to the Google Groups "Drools Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-development+unsub...@googlegroups.com.

Matteo Mortari

未读,
2019年6月11日 04:14:272019/6/11
收件人 drools-de...@googlegroups.com
Hi,
then indeed using the test cases imho is the best way to go, the "grun" from Antlr does not support implementation for non-context-free grammar scenario in an easy way.
Using the unit test will ensure you are using the non-context-free grammar correctly.

IFF you really, really want to just rely on what defined in the .g4 grammar, at the expense of potential pitfalls due to the non-context-free, personally I believe is much more easier to use the ANLTR4 extension from VSCode
I attach screenshot below

Hope this helps, available if any further questions or doubts!
MM

image.png



Hi, 

To unsubscribe from this group and stop receiving emails from it, send an email to drools-developm...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Drools Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-developm...@googlegroups.com.

To post to this group, send email to drools-de...@googlegroups.com.

Anonymous

未读,
2019年6月11日 08:16:082019/6/11
收件人 Drools Development
Hi,

Thanks for the reply i can generate the tree. Can you help me out with a simple test case that has a some function invocation, say sum(1, 2)


On Tuesday, June 11, 2019 at 1:44:27 PM UTC+5:30, Matteo Mortari wrote:
Hi,
Hi, 

To unsubscribe from this group and stop receiving emails from it, send an email to drools-development+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Drools Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-development+unsub...@googlegroups.com.

Matteo Mortari

未读,
2019年6月11日 08:20:052019/6/11
收件人 drools-de...@googlegroups.com

Hi, 

To unsubscribe from this group and stop receiving emails from it, send an email to drools-developm...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Drools Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-developm...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Drools Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-developm...@googlegroups.com.

To post to this group, send email to drools-de...@googlegroups.com.

Matteo Mortari

未读,
2019年6月20日 09:00:282019/6/20
收件人 drools-de...@googlegroups.com
Hi Anonymous / "yoyo.predator123@",

FYI we recently merged an extension which allows to properly run Antlr's "grun" with the FEEL .g4 grammar.


If you want to leverage the non-context-free features you cannot rely just on the command line, but you must provide programmatically the variables in scope.

Example result:
image.png

I hope this helps and please let us know if any feedback, I hope this is helpful.
MM
回复全部
回复作者
转发
0 个新帖子