xbase

How to JvmModelInferrer method body from XExpression and append boilerplate code

好久不见. 提交于 2021-01-29 09:50:37
问题 In a JvmModelInferrer, when constructing the body of a method or constructor, how do you insert both an XExpression from the grammar body = op.body and additional "boilerplate" code, for example body = [ append( ''' System.out.println("BOILERPLATE"); ''' ) ] I can achieve either but not both. For a minimal working example, consider the following canonical Xbase grammar, grammar org.example.xbase.entities.Entities with org.eclipse.xtext.xbase.Xbase generate entities "http://www.example.org

How to re-order JSON in BaseX for conversion to CSV?

岁酱吖の 提交于 2020-03-06 09:43:46
问题 I have JSON data which is just slightly backwards in that the "name" key should be first. The desired output as CSV : people alice,z10,y9,x7,atrib6 sue,home5,cell4 joe,phone3,phone2,phone1 It only matters that the "name" for the CSV is first, the rest of the order is arbitrary and meaningless. Through the BaseX GUI I can export this data as: ,z10,y9,x7,atrib6,alice home5,cell4,sue phone3,phone2,phone1,joe people by selecting CSV , although that leading comma looks odd. However, this is very

Using Python to write dbf table with fpt memos

久未见 提交于 2019-12-14 03:12:24
问题 I have a legacy application that uses .dbf and .fpt files. I am looking to read and write those files, I have figured out a way to write these files but not using fpt memos. I am using python 2.7.2 and dbf module 0.95.02. When I try to use the dbf module I get an error when trying to use FpTable. >>> import dbf >>> table = dbf.FpTable('test','name C(25); age N(3,0); qualified M') >>> table Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/doctor/.virtualenvs

Which header format can be assumed by reading an initial .DBF byte?

痞子三分冷 提交于 2019-12-13 14:56:46
问题 Regarding the first byte of a .DBF file and how to detect the version of xbase used (ie, the format of the rest of the file), the most comprehensive list I can compile is: Byte 0 ----------- x xxx x 001 = 0x?1 not used 0 000 0 010 = 0x02 FoxBASE 0 000 0 011 = 0x03 FoxBASE+/dBASE III PLUS, no memo x xxx x 100 = 0x?4 dBASE 7 0 000 0 101 = 0x05 dBASE 5, no memo 0 011 0 000 = 0x30 Visual FoxPro 0 011 0 001 = 0x31 Visual FoxPro, autoincrement enabled 0 011 0 010 = 0x32 Visual FoxPro, Varchar,

Grammatically restricted JVMModelInferrer inheritence with Xtext and XBase

一世执手 提交于 2019-12-11 17:07:15
问题 The following canonical XBase entities grammar (from "Implementing Domain-Specific Languages with Xtext and Xtend" Bettini) permits entities to extend any Java class. As the commented line indicates, I would like to grammatically force entities to only inherit from entities. grammar org.example.xbase.entities.Entities with org.eclipse.xtext.xbase.Xbase generate entities "http://www.example.org/xbase/entities/Entities" Model: importSection=XImportSection? entities+=Entity*; Entity: 'entity'