dsl

How GOTO statement in Groovy?

主宰稳场 提交于 2019-12-04 13:06:15
I saw this nice blog post about a Scala continuations that 'emulates' a GOTO statement in the Scala language. (read more about Continuations here ) I would like to have the same in the programming language Groovy. I think it's possible within a Groovy compiler phase transformation . I'm working on an Domain-Specific Language (DSL), and preferred embedded in Groovy. I would like to have the GOTO statement, because the DSL is an unstructured language (and is generated from workflow diagrams). I need a 'labeled' goto statement, not to line numbers. The DSL is a language for workflow definitions,

What is DSL in Scala? [closed]

偶尔善良 提交于 2019-12-04 12:12:11
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . Going through various Scala related material, term DSL is used at many places. Google search tells it is Domain specific language. What exactly it means, and why is it that this term doesn't comes across while learning other languages like Java? 回答1: As others have pointed out, the

Noise-free JSON processing with Scala

大城市里の小女人 提交于 2019-12-04 09:07:10
问题 I'm coming from a dotnet land, but recently have been looking at the possibilities of alternative programming languages. Nothing really serious, just some bits here and there. Recently I've discovered Scala and I'm pretty fascinated with it. Despite non-deterministic tinkering, I've done some intermediate checks of stuff that is important for me in C# and I feel rather satisfied: functional notions - tick, ad-hoc polymorphism - tick, annotations - tick, reflection and codegen - tick. Now I'm

Interpreter vs. Code Generator Xtext

无人久伴 提交于 2019-12-04 08:53:11
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 interpreter. Thank you, Salman Basically, interpreters and code generators work really differently. Code

Are Project-Specific DSLs a Liability? [closed]

早过忘川 提交于 2019-12-04 07:15:58
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 8 years ago . I've forked this question from a similar question I made in a comment I made to one of the many great answers I recieved. I was originally asking about AST macros, which mostly provoked very detailed and thoughtful responses from Lispers. Thanks. Lazy Evaluation vs Macros The question I made in a comment was whether project-specific DSLs are actually a good idea. Of course, this is completely

Is there a Harel Statechart DSL tool for Java?

北城以北 提交于 2019-12-04 04:24:14
I'm looking for a tool that understands a DSL in which I can define my statechart that generates Java code or where the statechart in the DSL is runnable as is. The tool would ideally be written in Java and must support superstates and orthogonal regions by definition of Harel Statecharts (or equivalently UML 2 State Machines). Alternatively, what would be the best library or tool to write such a DSL with? ahcox Yakindu looks good: http://www.statecharts.org Harel Statecharts Visual Language Textual DSL Generates Java Generates C Generates C++ Generation configurable / customisable Eclipse

Modeling set-based code-listings of sql data manipulation operations

限于喜欢 提交于 2019-12-04 03:54:17
问题 Technologies like LINQ do a good job being able to describe relational data queries, with types such as IQueryable , IGrouping , and IOrderedQueryable modeling projections , selections , aggregations , sorting , etc. These concepts from relational algebra allow us to communicate a fairly arbitrary query in one language on one machine and execute it in a different language (~sql) on a different machine. It would be nice to be able to do the same thing for even more complicated multi-part

Scala DSL - Nested block referencing parent

半腔热情 提交于 2019-12-04 03:33:19
问题 Playing about with a DSL in Scala, so lets say I have something like this: house { floor { bedroom("kids) bedroom("master") } floor { kitchen() } } Now what I want is at each nested block it to have a reference or be referencing functions on the enclosing block. Eg so the effect is that floor is added to the house, bedroom to the floor etc. Currently I do this in a horrible fashion of having a global stack that gets updated at each nested level to keep track of the current "context". Also my

Strategy for parsing natural language descriptions into structured data

烈酒焚心 提交于 2019-12-04 00:53:10
I have a set of requirements and I'm looking for the best Java-based strategy / algorthm / software to use. Basically, I want to take a set of recipe ingredients entered by real people in natural english and parse out the meta-data into a structured format (see requirements below to see what I'm trying to do). I've looked around here and other places, but have found nothing that gives a high-level advice on what direction follow. So, I'll put it to the smart people :-): What's the best / simplest way to solve this problem? Should I use a natural language parser, dsl, lucene/solr, or some other

Elasticsearch the terms filter raise “filter does not support [mediatest]”

萝らか妹 提交于 2019-12-04 00:39:25
my query is like this: { "query": { "filtered": { "filter": { "bool": { "must": [ { "term": { "online": 1 } }, { "terms": { "mediaType": "flash" } } ] } } } } } it raise a QueryParsingException [[comos_v2] [terms] filter does not support [mediaType]] ,of which the field "mediaType" exactly does not exist in mapping. my question is why term filter does not raise the Exception? The above is not a valid Query DSL. In the above Terms filter the values to "mediaType" field should be an array It should be the following : { "query": { "filtered": { "filter": { "bool": { "must": [ { "term": { "online"