dsl

Using JBoss DROOLS XMLDumper with .dslr file

北城以北 提交于 2019-12-23 03:32:18
问题 I have a .dslr file consiting of a rule(dslr) and a dsl file. I need to get the XML output of the DRL from this dslr. I've tried different ways with the XMLDumper but cannot get it to work. Any ideas? 回答1: First convert your DSLR file to DRL, then do the same as before. See following link for an example on how to convert DSLR to DRL: http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/compiler/DrlParserTest.java 回答2: I repackaged the unit test

How to join multiple queryDSL tables

ぃ、小莉子 提交于 2019-12-22 22:21:26
问题 I have some tables and I want to get result using queryDSL join, but haven't found any examples on multiple joins using queryDSL. I have these tables: Account table: accountId (PK) | email | password account_profile table: accountId (PK)(fk to account) | nickname Community table: articleId (PK) | accountId (fk to account) | title | content Now I want below JPQL to be queryDSL code select r from community r join r.account.profile a where a.nickname = :nickname I have entity metamodels -

how to include groovy dsl script from one groovy file to another

我只是一个虾纸丫 提交于 2019-12-22 17:54:08
问题 I have created a custom dsl command chain using methods in a groovy scripts . I have a problem in accessing this command chain from another groovy file . Is there a way to achieve the functionality ? I have tried using "evaluate" which is able to load the groovy file , but it is not able to execute the command chain. I have tried using Groovy shell class , but was not able to call the methods. show = { def cube_root= it } cube_root = { Math.cbrt(it) } def please(action) { [the: { what -> [of:

how to include groovy dsl script from one groovy file to another

我是研究僧i 提交于 2019-12-22 17:53:28
问题 I have created a custom dsl command chain using methods in a groovy scripts . I have a problem in accessing this command chain from another groovy file . Is there a way to achieve the functionality ? I have tried using "evaluate" which is able to load the groovy file , but it is not able to execute the command chain. I have tried using Groovy shell class , but was not able to call the methods. show = { def cube_root= it } cube_root = { Math.cbrt(it) } def please(action) { [the: { what -> [of:

Is there a way to match the content of a spirit::lex string token as a literal in a spirit::qi grammar

可紊 提交于 2019-12-22 10:10:40
问题 I'm writing a DSL and using a Boost Spirit lexer to tokenize my input. In my grammar, I want a rule similar to this (where tok is the lexer): header_block = tok.name >> ':' >> tok.stringval > ';' >> tok.description >> ':' >> tok.stringval > ';' ; Rather than specifying reserved words for the language (e.g. "name", "description") and deal with synchronizing these between the lexer and grammar, I want to just tokenize everything that matches [a-zA-Z_]\w* as a single token type (e.g. tok.symbol

C++ domain specific embedded language operators

元气小坏坏 提交于 2019-12-22 04:54:48
问题 In numerical oriented languages (Matlab, Fortran) range operator and semantics is very handy when working with multidimensional data. For example: A(i:j,k,:n) // represents two-dimensional slice B(i:j,0:n) of A at index k unfortunately C++ does not have range operator (:). of course it can be emulated using range/slice functor, but semantics is less clean than Matlab. I am prototyping matrix/tensor domain language in C++ and am wondering if there any options to reproduce range operator. I

C++ domain specific embedded language operators

我是研究僧i 提交于 2019-12-22 04:54:12
问题 In numerical oriented languages (Matlab, Fortran) range operator and semantics is very handy when working with multidimensional data. For example: A(i:j,k,:n) // represents two-dimensional slice B(i:j,0:n) of A at index k unfortunately C++ does not have range operator (:). of course it can be emulated using range/slice functor, but semantics is less clean than Matlab. I am prototyping matrix/tensor domain language in C++ and am wondering if there any options to reproduce range operator. I

How to parse DSL input to high performance expression template

廉价感情. 提交于 2019-12-22 00:07:02
问题 ( EDITED both title and main text and created a spin-off question that arose) For our application it would be ideal to parse a simple DSL of logical expressions. However the way I'd like to do this is to parse (at runtime) the input text which gives the expressions into some lazily evaluated structure (an expression template) which can then be later used within more performance sensitive code. Ideally the evaluation is as fast as possible using this technique as it will be used a large number

Interpreting custom language

戏子无情 提交于 2019-12-21 20:17:20
问题 I need to develop an application that will read and understand text file in which I'll find a custom language that describe a list of operations (ie cooking recipe). This language has not been defined yet, but it will probably take one of the following shape : C++ like code (This code is randomly generated, just for example purpose) : begin repeat(10) { bar(toto, 10, 1999, xxx); } result = foo(xxxx, 10); if(foo == ok) { ... } else { ... } end XML code (This code is randomly generated, just

Interpreter vs. Code Generator Xtext

孤街浪徒 提交于 2019-12-21 17:18:24
问题 I've a DSL written using Xtext. What I want is to execute that DSL to perform something good out of it. I wrote myDslGenerator class implementing the interface IGenerator in xtend to generate java code and it's working fine. I've two questions; What is the difference between Interpreter and Code Generator? Aren't both for executing DSL? How to write an interpreter? Any step by step tutorial link? I found many tutorial to generate code using xtend but couldn't find any for writing an