SlideShare a Scribd company logo
1 of 21
Ander Zubizarreta	9/1/2009 DSLto  C++ Sysdefcodegenerationusing MDWorkbench
ProblemDefinition Wehave a source XML filedescribing a system, accordingto a XML Schemametamodel System has manyelements of thetypeControllable Thegoalistogeneratea cppimplementationforeachControllabletypeelement
Problemdefinition XSD
ProblemDefinition Source XML file The XML file describes a system Thesystem has manycontrollables Eachcontrollable has inputs, outputs, params, faults… Target .h and .cppfileforeachControllable The generation of the .H file is straightforward The generation of the .CPP file comprises several RuleSets Locals: For each input/output/param/fault/timer  define a local of that type doInit  initialize each local variable  by getting its value (using mappings in wtsl) WHY IS USED? We’ll use MDWorkbench forthatpurpose
MDWorkbench MDWorkbench is a model-driven engineering development environment to build: Source code and text generators Word documentation Model transformers Eclipse-based IDE Java code may be used in MDWorkbench projects Developed by Sodius SAS
MDWorkbench
Solution Metamodel C++ code Model Rules Templates
Steps Importthemetamodelto MDWorkbench Browsethemodelusing MDWorkbench Createtherulesets and templatesforcodegeneration Runthegenerator
1. Importing a metamodel MDWorkbench nativelyallowstoworkwithEcore, Relationalor UML models New metamodels can beimported, allowingtoworkwithdifferentkind of models Importing a metamodelconsists in creatingan Eclipse pluginwhichwillbeusedby MDWorkbench Ourmetamodelisdefinedusing XML Schema
1. Importing a metamodel 1 3 4 2 Select the specific file
1. Importing a metamodelCreatingPlugin Wenowhavetoexportthecreatedproject as a plugin Whenwerestart MDWorkbench the new metamodelwillbeavailable
2. Browsingthemodel Once themetamodel has beenimportedwe can open themodel in MDWorkbench and browseit
3. Writingthegenerators Rulesets, texttemplates and scripts can beusedtogeneratecode Rulesets are written in MQL Templatesarwritten in TGL Scripts can bewritten in MQL, TGL or Java First sketch of thesolution: Twocodetemplates: onefor .h files and otherfor .cpp files A ruleset: toapplythetemplatestoeachcontrollable in themodel Scripts: we’llcalltosomescrpitsfromthetemplatestogettheelements of thecontrollable
3. Writingthegenerators Ruleset: cppGenerator.mqr Templates: hGen.tgt cppGen.tgt Scripts: doGetInitializations() doGetLocalsDefinitions()
3. WritingthegeneratorshGen.tgt Refer to “20081202_MDWorkbench_Tool.ppt” for a detailed overview of Templates
3. WritingthegeneratorscppGen.Tgt (callto script) Refer to “20081202_MDWorkbench_Tool.ppt” for a detailed overview of Templates
3. WritingthegeneratorsScripts Refer to “20081202_MDWorkbench_Tool.ppt” for a detailed overview of Scripts
3. WritingthegeneratorsRuleset cppGeneration.mqr: appliesthetexttemplatestoeachcontrollable Refer to “20081202_MDWorkbench_Tool.ppt”for a detailed overview of  Rulesets
4. RunningthegeneratorRunconfiguration Selecttheruleset as themainelementwewanttorun and the input model
4. RunningthegeneratorOutput Console output: Report:
4. RunningthegeneratorOutput Part of a generated .cppfile:

More Related Content

What's hot

Operator overloading
Operator overloadingOperator overloading
Operator overloadingabhay singh
 
Whirlwind tour of the Runtime Dynamic Linker
Whirlwind tour of the Runtime Dynamic LinkerWhirlwind tour of the Runtime Dynamic Linker
Whirlwind tour of the Runtime Dynamic LinkerGonçalo Gomes
 
Emscripten, asm.js, and billions of math ops
Emscripten, asm.js, and billions of math opsEmscripten, asm.js, and billions of math ops
Emscripten, asm.js, and billions of math opsLuka Zakrajšek
 
What make Swift Awesome
What make Swift AwesomeWhat make Swift Awesome
What make Swift AwesomeSokna Ly
 
Presentation on overloading
Presentation on overloading Presentation on overloading
Presentation on overloading Charndeep Sekhon
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator OverloadingNilesh Dalvi
 
