gsmanu007/Operator-Precedence-Parser — reverse-engineered prompt
Reverse engineered prompt
Build me a simple Python operator precedence parser. It should read a grammar from a grammar.txt file and read operator precedence and associativity rules from an order.csv file, then use those to check whether an input expression is valid.
Use a basic arithmetic example where i means an identifier, like i minus i plus i. The program should show the parsing steps clearly so I can see how the input string is shifted and reduced, and it should finally say whether the string is accepted or rejected.
Keep it easy to run from the command line, with the sample grammar and precedence file included. I don’t need a big UI or anything fancy, just a working educational parser that demonstrates operator precedence parsing for simple expressions.
Want more depth? Deep Reverse