简体   繁体   English

如何在 Eclipse 中自定义自定义编程语言?

[英]How to Customize a custom programming language in Eclipse?

How to customize eclipse for a programming language.如何为编程语言自定义 eclipse。 Can any one give basics how to start customization.任何人都可以提供如何开始定制的基础知识。 My programming language is based on XML.我的编程语言基于 XML。

One good start is to look at Eclipse XText一个好的开始是查看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.只需将您的语法放在适当的位置,您不仅可以获得工作解析器和链接器,还可以获得一流的 Eclipse 支持。

As this thread suggests , integrating XML in XText might not be trivial:正如该线程所暗示的那样,在 XText 中集成 XML 可能并非易事:

You could also generate an ecore file from the XSD and directly read in your XML files as EMF resources.您还可以从 XSD 生成一个 ecore 文件,并直接将您的 XML 文件读入作为 EMF 资源。 Then perform EMF validation on them.然后对它们执行 EMF 验证。

See XText Package declaration for more on ECore.有关 ECore 的更多信息,请参阅XText 包声明

Xtext parsers create in-memory object graphs while consuming text. Xtext 解析器在使用文本的同时创建内存中的对象图。
Such object-graphs are instances of EMF Ecore models.这种对象图是 EMF Ecore 模型的实例。

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. Ecore 模型基本上由包含 EClasses (src)、EDataTypes (src) 和 EEnums (src) 的 EPackage (src) 组成(更多详细信息请参阅 EMF 部分)并描述实例化对象的结构。

Xtext can infer Ecore models from a grammar (see Ecore model inference) but it is also possible to import existing Ecore models. Xtext 可以从语法推断 Ecore 模型(请参阅 Ecore 模型推断),但也可以导入现有的 Ecore 模型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM