Encerrado

Code generation for a parser in minic language

The project consist in extending a parser for

miniC, from a lex and yacc file given by me, with intermediate code generation using the three address instruction.

**Example:**

For a function/procedure call p(x1,x2,…,xn) you should generate code of the form:

*param x1

param x2

.

.

.

param xn

call p,n*

**For:**

int A[10];

int main(){

int i;

int max;

int sum;

i=0; sum = 0;

while(i < 10){

max = findMax(i);

A[i] = max;

Sum = sum + max;

i = i + 1;

}

print_int(sum);

}

**Should generate:**

main:

i = 0

sum = 0

L1: if i < 10 goto L2

goto L3

L2: putparam i

max = call findMax, 1

A[i] = max

t1 = sum + max

sum = t1

t2 = i + 1

i = t2

goto L1

L3: putparam sum

call

The output is validated by using the three-address instruction simulator also given.

- Yacc and Lex tools.

The project should pass in the tests given.

Habilidades: Engenharia, MySQL, PHP, Gestão de projetos, Arquitetura de software, Teste de Software

Ver mais: minic language, l2, int i, example project, max p, yacc, xn, lex project, form generation, php generation, project management tools php, code language, language address, address code, project yacc, generate code, intermediate code yacc, code call, yacc intermediate code, t1, project code language, yacc project, php file language, php file generation, code project 2008

Acerca do Empregador:
( 0 comentários ) Portugal

ID do Projeto: #3014953

1 freelancer está ofertando em média $26 para este trabalho

vanzolo

See private message.

$25.5 USD in 3 dias
(42 Comentários)
5.8