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

Bug 250403

Summary: QVTO grammar: Support ComputeExp expression
Product: [Modeling] QVTo Reporter: Alexander Igdalov <alexander.igdalov>
Component: EngineAssignee: Alexander Igdalov <alexander.igdalov>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: dvorak.radek
Version: unspecifiedKeywords: plan
Target Milestone: 2.0 M3   
Hardware: All   
OS: All   
Whiteboard:

Description Alexander Igdalov CLA 2008-10-10 05:32:18 EDT
 
Comment 1 Alexander Igdalov CLA 2008-10-13 08:58:01 EDT
Implemented. EBNF section of the spec is clear about the body of ComputeExp - it says it must be a block of expressions (in braces '{' and '}'). However, the spec contains numerouos examples of ComputeExp syntax where the body is a simple OCL expression used without braces.
An attempt to implement the latter variant leads to multiple shift-reduce conflicts. For example:

1. compute (a : String = 'a') return - b;
-- (compute (a : String = 'a') return) - b;
-- compute (a : String = 'a') return (- b);
2. compute (a : String = 'a') var b : String := a;
-- (compute (a : String = 'a') var b : String) := a;
-- compute (a : String = 'a') (var b : String := a);

Thus, the only consistent variant (with block expression) was implemented.