eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[pivot] elseif lookup failure #1627

Closed eclipse-ocl-bot closed 2 hours ago

eclipse-ocl-bot commented 2 hours ago

| --- | --- | | Bugzilla Link | 480060 | | Status | RESOLVED FIXED | | Importance | P3 normal | | Reported | Oct 18, 2015 06:10 EDT | | Modified | Dec 19, 2016 13:03 EDT | | Reporter | Ed Willink |

Description

From the QVTd HSV2HLS example The follwoing

query hsv2hls::hsv2rgb(color : HSVTree::HSV) : HSV2HLS::RGB\ {\ let hsv : Sequence(String) = color.tokenize(',') in\ let h : Integer = hsv->at(1).toInteger() in\ let s : Integer = hsv->at(2).toInteger() in\ let v : Integer = hsv->at(3).toInteger() in\ let c : Integer = v s in\ let x : Integer = c (1 - (h.div(60).mod(2) - 1).abs()) in\ let m : Integer = v -c in\ let t : Tuple(r:Integer,g:Integer,b:Integer) =\ if h < 60 then Tuple{r=c,g=x,b=0}\ else if h < 120 then Tuple{r=x,g=c,b=0}\ else if h < 180 then Tuple{r=0,g=c,b=x}\ else if h < 240 then Tuple{r=0,g=x,b=c}\ else if h < 300 then Tuple{r=x,g=0,b=c}\ else Tuple{r=c,g=0,b=x} endif endif endif endif endif in\ let r = 255 (t.r + m) in\ let g = 255 (t.g + m) in\ let b = 255 * (t.b + m) in\ r.toString() + ',' + g.toString() + ',' + b.toString()\ }

cannot be converted to elseif; the lookups with the elseif fail.

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Oct 20, 2015 08:48

Problem is that the master branch has grammar support only for elseif. The functional support is still on ewillink/master

commit f982cd89c540f7db4030c346f11eba6f87e5a7d1\ [ocl25] Add CS2AS/AS2CS/PrettyPrint/Test for IfExp.isElseIf

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Dec 19, 2016 13:03

elseif fixes pushed to master for M5.

HSV2HSL progress in Bug 509305