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?

有帮助吗?

解决方案

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)*)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top