IMP source code formatting toolhttps://www.eclipse.org/forums/index.php/mv/msg/5472/16449/#msg_16449
I just want to let everybody know that we've been working on a source
code formatting tool for IMP based on the Box formatting language.

Box is a general formatting formalism used in several forms by other
meta programming frameworks. In our tool we are using the box tools from
the ASF+SDF Meta-Environment directly (www.meta-environment.org).

The following outline of the user story is split in two parts:

1. Meta programmer defines a formatter:
To obtain a formatter for a new DSL or language extension, the meta
programmer maps language patterns to Box expressions using a special
editor. The editor allows pattern matching in concrete syntax of the DSL
or programming language at hand. When the meta programmer is done, this
mapping is used to construct a full mapping from programs (or parts of
programs) to Box. Any construct in the language that the meta programmer
forgot about, are formatted using default mappings to Box. After that,
the Box expression is mapped to source code again by a Box-to-Text
processor.

2. Actual programmer uses the generated formatter:
The generated formatter can be deployed (as an XML file) with an IMP
generated language plugin. The actual programmer can simple press the
Source Format menu option, or use the shortcut keys to format her source
code.

The tool is designed to work with any kind of parsing technology that
satisfies a certain set of properties. The bridge is made by
implementing an interface. Also, to be able to parse patterns, the
parser for the DSL language needs extension with placeholders (meta
variables).

That's about it. The current state of the formatting plugin is a
functional prototype. It depends on ASF+SDF software, for which I will
start some IP discussion and administrative actions soon. The tool needs
fine tuning, testing and review before I would consider it finished.
I'll keep you posted on further developments.