- #1
anonim
- 40
- 2
in .y code:
in l code:
I got an error:
error: $3 of ‘EXPI’ has no declared type $$=$3;
code blog with the line where I got the error:
Why am I getting an error when I declare it? Can you help me solve this?
Code:
%union{
int ival;
int *ivals;
char id[20];
char *str;
bool *b;
}
%start START
%token COMMENT OP_PLUS OP_MINUS OP_DIV OP_MULT OP_OP OP_CP OP_DBLMULT OP_OC OP_CC OP_COMMA KW_AND KW_OR KW_NOT KW_EQUAL KW_LESS
KW_NIL KW_LIST KW_APPEND KW_CONCAT KW_SET KW_DEFFUN KW_FOR KW_IF KW_EXIT KW_DEFVAR KW_WHILE
KW_LOAD KW_DISP KW_TRUE KW_FALSE NEWLINE
FLOAT_NUMBER LISTOP%token <ival> LIMITED_VALUE
%token <id> IDENTIFIER
%token <str> FLE
%token <ival> NUMBER
%type <ival> START
%type <ival> EXPI
%type <ival> EXPB
%type <ivals> VALUES
%type <ivals> EXPLISTI
%type <ivals> LISTVALUE
%type <b> BinaryValue
in l code:
Code:
[[:alpha:]][[:alnum:]]* {strcpy(yylval.id, yytext); return IDENTIFIER;}
[[1-9][:digit:]]+ {yylval.ival = atoi(yytext); return VALUE;}
{LIMITED_VALUE} {yylval.ival = atoi(yytext); return VALUE;}
I got an error:
error: $3 of ‘EXPI’ has no declared type $$=$3;
code blog with the line where I got the error:
Code:
| OP_OP KW_WHILE OP_OP EXPB OP_CP EXPLISTI OP_CP{
$$=$3;
if(!$3){
listIndex=0;
listValues[0]=NULL;
}
list_flag=1;
}