Bug 250403 - QVTO grammar: Support ComputeExp expression
Summary: QVTO grammar: Support ComputeExp expression
Status: RESOLVED FIXED
Alias: None
Product: QVTo
Classification: Modeling
Component: Engine (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 2.0 M3   Edit
Assignee: Alexander Igdalov CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
Depends on:
Blocks:
 
Reported: 2008-10-10 05:32 EDT by Alexander Igdalov CLA
Modified: 2008-10-13 11:45 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.