I'm implementing a line-by-line data parser, and it works by calling yyparse in a loop. Only problem is that I have no way of extracting the data, other than a global variable, which I'd prefer to avoid. Any tips?
You can use bison's %parse-param directive to add argument(s) for yyparse, which can include a pointer (or in C++ a reference) to some variable or data structure that can be written to in the actions in the parser.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With