Book a Demo

Author Topic: Can't generate %fileImports% and %fileHeaders%  (Read 2994 times)

fy1997

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Can't generate %fileImports% and %fileHeaders%
« on: August 14, 2020, 06:12:42 pm »
I created a custom language based on C++. Implementation Code Templates are copied/pasted from C++ ones.

I also created a MDG technology corresponding to this custom language .
When generating code using this template,the %fileImports% and %fileHeaders% macro from my "Import Section Impl" template is empty . Let me notice that everything's fine if I choose to generate the MyClass code by using the default C++ language.

Why?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Can't generate %fileImports% and %fileHeaders%
« Reply #1 on: August 18, 2020, 08:05:26 am »
What you want is a list over Import and ImportImpl templates.

See this example from PHP, which I suspect you can use verbatim once you've implemented the appropriate Import templates.

Code: [Select]
$imports = %classImports% + "\n"
$imports += %list="Import" @separator="\n" importFromAggregation=="T" or importFromAssociation=="T" or importFromAtt=="T" or importFromDependency=="T" or importFromGeneralization=="T" or importFromMeth=="T" or importFromParam=="T" or importFromRealization=="T" or importFromPropertyType=="T"%
%REMOVE_DUPLICATES($imports, "\n")%