| Summary: | QVTO grammar: Support ComputeExp expression | ||
|---|---|---|---|
| Product: | [Modeling] QVTo | Reporter: | Alexander Igdalov <alexander.igdalov> |
| Component: | Engine | Assignee: | Alexander Igdalov <alexander.igdalov> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | dvorak.radek |
| Version: | unspecified | Keywords: | plan |
| Target Milestone: | 2.0 M3 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Alexander Igdalov
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.
|