Community
Participate
Working Groups
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.
(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?
(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.
fixed & pushed to master. Now the literals will only be used if they are available. In all other cases, the getters will be used.
Closing all bugs that were set to RESOLVED before Neon.0