help-bison
[Top][All Lists]
Advanced

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

Re: calling yyparse repeatedly


From: Akim Demaille
Subject: Re: calling yyparse repeatedly
Date: 24 Jan 2002 17:56:33 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

| > You should have described your problem completely the first time!
| >
| > Try to rewind the FILE * first, then yyrestart.  If that's not enough,
| > fclose it, fopen it again: maybe Flex is trying to be too smart (which
| > is often not a good thing from programming tools).
| >
| >        The rewind function sets the file position  indicator  for
| >        the  stream  pointed  to by stream to the beginning of the
| >        file.  It is equivalent to:
| >
| >               (void)fseek(stream, 0L, SEEK_SET)
| >
| >        except that the error indicator for  the  stream  is  also
| >        cleared (see clearerr(3)).
| 
| i finished exercies(rewinding yyin, closing and opeing the yyin, and
| calling yyrestart before the second call) what u said, At the first call
| the output is looks like below one.
| 
| 
| --(end of buffer or a NUL) ----->(First call of yyparse)
| --accepting rule at line 60 ("<?EML-VERSION 1.0?>")
| --accepting rule at line 69 ("
| <?ETT")
| --accepting rule at line 59 (" ")
| 
| goes on......
| 
| 
| 
| --(end of buffer or a NUL)
| yywrap called
| --EOF (start condition 1)
| Test-1: parser passed    ---> (First call is finished)
| --(end of buffer or a NUL)  ---->(Second call of yyparse)
| --accepting rule at line 75 ("<")
| Got an Error
| !ERROR(<)
| --accepting rule at line 74 ("?EML-VERSION 1.0?>")
| Syntax error: parse error
| Test-2: parser failed
| Press any key to continue
| 
| Where am goin wrong

I don't know.  Try using both the flex _and_ bison traces.



reply via email to

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