help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

calling yyparse repeatedly


From: Prabhu M.K
Subject: calling yyparse repeatedly
Date: Thu, 24 Jan 2002 09:58:48 +0530

Hi,
I am calling yyparse() twice in my main program to parse a  file. For
the first call, it worked fine. and in the second call it thowed an
parse error.

This is how the main program looks

int
main(int argc, char** argv)
{
yyin = fopen("example","r");
 if(!yyparse()){
  printf("Test-1: parser passed\n");
  YY_BUFFER_CLEAR;
  fclose(yyin);
  yyin = fopen("example","r");
  langparserrestart(yyin );
  if(!yyparse())
   printf("Test-2: parser passed\n");
  else
   printf("Test-2: parser failed\n");
 }
 else
  printf("Test-1: parser failed\n");

 return 0;
}

Where i am doing wrong....

Thaks in Advance

Regards
Prabhu M.K

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]