Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top