Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352162 - [sequencer][generator] Large EPackage don't have a Literals Class
Summary: [sequencer][generator] Large EPackage don't have a Literals Class
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: SR1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-14 16:23 EDT by Sebastian Zarnekow CLA
Modified: 2017-09-19 17:54 EDT (History)
1 user (show)

See Also:
sebastian.zarnekow: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Zarnekow CLA 2011-07-14 16:23:42 EDT
The question came up in the newsgroup. The generated SemanticSequencer contains references to the Literals type of generated / imported EPackages even though this type does not exists for large EPackages. The code should use an injected instance of the Package (a binding has to be added to the runtime module) and use the getters that are available on that instance. 

E.g. instead of XtextPackage.Literals.GRAMMAR__NAME the code should read 

@Inject
XtextPackage xtextPackage;

..

xtextPackage.getGrammar_Name()

If the genmodel allows to introspect whether there is a Literals class, it may be interesting to use the literals as long as they are available for readability reasons, but I'm pretty sure that is does not make any difference wrt runtime behavior.
Comment 1 Moritz Eysholdt CLA 2011-07-14 16:29:35 EDT
(In reply to comment #0)
> If the genmodel allows to introspect whether there is a Literals class, it may
> be interesting to use the literals as long as they are available for
> readability reasons, but I'm pretty sure that is does not make any difference
> wrt runtime behavior.

Yes, the Genmodel has information on whether there are literals and getters or just getters. I think there is even a method that returns the Literals' name if it is available and the getter otherwise. I'll investigates this further.

Is it safe to assume that getters are available in any case?
Comment 2 Sebastian Zarnekow CLA 2011-07-14 16:32:30 EDT
(In reply to comment #1)
> Is it safe to assume that getters are available in any case?

Yes, I'm pretty sure they are available in any case. At least that's what their implementation suggests.
Comment 3 Moritz Eysholdt CLA 2011-07-15 09:19:29 EDT
fixed & pushed to master.

Now the literals will only be used if they are available. In all other cases, the getters will be used.
Comment 4 Karsten Thoms CLA 2017-09-19 17:43:32 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 5 Karsten Thoms CLA 2017-09-19 17:54:38 EDT
Closing all bugs that were set to RESOLVED before Neon.0