Hi everybody!!!
I have a problem.
I'm writing a program with flex and I'm using this code:
%union {
int entero;
char *cadena;
TipoDato tipo;
}
This code is for my data types.
I want evaluate the next line: expresion SUM expresion where SUM is the operation sum for evaluate, for example 69 + 60
When I write this
if (($1.tipo == ENT) && ($3.tipo == ENT)){
$$.tipo = ENT;
} else if (($1.tipo == CADEN) && ($3.tipo == CADEN)) {
$$.tipo = CADEN;
} else {
printf ("Error en la suma: Tipos de datos incompatibles Revise los tipos\n");
yyerror(parser);
}
I have the next error
../src/buggy.y:350.37-38: $1 de `expresion' no tiene tipo declarado
../src/buggy.y:351.28-29: $1 de `expresion' no tiene tipo declarado
buggy.tab.c: In function ‘yyparse’:
buggy.tab.c:1646: warning: implicit declaration of function ‘yylex’
../src/buggy.y: At top level:
lex.yy.c:1577: warning: ‘yyunput’ defined but not used
lex.yy.c:1618: **warning: ‘input’ defined but not used
Leyendo fichero '../docs/prog1.bgy'.
What is the problem?
Thanks!
Bye!!