How to expose new members to custom ClassConcept?

Hi, I'm currently writing a DSL for Agent Oriented Programming by extending the BaseLanguage. In this language I have the concepts of Agent and Capacity. An Agent is an extension of ClassConcept and Capacity is an extension of Interface.

I also have the UsesDeclaration concept which introduces the uses keyword. When an Agent declares that it uses a given capacity, it means that all the methods defined in the capacity are available to use in the context of the Agent.

Here's an example of what it looks like in the editor:

Here I define an Agent named "BootAgent", this Agent uses the capacities Lifecycle and Logging. Both of these capacities are interfaces with several methods. For instance, the Lifecycle capacity declares the method spawn(Agent).

I would like to be able to call this method inside the body of my BootAgent, but I don't know where to start to do this. Also, I would like to have all the methods of the capacities available with autocompletion.

Thanks

1 comment

It's all good, I found how to do it: I defined a behavior for my UsesDeclaration concept. In this behavior, I override the populateMember function which comes from the IClassifierMember interface like it's done in the InstanceMethodDeclarationBehavior.

Here's what it looks like:

0

Please sign in to leave a comment.