Continuing to Shape Statically Resolved Indirect Anaphora for Naturalistic Programming
A transfer from cognitive linguistics to the Java programming language
Sebastian Lohmeier (sl at

This work continues to form indirect anaphora as a new means of reference that is transferred from cognitive linguistics to the Java programming language. Indirect anaphora is a kind of textual reference in which a phrase is related but not co-referential to another phrase. Although my knowledge of linguistics is limited, the transfer starts with Schwarz-Friesel's process-oriented cognitive model of indirect anaphora as well as a modular theory of mental representations, three-tier semantics and her concept of a text-world model. Programming languages are considered metaphorically connected to natural languages and this relation is expanded by adding indirect anaphora to Java. Key aspects of the metaphor of indirect anaphors in Java are that textual and memorized knowledge is identical in Java and that an abstract syntax tree of Java source code functions as a text-world model. A subset of Schwarz-Friesel's forms of indirect anaphora is modeled using pre- and postconditions and invariants and is partially implemented for compile-time resolution. Development was test-first instead of using real-world source code, the impact of control structures has not yet been considered. Applicability of indirect anaphors will be relative to individual programmers, tasks and dynamics of learning.

This text is a reworked version of my bachelor thesis. It is a work in progess. Updates will be posted here.

Full text


Invoke java -jar JaaaCompiler.jar to run it and see usage instructions.


Sources are available zipped and from Subversion repositories.

The zip file contains the following directories:

Note that the source files from the JastAddJ project are only provided to be able to compile the released version autonomously.

The sources are also available directly from Subversion repositories. The following list provides links to the repositories along with the tag or in case of the JastAddJ sources the revision used and the revision that contains the last modification to the module in question.

The following hints are based on the zipped sources but apply just as well to sources checked out from SVN.

To build the project yourself, copy the directories under src/ to a writable directory and either invoke ant jar to generate a binary, or ant test to execute the tests. Use ant clean to remove built artifacts. Most likely you need to increase the heap space by setting the environment variable ANT_OPTS: export ANT_OPTS=-Xmx256m.

The project is developed under Eclipse, hence the projects files can also be maintained in eclipse. Each subdirectory of src/ comes with a .project file and is to be imported as a separate project in Eclipse. Please make sure that each projects is named after the subdirectory of src/ it is based on. You can configure the targets invoked above in Eclipse and will need to increase heap space as well. A Ant separate target gen is provided that does not compile but only generates the sources of the compiler so they can be edited, compiled and tested in Eclipse.


The source and binary code artifacts of the implementation are provided under
a BSD-style license.