20090109 Dsl2cpp Md Workbench

67 %
33 %
Information about 20090109 Dsl2cpp Md Workbench

Published on July 24, 2009

Author: azubi

Source: slideshare.net

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:

Add a comment

Related pages

Download - UpdateStar - UpdateStar.com

UpdateStar Free and UpdateStar Premium come with the same installer. UpdateStar includes support for many languages such as English, German, French, ...
Read more

downloadcrack - blogspot.com

downloadcrack 2011年10月15 ... Petroleum Workbench Interpret.V2003 Powerlog v3.2.2 ... MSC.Software.MD.Nastran.v2007.1 MSC.SOFY.V2007.R1 MSC Superform V2005
Read more

cracksoftware2012 | Just another WordPress.com site

Just another WordPress.com site. Startseite; ... Petroleum Workbench Interpret.V2003 ... Penguin.For.Rhino.v2.0.SR1.Build.20090109 RhinoNest 2.1
Read more

downloadcrack: Famous Software ftp download 2013!!A

Petroleum Workbench Interpret.V2003 ... Penguin.For.Rhino.v2.0.SR1.Build.20090109 RhinoNest 2.1 ... MSC.Software.MD.Nastran.v2007.1
Read more

نرم افزارهاي گروه 49-ح | آگهي از ...

MSC.MD.ADAMS.R3.WINDOWS.LINUX.UNIX.LINUX64 ... My.Eclipse.EnterPrise.WorkBench.v3.6.2 MyBPA 1.0 ... Penguin.For.Rhino.v2.0.SR1.Build.20090109
Read more

lmininubart - Blog

... MD just down the road from ... Petrosys v16.8 Petroleum Workbench Interpret.V2003 Powerlog v3 ... Rhino.v2.0.SR1.Build.20090109 RhinoNest 2.1 RhinoCAM ...
Read more

ccdb-portal.crbs.ucsd.edu:8081

The workbench supports the retrieval, ... USA (Brown) * The Kennedy Krieger Institute, Baltimore, MD, USA (KKI) * The Donders Institute, Nijmegen, ...
Read more