Hi everybody! I am currently working on a shell and wrote custom C++ code that takes Bison's symbol stack at a certain point (i.e. when an error occured) and walks ahead the Bison generated yyfoo tables / tree of the shell's grammar. I added that custom code for two purposes: 1) providing very user friendly error messages on syntax errors and 2) providing the user visual auto completion & auto correction while typing in the shell.
It is already working, however to make those syntax error messages and auto completion suggestions even more appropriate & human friendly, I would need to stick some additional custom meta informations to the individual grammar rules. It could be as simple as binding my own constant number to each grammar rule like (pseudo code): enum { MY_META_INFO1 = 3, MY_META_INFO2 = 7, ... }; ... foo : bla custom_meta(MY_META_INFO8) | bar custom_meta(MY_META_INFO2) | command number custom_meta(MY_META_INFO3) ; So that I am able to lookup those constants by the respective Bison grammar rule index number at runtime and accordingly to associate grammar rules in the Bison generated yyfoo tables with my own table(s), where the latter would provide my own, more detailed informations about individual grammar rules. I hope this somehow explains what I am trying to get at. ;-) Is there already some kind of solution for that in Bison? Or does anybody know a work around to achieve something like that? Best regards, Christian Schoenebeck _______________________________________________ help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison