calling a defined java method or interface method in the concept


I have a project which is actually mix of dsl and java concepts. Actually trying to create a general purpose dsl. My problem is I can not call the java methods I have created(these are interface methods but I implement them inside the concept anyway, so they exist) in other methods in the same concept. Does anyone know how to achieve this? I mean how to use a method or interface method(both implemented in the concept) as an expression. My attempt for reference that extends Expression doesn't work.

in the images you'll see a method that has one line instruction
int a = abc(); I try to call the method which returns 1.

public int abc() {
  return 1;





Comment actions Permalink
Have you defined any reduction rules for methodRefAsExpression? You have to reduce it to a baseLanguage concept (InstanceMethodCallOperation in this case).
Comment actions Permalink
sorry, i was busy to look at if someone replied. thanks for answer. i totally forgot to do that before i saw your remind. some other problems still persist, but this one is just solved. another issue with this implementation, how can i call more than one expression, actual arguments when i call a method from another one because my solution just lets me for one method( expression);? thanks again.
Comment actions Permalink
  1. Set the cardinality of the "expression" child in methodRefAsExpression to 0...n.
  2. You may want to set a separator for the child list in the editor of methodRefAsExpression.
  3. In the reduction rule use a $COPY_SRCL$ macro.

Please sign in to leave a comment.