[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: calling yyparse repeatedly
From: |
Prabhu M.K |
Subject: |
Re: calling yyparse repeatedly |
Date: |
Thu, 24 Jan 2002 17:23:27 +0530 |
yyrestart() doesn't seems to be helping. Still yylex() returing 0 after
the call of yyparse and yyrestart.
I made some changes ie., instead of using yyin, i filled the scanner
buffer with the help of function yy_scan_bytes(), which populates the
scanner buffer from another charcter buffer.
main(){
filelen=0;
fp = fopen("example1.xml","r");
buffer = (char *)malloc(1024);
while((buffer[filelen] = fgetc(fp))!=EOF)
{
filelen++;
}
if(!langparserparse()){
printf("Test-1: parser passed\n");
langparserrestart(NULL);
printf("%d\n",langparserlex());
} else
printf("Test-1: parser failed\n");
}
Still langparserlex returning 0.
Regards
Parbhu
Akim Demaille wrote:
> >>>>> "Prabhu" == Prabhu M K <Prabhu> writes:
>
> Prabhu> Thanks very much for reply... Ye I called yylex() twice after
> Prabhu> yyparse(). It is exactly what u told(series of 0). What should
> Prabhu> I do for reinitializing the scanner. The Scanner generator i
> Prabhu> use FLEX. Is that enough if i call yy_flush_buffer() in the
> Prabhu> <<EOF>> rule??
>
> I doubt it. Dive into the documentation. Especially yyrestart.
>
> _______________________________________________
> Help-bison mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/help-bison
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
- calling yyparse repeatedly, Prabhu M.K, 2002/01/23
- Re: calling yyparse repeatedly, Akim Demaille, 2002/01/24
- Re: calling yyparse repeatedly, Prabhu M.K, 2002/01/24
- Re: calling yyparse repeatedly, Akim Demaille, 2002/01/24
- Re: calling yyparse repeatedly,
Prabhu M.K <=
- Re: calling yyparse repeatedly, Akim Demaille, 2002/01/24
- Re: calling yyparse repeatedly, Prabhu M.K, 2002/01/24
- Re: calling yyparse repeatedly, Akim Demaille, 2002/01/24
- Re: calling yyparse repeatedly, Prabhu M.K, 2002/01/24
- Re: calling yyparse repeatedly, Akim Demaille, 2002/01/24
- Re: calling yyparse repeatedly, Anthony DeRobertis, 2002/01/24
- Re: calling yyparse repeatedly, Prabhu M.K, 2002/01/24
- Re: calling yyparse repeatedly, Tim Van Holder, 2002/01/25
- Re: calling yyparse repeatedly, Hans Aberg, 2002/01/24