Lec 28 - operator overloading
Lec 28 - operator overloadingLec 28 - operator overloading
Lec 28 - operator overloadingPrincess Sam
 
ADVANCED FEATURES OF C++
ADVANCED FEATURES OF C++ADVANCED FEATURES OF C++
ADVANCED FEATURES OF C++NITHYA KUMAR
 
NyaruDBにゃるものを使ってみた話 (+Realm比較)
NyaruDBにゃるものを使ってみた話 (+Realm比較)NyaruDBにゃるものを使ってみた話 (+Realm比較)
NyaruDBにゃるものを使ってみた話 (+Realm比較)Masaki Oshikawa
 
Operator overloading and type conversions
Operator overloading and type conversionsOperator overloading and type conversions
Operator overloading and type conversionsAmogh Kalyanshetti
 
Functional programming in Javascript
Functional programming in JavascriptFunctional programming in Javascript
Functional programming in JavascriptKnoldus Inc.
 

What's hot (20)

Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
Whirlwind tour of the Runtime Dynamic Linker
Whirlwind tour of the Runtime Dynamic LinkerWhirlwind tour of the Runtime Dynamic Linker
Whirlwind tour of the Runtime Dynamic Linker
 
cpp-file-handling
cpp-file-handlingcpp-file-handling
cpp-file-handling
 
Go for Rubyists
Go for RubyistsGo for Rubyists
Go for Rubyists
 
Compile time polymorphism
Compile time polymorphismCompile time polymorphism
Compile time polymorphism
 
Emscripten, asm.js, and billions of math ops
Emscripten, asm.js, and billions of math opsEmscripten, asm.js, and billions of math ops
Emscripten, asm.js, and billions of math ops
 
Let's Go-lang
Let's Go-langLet's Go-lang
Let's Go-lang
 
What make Swift Awesome
What make Swift AwesomeWhat make Swift Awesome
What make Swift Awesome
 
Review functions
Review functionsReview functions
Review functions
 
Presentation on overloading
Presentation on overloading Presentation on overloading
Presentation on overloading
 
Lua Study Share
Lua Study ShareLua Study Share
Lua Study Share
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator Overloading
 
Lec 28 - operator overloading
Lec 28 - operator overloadingLec 28 - operator overloading
Lec 28 - operator overloading
 
ADVANCED FEATURES OF C++
ADVANCED FEATURES OF C++ADVANCED FEATURES OF C++
ADVANCED FEATURES OF C++
 
C# Method overloading
C# Method overloadingC# Method overloading
C# Method overloading
 
NyaruDBにゃるものを使ってみた話 (+Realm比較)
NyaruDBにゃるものを使ってみた話 (+Realm比較)NyaruDBにゃるものを使ってみた話 (+Realm比較)
NyaruDBにゃるものを使ってみた話 (+Realm比較)
 
Objective c intro (1)
Objective c intro (1)Objective c intro (1)
Objective c intro (1)
 
Operator overloading and type conversions
Operator overloading and type conversionsOperator overloading and type conversions
Operator overloading and type conversions
 
Overloading
OverloadingOverloading
Overloading
 
Functional programming in Javascript
Functional programming in JavascriptFunctional programming in Javascript
Functional programming in Javascript
 

Viewers also liked

Inside Pediatrics Winter 2008
Inside Pediatrics Winter 2008Inside Pediatrics Winter 2008
Inside Pediatrics Winter 2008Early On Michigan
 
Historia De Engormix2
Historia De Engormix2Historia De Engormix2
Historia De Engormix2Engormix.com
 
Region Campaign
Region CampaignRegion Campaign
Region Campaignserhio2009
 
SSAE Mentor Program
SSAE Mentor ProgramSSAE Mentor Program
SSAE Mentor ProgramJosh Wentz
 
Project Find Webinar May.6.2010
Project Find Webinar May.6.2010Project Find Webinar May.6.2010
Project Find Webinar May.6.2010Early On Michigan
 
TitaniumでiOS/Android同時リリース:NIFTY-Serveの事例
TitaniumでiOS/Android同時リリース:NIFTY-Serveの事例TitaniumでiOS/Android同時リリース:NIFTY-Serveの事例
TitaniumでiOS/Android同時リリース:NIFTY-Serveの事例Tomoya Narita
 
