Desafio - Compilador (Inventem uma liguagem)

Started by KTachyon, May 04, 2006, 03:44:16 AM

Previous topic - Next topic

kingless

Como é que está o projecto ?

KTachyon

Tá em stand by até eu acabar os exames.
My Q4 estimate: Macs: 5.89M; iPods: 4.19M; iPhones: 30.0M; iPads: 18.05M; Revenue: 37.00B; EPS: 9.50
AAPL Q3 result: Macs: 4.02M; iPods: 6.80M; iPhones: 26.0M; iPads: 17.04M; Revenue: 35.02B; EPS: 9.32

Teotónio Ricardo


KTachyon

Este projecto fica em stand by até que eu consiga arranjar tempo para continuar a trabalhar nele e resolver uns porblemas de parsing que o programa tem. Possívelmente posso ter que voltar a refazer a linguagem para a libertar de algumas ambiguidades que possam eventualmente existir.

Por enquanto tenho 3 projectos para fazer este semestre e as coisas estão apertadas.
My Q4 estimate: Macs: 5.89M; iPods: 4.19M; iPhones: 30.0M; iPads: 18.05M; Revenue: 37.00B; EPS: 9.50
AAPL Q3 result: Macs: 4.02M; iPods: 6.80M; iPhones: 26.0M; iPads: 17.04M; Revenue: 35.02B; EPS: 9.32

exalt

Boas

eu sei umas coisas s programação e ajudo s precisarem, na boa :boa:

cumps

KTachyon

Estado actual das coisas:

In file included from functions.h:1,

from functions.c:1:

structures.h:61: error: two or more data types in declaration specifiers

structures.h:77: error: parse error before \\'d_testcond\\'

structures.h:77: warning: no semicolon at end of struct or union

structures.h:87: error: parse error before \\'}\\' token

structures.h:150: error: parse error before \\'is_codelines\\'

structures.h:150: warning: no semicolon at end of struct or union

structures.h:152: error: parse error before \\'}\\' token

structures.h:156: error: parse error before \\'is_codelines\\'

structures.h:156: warning: no semicolon at end of struct or union

structures.h:161: error: parse error before \\'is_codelines\\'

structures.h:161: warning: no semicolon at end of struct or union

In file included from functions.h:1,

from functions.c:1:

structures.h:1:1: error: unterminated #ifndef

In file included from functions.c:1:

functions.h:3: error: parse error before \\'*\\' token

functions.h:3: error: parse error before \\'*\\' token

functions.h:3: warning: data definition has no type or storage class

functions.h:4: error: parse error before \\'*\\' token

functions.h:4: warning: data definition has no type or storage class

functions.h:5: error: parse error before \\'*\\' token

functions.h:5: warning: data definition has no type or storage class

functions.h:6: error: parse error before \\'*\\' token

functions.h:6: error: parse error before \\'*\\' token

functions.h:6: warning: data definition has no type or storage class

functions.h:7: error: parse error before \\'*\\' token

functions.h:7: error: parse error before \\'*\\' token

functions.h:7: warning: data definition has no type or storage class

functions.h:8: error: parse error before \\'*\\' token

functions.h:8: warning: data definition has no type or storage class

functions.h:9: error: parse error before \\'*\\' token

functions.h:9: error: parse error before \\'*\\' token

functions.h:9: warning: data definition has no type or storage class

functions.h:10: error: parse error before \\'*\\' token

functions.h:10: error: parse error before \\'*\\' token

functions.h:10: warning: data definition has no type or storage class

functions.h:11: error: parse error before \\'*\\' token

functions.h:11: error: parse error before \\'*\\' token

functions.h:11: warning: data definition has no type or storage class

functions.h:12: error: parse error before \\'*\\' token

functions.h:12: error: parse error before \\'*\\' token

functions.h:12: warning: data definition has no type or storage class

functions.h:13: error: parse error before \\'*\\' token

functions.h:13: error: parse error before \\'*\\' token

functions.h:13: warning: data definition has no type or storage class

functions.h:14: error: parse error before \\'*\\' token

functions.h:14: warning: data definition has no type or storage class

