Re: re-entrant parsers, pure_parser, bison, flex

tiggr@ics.ele.tue.nl (Pieter Schoenmakers)
16 Jul 1997 22:57:32 -0400

          From comp.compilers

Related articles
re-entrant parsers, pure_parser, bison, flex lmipjmy@eei.ericsson.se (PJ Mealy) (1997-07-13)
Re: re-entrant parsers, pure_parser, bison, flex lmipjmy@eei.ericsson.se (PJ Mealy) (1997-07-16)
Re: re-entrant parsers, pure_parser, bison, flex tiggr@ics.ele.tue.nl (1997-07-16)
Re: re-entrant parsers, pure_parser, bison, flex lmipjmy@eei.ericsson.se (PJ Mealy) (1997-07-18)
Re: re-entrant parsers, pure_parser, bison, flex cfc@world.std.com (1997-07-18)
Re: re-entrant parsers, pure_parser, bison, flex 71511.3711@CompuServe.COM (Brian W. Inglis) (1997-07-21)
Re: re-entrant parsers, pure_parser, bison, flex bear@sonic.net (Ray Dillinger) (1997-07-22)
Re: re-entrant parsers, pure_parser, bison, flex vetter@cc.gatech.edu (Jeffrey Vetter) (1997-07-22)
Re: re-entrant parsers, pure_parser, bison, flex jlilley@empathy.com (John Lilley) (1997-08-24)
| List of all articles for this month |

From: tiggr@ics.ele.tue.nl (Pieter Schoenmakers)
Newsgroups: comp.compilers
Date: 16 Jul 1997 22:57:32 -0400
Organization: Eindhoven University of Technology
References: 97-07-063
Keywords: parse

The moderator natters:


      [You have to fiddle the lexer yourself. If you just want to parser to be
      recursive, you need only add the extra &yyval argument to yylex. If you
      want a truly recursive lexer that you can recurse into at any time,
      you're out of luck with flex. -John]


What is `at any time'? If it suffices to be able to use the lexer on a
second file that is included by a first file while the first file is
currently being parsed, lexed, buffered, buffered (again) and read, then
a wrapper around the parser's entry function suffices. This wrapper can
setup a fresh YY_BUFFER_STATE, using yy_create_buffer and
yy_switch_to_buffer (and yy_delete_buffer). If `at any time' is at more
times than this, a similar wrapper can be put around something else,
though I can't imagine the circumstances under which this would be
necessary. --Tiggr
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.