Description:
A script that demonstrates the model querying facilities of EOL.
-- In this script, we query Ecore to find out:
-- ... how many classes it has EClass.all.size().println('All classes: ');
-- ... how many abstract classes it has EClass.all.select(c|c.abstract) .size().println('Abstract classes: ');
-- ... the names of its classes and how many -- features each one has 'Class names: '.println(); for (c in EClass.all) { var toPrint := ' ' + c.name; toPrint := toPrint + '->' + c.eStructuralFeatures.size();
In the editor on the left, you can write and run EOL scripts (what is EOL?) from your browser, without needing to download or install anything in your computer.
Except for playing with the basic features of the language, you can also query and modify a real EMF model (which for simplicity, is Ecore itself).
Below are several small EOL scripts which you can try. To try a script, copy/paste it in the editor on the left and then click the Run button to run it and see its output in the console.