Linking XCastExpression to a "toX" function [message #1774571] |
Tue, 17 October 2017 12:54 |
|
Dear all.
In my DSL, I would like to enable operator overriding for the cast expressions.
My idea is:
Let the following code:
var x = ...
var y = x as String
var z = x as Y
"x as String" should be map to the Java code "x.toString()".
"x as Y" should be be map to the Java code:
* "x.toY()" if this instance function is defined and accessible,
* "toY(x)" if this class function is defined and accessible,
* "(Y) x" otherwise
My question is: what are the typical classes within Xbase to be extended for enabling this behavior?
I think about:
* XbaseCompiler for generating the Java code,
* DSLValidator for changing the validation test.
What else?
Thank in advance.
Stéphane.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02655 seconds