[Top][All Lists]

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

Proposal to improving section 3.4.5 of the Bison's manual for version 3.

From: Gabriel Czernikier
Subject: Proposal to improving section 3.4.5 of the Bison's manual for version 3.0.4
Date: Wed, 1 Feb 2017 17:49:05 -0300


I have an opinion on Bison’s manual for Bison 3.0.4, particularly about the
%define api.value.type when used with the “{struct…}” option.

Storing, alongside the parser states, structured values on the push stack,
leverages the parser to a capability extent unreacheable if through the
more modest untyped and union values.

Between parentheses, you can consider unions bearing with such structures
as a particularity for the generality addressed in these notes.

Just to be mentioned by a humble naive on the matter, structured values
representing the grammar symbols are used to build a so called “derivation
tree”, used in compiler construction. Bison and especially Yacc handbooks
themselves have a bibliographical references notice pointing to papers
talking on that (be a case “LR Parsing”, A. V. Aho and S. C. Johnson). Yacc
handbook is included in standard Bison distributions.

Structured values used in the parser, open the door to all sort of
possibilities, techniques and subjects that are addressed in their own,
dedicated-to-the-subject books. Giving bibliographic references does a job
in showing the reader that open door.

In section 3.4.5, “Providing a Structured Semantic Value Type”, we have the
following text: “Actually, you may also provide a struct rather that a
union, which may be handy if you want to track information for every symbol
(such as preceding comments).”

It’s okay to say it, except the part “(such as preceding comments)”, for
when I read it, I was led into a state of uncertainness.

To me, a question arose on  what “preceding comments” means. I thought it
was a way of handling with input string representing “comments” in the
language of the generated parser (for example /*this*/ in C). Not. Then I
thought it was about a loose reference to a “previous comment” on the
handbook itself (lacking the precise section, in contrast to usual Bison
manual’s internal reference style). Neither.

The quoted paragraph (except the phrase in objection) is a place on the
book that makes an opportunity available to lead the reader to a state of
curiosity about what will be beyond what I called above the “open door”,
had this paragraph ended with a more instilling phrase, one that conveys
through path on structured values, track of symbols, a mention on the big
subject they relate to, Bison’s impossibility to have it all inside its
scope, and a connection to the bibliographical references section. We could
think a reformulation to the paragraph entirely.

Gabriel Czernikier

reply via email to

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