Super Size Public Awareness 2008
Super Size Public Awareness 2008Super Size Public Awareness 2008
Super Size Public Awareness 2008Early On Michigan
 
Michigan Perinatal Statistics
Michigan Perinatal StatisticsMichigan Perinatal Statistics
Michigan Perinatal StatisticsEarly On Michigan
 
Nomo2 Final Product Presentation Final
Nomo2 Final Product Presentation FinalNomo2 Final Product Presentation Final
Nomo2 Final Product Presentation FinalJosh Wentz
 
Miaeyc early childhood_march_2011
Miaeyc early childhood_march_2011Miaeyc early childhood_march_2011
Miaeyc early childhood_march_2011Early On Michigan
 
CompassLearning Secondary Programs
CompassLearning Secondary ProgramsCompassLearning Secondary Programs
CompassLearning Secondary ProgramsDMayfield1
 
Technology And Education
Technology And EducationTechnology And Education
Technology And EducationRick Lehman
 
Kadin (29 Juli 2009)
Kadin (29 Juli 2009)Kadin (29 Juli 2009)
Kadin (29 Juli 2009)Bio Perforasi
 
Social Emotional Health: A Guide for Families with Children Birth to Age 8
Social Emotional Health: A Guide for Families with Children Birth to Age 8Social Emotional Health: A Guide for Families with Children Birth to Age 8
Social Emotional Health: A Guide for Families with Children Birth to Age 8Early On Michigan
 

Viewers also liked (20)

Inside Pediatrics Winter 2008
Inside Pediatrics Winter 2008Inside Pediatrics Winter 2008
Inside Pediatrics Winter 2008
 
Historia De Engormix2
Historia De Engormix2Historia De Engormix2
Historia De Engormix2
 
Region Campaign
Region CampaignRegion Campaign
Region Campaign
 
SSAE Mentor Program
SSAE Mentor ProgramSSAE Mentor Program
SSAE Mentor Program
 
Making A Difference
Making A  DifferenceMaking A  Difference
Making A Difference
 
Project Find Webinar May.6.2010
Project Find Webinar May.6.2010Project Find Webinar May.6.2010
Project Find Webinar May.6.2010
 
TitaniumでiOS/Android同時リリース:NIFTY-Serveの事例
TitaniumでiOS/Android同時リリース:NIFTY-Serveの事例TitaniumでiOS/Android同時リリース:NIFTY-Serveの事例
TitaniumでiOS/Android同時リリース:NIFTY-Serveの事例
 
Super Size Public Awareness 2008
Super Size Public Awareness 2008Super Size Public Awareness 2008
Super Size Public Awareness 2008
 
Michigan Perinatal Statistics
Michigan Perinatal StatisticsMichigan Perinatal Statistics
Michigan Perinatal Statistics
 
Nomo2 Final Product Presentation Final
Nomo2 Final Product Presentation FinalNomo2 Final Product Presentation Final
Nomo2 Final Product Presentation Final
 
Miaeyc early childhood_march_2011
Miaeyc early childhood_march_2011Miaeyc early childhood_march_2011
Miaeyc early childhood_march_2011
 
Web 2.0
Web 2.0Web 2.0
Web 2.0
 
CompassLearning Secondary Programs
CompassLearning Secondary ProgramsCompassLearning Secondary Programs
CompassLearning Secondary Programs
 
Technology And Education
Technology And EducationTechnology And Education
Technology And Education
 
MiAEYC March 25th, 2010
MiAEYC March 25th, 2010MiAEYC March 25th, 2010
MiAEYC March 25th, 2010
 
Early On101 Mcecc2009
Early On101 Mcecc2009Early On101 Mcecc2009
Early On101 Mcecc2009
 
Map idea in_michigan
Map idea in_michiganMap idea in_michigan
Map idea in_michigan
 
Kadin (29 Juli 2009)
Kadin (29 Juli 2009)Kadin (29 Juli 2009)
Kadin (29 Juli 2009)
 
Foresight
ForesightForesight
Foresight
 
Social Emotional Health: A Guide for Families with Children Birth to Age 8
Social Emotional Health: A Guide for Families with Children Birth to Age 8Social Emotional Health: A Guide for Families with Children Birth to Age 8
Social Emotional Health: A Guide for Families with Children Birth to Age 8
 

Similar to 20090109 Dsl2cpp Md Workbench

