|Re: Creating XExpressions Manually [message #1028724 is a reply to message #1027895]
||Thu, 28 March 2013 16:50
| Hallvard Traetteberg
Registered: July 2009
Location: Trondheim, Norway
I've also tried something similer, but couldn't make it work. I would |
very much like to be able to create a complex method body containing
sub-expressions from several places in the original DSL text. But I
think too much is happening in the linking process to make it easy to do
by manually creating Xbase objects. It would be great to have an
XbaseExpressionBuilder with toXExpression methods (toIf, toReturn,
toBlock, ...) that make this possible.
There's to much happening during linking
On 28.03.13 09.01, First Last wrote:
> It seems like it should be possible to create a method body by defining
> an XExpression, but while this will compile and run without error, it
> does not generate a method body:
> body = XbaseFactory::eINSTANCE.createXBlockExpression => [
> expressions += XbaseFactory::eINSTANCE.createXReturnExpression => [
> expression = XbaseFactory::eINSTANCE.createXStringLiteral => [
> value = 'String'
> While it is useful to generate method bodies using the string-based
> template approach, it would sometimes be better to avoid the parsing
> required by that approach and directly generate the necessary AST elements.
> What is missing from this example that is necessary to generate code?
Powered by FUDForum
. Page generated in 0.02778 seconds