[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
YY_CURRENT_BUFFER undeclared
From: |
Buday Gergely |
Subject: |
YY_CURRENT_BUFFER undeclared |
Date: |
Thu, 4 Dec 2003 12:46:46 +0100 (MET) |
Hi,
I'm using flex 2.5.4.
I got
$ gcc cs.c lex.yy.c -lfl
cs.c: In function `main':
cs.c:26: `YY_CURRENT_BUFFER' undeclared (first use in this function)
cs.c:26: (Each undeclared identifier is reported only once
cs.c:26: for each function it appears in.)
What is the problem? Is it a bug? Should I use a newer version?
See my files below.
- Gergely
==cs.c=================================================================
#include <stdio.h>
#include "phonemes.h"
int main(int argc, char *argv[])
{
int token;
if (argc==1) {printf("Missing parameter - please give a string to
parse\n");
exit(1);}
else yy_scan_string(argv[1]);
while ((token=yylex()) != EOF)
{
switch (token) {
case CS :
printf("rovid cse.");
break;
case CCS :
printf("hosszu cse.");
break;
case SILENCE :
printf("szunet.");
break;
};
};
yy_delete_buffer( YY_CURRENT_BUFFER );
}
======phonemes.h======================================
enum keyword
{ SILENCE = 32, /* this ensures that this enum is directly printable */
A, AA, B, BB, C, CC, CS, CCS, D, DD, DZ, DDZ, DZS, DDZS, E, EE, F, FF,
G, GG, GY, GGY, H,
DOH, /* x in the usual notation */
I, II, J, JJ,
KAPJ, /* C with a tail in usual notation */
DOBJ, /* capital J in usual notation */
K, KK, L, LL, M, MM, N, NN, NY, NNY, O, OO, OE, OEOE, P, PP, R, RR,
S, SS, SZ, SSZ, T, TT, TY, TTY, U, UU, UE, UEUE, V, VV,
W, /* v at the beginning of a word */
Z, ZZ, ZS, ZZS
};
=====graph2phon.yy=====================================
%{
#include "phonemes.h"
%}
%%
ccs return CCS;
cs return CS;
<<EOF>> return EOF;
. return SILENCE;
- YY_CURRENT_BUFFER undeclared,
Buday Gergely <=