functions.h:15: error: parse error before \\'*\\' token

functions.h:15: warning: data definition has no type or storage class

functions.h:17: error: parse error before \\'is_single_exp_list\\'

functions.h:18: error: parse error before \\'*\\' token

functions.h:18: error: parse error before \\'is_single_exp\\'

functions.h:18: warning: data definition has no type or storage class

functions.h:19: error: parse error before \\'*\\' token

functions.h:19: error: parse error before \\'*\\' token

functions.h:19: warning: data definition has no type or storage class

functions.h:20: error: parse error before \\'*\\' token

functions.h:20: error: parse error before \\'*\\' token

functions.h:20: warning: data definition has no type or storage class

functions.h:21: error: parse error before \\'*\\' token

functions.h:21: error: parse error before \\'*\\' token

functions.h:21: warning: data definition has no type or storage class

functions.h:22: error: parse error before \\'*\\' token

functions.h:22: error: parse error before \\'*\\' token

functions.h:22: warning: data definition has no type or storage class

functions.h:23: error: parse error before \\'*\\' token

functions.h:23: error: parse error before \\'is_single_exp_list\\'

functions.h:23: warning: data definition has no type or storage class

functions.h:24: error: parse error before \\'*\\' token

functions.h:24: error: parse error before \\'op\\'

functions.h:24: warning: data definition has no type or storage class

functions.h:25: error: parse error before \\'*\\' token

functions.h:25: error: parse error before \\'*\\' token

functions.h:25: warning: data definition has no type or storage class

functions.c: In function \\'insert_codeline_list\\':

functions.c:6: warning: incompatible implicit declaration of built-in function \\'malloc\\'

functions.c:10: error: \\'NULL\\' undeclared (first use in this function)

functions.c:10: error: (Each undeclared identifier is reported only once

functions.c:10: error: for each function it appears in.)

functions.c:15: warning: assignment from incompatible pointer type

functions.c:17: warning: assignment from incompatible pointer type

functions.c: In function \\'insert_attrib\\':

functions.c:26: warning: incompatible implicit declaration of built-in function \\'malloc\\'

functions.c:28: error: \\'ial\\' undeclared (first use in this function)

functions.c:28: warning: incompatible implicit declaration of built-in function \\'strdup\\'

functions.c: At top level:

functions.c:34: error: parse error before \\'is_oper\\'

functions.c:39: error: parse error before \\'is_oper\\'
My Q4 estimate: Macs: 5.89M; iPods: 4.19M; iPhones: 30.0M; iPads: 18.05M; Revenue: 37.00B; EPS: 9.50
AAPL Q3 result: Macs: 4.02M; iPods: 6.80M; iPhones: 26.0M; iPads: 17.04M; Revenue: 35.02B; EPS: 9.32

KTachyon

Bem me parecia que isto não estava assim tão avançado... As funções de parsing da linguagem não estão ainda feitas. Por isso dava este bocado só de erros das funções:

functions.h:3: error: parse error before \\'*\\' token

functions.h:3: error: parse error before \\'*\\' token

functions.h:3: warning: data definition has no type or storage class

functions.h:4: error: parse error before \\'*\\' token

functions.h:4: warning: data definition has no type or storage class

functions.h:5: error: parse error before \\'*\\' token

functions.h:5: warning: data definition has no type or storage class

functions.h:6: error: parse error before \\'*\\' token

functions.h:6: error: parse error before \\'*\\' token

functions.h:6: warning: data definition has no type or storage class

functions.h:7: error: parse error before \\'*\\' token

functions.h:7: error: parse error before \\'*\\' token

functions.h:7: warning: data definition has no type or storage class

functions.h:8: error: parse error before \\'*\\' token

functions.h:8: warning: data definition has no type or storage class

functions.h:9: error: parse error before \\'*\\' token

functions.h:9: error: parse error before \\'*\\' token

functions.h:9: warning: data definition has no type or storage class

functions.h:10: error: parse error before \\'*\\' token

functions.h:10: error: parse error before \\'*\\' token

functions.h:10: warning: data definition has no type or storage class

