how to declare an array in xtext

匆匆过客 提交于 2020-01-16 19:18:01

问题


I need to declare an integer array in a domain specific language using xtext.

PolyLine:
'polyline' color = Color '{'                    Line1
'points number' n = INT                         Line2
'x points'                                      Line3
'y ponts'                                       Line4
'}';

In above rule declaration, I need to get several x and y points which indicate some coordination (theirs number is equal to n property in line2). But I can't find any document that help me to answer my question "How I can declare a array in xtext"? Can somebody help please?


回答1:


I am not quite sure what your questions targets but you can have lists of things basically using the += operator

points+=INT+

(points+=INT ("," points+=INT)*)



来源:https://stackoverflow.com/questions/22745667/how-to-declare-an-array-in-xtext

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!