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

Bug 319978

Summary: Improve documentation on data type rules
Product: [Modeling] TMF Reporter: Robert Wloch <robert>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: alex, jan, robert, sebastian.zarnekow
Version: 1.0.0Flags: sebastian.zarnekow: helios+
Target Milestone: SR1   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
grammar producing the bug
none
example model with the bug none

Description Robert Wloch CLA 2010-07-15 08:44:00 EDT
Created attachment 174391 [details]
grammar producing the bug

Using the attached grammar I only hide the ML_COMMENT rule for fully qualified name imports to allow the following:

package org./*xtext.*/workshopmaterial

This, however will be parsed to the package name "org. workshopmaterial". Further import calls will only work if the import statement contains a comment at the exact same position due to the magically inserted whitespace:

import org./*xtext.*/workshopmaterial.Handout (will work)

property exercises org/*.xtext*/.workshopmaterial.Exercise (will not work)

Attached are the grammar and an example file reproducing the bug.
Comment 1 Robert Wloch CLA 2010-07-15 08:45:36 EDT
Created attachment 174392 [details]
example model with the bug

the outline view shows the magically inserted whitespace
Comment 2 Sebastian Zarnekow CLA 2010-07-15 11:00:06 EDT
Your value converter has to ensure that the space is not inserted.
The default implementation will insert a space in a data type value if both data type values had something hidden between them.

DT:
  'key' 'word';

key/*foo*/word becomes key word instead of keyword.
Comment 3 Sebastian Zarnekow CLA 2010-07-30 13:06:29 EDT
I'ld like to close this one as won't fix. Any objections?

(Flagged as assigned to be able to find it).
Comment 4 Alexander Nittka CLA 2010-07-31 03:13:02 EDT
Could a paragraph be added in the value converter section/datatype rule section of the documentation? The DefaultTerminalsConverter is found easily enough, but currently I am not sure if the same is true for the default converter for datatype rules returning a string. As the qualified name is heavily used, this behaviour (which is not immediately obvious) should be explained. Otherwise, others may stumble upon the problem that names suddenly cannot be resolved anymore.
Comment 5 Robert Wloch CLA 2010-08-02 02:07:11 EDT
You can close it. Also, I accompany Alex: Would be nice to have a hint in the documentation.
Comment 6 Sebastian Zarnekow CLA 2010-08-02 02:10:13 EDT
See comment #4 and comment #5
Comment 7 Alexander Nittka CLA 2010-08-02 07:29:08 EDT
If I see it correctly, it is not a (default) value converter that inserts the spaces. It is LinkingHelper#getCrossRefNodeAsString for hidden tokens.
Comment 8 Jan Koehnlein CLA 2010-08-05 11:14:21 EDT
Should not be a problem with the new QualifiedNameValueConverter.

Added a section in the docs for the value converter.
Comment 9 Alexander Nittka CLA 2010-08-06 09:07:56 EDT
Note, that the documentation of data type rules still says: "This looks similar to the terminal rule we've defined above", but this definition has been removed. This sentence could simply be removed.
Comment 10 Jan Koehnlein CLA 2010-08-09 06:00:46 EDT
Fixed in HEAD.
Comment 11 Karsten Thoms CLA 2017-09-19 15:42:06 EDT
Closing bug which were set to RESOLVED before Eclipse Neon.0.