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.
Provide an Eclipse IDE generation environment derived from a language grammar
I plan to extend Chris J Daly’s Gymnast (described in Language Toolkits Technology Exchange, EclipseCON 2005) so that it supports:
1. generating EMF-compliant classes for Concrete Syntax Tree nodes. With that, using OCL (Object Constraint Language) becomes possible to check the well-formedness of CSTs before transforming them to ASTs. The author of such transformation may thus employ QVT-style technology, e.g. ATLAS ATL.
2. generating an LPG grammar in addition to those already supported (ANTLR and JavaCC).
3. generate a visitor to unparse a CST into a pretty-printed representation, re-using hints specified in the existing Gymnast grammar format. For example,
sequence ifConstruct :
"if" expr
"then" expr
"else" expr
"endif"
would result in unparsing following a similar layout.
4. generate a text editor with usability features. The design patterns to generate have been harvested while implementing the Emfatic extension for EMF Generics. These usability features include:
Outline view, Mark occurrences, folding, Hovers displaying declaration for a given usage, Live problem and warning markers, Navigable hyperlinks, "File New" wizard, AutoEdits such as SmartBrace (i.e. automatically completing with a closing terminal), User-provided templates, Syntax-aware Content Assist. Refactoring will be explored (at the very least, by updating usages-for-declarations)
A common theme consists in making the most out of the input specification. For example, the type-checking rules for expressions in a DSL are usually not specified declaratively. OCL (Object Constraint Language) can uniformly be used to specify static semantics and type-checking rules, as shown in: Rules for Type-checking of Parametric Polymorphism in EMF Generics
Tips on processing OCL are reported in my Eclipse Technical article (under review), at: How to process OCL Abstract Syntax Trees
Once the extensions 1. to 4. have been implemented, an IDE for Gymnast will be bootstrapped with the Gymnast generator. Additionally, a case study will be undertaken to validate the approach, i.e. an IDE will be generated for one of:
- an ExecutableUML-style language but EMF-based
- JPQL (ORM-level query language in EJB3), building upon the metamodel described in JPQL metamodel with well-formedness rules
- a human-readable notation for UML2
Preparing developer documentation (and community articles) is an integral part of the planned tasks.