LOSS_C11- Programming Linux 20221006.pdf
LOSS_C11- Programming Linux 20221006.pdfLOSS_C11- Programming Linux 20221006.pdf
LOSS_C11- Programming Linux 20221006.pdfThninh2
 
cs262_intro_slides.pptx
cs262_intro_slides.pptxcs262_intro_slides.pptx
cs262_intro_slides.pptxAnaLoreto13
 
Sql Bits Sql Server Crash Dump Analysis
Sql Bits   Sql Server Crash Dump AnalysisSql Bits   Sql Server Crash Dump Analysis
Sql Bits Sql Server Crash Dump AnalysisPablo Alvarez Doval
 
Runtime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya RathoreRuntime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya RathoreEsha Yadav
 
Introduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxIntroduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxNEHARAJPUT239591
 
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJIntroduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJmeharikiros2
 
Eclipse Modeling Framework
Eclipse Modeling FrameworkEclipse Modeling Framework
Eclipse Modeling FrameworkAjay K
 
Whats New in Visual Studio 2012 for C++ Developers
Whats New in Visual Studio 2012 for C++ DevelopersWhats New in Visual Studio 2012 for C++ Developers
Whats New in Visual Studio 2012 for C++ DevelopersRainer Stropek
 
Autoconf&Automake
Autoconf&AutomakeAutoconf&Automake
Autoconf&Automakeniurui
 
C++ helps you to format the I/O operations like determining the number of dig...
C++ helps you to format the I/O operations like determining the number of dig...C++ helps you to format the I/O operations like determining the number of dig...
C++ helps you to format the I/O operations like determining the number of dig...bhargavi804095
 
CS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docxCS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docxfaithxdunce63732
 
Dynamic Slides using OpenOffice.org Impress and Python
Dynamic Slides using OpenOffice.org Impress and PythonDynamic Slides using OpenOffice.org Impress and Python
Dynamic Slides using OpenOffice.org Impress and PythonCarles Pina Estany
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfAnassElHousni
 
Visual Studio.NET
Visual Studio.NETVisual Studio.NET
Visual Studio.NETsalonityagi
 
Virtual platform
Virtual platformVirtual platform
Virtual platformsean chen
 

Similar to 20090109 Dsl2cpp Md Workbench (20)

LOSS_C11- Programming Linux 20221006.pdf
LOSS_C11- Programming Linux 20221006.pdfLOSS_C11- Programming Linux 20221006.pdf
LOSS_C11- Programming Linux 20221006.pdf
 
C++Basics2022.pptx
C++Basics2022.pptxC++Basics2022.pptx
C++Basics2022.pptx
 
C++ How to program
C++ How to programC++ How to program
C++ How to program
 
GCC RTL and Machine Description
GCC RTL and Machine DescriptionGCC RTL and Machine Description
GCC RTL and Machine Description
 
cs262_intro_slides.pptx
cs262_intro_slides.pptxcs262_intro_slides.pptx
cs262_intro_slides.pptx
 
Sql Bits Sql Server Crash Dump Analysis
Sql Bits   Sql Server Crash Dump AnalysisSql Bits   Sql Server Crash Dump Analysis
Sql Bits Sql Server Crash Dump Analysis
 
Runtime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya RathoreRuntime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya Rathore
 
Introduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptxIntroduction-to-C-Part-1.pptx
Introduction-to-C-Part-1.pptx
 
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJIntroduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
Introduction-to-C-Part-1 JSAHSHAHSJAHSJAHSJHASJ
 
Eclipse Modeling Framework
Eclipse Modeling FrameworkEclipse Modeling Framework
Eclipse Modeling Framework
 
Whats New in Visual Studio 2012 for C++ Developers
Whats New in Visual Studio 2012 for C++ DevelopersWhats New in Visual Studio 2012 for C++ Developers
Whats New in Visual Studio 2012 for C++ Developers
 
Autoconf&Automake
Autoconf&AutomakeAutoconf&Automake
Autoconf&Automake
 
C++ helps you to format the I/O operations like determining the number of dig...
C++ helps you to format the I/O operations like determining the number of dig...C++ helps you to format the I/O operations like determining the number of dig...
C++ helps you to format the I/O operations like determining the number of dig...
 
CS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docxCS 23001 Computer Science II Data Structures & AbstractionPro.docx
CS 23001 Computer Science II Data Structures & AbstractionPro.docx
 
