| Summary: | [xbase] make sure semantically mandatory parenthesis are preserved during serialization | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Moritz Eysholdt <moritz.eysholdt> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jan, sebastian.zarnekow, sven.efftinge |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
tests are green now. please review org.eclipse.xtext.xbase.tests.serializer.SerializerTest.testSerialize_02() and org.eclipse.xtext.xbase.serializer.XbaseSyntacticSequencer.emit_XParenthesizedExpression_LeftParenthesisKeyword_0_a(EObject, ISynTransition, INode, INode) reviewing this on Friday unveiled that the hooks for syntactic ambiguities in the generated code should not include scenarios that are ambiguous that can be solved via the RuleCallStack when traversing a PDA.
Futhermore, xbase still has more scenarios where a "(" need to be mandatory than the code handles yet. Sebastian also pointed out, that there are scenarios where a ";" is mandatory.
(In reply to comment #2) > reviewing this on Friday unveiled that the hooks for syntactic ambiguities in > the generated code should not include scenarios that are ambiguous that can be > solved via the RuleCallStack when traversing a PDA. This is fixed now. The callbacks generated in the AbstractXbaseSyntacticSequencer are now exactly the way they are supposed to be. > Futhermore, xbase still has more scenarios where a "(" need to be mandatory > than the code handles yet. Sebastian also pointed out, that there are scenarios > where a ";" is mandatory. Let's come up with a complete list of scenarios in which - "(" is mandatory but not enforced by the precedence hierarchy in the grammar. - ";" is mandatory but not enforced by the grammar. Are there still remaining issues, Moritz? (In reply to comment #4) > Are there still remaining issues, Moritz? Ping. (In reply to comment #4) > Are there still remaining issues, Moritz? (In reply to comment #3) > Let's come up with a complete list of scenarios in which > - "(" is mandatory but not enforced by the precedence hierarchy in the grammar. > - ";" is mandatory but not enforced by the grammar. we still don't have this list. All these scenarios need to be handeld in o.e.x.xbase.serializer.XbaseSyntacticSequencer.emit_XParenthesizedExpression_LeftParenthesisKeyword_0_a(...) and by overriding o.e.x.xbase.serializer.AbstractXbaseSyntacticSequencer.emit_XBlockExpression_SemicolonKeyword_2_1_q() We should open individual bugs instead of waiting for a list. Requested via bug 522520. -M. |
Example: --- (if (false) new Double('-10') else new Integer('1')).compareTo(1) --- here, the parenthesis surrounding the if-statement are not mandatory according to the grammar's precedence hierarchy. Therefore, they don't get serialized by default. However, they must be preserved since leaving them out would change the semantics.