Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357820 - Need utility to break apart compound conditional expressions
Summary: Need utility to break apart compound conditional expressions
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 critical (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 353218 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-15 10:33 EDT by Jeff Douglas CLA
Modified: 2017-02-23 14:17 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Douglas CLA 2011-09-15 10:33:40 EDT
Paul, can you please provide a utility that takes a conditional expression and breaks it up into multiple conditional expressions, if there are any function invocations?
Comment 1 Jeff Douglas CLA 2011-10-01 16:41:41 EDT
*** Bug 353218 has been marked as a duplicate of this bug. ***
Comment 2 Paul Harmon CLA 2011-10-10 13:54:34 EDT
I have completed this and added a preprocess step to the beginning of each generated to invoke the code to expand the binary expressions.
Comment 3 Huang Ji Yong CLA 2011-10-13 01:29:12 EDT
Hi Paul,
It seems this change cause a defect when the conditional expression is used in a while statement.

For example, in the following RUI Handler
handler testCombound type RUIhandler{onConstructionFunction = start}
     a Widget{};	
    function start()
    	while(a.class == "where" && a.getAttribute("hello") == 2)
            a = a.parent
    	end
    end
end

The generated IR for the function start is

Function(Start), Compound, While(Compound(It is a Member now)) ..
The compound statement for while is only evaluated once. But actually, the compound should be evaluated for every loop.

This defect leads to the following JSGen code
"start": function() {
	var eze_compound_1 = false;
	eze_compound_1 = ((egl.checkNull(this.a).getClass()) == "where");
	if (eze_compound_1) {
             eze_compound_1 = (this.a.getAttribute("hello") == {eze$$value : 2, eze$$signature : "i;"});
	}
	while (eze_compound_1) {   // HERE the WHILE condition is not correct
            .......
	}
}
Comment 4 Paul Harmon CLA 2011-10-17 16:05:48 EDT
I have updated my utility to handle CompoundConditions in While and For statements
Comment 5 Lisa Lasher CLA 2011-11-09 14:13:16 EST
This high severity defect was fixed several weeks ago, so I am closing.