Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "MoScript"
Line 39: | Line 39: | ||
Then create a MoScript script by clicking in File-> New-> File. Give it the name helloWorld.mscr. When the file is open, fill it with the following script code: | Then create a MoScript script by clicking in File-> New-> File. Give it the name helloWorld.mscr. When the file is open, fill it with the following script code: | ||
− | |||
program helloWorld | program helloWorld | ||
Line 47: | Line 46: | ||
After saving the file, if there are no errors, you should see a new binary file called helloWorld.asm in the project explorer or navigator. | After saving the file, if there are no errors, you should see a new binary file called helloWorld.asm in the project explorer or navigator. | ||
− | |||
Now that the code is ready, create a MoScript launcher to run the script, by clicking in Run-> Run Configurations... | Now that the code is ready, create a MoScript launcher to run the script, by clicking in Run-> Run Configurations... | ||
[[Image:MoScript-HelloWorld3.png]] | [[Image:MoScript-HelloWorld3.png]] | ||
+ | |||
In the advanced tab, check the options Clear console before launch and Print execution times to console, so that you can clearly see when de script finishes. | In the advanced tab, check the options Clear console before launch and Print execution times to console, so that you can clearly see when de script finishes. | ||
[[Image:MoScript-HelloWorld4.png]] | [[Image:MoScript-HelloWorld4.png]] | ||
− | Then press the Apply button and the Run button. | + | |
− | In the console window you will see an error like the following: | + | Then press the Apply button and the Run button. In the console window you will see an error like the following: |
Error loading file:...workspacePath/.am3/megamodel.xmi: java.io.FileNotFoundException: ... (No such file or directory) | Error loading file:...workspacePath/.am3/megamodel.xmi: java.io.FileNotFoundException: ... (No such file or directory) | ||
+ | |||
This is because the megamodel file has not been created yet. For creating the megamodel file, open the AM3 Perspective. | This is because the megamodel file has not been created yet. For creating the megamodel file, open the AM3 Perspective. | ||
[[Image:MoScript-HelloWorld1.png]] | [[Image:MoScript-HelloWorld1.png]] | ||
+ | |||
And create any model element from the left panel. Give it any value and then use File->Save to save the Megamodel. With this operation the Megamodel file is being created in the filesystem. | And create any model element from the left panel. Give it any value and then use File->Save to save the Megamodel. With this operation the Megamodel file is being created in the filesystem. | ||
[[Image:MoScript-HelloWorld5.png]] | [[Image:MoScript-HelloWorld5.png]] | ||
+ | |||
Now try again to run the script by clicking on Run->Run History->Hello World and you should see the output in the console. | Now try again to run the script by clicking on Run->Run History->Hello World and you should see the output in the console. | ||
[[Image:MoScript-HelloWorld6.png]] | [[Image:MoScript-HelloWorld6.png]] |
Revision as of 05:02, 21 November 2011
< To: MDT
< To: MoDisco
< To: AM3
AM3 |
Download |
Community |
Mailing List • Forum |
Bugzilla |
Opened bugs |
All bugs |
Contribute |
Browse Source |
The MoScript prototype (extending AM3), being developed by the AtlanMod Team, is part of the MoDisco project. It provides a textual domain-specific language for model management.
Contents
Overview
The goal of MoScript is to provide...
Download and install
The MoScript prototype is available from the Eclipse-MDT MoDisco SVN (sources only). The steps to install MoScript are the following:
- Download the Eclipse Modeling Tools from here: Eclipse Modeling Tools (Indigo)
- Install ATL from sources:
- Download the ATL source code project set file (.psf) from here [1].
- Import it into Eclipse with File->Import->Team->Team Project Set.
- Download the MoScript patch for ATL from Bugzilla – Bug 361688.
- Click right click on any ATL plugin project and select Team->Apply Patch ... and select the patch to apply it to ATL.
- Install sublcipse and subversion if you have not done it yet.
- Install AM3 and MoScript from sources:
- Open the SVN perspective by selecting Window -> Open Perspective-> SVN Repository Exploring perspective.
- Add a new repository location by selecting File->New->Repository Location. The required parameters are the followings:
- Browse the just created repository location until /plugins/trunk and checkout all the plugins
Documentation
You can find from this section the documentary resources around the MoScript prototype and underlying approach.
Reference documentation
Examples
MoScript Hello World!
Create a new MoScript project by clicking on File-> New-> Project and selecting the MoScript project type under the AM3 Folder.
Then create a MoScript script by clicking in File-> New-> File. Give it the name helloWorld.mscr. When the file is open, fill it with the following script code:
program helloWorld do{ 'HelloWorld'.debug(); }
After saving the file, if there are no errors, you should see a new binary file called helloWorld.asm in the project explorer or navigator. Now that the code is ready, create a MoScript launcher to run the script, by clicking in Run-> Run Configurations...
In the advanced tab, check the options Clear console before launch and Print execution times to console, so that you can clearly see when de script finishes.
Then press the Apply button and the Run button. In the console window you will see an error like the following:
Error loading file:...workspacePath/.am3/megamodel.xmi: java.io.FileNotFoundException: ... (No such file or directory)
This is because the megamodel file has not been created yet. For creating the megamodel file, open the AM3 Perspective.
And create any model element from the left panel. Give it any value and then use File->Save to save the Megamodel. With this operation the Megamodel file is being created in the filesystem.
Now try again to run the script by clicking on Run->Run History->Hello World and you should see the output in the console.
Screencasts & slides
To be completed.
Related publications
To be completed.
Use Cases
MoScript comes with a set of use cases showing different possible uses of the MoScript tool in various contexts and for varied purposes (similarly to what is done in the M2M ATL project). A general description is given for each of these use cases, as well as some more precise documentations for many of them. For some, prototypes have already been implemented and are directly downloadable from their respective page.
XXX
To be completed.
YYY
To be completed.
Support
- Newsgroup: eclipse.modisco
- Forum
- Opened bugs
- All bugs
- Submit a new bug
- FAQ
Relationships with other Eclipse Projects
MoScript reuses different existing EMP (Eclipse Modeling Project) projects: To be completed.