|Basic Yacc Question firstname.lastname@example.org (1995-04-05)|
|Re: Basic Yacc Question email@example.com (1995-04-14)|
|Re: Basic Yacc Question firstname.lastname@example.org (1995-04-20)|
|From:||email@example.com (Daniel J. Salomon)|
|Organization:||Computer Science, University of Manitoba, Winnipeg, Canada|
|Date:||Fri, 14 Apr 1995 17:26:56 GMT|
firstname.lastname@example.org (I. Badcoe) writes:
> Basically I picked up the Gnu-Bison documentation and started to read
> through it with a view to creating a pre-processor. Everything is (nearly)
> clear to be *except* if (as in this case) you're writting an interpretter
> instead of a compiler, how do you implement a definite-loop ? Several
One option is to write a function that tells the scanner where in the source
to scan next. Before you start parsing, initialize the scanner to the start
of the source program. When your parser want to repeat a section it calls
the scanner location function to reset the current scanner location.
You will have to make a prepass over the source to discover the location
of labels that have not yet been encountered by the parser.
Daniel J. Salomon -- salomon@cs.UManitoba.CA
Dept. of Computer Science / University of Manitoba
Winnipeg, Manitoba, Canada R3T 2N2 / (204) 474-8687
Return to the
Search the comp.compilers archives again.