Community
Participate
Working Groups
Build Identifier: M20100909-0800 Consider the following grammar: SuperType: TypeA | TypeB; TypeA: SubTypeA1 | SubTypeA2; SubTypeA1: name='A1'; SubTypeA2: name='A2'; TypeB: SubTypeB; SubTypeB: name='B'; In this case, neither TypeB nor SuperType will contain a name attribute in the generated source code. Adding a second alternative to TypeB or removing TypeB and adding SubTypeB directly to the alternatives of SuperType resolves this issue and adds name to SuperType. Reproducible: Always
This works as specified. The attributes will be pulled up if there is more than one subtype and all subtypes have the attribute in common. That condition does not hold for TypeB which has not a 'name' attribute. Consider the following simplified example: Type: SubType | {Type} 'keyword'; SubType: someAttribute=ID; If we reduce the constraints that mark attributes as 'to-be-pulled-up', all attributes would end up in the most abstract super type. That's usually not what you'ld expect. In general I'd recommend to switch to imported metamodels as soon as your grammar is settled or the meta model inference does not do what you want. Please reopen if I missed a point.
Closing all bugs that were set to RESOLVED before Neon.0