Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 357820

Summary: Need utility to break apart compound conditional expressions
Product: z_Archived Reporter: Jeff Douglas <jeffdouglas>
Component: EDTAssignee: Project Inbox <edt.compiler-inbox>
Status: CLOSED FIXED QA Contact:
Severity: critical    
Priority: P1 CC: greer, hjiyong, pharmon, svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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.