functions.h:11: error: parse error before \\'*\\' token

functions.h:11: error: parse error before \\'*\\' token

functions.h:11: warning: data definition has no type or storage class

functions.h:12: error: parse error before \\'*\\' token

functions.h:12: error: parse error before \\'*\\' token

functions.h:12: warning: data definition has no type or storage class

functions.h:13: error: parse error before \\'*\\' token

functions.h:13: error: parse error before \\'*\\' token

functions.h:13: warning: data definition has no type or storage class

functions.h:14: error: parse error before \\'*\\' token

functions.h:14: warning: data definition has no type or storage class

functions.h:15: error: parse error before \\'*\\' token

functions.h:15: warning: data definition has no type or storage class

functions.h:17: error: parse error before \\'is_single_exp_list\\'

functions.h:18: error: parse error before \\'*\\' token

functions.h:18: error: parse error before \\'is_single_exp\\'

functions.h:18: warning: data definition has no type or storage class

functions.h:19: error: parse error before \\'*\\' token

functions.h:19: error: parse error before \\'*\\' token

functions.h:19: warning: data definition has no type or storage class

functions.h:20: error: parse error before \\'*\\' token

functions.h:20: error: parse error before \\'*\\' token

functions.h:20: warning: data definition has no type or storage class

functions.h:21: error: parse error before \\'*\\' token

functions.h:21: error: parse error before \\'*\\' token

functions.h:21: warning: data definition has no type or storage class

functions.h:22: error: parse error before \\'*\\' token

functions.h:22: error: parse error before \\'*\\' token

functions.h:22: warning: data definition has no type or storage class

functions.h:23: error: parse error before \\'*\\' token

functions.h:23: error: parse error before \\'is_single_exp_list\\'

functions.h:23: warning: data definition has no type or storage class

functions.h:24: error: parse error before \\'*\\' token

functions.h:24: error: parse error before \\'op\\'

functions.h:24: warning: data definition has no type or storage class

functions.h:25: error: parse error before \\'*\\' token

functions.h:25: error: parse error before \\'*\\' token

functions.h:25: warning: data definition has no type or storage class

functions.c: In function \\'insert_codeline_list\\':

functions.c:6: warning: incompatible implicit declaration of built-in function \\'malloc\\'

functions.c:10: error: \\'NULL\\' undeclared (first use in this function)

functions.c:10: error: (Each undeclared identifier is reported only once

functions.c:10: error: for each function it appears in.)

functions.c:15: warning: assignment from incompatible pointer type

functions.c:17: warning: assignment from incompatible pointer type

functions.c: In function \\'insert_attrib\\':

functions.c:26: warning: incompatible implicit declaration of built-in function \\'malloc\\'

functions.c:28: error: \\'ial\\' undeclared (first use in this function)

functions.c:28: warning: incompatible implicit declaration of built-in function \\'strdup\\'

functions.c: At top level:

functions.c:34: error: parse error before \\'is_oper\\'

functions.c:39: error: parse error before \\'is_oper\\'

Portanto, os erros anteriores nas estruturas (structures.h) estão resolvidos. Agora é começar as funções de inserção. Algum voluntário para completar isto?

Vou ter k ser eu, n é?
My Q4 estimate: Macs: 5.89M; iPods: 4.19M; iPhones: 30.0M; iPads: 18.05M; Revenue: 37.00B; EPS: 9.50
AAPL Q3 result: Macs: 4.02M; iPods: 6.80M; iPhones: 26.0M; iPads: 17.04M; Revenue: 35.02B; EPS: 9.32

KTachyon

Já agora, quem tiver sugestões (modificações) a fazer sobre a linguagem, é melhor que comece a sugeri-las já, que é para eu não ter que voltar a modificar o código dos motores de parsing.
My Q4 estimate: Macs: 5.89M; iPods: 4.19M; iPhones: 30.0M; iPads: 18.05M; Revenue: 37.00B; EPS: 9.50
AAPL Q3 result: Macs: 4.02M; iPods: 6.80M; iPhones: 26.0M; iPads: 17.04M; Revenue: 35.02B; EPS: 9.32