[Top][All Lists]

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

Lookahead correction for the C++ skeleton

From: Adrian Vogelsgesang
Subject: Lookahead correction for the C++ skeleton
Date: Tue, 9 Jul 2019 12:12:22 +0000
User-agent: Microsoft-MacOutlook/10.10.b.190609

Dear bison community,

Attached to this email you can find two small patches which I would like to
contribute to bison.

cxx-table-indentation.patch is really minor: it fixes the indentation of the 
tables `yypact_` and friends in the headers for the skeleton.

cxx-lac.patch is more interesting:
This patch adds support for Lookahead Correction to the C++ skeleton.
It contains pretty much a direct port of LAC from the yacc.c C skeleton.

The largest difference from the C skeleton's LAC is probably memory management:
In C++, I simply reused the existing `stack` class while the C equivalent does
memory management through `yy_lac_stack_realloc` etc.
Also, the C++ port uses functions instead of macros for `yy_lac_establish_`,

All existing bison tests are passing and I am quite sure that the patch works 
as expected
because integrating a C++ parser with those patches into Hyper (a SQL database;; went 
and our internal test suite for Hyper is still passing. (Only test failures: 
the list of expected
tokens is now correct and our test cases were expecting the incorrect list in 
some places)

The patch does not yet add any new test cases to bison’s test suite since I 
sure how to do so. `tests/` and `tests/` contain tests 
the existing LAC support in the C parser. However, I did not just want to copy 
& paste
those test cases for C++ and instead would prefer to factor out common test
Unfortunately, I never used autotest or m4 before, so I don’t know how to do 
Any help here would be appreciated :)


Attachment: cxx-lac.patch
Description: cxx-lac.patch

Attachment: cxx-table-indentation.patch
Description: cxx-table-indentation.patch

reply via email to

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