Search code examples
rubyyacclex

Lex/Rex and Yacc/Racc files for Kconfig


I would like to parse Linux Kconfig files to create a graph visualization of their relationships. My first thought was to use rex/racc (ruby versions of lex/yacc) to parse the Kconfigs because ruby is my language of choice. I figure there must be lex/yacc files for parsing Kconfigs that I could adapt but I cannot for the life of me find any. Does anyone have any links to these or know of any other ruby-based parser for Kconfigs?

I found this Stackflow question but there's no useful links or specs.


Solution

  • There are Yacc and Lex files for the Kconfig format in the Linux source tree, in the scripts/kconfig directory:

    Of course, these will not work as-is in Ruby/Racc, but they should be a good starting point.