C# tutorial
C# tutorialC# tutorial
C# tutorial
 
Dynamic Slides using OpenOffice.org Impress and Python
Dynamic Slides using OpenOffice.org Impress and PythonDynamic Slides using OpenOffice.org Impress and Python
Dynamic Slides using OpenOffice.org Impress and Python
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdf
 
Visual studio.net
Visual studio.netVisual studio.net
Visual studio.net
 
Visual Studio.NET
Visual Studio.NETVisual Studio.NET
Visual Studio.NET
 
Virtual platform
Virtual platformVirtual platform
Virtual platform
 

Recently uploaded

complaint-ECI-PM-media-1-Chandru.pdfra;;prfk
complaint-ECI-PM-media-1-Chandru.pdfra;;prfkcomplaint-ECI-PM-media-1-Chandru.pdfra;;prfk
complaint-ECI-PM-media-1-Chandru.pdfra;;prfkbhavenpr
 
Referendum Party 2024 Election Manifesto
Referendum Party 2024 Election ManifestoReferendum Party 2024 Election Manifesto
Referendum Party 2024 Election ManifestoSABC News
 
Dynamics of Destructive Polarisation in Mainstream and Social Media: The Case...
Dynamics of Destructive Polarisation in Mainstream and Social Media: The Case...Dynamics of Destructive Polarisation in Mainstream and Social Media: The Case...
Dynamics of Destructive Polarisation in Mainstream and Social Media: The Case...Axel Bruns
 
Opportunities, challenges, and power of media and information
Opportunities, challenges, and power of media and informationOpportunities, challenges, and power of media and information
Opportunities, challenges, and power of media and informationReyMonsales
 
Manipur-Book-Final-2-compressed.pdfsal'rpk
Manipur-Book-Final-2-compressed.pdfsal'rpkManipur-Book-Final-2-compressed.pdfsal'rpk
Manipur-Book-Final-2-compressed.pdfsal'rpkbhavenpr
 
How Europe Underdeveloped Africa_walter.pdf
How Europe Underdeveloped Africa_walter.pdfHow Europe Underdeveloped Africa_walter.pdf
How Europe Underdeveloped Africa_walter.pdfLorenzo Lemes
 
Different Frontiers of Social Media War in Indonesia Elections 2024
Different Frontiers of Social Media War in Indonesia Elections 2024Different Frontiers of Social Media War in Indonesia Elections 2024
Different Frontiers of Social Media War in Indonesia Elections 2024Ismail Fahmi
 
Vashi Escorts, {Pooja 09892124323}, Vashi Call Girls
Vashi Escorts, {Pooja 09892124323}, Vashi Call GirlsVashi Escorts, {Pooja 09892124323}, Vashi Call Girls
Vashi Escorts, {Pooja 09892124323}, Vashi Call GirlsPooja Nehwal
 
Top 10 Wealthiest People In The World.pdf
Top 10 Wealthiest People In The World.pdfTop 10 Wealthiest People In The World.pdf
Top 10 Wealthiest People In The World.pdfauroraaudrey4826
 
HARNESSING AI FOR ENHANCED MEDIA ANALYSIS A CASE STUDY ON CHATGPT AT DRONE EM...
HARNESSING AI FOR ENHANCED MEDIA ANALYSIS A CASE STUDY ON CHATGPT AT DRONE EM...HARNESSING AI FOR ENHANCED MEDIA ANALYSIS A CASE STUDY ON CHATGPT AT DRONE EM...
HARNESSING AI FOR ENHANCED MEDIA ANALYSIS A CASE STUDY ON CHATGPT AT DRONE EM...Ismail Fahmi
 
N Chandrababu Naidu Launches 'Praja Galam' As Part of TDP’s Election Campaign
N Chandrababu Naidu Launches 'Praja Galam' As Part of TDP’s Election CampaignN Chandrababu Naidu Launches 'Praja Galam' As Part of TDP’s Election Campaign
N Chandrababu Naidu Launches 'Praja Galam' As Part of TDP’s Election Campaignanjanibaddipudi1
 
Chandrayaan 3 Successful Moon Landing Mission.pdf
Chandrayaan 3 Successful Moon Landing Mission.pdfChandrayaan 3 Successful Moon Landing Mission.pdf
Chandrayaan 3 Successful Moon Landing Mission.pdfauroraaudrey4826
 
