Book a Demo

Author Topic: LITERAL TEXT IN TRANSFORMATIONS  (Read 2341 times)

wink

  • EA User
  • **
  • Posts: 48
  • Karma: +0/-0
  • Montjoie, que jamais ne choit!
    • View Profile
LITERAL TEXT IN TRANSFORMATIONS
« on: February 22, 2006, 08:31:06 am »
Hello everybody,

I'm currently writing transformations for my unit tests.
Although I find the transformation scripts are not really intuitive (especially due to the lack of documentation and examples) I've managed to do some quite useful stuff.

However I've come to a point where I need to generate a default value for the attributes of the transformationclass that must include double quotes

something like:

Code: [Select]

$Default ="MOCKPP_PCHAR("
$Default+="%className%/%opName%"
$Default+="), this"

Attribute
{
 name=%qt%m_ExpList_%opName%%qt%
 type=%qt%mockpp::ExpectationList<%paramType>%qt%
 default=%qt%$Default%qt%
}



The final default value should be:
MOCKPP_PCHAR("MyClass/MyMethod"), this


No matter what I try, %qt% or " I either get script errors or the generated text does not contain the double quotes.

I'd appreciate your help a lot!

cheers Manfred
Best regards,
Manfred

thomaskilian

  • Guest
Re: LITERAL TEXT IN TRANSFORMATIONS
« Reply #1 on: February 22, 2006, 10:30:44 am »
default="this is \"quoted\" text"
does the trick.

Sparx: Please update the documentation!

wink

  • EA User
  • **
  • Posts: 48
  • Karma: +0/-0
  • Montjoie, que jamais ne choit!
    • View Profile
Re: LITERAL TEXT IN TRANSFORMATIONS
« Reply #2 on: February 23, 2006, 12:02:30 am »
Hi Thomas,

Thank you very much! :D

I did not even hope that something like that would be possible, considered the rest of the script syntax.  ;)

Great find!

have a nice day,

cheers Manfred  
Best regards,
Manfred