[rules-dev] Rete DSL testing harness
Mark Proctor
mproctor at codehaus.org
Wed Dec 2 07:49:25 EST 2009
Michael Neale wrote:
> I think it would be mvel - kind of an external dsl, but mvel is a
> languge as well, so not sure how you would classify it.
>
No it's a simple java line parser. I just chunk based on indendation. I
do evaluate parts of those chunks with MVEL, for things like array
building. I did it like this as I found any other DSL language just had
too much extra verbage, like more brackets or symbols, because it's
restricted to the way it's parser works.
trunk/drools-core/src/test/java/org/drools/reteoo/test/ReteDslTestEngine.java
So first I put it through chunkReader(). This turns it into a list of
strings, it removes any comments but keeps spacing
The chunkReader is used by buildDslCommands(). This iterates each String
in the list and uses indentation position to know which commands execute
against which steps. I chose indentation rather than { ... } brackets as
I wanted something that was more easily readable. It does make the
authoring slightly more fragile, but readability was important here.
Once we have the list of steps we can evaluate them with run().
Mark
> Sent from my phone.
>
> On 02/12/2009, at 8:53 PM, leo_gomes <leonardo.f.gomes at gmail.com> wrote:
>
>
>> Is it an internal dsl written in jython or something like that, or an
>> external one that you crafted with antlr?
>>
>> Is it on trunk?
>>
>> Leo.
>>
>>
>> Mark Proctor wrote:
>>
>>> Thought i'd flash this up on dev mailing list, incase anyone wanted
>>> to
>>> discuss it - or help :)
>>> http://blog.athico.com/2009/11/rete-dsl-testing-harness.html
>>>
>>> Mark
>>>
>>> _______________________________________________
>>> rules-dev mailing list
>>> rules-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/rules-dev
>>>
>>>
>>>
>> --
>> View this message in context: http://n3.nabble.com/Rete-DSL-testing-harness-tp63446p66217.html
>> Sent from the Drools - Dev mailing list archive at Nabble.com.
>> _______________________________________________
>> rules-dev mailing list
>> rules-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-dev
>>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20091202/1a112f18/attachment.html
More information about the rules-dev
mailing list