VIP Girls Available Call or WhatsApp 9711199012
VIP Girls Available Call or WhatsApp 9711199012VIP Girls Available Call or WhatsApp 9711199012
VIP Girls Available Call or WhatsApp 9711199012ankitnayak356677
 
Brief biography of Julius Robert Oppenheimer
Brief biography of Julius Robert OppenheimerBrief biography of Julius Robert Oppenheimer
Brief biography of Julius Robert OppenheimerOmarCabrera39
 
Quiz for Heritage Indian including all the rounds
Quiz for Heritage Indian including all the roundsQuiz for Heritage Indian including all the rounds
Quiz for Heritage Indian including all the roundsnaxymaxyy
 
AP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep Victory
AP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep VictoryAP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep Victory
AP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep Victoryanjanibaddipudi1
 

Recently uploaded (16)

complaint-ECI-PM-media-1-Chandru.pdfra;;prfk
complaint-ECI-PM-media-1-Chandru.pdfra;;prfkcomplaint-ECI-PM-media-1-Chandru.pdfra;;prfk
complaint-ECI-PM-media-1-Chandru.pdfra;;prfk
 
Referendum Party 2024 Election Manifesto
Referendum Party 2024 Election ManifestoReferendum Party 2024 Election Manifesto
Referendum Party 2024 Election Manifesto
 
Dynamics of Destructive Polarisation in Mainstream and Social Media: The Case...
Dynamics of Destructive Polarisation in Mainstream and Social Media: The Case...Dynamics of Destructive Polarisation in Mainstream and Social Media: The Case...
Dynamics of Destructive Polarisation in Mainstream and Social Media: The Case...
 
Opportunities, challenges, and power of media and information
Opportunities, challenges, and power of media and informationOpportunities, challenges, and power of media and information
Opportunities, challenges, and power of media and information
 
Manipur-Book-Final-2-compressed.pdfsal'rpk
Manipur-Book-Final-2-compressed.pdfsal'rpkManipur-Book-Final-2-compressed.pdfsal'rpk
Manipur-Book-Final-2-compressed.pdfsal'rpk
 
How Europe Underdeveloped Africa_walter.pdf
How Europe Underdeveloped Africa_walter.pdfHow Europe Underdeveloped Africa_walter.pdf
How Europe Underdeveloped Africa_walter.pdf
 
Different Frontiers of Social Media War in Indonesia Elections 2024
Different Frontiers of Social Media War in Indonesia Elections 2024Different Frontiers of Social Media War in Indonesia Elections 2024
Different Frontiers of Social Media War in Indonesia Elections 2024
 
Vashi Escorts, {Pooja 09892124323}, Vashi Call Girls
Vashi Escorts, {Pooja 09892124323}, Vashi Call GirlsVashi Escorts, {Pooja 09892124323}, Vashi Call Girls
Vashi Escorts, {Pooja 09892124323}, Vashi Call Girls
 
Top 10 Wealthiest People In The World.pdf
Top 10 Wealthiest People In The World.pdfTop 10 Wealthiest People In The World.pdf
Top 10 Wealthiest People In The World.pdf
 
HARNESSING AI FOR ENHANCED MEDIA ANALYSIS A CASE STUDY ON CHATGPT AT DRONE EM...
HARNESSING AI FOR ENHANCED MEDIA ANALYSIS A CASE STUDY ON CHATGPT AT DRONE EM...HARNESSING AI FOR ENHANCED MEDIA ANALYSIS A CASE STUDY ON CHATGPT AT DRONE EM...
HARNESSING AI FOR ENHANCED MEDIA ANALYSIS A CASE STUDY ON CHATGPT AT DRONE EM...
 
N Chandrababu Naidu Launches 'Praja Galam' As Part of TDP’s Election Campaign
N Chandrababu Naidu Launches 'Praja Galam' As Part of TDP’s Election CampaignN Chandrababu Naidu Launches 'Praja Galam' As Part of TDP’s Election Campaign
N Chandrababu Naidu Launches 'Praja Galam' As Part of TDP’s Election Campaign
 
Chandrayaan 3 Successful Moon Landing Mission.pdf
Chandrayaan 3 Successful Moon Landing Mission.pdfChandrayaan 3 Successful Moon Landing Mission.pdf
Chandrayaan 3 Successful Moon Landing Mission.pdf
 
