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.
Triquetrum/Xtext
One idea is to use Xtext to describe models textually. See Triquetrum Command Language (github issue)
Below are various references:
- Ptcl was a Tcl-based language for Ptolemy Classic. The ptcl manual might be of use to help define some of the Xtext commands. For example, both will need to connect ports from an outer composite to an inner composite.
- The NamedObj class in Ptolemy II has a description() method that describes a model. For example $PTII/ptolemy/actor/test/CompositeActor.tcl has a test that invokes description() on a model. The description() functionality is little used and has been replaced with MoML.
- Ptolemy II uses MoML (Modeling Markup Language) to store models on disk. See Heterogeneous Concurrent Modeling and Design in Java (Volume 1: Introduction to Ptolemy II), Chapter 7, MoML. See also 5.8 What file format are the models stored in?. In particular, note that the MoML description is not a complete description because the actors may be defined in Java or MoML and the definitions may be overwritten.
- Hallvard Traetteberg visited the Ptolemy group in 2012-2013 and did a first cut of creating Ptolemy II OSGi bundles. Hallvard also developed some Xtext work, see https://github.com/hallvard/ptolemy. Hallvard has not been using Ptolemy much recently, but his work is there.
- Eclipse Layout Kernel (Elk) has Issue #101 Implemented a textual format for ElkGraph. Ptolemy II uses an automatic layout mechanism called Kieler, which is related to Elk.
How To Try out the Xtext interface
These notes are incomplete, but should be enough to get started
The Xtext was never checked in to the main Triquetrum repo, instead it is found in https://github.com/rtotaro/triquetrum
The TriQuetrum Command Language (TqCL) is defined at https://github.com/rtotaro/triquetrum/blob/rtotaro/ft/190/TqclBackup/org.eclipse.triquetrum.commands.xtext/src/main/java/org/eclipse/triquetrum/commands/Tqcl.xtext
- Build Triquetrum from Sources.
- Instead of using the main Triquetrum repo, use https://github.com/rtotaro/triquetrum
- Check out the branch with:
git checkout rtotaro/ft/190/TriquetrumCommandLanguageToPush
. There will probably be build errors which are fixed next. - In the org.eclipse.triquetrum.target.platform project, open the org.eclipse.triquetrum.commands.xtext.platform.target definition and click on "Set as Target Platform". It may take a few minutes for the dependencies to download.
- TBD continue with the steps necessary to try it out.
Syntax
- See Tqcl for a description of the syntax.