I am trying to use yply to generate a parser off of an existing parser written with bison/flex.
The parser code is here:
The parser is for the SELinux policy files and converts them into binary form to load into the kernel
A lot of this is still smoke and mirrors, I am new to this world of parsing, but I really liked the idea
of yply in that I don't need to keep separate definitions of the parser, it can live in checkpolicy
like it always has.
With that said, I ran into Python throwing a syntax error on the generated output when the expanded
prod ended with a single quote. I was able to correct this via the attached patch (raw-diff only sorry).
Not sure if thats the best fix, I can upload this to GitHub as a pull request if desired.
I was able to run the generate code, but then got errors from ply:
<snip>
ERROR: new.py:416: Symbol 'names' used, but not defined as a token or a rule
ERROR: new.py:416: Symbol 'names' used, but not defined as a token or a rule
ERROR: new.py:416: Symbol 'names' used, but not defined as a token or a rule
ERROR: new.py:416: Symbol 'names' used, but not defined as a token or a rule
WARNING: Token 'SAMEUSER' defined, but not used
WARNING: Token 'IPV4_ADDR' defined, but not used
ERROR: Infinite recursion detected for symbol 'default_user_def'
ERROR: Infinite recursion detected for symbol 'cond_stmt_def'
ERROR: Infinite recursion detected for symbol 'dominance'
ERROR: Infinite recursion detected for symbol 'common_perms'
ERROR: Infinite recursion detected for symbol 'level_def'
ERROR: Infinite recursion detected for symbol 'policy'
ERROR: Infinite recursion detected for symbol 'mlsvalidatetrans_def'
ERROR: Infinite recursion detected for symbol 'sensitivities'
ERROR: Infinite recursion detected for symbol 'default_range_def'
</snip>
Any help, is this tool officially supported by the project?