Wiki

Clone wiki

scenariotools-sml / SML Syntax

This page describes how the IDE support for SML documents is implemented and how the syntax is organized.

IDE support

The source code editors for scenario modeling language specifications and sml collaborations are built with the help of the domain specific language framework Xtext. The abstract syntax for most of the language is defined by an ecore model and the concrete syntax is defined by an xtext grammar. Note: If you have used neither xtext nor emf/ecore, you should google for tutorials and first learn the basics of how to use both frameworks.

From the grammar, xtext generates a document parser, a text editor that can be used in eclipse to edit sml files, as well as validation and refactoring support.

SML Concrete & Abstract Syntax Definition

The concrete syntax definition for the Scenario Modeling Language is distributed over three xtext grammars:

  • org.scenariotools.sml.expressions.ScenarioExpressions contains the expression-sublanguage and the import rule.
  • org.scenariotools.sml.collaboration.Collaboration contains the syntax for collaborations, scenarios, interaction fragments, roles and role bindings.
  • org.scenariotools.sml.SML contains Syntax for specifications and for parameter ranges.

The abstract syntax for the types used in the expressions grammar is generated from the xtext grammar and is contained in the project org.scenariotools.sml.expressions.model. The abstract syntax for the collaboration and sml languages is defined by the ecore model in the project org.scenariotools.sml.model. The abstract syntax is kept in separate projects in order to avoid hard dependencies to xtext.

Validation

  • TODO complete this.

Updated