previous                     ToC                 next

 

7.      Translating

 

Set operations on regular languages can be efficiently performed by means of algorithms operating on Finite Automata.

The expressions declared in RLA are therefore translated into minimum state Deterministic Finite Automata whose references are stored in the Symbol Table as values corresponding to input symbols or identifiers.

Finite Automata are implemented by the class Autom declared in Autom.java, that actually replaces the class Symb introduced in the previous section.

States and transitions in Finite Automata are specified by the classes State and Trans respectively, declared in State.java and Trans.java.

The Equiv class declared in Equiv.java looks for equivalent states in a DFA in order to perform state minimization.

 

The tranlator for RLA is specified in rla.cup.

You can generate the translator and run it on the input program Sample.rla by means of rla.bat.

The output reported in  TranslationResult.txt will be printed on the Java console.

 

 

previous                     ToC                 next