| Skip to content. |
Lehrstuhl Systemanalyse |
| Language Modelling HomeA MOF 2.0 for JavaTextual Editing FrameworkModel Pattern | |
DocumentationThis is just a conceptual documentation and we cannot go into all the technical details because these are currently subject to continuous changes. After the first major release of TEF, we will provide more tutorials that explain all the TEF features in detail.TEF and EclipseTEF editors are eclipse decorated text editors. That means they use the same facilities than, for example, the Java editor. They use the rulers to mark errors and occurences and provide according hovers for this markings. Syntax highlighting and code-completion is realised based on the same eclipse given framework. How such eclipse editors work and are to be programmed has not to concern you, because TEF abstracts from the eclipse editor framework. You simply use TEF to define a textual syntax that describes your editor, the rest is automatically done by TEF. TEF itself is an eclipse plugin and each TEF editor that you create is a eclipse plugin too. TEF currently works with eclipse 3.2 and required the EMF installed. The Reconciliation Process
On first sight, a TEF editor works like a regular text editor: the user enters text and the text is stored in memory as a sequence of characters. But of course that is only half the story. Each time the user stops typing for a few seconds a background process is running that transforms the user text into a model. Because this is usually done to replace an old model that become invalid through the recent user typing, we like to call this process reconciliation. The image on the right shows this reconciliation process. It starts with the user text. This text is parsed according the context free syntax of our language. The result is a tree-based representation of the text. Since a model contains non context free features. This are mainly cross references: for example, the use of a variable references the variable definition. The next step is therefore to resolve all those references. This step will convert the abstract syntax tree into an actual model that is corresponding to the language's meta-model. After that the model is checked against the constraints in the meta-model. During all this three steps, errors can be discovered: the parser can fail parsing due to an syntax error; a name might be wrong, so it cannot be resolved; a model invariant may be violated. All these errors are reported back to the user, by placing a red line with a error message hover under the corresponding places within the text. Reconciliation tries to regularly update the model represented by the text. All the information about parsing, reference resolution, and constraint checking have to be providing by a language engineer. TEF uses a textual syntax definition language, that can be used to define a concrete textual notation. These syntax definitions include all the necessary information and refer to the languages meta-model. In other words, these syntax definitions describe a TEF editor. Semantic FeaturesWithin the syntax defintion, a language engineer can describe several non-syntax aspects of the language. This concludes reference resolution and code completion, syntax highlighting, constraint checking, etc. We will add additional information soon. In the mean time this meta-bubble entry might give some insight. |