\chapter{Related work} Probably the closest related work is Proxima \cite{schrage04Proxima}. Proxima is a generic framework for creating structure editors. Programmers have full control over how the presentation is done, and edit operations can be done on the presentation level and get mapped back to the data model. It provides tools for defining parsers, ASTs, and evaluation using attribute grammars. To find other related work, one can either narrow the problem to only parser technology, or narrow the problem to specific programming languages. There is a lot of literature about tracking position information in parsers and parser generators. An old, well-known implementation is lex/yacc \cite{levine92lex}, while a more recent one is ANTLR \cite{parr07antlr}. Both and more have also been mentioned in the introduction. And of course we have seen a lot of Parsec in this thesis. The other option is to zoom in on specific compiler implementations and take a look at how the problem is handled there. The Glasgow Haskell Compiler, for example, uses the |Located| datatype to couple a value with position information: \begin{code} data Located e = L SrcSpan e \end{code} Then every child in every AST type is wrapped in an |L| manually to keep track of positions. In object-oriented implementations, the position information is usually stored in a superclass. For example, in the compiler included in the Eclipse Java Development Tools \cite{JDT}, every node in the AST derives from |ASTNode| which provides methods \texttt{int getStartPosition()} and \texttt{int getLength()}. Also interesting is the |TextEditor| class in the Eclipse Plug-in Framework that allows a programmer to build text editors for arbitrary languages. It provides support for many features typical for text editors, such as syntax highlighting and content outlines. But the modelling of the AST and the parsing of the source code is completely left to the programmer.