This is what xtext says on its official website.
"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 ."
Creating your own DSL is never that easy. You only need to write your syntax, and then hand the rest to xtext (including parser, linker and seamless support in eclipse ).
To learn xtext, you must at least understand the following technologies:
- Principles of grammar (Parser (left associativity, precedence, etc) and lexer), ebnf --> write xtext
- Anlr --> Generate parser
- Mwe2
- EMF and ecore --> in memory expression of Model
- Dependency injection and Google guice. --> put it in together
- Developing using eclipse --> ide support
- Java language, libraries and JVM
- Xtend --> one DSL for made Java developer more easy
- Xbase --> make write xtext more easy
Before proceeding, let's first explain what DSL is. Translation is a language in a specific field. DSL developers can develop experts in a certain field or industry.
Dialects That can be understood, they do not realize the specific implementation of the underlying layer, so as to focus on their own work, improve efficiency, and isolate responsibility.
Xtext is a free and open-source project to implement DSL.
To use xtext, you only need to compile the xtext file, that is, your DSL syntax, and some methods provided to you by extending xtext, you can implement a development environment that is supported by eclipse using the DSL language,
This environment can provide syntax highlighting, auto-incomplete, code assistance, syntax error checking, modification method recommendations, and other functions like jdt or PDT.
Xtext workflow:
- Compile an xtext File
- Use mwe2 to generate all the basic frameworks of the code you need. This framework can be run. This includes the ecore required by EMF, corresponding objects, corresponding editors, and UT tests.
- In the running process, it is connected through guice.
If you have time in the future, I will connect each part and talk about it.
Http://www.euclideanspace.com/software/development/eclipse/xtext/index.htm
What is xtext?