MontiCore - Getting Started
For getting started with MontiCore using Eclipse do the following:
Setting up Eclipse
- Download and install Eclipse (or use an existing one)
- Open Eclipse
- Install needed Plugins
- Help > Install new Software
- Make sure the M2E (Maven 2 Eclipse) Plugin is installed
- M2E can be found here
- Make sure to confire Eclipse to use a JDK instead of an JRE
- Window > Preferences > Java > Installed JREs
Importing the Example
- Clone the github project or download the zip for the Automata Example here.
- Existing Maven Projects
- Click next
- Click on the Browse.. button and use the folder holding the pom.xml
- Right click on the project
- Run as > Maven install
- Add ‹../target/generated-sources/monticore/sourcecode› to your build path
- Right click on the folder > Build Path > Use as Source Folder
MontiCore will be launched and the following steps will be executed:
- The specified grammar will be parsed and processed by MontiCore.
- Java source files for the corresponding DSL infrastructure will be generated into the default output directory ‹../target/generated-sources/monticore/sourcecode›. This infrastructure consists of:
- /automata/_ast containing the abstract syntax representation of the automata DSL.
- /automata/_cocos containing infrastructure for context conditions of the automata DSL.
- /automata/_od containing infrastructure for printing object diagrams of the automata DSL.
- /automata/_parser containing the generated parsers which are based on ANTLR.
- /automata/_symboltable containing infrastructure for the symbol table of the automata DSL.
- /automata/_visitor containing infrastructure for visitors of the automata DSL.
- /reports/Automata containing reports created during the processing of the automata grammar.
- The output directory will also contain a log file of the executed generation process ‹monticore.YYYY-MM-DD-HHmmss.log›.
- If an error occurs and you cannot solve the problem you may take a look into the MontiCore log file located in the respectively specified output directory (e.g. ‹out/monticore.YYYY-MM-DD-HHmmss.log› by default). It contains more verbose and developer-oriented, technical output than the CLI output.
- Please report any unknown issues to firstname.lastname@example.org. Please include the processed grammar, model, and the log file.