Skip to content

Make bison use reentrant#21

Open
TheCount wants to merge 12 commits into
vnmakarov:masterfrom
TheCount:feature-reentrant-flexbison
Open

Make bison use reentrant#21
TheCount wants to merge 12 commits into
vnmakarov:masterfrom
TheCount:feature-reentrant-flexbison

Conversation

@TheCount
Copy link
Copy Markdown

This PR depends on #20.

It makes the use of bison (sgramm.y) reentrant. To this end, it also introduces a method of slipping a pointer to the grammar into the user-provided read_terminal() and read_rule() functions.

It brings the tests somewhat closer to reentrancy (ansic.l and ansic.y), even though it doesn't affect the library itself.

With that, all external dependencies to yaep have been made reentrant. The next steps towards resolving #12 can now concentrate on the core of the library itself.

TheCount added 8 commits March 1, 2022 22:04
hashtab.cpp: do not use yaep_free() on memory obtained with operator
new().
As a test, eliminate the static global variable anode_cost.

Required for vnmakarov#12.
Eliminate all global variables not needed in sread_terminal() or
sread_rule().

Required for vnmakarov#12.
Eliminate remaining global variables used by sread_terminal() and
sread_rule() by passing parser data via reentrancy hack.

Required for vnmakarov#12.
Make sgramm.y compatible with older bison versions.
@TheCount TheCount force-pushed the feature-reentrant-flexbison branch from 697c850 to f02db90 Compare March 1, 2022 21:12
@TheCount TheCount force-pushed the feature-reentrant-flexbison branch from f02db90 to 951188c Compare March 1, 2022 21:29
@TheCount TheCount mentioned this pull request Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant