Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #2641 > unrolled thread

Re: Bootstrapping yacc in yacc -> Bootstrapping yacc in lex!

Started byRock Brentwood <rockbrentwood@gmail.com>
First post2021-04-04 13:27 -0500
Last post2021-04-04 13:27 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.compilers


Contents

  Re: Bootstrapping yacc in yacc -&gt; Bootstrapping yacc in lex! Rock Brentwood <rockbrentwood@gmail.com> - 2021-04-04 13:27 -0500

#2641 — Re: Bootstrapping yacc in yacc -&gt; Bootstrapping yacc in lex!

FromRock Brentwood <rockbrentwood@gmail.com>
Date2021-04-04 13:27 -0500
SubjectRe: Bootstrapping yacc in yacc -&gt; Bootstrapping yacc in lex!
Message-ID<21-04-001@comp.compilers>
From Kaz Kylheku:
>You could simply allow rules of this form
>    ":" right side ...
>With a semantic restrction that this must be preceded by a rule that
>is not terminated with a semicolon, whose last element is a symbol:

In other words: post-processing. That's not too much different that
the id + colon hack.

I misspoke in my earlier post. The hack was not created by Bison, but
has been around and *is* part of the grammar in the POSIX standard. So
the yacc grammar in the POSIX standard is LALR(1). I also see the hack
done in the Sun version of UNIX hack.
[I believe that hack goes way back.  It always seemed to me ironic that
the grammar for yacc, the most popular LALR(1) parser generator, isn't
quite LALR(1). The original Unix yacc used the id+colon hack in C code. -John]

[toc] | [standalone]


Back to top | Article view | comp.compilers


csiph-web