VIP Girls Available Call or WhatsApp 9711199012
VIP Girls Available Call or WhatsApp 9711199012VIP Girls Available Call or WhatsApp 9711199012
VIP Girls Available Call or WhatsApp 9711199012
 
Brief biography of Julius Robert Oppenheimer
Brief biography of Julius Robert OppenheimerBrief biography of Julius Robert Oppenheimer
Brief biography of Julius Robert Oppenheimer
 
Quiz for Heritage Indian including all the rounds
Quiz for Heritage Indian including all the roundsQuiz for Heritage Indian including all the rounds
Quiz for Heritage Indian including all the rounds
 
AP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep Victory
AP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep VictoryAP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep Victory
AP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep Victory
 

20090109 Dsl2cpp Md Workbench

  • 1. Ander Zubizarreta 9/1/2009 DSLto C++ Sysdefcodegenerationusing MDWorkbench
  • 2. ProblemDefinition Wehave a source XML filedescribing a system, accordingto a XML Schemametamodel System has manyelements of thetypeControllable Thegoalistogeneratea cppimplementationforeachControllabletypeelement
  • 4. ProblemDefinition Source XML file The XML file describes a system Thesystem has manycontrollables Eachcontrollable has inputs, outputs, params, faults… Target .h and .cppfileforeachControllable The generation of the .H file is straightforward The generation of the .CPP file comprises several RuleSets Locals: For each input/output/param/fault/timer define a local of that type doInit initialize each local variable by getting its value (using mappings in wtsl) WHY IS USED? We’ll use MDWorkbench forthatpurpose
  • 5. MDWorkbench MDWorkbench is a model-driven engineering development environment to build: Source code and text generators Word documentation Model transformers Eclipse-based IDE Java code may be used in MDWorkbench projects Developed by Sodius SAS
  • 7. Solution Metamodel C++ code Model Rules Templates
  • 8. Steps Importthemetamodelto MDWorkbench Browsethemodelusing MDWorkbench Createtherulesets and templatesforcodegeneration Runthegenerator
  • 9. 1. Importing a metamodel MDWorkbench nativelyallowstoworkwithEcore, Relationalor UML models New metamodels can beimported, allowingtoworkwithdifferentkind of models Importing a metamodelconsists in creatingan Eclipse pluginwhichwillbeusedby MDWorkbench Ourmetamodelisdefinedusing XML Schema
  • 10. 1. Importing a metamodel 1 3 4 2 Select the specific file
  • 11. 1. Importing a metamodelCreatingPlugin Wenowhavetoexportthecreatedproject as a plugin Whenwerestart MDWorkbench the new metamodelwillbeavailable
  • 12. 2. Browsingthemodel Once themetamodel has beenimportedwe can open themodel in MDWorkbench and browseit
  • 13. 3. Writingthegenerators Rulesets, texttemplates and scripts can beusedtogeneratecode Rulesets are written in MQL Templatesarwritten in TGL Scripts can bewritten in MQL, TGL or Java First sketch of thesolution: Twocodetemplates: onefor .h files and otherfor .cpp files A ruleset: toapplythetemplatestoeachcontrollable in themodel Scripts: we’llcalltosomescrpitsfromthetemplatestogettheelements of thecontrollable
  • 14. 3. Writingthegenerators Ruleset: cppGenerator.mqr Templates: hGen.tgt cppGen.tgt Scripts: doGetInitializations() doGetLocalsDefinitions()
  • 15. 3. WritingthegeneratorshGen.tgt Refer to “20081202_MDWorkbench_Tool.ppt” for a detailed overview of Templates
  • 16. 3. WritingthegeneratorscppGen.Tgt (callto script) Refer to “20081202_MDWorkbench_Tool.ppt” for a detailed overview of Templates
  • 17. 3. WritingthegeneratorsScripts Refer to “20081202_MDWorkbench_Tool.ppt” for a detailed overview of Scripts
  • 18. 3. WritingthegeneratorsRuleset cppGeneration.mqr: appliesthetexttemplatestoeachcontrollable Refer to “20081202_MDWorkbench_Tool.ppt”for a detailed overview of Rulesets
  • 19. 4. RunningthegeneratorRunconfiguration Selecttheruleset as themainelementwewanttorun and the input model
  • 21. 4. RunningthegeneratorOutput Part of a generated .cppfile: