18.04.2013 Views

Dissertaç ˜ao de Mestrado Mestrado em Engenharia Informática Jo ...

Dissertaç ˜ao de Mestrado Mestrado em Engenharia Informática Jo ...

Dissertaç ˜ao de Mestrado Mestrado em Engenharia Informática Jo ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3. AN APPLICATION RECONFIGURATION FRAMEWORK 3.4. Generic to Original syntax Converter<br />

Presentation Layer<br />

User Interface<br />

Logical Layer<br />

Configuration<br />

File Parser<br />

Co<strong>de</strong><br />

Generator<br />

Storage Layer<br />

Tentative<br />

Parser<br />

Repository<br />

Grammar<br />

Repository<br />

Presentation Layer<br />

Grammar<br />

Compiler<br />

Logical Layer<br />

Storage Layer<br />

Figure 3.5: Interactions on the failed file recognition scenario<br />

interface Printer {<br />

void print(String file);<br />

}<br />

Listing 3.7: Printer proposed interface<br />

5. If a parser is approved, it is stored in the Parser Repository and the Tentative<br />

Grammar Repository may be <strong>em</strong>ptied.<br />

Afterwards, the course of action returns to normal: the AST produced by the parser is sent<br />

to the Co<strong>de</strong> Generator and the resulting file in generic syntax is stored to disk by the User<br />

Interface. The interactions between components on this process are <strong>de</strong>picted in Figure 3.5.<br />

Annex A.1 is a sequence diagram showing how components interact with each other, and<br />

in what or<strong>de</strong>r.<br />

3.4 Generic to Original syntax Converter<br />

The conversion from generic syntax back to the original one is accomplished solely by one<br />

component, the Printer (Listing 3.7).<br />

The Printer is able to convert files in generic syntax to any configuration file format. It<br />

does so by using the information on the file’s original syntax, captured by the Co<strong>de</strong> Generator<br />

in Section 3.3.<br />

The outcome of the Printer is the modified file in its original syntax, which r<strong>em</strong>ains 100%<br />

functional and is ready to be re-merged with the other application files, causing the application<br />

to become configured.<br />

33

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!