02.06.2013 Views

MAFCOG 1.0A Generic code generator for Mathematical Functions

MAFCOG 1.0A Generic code generator for Mathematical Functions

MAFCOG 1.0A Generic code generator for Mathematical Functions

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.

.<br />

r<br />

r -<br />

;;-<br />

"<br />

.r-<br />

r<br />

r<br />

r:<br />

,<br />

;.<br />

!'r<br />

~r<br />

• r<br />

j'<br />

I I<br />

I<br />

!<br />

~ I"'"<br />

,<br />

I"'"<br />

r:<br />

r:<br />

r<br />

----<br />

Formula<br />

D..r.nlUon<br />

XMI..Pars.ng I..ayer .<br />

XMt.. Templates<br />

, Parsing<br />

.S:<br />

Ruks<br />

.<br />

r<br />

- j~ ~.<br />

•••<br />

4.2.1 Formula PI1T.\'I!TEngine Out Put:<br />

The Data Structures containing the details<br />

of the <strong>for</strong>mula are extracted and provided as<br />

input to the X~tL reader and parser. The<br />

XML reader and parser will read templates<br />

accordingly <strong>for</strong> generating the <strong>code</strong>. The<br />

Out put from Formula Parser engine<br />

includes the detnil s such as "Target<br />

Language", Tokcns, Operands used,<br />

<strong>Mathematical</strong> operators (Power, Square,<br />

Square Root etc.)<br />

4.2.2 TII(~XML<br />

Parser:<br />

This' part generates two things:<br />

• A programm i:1g language<br />

.capable of complex logic;<br />

··1encra~~. c- .. -<br />

'... . . ':r,,!!\ m;.:1~~;I' .<br />

Proceedings of the National Conference on<br />

Computing and Applications (NACCA '06)<br />

National Engineering College. Kovtlpatti, Tamil Nadu<br />

.~rc.... I<br />

. .. , E'~~'~"':-i' ;<br />

-u: ....,.,<br />

C4de Genera ••on Layer<br />

Temporary templates will be dynamically<br />

created to store the <strong>code</strong> blocks <strong>for</strong> further<br />

use as explained above.<br />

',4.2.4 The logic module that generates<br />

rules: .<br />

After reading the XML templates in the<br />

XML documents and navigating through it,<br />

<strong>MAFCOG</strong> LO <strong>generator</strong> will pick up<br />

in<strong>for</strong>mation in different parts of the<br />

templates to select and assemble the<br />

templates into proper <strong>code</strong> thus generating<br />

the pseudo-<strong>code</strong> after reading the<br />

Document Reader And .. APPLICATION nude's target-language<br />

• An XML utiliry <strong>for</strong> the language ..<br />

For <strong>MAFCOG</strong> 1,0 the language to be used<br />

as "Java" and X~IL utility as "JDOM"_ The<br />

XML document reader-and parser will read<br />

out the Out put from Formula Parser engine.<br />

and parse the Xl\IL templates accordingly<br />

4.2.3 The template lihrary:<br />

The XML Templates. which will be read, are as<br />

• Mathkules<br />

• JavaDOC<br />

• Control Structures.<br />

CeneriJre :<br />

- :. attribute .The <strong>code</strong> blocks generated will be<br />

. stored .in temporary templates in template<br />

that is library <strong>for</strong> further use.<br />

TtmpIL~!..~<br />

XMLParSing L!'rer<br />

Fig 1.3 XML Parsing Layer<br />

4.3. Code Generation Layer<br />

Code Generation Layer<br />

Source Code Generator will read the XML<br />

rules, selecting the appropriate data<br />

structures populated from XML templates,<br />

inserting the proper variables into the<br />

365 ~I<br />

\<br />

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

Saved successfully!

Ooh no, something went wrong!