dsl

How to add cascading content assist in Xtext document

佐手、 提交于 2019-12-11 16:03:33
问题 I want to add cascading content assist while creating an array of pre-defined values. When I'm creating the array, it should first give me the assist to add only '{'. After that it should suggest me the list of pre-defined values and a '}'. If I choose a value, it should suggest me to add a comma, then repeat the above step. It should keep suggesting me these until I add a closing brace. Currently I'm able to provide content-assist for only one element in the array. An example of desired

A DSL in Python for tabular analysis and processing?

倖福魔咒の 提交于 2019-12-11 15:35:43
问题 I am carrying around the idea to create a restricted form of a language for tabular analysis. Thequestion is if there is something like the following already around or if there are better ideas todo it. The key requirement is that the user must be able to employ naked script files without thenecessity to produce a full Python program. OTOH elements of the script language are compiled at runtime andshould offer a possibility to formulate complex conditions and calculations (mostly arithmetic

Match string in XText regardless of upper/lower case

落花浮王杯 提交于 2019-12-11 13:33:31
问题 I want to create a rule in XText that matches to a string, but does not care in what case the string is. For example, I want it to match against both "DUCK", "DucK" and "duck". Is there a more simple way of doing it than covering all cases, like: Rule: 'Duck'|'DucK'|'DuCK'|... and so on ; 回答1: There is a flag that you can configure in the mwe2 workflow. Replace the XtextAntlrGeneratorFragment by the org.eclipse.xtext.generator.parser.antlr.ex.rt.AntlrGeneratorFragment and pass options = {

Use Ruby to parse a Tcl DSL

ε祈祈猫儿з 提交于 2019-12-11 10:29:40
问题 I would like to be able to parse some Tcl code where arguments are not surrounded by strings. Consider this tcl code: proc foo {name} { puts "Foo --> $name" } foo bar For those unfamiliar with Tcl, foo is the method name and bar is the argument (quotes are optional in Tcl). The previous code will output: Foo --> bar Is it possible to parse exactly the same input using ruby ( bar remains unquoted)? The equivalent ruby code is: def foo(name) puts "Foo --> #{name}" end tcl = <<-TCL.gsub(/^\s+/,

String.split() in Karate Feature File returning exceptions

六月ゝ 毕业季﹏ 提交于 2019-12-11 10:26:06
问题 I'm unsure about how I can split the response string from an already created feature to obtain the response header "Location" value. What I've tried 1) Feature: Create Tariff Background: * def result = call read('../../get-user-token.feature') * def serviceId = call read('create-service.feature') Scenario: Create Tariff Given url 'https://app-dev.topbox.pro/tariff-svc/api/v1/tariffs' And header Authorization = result.response.token_type + " " + result.response.access_token And request """ {

Spring Integration Java DSL - Set RecepientListRouter recipients dynamically?

青春壹個敷衍的年華 提交于 2019-12-11 09:15:09
问题 I have a method which needs to execute multiple tasks async'ly.. I've managed to achieve that using the following IntegrationFlow: @Bean public IntegrationFlow startJobTask() { return IntegrationFlows.from("TaskRoutingChannel") .handle("jobService", "executeTasks") .routeToRecipients(r -> r .recipient("testTaskChannel") .recipient("test2TaskChannel")) .get(); } @Bean ExecutorChannel testTaskChannel(){ return new ExecutorChannel(this.getAsyncExecutor()); } @Bean ExecutorChannel

How to create ConfigObject using only nested maps in Grails?

萝らか妹 提交于 2019-12-11 08:15:46
问题 It is possible to implement closure-based config as a map of maps? grails { acme { host = 'localhost' poolSettings { timeout = 5000 } } } The above config is convention for a grails plugin. We're doing a migration, and due to legacy constraints, we need to create the config dynamically to eliminate impact to legacy code. I started with a simple config: grails.acme = [host:'localhost'] This works fine with the plugin on startup, so I added a nested map: grails.acme = [host:'localhost'] def

Get absolute path of the script directory that is being processed by Job DSL

夙愿已清 提交于 2019-12-11 05:00:57
问题 I have a DSL groovy script defining a pipeline job. I need to load Jenkinsfile from the workspace. The Jenkinsfile resides in the same folder as that of the groovy script. I am trying to get the path of the groovy script programmatically so that I can use that to figure out the path of the Jenkinsfile and load it using readFileFromWorkspace . I tried using __FILE__ directive after going through the job-dsl-wiki. But I am getting the following error: Processing provided DSL script ERROR: (test

Karate - Ability to dynamically decide the type of match in karate for verification

让人想犯罪 __ 提交于 2019-12-11 04:59:10
问题 Lets say we scripted the scenarios following way for our evolving servers Actual server v1 response response = { id: "1", name: "karate" } Mocking client v1 schema schema = { id: "#string", name: "#string } * match response == schema Actual server v2 response response = { id: "2", name: "karate", value: "is" } Mocking client v2 schema schema = { id: "#string", name: "#string, value: "#string" } * match response == schema Actual server v3 response response = { id: "3", name: "karate", value:

AutoCompletion for my DSL keywords in Geany

匆匆过客 提交于 2019-12-11 04:18:40
问题 Geany(IDE) supports Autocompletion or IntelliSense as you program, but this is done based on the words you've used in the code so far. Is there any way so I could have Autocompletion for my language keywords? 回答1: You can achieve this by writing your own tag file. It should be name like <somename>.<filetype>.tags and can be stored e.g. inside .geany-folder or inside global folders. You can import it via Tools-menu. The tag file contains of a list of your methods, functions etc of your