4 Jul 1997 14:51:08 -0400

Related articles |
---|

Depot4 - Easy to use parser/translator generator for Java and Oberon lampe@math.tu-dresden.de (J.Lampe) (1997-07-04) |

From: | "J.Lampe" <lampe@math.tu-dresden.de> |

Newsgroups: | comp.compilers |

Date: | 4 Jul 1997 14:51:08 -0400 |

Organization: | Techn. University Dresden |

Keywords: | parse, tools, Java, Oberon |

Depot4 - A simple to use translator generator

NOW available in two versions for JAVA and OBERON

Depot4 is an extensible translator-generator. It is easy to use

without special knowledge from compiler design. Some basic ideas of

formal language theory and familiarity with the EBNF should be

enough. Depot4 is well suited for text to text translation, but one of

its unique features is that it can easily be extended to more

elaborated objects, e.g., styled texts, drawings etc.

The Depot4 software was developed at TU Dresden, Dept. of

Mathematics/Subd. Scientific Computing.

Visit

http://www.math.tu-dresden.de/wir/staff/lampe/Depot4.html

There are - the software

- examples

- the sources

- a online manual

- a demo (Netscape only)

and it is free!

The prior aim of Depot4 is simple use. This is achieved by nonterminal

based modularization and recursive transaltion based description. The

latter will be illustrated by a small example:

To avoid misunderstanding, distinguish the implementation of a

translator from its use (application). Implementation will result in

an executable procedure/class, which afterwards may be applied to

perform some further translation. Translations are described by means

of a meta-language called Ml4, which is, in fact, an extension of EBNF

formalism. ExampleTask: Invert a list of numbers, e.g., "1, 2, 3"

into "3; 2; 1"

Step 1: Describe the translator

The expression before the "->" sign defines the source of the

translation. It is follwed by an expression giving the wanted

result - the target production. ('num' is a supplied terminal,

its translation 'num_' is the accepted number itself.)

NumList = num [ ',' NumList ] -> [ NumList_ '; ' ] num_.

Step 2: Implement the translator by executing the TRANSLATE command

Now this toy translator is ready for use. This is the end of

implementation! Usually there are, of course, more than one

production.

It follows the use of the implemented translator.

Step 3: Tell the system, which translator to use. Translators are

identified by their root productions. Here it's 'NumList'.

Step 4: Apply the translator to some list of numbers, e.g., 1,2,3,4.

and execute the USE command.

That's really complete.

To be honest: Depot4 offers very simple solutions for simple problems.

However, it may help you in solving hard problems - such as C to

Pascal - but they will keep hard.

Jurgen Lampe

Dept. Mathem./Techn. Univ. Dresden (Germany)

lampe@math.tu-dresden.de

http://www.math.tu-dresden.de/wir/staff/lampe/

--

Post a followup to this message

Return to the
comp.compilers page.

Search the
comp.compilers archives again.