I have this simple grammar which basically simply split symbols at white space
================ %{ #include <stdio.h> #include <stdlib.h> %} %output "parser.c" %defines "parser.h" %union { char *str; } %token <str> WORD %start Input %% Input : WORD { printf("word: %s\n", yylval.str); } | Input WORD { printf("word: %s\n", yylval.str); } ; %% ================ I'm trying to put this into a library, so the main() is in another file. This works, it's printing all the words. However what I want to do instead is return some data structure such as an array with all the WORDs (printf() is only there for testing). So... how can I achieve this? _______________________________________________ help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison