Add eObject to the parse tree programaticaly
问题 Here is a snapshot of my grammar: Sort: name=ID ; Variable name=ID ':' type=[Sort] My requirement is to have a predefined Sort let's call it Loc . There is no need for the user to define this sort, thus when a Variable is defined with a Loc type, Xtext should automatically reference it to my predefined Sort. How can I initiate the program so that at the beginning a Sort instance is generated? I already used the Factory method 'CreateSort' in my validator class, but no use. any idea? 回答1: Your