Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364508 - Xbase QualifiedNameProvider implementation ignores ValidID-definition
Summary: Xbase QualifiedNameProvider implementation ignores ValidID-definition
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.1.0   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: M5   Edit
Assignee: Holger Schill CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-22 14:47 EST by Alexander Nittka CLA
Modified: 2017-09-19 18:15 EDT (History)
4 users (show)

See Also:
sebastian.zarnekow: juno+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Nittka CLA 2011-11-22 14:47:18 EST
In the first iteration this is a question rather than a bug report. Take the domainmodel example and override the ValidID - adding a keyword to be allowed in a valid Id - rule to:

ValidID:ID|"op";

Name the package in a sample model file op.mypackage

The result is that the name (i.e. the string stored in the name feature) of the package is indeed only "mypackage" (see outline view and index etc.) The reason is that the QualifiedNameValueConverter in its toValue-method iterates only over the *leaf nodes*. So although the value converter for ValidID might already be correct or is overridden to be correct, it is not used at all in the QualifiedNameValueConverter.
The leafs will be ID and Keyword, but a keyword cannot even be processed by a delegate rule call, so the QualifiedNameValueConverter would have to be "reimplemented".

Question: is this intended or is it a bug? My impression from the grammar design is that the point of the ValidID rule is being able to change what an ID may look like without touching the QualifiedNameRule (and hence not touch its value converter) at all. I would understand having to modify the QualifiedNameValueConverter if I actually change the QualifiedName rule...
Comment 1 Sebastian Zarnekow CLA 2011-11-22 15:09:18 EST
It's a bug.
Reproducable with Xtend and the package com.foo.create
Comment 2 Holger Schill CLA 2012-01-06 08:23:55 EST
Introduced XbaseQualifiedNameValueConverter to deal with the ValidIds.

pushed tests and fix to MASTER.
Comment 3 Karsten Thoms CLA 2017-09-19 18:05:06 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 4 Karsten Thoms CLA 2017-09-19 18:15:04 EDT
Closing all bugs that were set to RESOLVED before Neon.0