Search code examples
xmleclipseeclipse-plugineclipse-rcpeclipselink

How to Customize a custom programming language in Eclipse?


How to customize eclipse for a programming language. Can any one give basics how to start customization. My programming language is based on XML.


Solution

  • One good start is to look at Eclipse XText

    Building your own domain-specific languages has never been so easy. Just put your grammar in place and you not only get the working parser and linker but also first class Eclipse support.

    As this thread suggests, integrating XML in XText might not be trivial:

    You could also generate an ecore file from the XSD and directly read in your XML files as EMF resources. Then perform EMF validation on them.

    See XText Package declaration for more on ECore.

    Xtext parsers create in-memory object graphs while consuming text.
    Such object-graphs are instances of EMF Ecore models.

    An Ecore model basically consists of an EPackage (src) containing EClasses (src), EDataTypes (src) and EEnums (src) (see the section on EMF for more details) and describes the structure of the instantiated objects.

    Xtext can infer Ecore models from a grammar (see Ecore model inference) but it is also possible to import existing Ecore models.